agentleFS
luocfprimeluocfprime/labtasker/AGENTS.md

labtasker

AGENTS.md39 starsChanged 46 days agoApache-2.0View on GitHub

Labtasker is a deliberately small task queue for parallel model inference, evaluation, and other independent machine-learning experiments. Its main use case is a long-lived Worker that loads expensive process state once and executes many parameterized Tasks. Labtasker schedules work; it does not allocate GPUs, manage a cluster, orchestrate workflow runs, or store artifacts. Experimental Task dependencies only gate claim on direct predecessor success; users own graph correctness, pending diagnosis, data transfer, and Worker lifetime. Missing IDs, self references and cycles…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 33,398 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository6 other files it gives its agents.

The file

Show its rules and text

We split this AGENTS.md into the rules it gives an agent

14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    Do not recreate parallel planning or comparison documents.

    line 40
  2. Very specific:

    Keep one synchronous SQLAlchemy transaction per service command.

    line 70
  3. Very specific:

    Keep API errors in the stable Labtasker envelope with a fixed code, readable message, and structured details.

    line 77
  4. Distinctive:

    Keep Client and Server boundary models independent.

    line 79
  5. Distinctive:

    Treat platform support as an explicit capability boundary.

    line 83
  6. Very specific:

    Use uv from the repository root.

    line 104
  7. Very specific:

    Use Conventional Commits for every repository commit: type: summary or type(scope): summary, with a semantic type such as feat, fix, …

    line 106
  8. Distinctive:

    Prefer the smallest change that satisfies the contract.

    line 109
  9. Very specific:

    Keep public documentation and code terminology as Task, Queue, Worker, Client, and Server when referring to Labtasker concepts.

    line 111
  10. Distinctive:

    Before implementing an addition, removal, or observable change to a public Python, HTTP, CLI, configuration, or persisted interface, …

    line 116
  11. Distinctive:

    Do not add or update production dependencies without explaining the concrete need and verifying the Client/Server package boundary.

    line 121
  12. Very specific:

    Never hand-edit generated site/, dist/, caches, local .labtasker/ data, or uv.lock package records.

    line 123
  13. Very specific:

    Do not commit, tag, push, create a GitHub release, or publish packages unless the user explicitly authorizes that external action.

    line 125
  14. Distinctive:

    Run focused tests while iterating, then choose final checks proportional to the change.

    line 131

≈ “Common” is an estimate: at least 1 in 5 of the 43,423 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
AGENTS.md

Labtasker agent guide

Project context

Labtasker is a deliberately small task queue for parallel model inference, evaluation, and other independent machine-learning experiments. Its main use case is a long-lived Worker that loads expensive process state once and executes many parameterized Tasks. Labtasker schedules work; it does not allocate GPUs, manage a cluster, orchestrate workflow runs, or store artifacts. Experimental Task dependencies only gate claim on direct predecessor success; users own graph correctness, pending diagnosis, data transfer, and Worker lifetime. Missing IDs, self references and cycles are accepted; deletion has no dependency protection.

The repository contains two independent runtime distributions and one code-free convenience metapackage:

  • packages/labtasker-client: synchronous Client, Python and command Workers, public Python API, and labtasker CLI.
  • packages/labtasker-server: FastAPI/SQLite Server, migrations, and labtasker-server CLI.
  • packages/labtasker: full installation depending on matching Client and Server releases.

Neither package may depend on the other. Keep FastAPI, SQLAlchemy, Alembic, and Uvicorn out of the Client dependency tree.

Sources of truth

  • docs/reference/specification.md is the authoritative product and protocol contract. When implementing an existing decision, follow it over historical v1 behavior.
  • README.md and docs/ are the maintained user-facing explanation. Update them when observable behavior changes.
  • Tests record executable invariants but do not silently redefine the public contract. If a requested design change disagrees with the specification, update the specification, implementation, tests, and relevant guide together.
  • Branch v1 and .worktree/v1 are historical references only. Do not edit the v1 worktree as part of v2 work and do not assume v1 compatibility.

Do not recreate parallel planning or comparison documents. Put durable public decisions in the specification, user guidance in docs/, and implementation rationale close to the code or in a focused architectural note only when it will remain useful after the change ships.

Core design invariants

  • High priority: transport failures must not directly interrupt an already started Task execution or be counted as workload failures. Retry Task heartbeats and unresolved terminal reports under their existing contracts. Supplementary Worker-observation failures must not affect startup, claiming, execution or the failure guard. Startup checks and claim retain their bounded retry and failure-exit behavior; do not reinterpret this rule as requiring indefinite recovery there. Never treat unavailable communication as an empty Queue. Preserve run_id fencing and honor confirmed ownership loss. The one-second observation shutdown wait applies only after an independent exit decision. See specification section 3.0 for these distinctions.
  • Minimalism is a product requirement. Add a public concept only for a concrete experiment workflow, and update only the necessary, explicitly approved public surfaces. A Python or execution-context helper does not require a parallel CLI command.
  • Queue is the only server-side namespace and scheduling pool. Routes are exact, case-sensitive compatibility labels, not resource records.
  • The Server stores authoritative Tasks and supplementary expiring Worker observations, without managing Worker processes. Observations never affect scheduling or ownership. Each Worker executes at most one Task at a time and claims with a fresh private run_id.
  • Preserve run_id fencing for heartbeat, completion, failure, cancellation, unclaim, lease expiry, and retry races. Never weaken a guard to make a stale request appear successful.
  • Keep one synchronous SQLAlchemy transaction per service command. Mutations use BEGIN IMMEDIATE; atomic claim remains explicit SQL. Schema changes require an Alembic migration and real-file SQLite tests.
  • One Server process owns one SQLite file. Do not introduce multi-process claims, background ownership, SSE, or an in-memory event source of truth implicitly.
  • The public Task states remain pending, running, succeeded, failed, and cancelled. Use explicit lifecycle actions instead of a generic status patch.
  • Keep API errors in the stable Labtasker envelope with a fixed code, readable message, and structured details. Do not expose FastAPI/Pydantic native errors.
  • Keep Client and Server boundary models independent. OpenAPI is the machine-readable HTTP contract; do not add a shared runtime model package.
  • Preserve deterministic, non-interactive, agent-friendly CLI output: requested data on stdout, diagnostics on stderr, and no TTY-dependent behavior.
  • Treat platform support as an explicit capability boundary. A feature documented as unsupported on the detected platform must fail before network access, Task claim, journal creation, or process startup; do not silently degrade it or wait for a platform primitive to fail. Lack of release gating alone is not an unsupported feature, and a documented portable fallback remains allowed.

Repository map

  • packages/labtasker-client/src/labtasker/: Client transport, models, binding, Worker runtimes, journals, and CLI.
  • packages/labtasker-server/src/labtasker_server/: app routes, services, persistence models, validation, filtering, and migrations.
  • tests/client, tests/server, tests/e2e: ordinary release-gated tests.
  • tests/distributed: real launcher tests marked distributed_integration.
  • docs/reference: exact public interfaces and full specification.
  • .agents/skills: repository-scoped workflows loaded only when relevant.

Working agreements

  • Inspect git status and the relevant diff before editing. Preserve unrelated user changes in a dirty worktree.
  • Use uv from the repository root. Do not introduce another environment, package manager, build frontend, formatter, or test runner.
  • Use Conventional Commits for every repository commit: type: summary or type(scope): summary, with a semantic type such as feat, fix, refactor, test, docs, chore, build, ci, or perf.
  • Prefer the smallest change that satisfies the contract. Do not leave aliases, compatibility switches, unused abstractions, or speculative extension points.
  • Keep public documentation and code terminology as Task, Queue, Worker, Client, and Server when referring to Labtasker concepts.
  • A public contract change normally requires checking Server schema/service/app, Client model/transport/API/CLI, OpenAPI, docs, and tests. Use the public-contract-change skill for that workflow.
  • Before implementing an addition, removal, or observable change to a public Python, HTTP, CLI, configuration, or persisted interface, present the exact changed surface separately and obtain the user's explicit approval. Approval of a broad plan or specification does not authorize public interfaces that were not individually made clear for review.
  • Do not add or update production dependencies without explaining the concrete need and verifying the Client/Server package boundary.
  • Never hand-edit generated site/, dist/, caches, local .labtasker/ data, or uv.lock package records. Regenerate them with their owning tool.
  • Do not commit, tag, push, create a GitHub release, or publish packages unless the user explicitly authorizes that external action. Use the release skill for release preparation or publication.

Validation

Run focused tests while iterating, then choose final checks proportional to the change. The complete ordinary gate is:

uv sync --all-packages --group dev --frozen
uv run ruff format --check .
uv run ruff check .
uv run mypy packages/labtasker-client/src packages/labtasker-server/src
uv run pytest
uv run zensical build --clean
uv build --all-packages

Also run uv run pytest -m distributed_integration when changing launcher, fork, process-group, rank, or distributed-worker behavior and the required ML dependencies are installed. A documentation-only change needs the documentation build and relevant link checks, not unrelated runtime tests.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.