Make agent-swarm domain-neutral and adaptive

This commit is contained in:
Emil Shanaty
2026-10-27 19:27:11 +03:00
parent 464b610bf1
commit 20497d9c0c
11 changed files with 191 additions and 58 deletions
+9 -9
View File
@@ -4,7 +4,7 @@ A packet is everything one agent needs and nothing else. The lead writes packets
## The context ladder
1. `.swarm/brief.md` — shared by all tasks: goal, success criteria, stack, commands, conventions, hazards, forbidden actions.
1. `.swarm/brief.md` — shared by all tasks: goal, success criteria, domain/evidence, commands or sources, conventions, hazards, forbidden actions.
2. `.swarm/tasks/Txx.md` — one task: objective, inputs, deliverables, write scope, contract, acceptance, stop conditions.
3. `.swarm/contracts.md` — frozen interfaces; read the relevant section only.
4. Pointers — `path:line` ranges, not pasted code.
@@ -16,7 +16,7 @@ If a worker needs the lead's conversation, the packet is incomplete. If a packet
Copy `assets/brief.md.tmpl`. Rules:
- Goal is one paragraph; success criteria are checkable.
- List the exact build/test/lint commands. Workers should not guess.
- List the exact commands or evidence sources for the domain. Workers should not guess.
- Map only the paths a worker may need; link the rest.
- Hazards: generated files, migrations, flaky tests, shared ports, secrets. Name what not to touch.
- Global forbidden actions are identical in every packet; keep them in the brief to save prompt space.
@@ -26,11 +26,11 @@ Copy `assets/brief.md.tmpl`. Rules:
Copy `assets/task.md.tmpl`. Rules:
- Objective: what must exist when done, in 1–3 sentences.
- Inputs: brief, contract section, and exact code ranges.
- Inputs: brief, contract section, and exact file/source ranges.
- Deliverables: paths, including tests.
- Write scope: globs. Everything else is read-only.
- Contract: exact signature or output shape. If it is not written, it is not frozen.
- Acceptance: 1–3 commands a verifier can re-run. "Code is clean" is not a check.
- Acceptance: 1–3 checks a verifier can re-run independently: commands, artifacts, citations, metrics or renders. "Works well" is not a check.
- GUI: acceptance includes a deterministic screenshot command, fixed window sizes and an isolated display; see `references/visual-testing.md`.
- Stop conditions: time/attempt limit (25 min for S/M, 45–60 for L) plus "ask, do not guess" for load-bearing unknowns.
- Never include another task's internal details; workers do not need the whole plan.
@@ -40,8 +40,8 @@ Copy `assets/task.md.tmpl`. Rules:
Copy `assets/verifier.md.tmpl`. Rules:
- State plainly: you did not write this; do not fix it.
- State that the tree is frozen: no source/test/docs/manifest edits during verification.
- Give criteria, changed paths, and commands; withhold the worker's rationale.
- Require a table: criterion, command, observed, pass/fail.
- Give criteria, changed paths/artifacts, and evidence checks; withhold the worker's rationale.
- Require a table: criterion, evidence, observed, pass/fail.
- Ask for scope, contract, and test-quality checks.
- Require the full review file **first**, then a minimal `{task_id, verdict, summary, review_file}` return (`assets/verdict.schema.json`). The review file is the source of truth; a schema miss must not erase the verification work.
- GUI: require an isolated Xvfb/display, screenshots at default and minimum sizes, and the exact commands used; shared-desktop screenshots are not evidence.
@@ -51,8 +51,8 @@ Copy `assets/verifier.md.tmpl`. Rules:
Copy `assets/report.schema.json` to `.swarm/report.schema.json` and `assets/verdict.schema.json` to `.swarm/verdict.schema.json` during bootstrap; workers/verifiers read those copies. Field discipline:
- `status`: `done` (acceptance met), `partial` (some criteria met, listed), `blocked` (needs a lead decision), `failed` (attempted, cannot proceed).
- `verdict` (verifiers only): `pass`, `pass_with_risks`, or `fail`; the detailed findings belong in the review file, not a required workflow array.
- `files_changed`: exact deliverable/code paths, no globs. Coordination artifacts under `.swarm/` are implicit and may be omitted.
- `evidence`: commands and observed results, one line each.
- `files_changed`: exact deliverable paths/artifacts, no globs. Coordination artifacts under `.swarm/` are implicit and may be omitted.
- `evidence`: commands, artifact paths, citations, metrics or renders with observed results, one line each.
- `acceptance`: per check, `pass|fail|not_run` plus evidence.
- `assumptions`: load-bearing assumptions the lead must confirm.
- `blocked_question`: one precise question, only when `status=blocked`.
@@ -64,7 +64,7 @@ Keep `summary` under ~300 characters. The lead reads summaries first and opens a
| Mistake | Fix |
|---|---|
| Pasting the whole conversation into every prompt | Write a brief; point to files |
| Vague acceptance ("works well") | A command and an expected result |
| Vague acceptance ("works well") | A re-runnable check and an expected result |
| No non-goals | List what not to touch |
| Two tasks own one file | Serialize or merge |
| Task needs 2+ hours | Split by deliverable, not by file count |