Programovací agent dostane požadavek na jednu změnu. Změnu provede, upraví soubor, na který ho nikdo nežádal sáhnout, a ohlásí, že je hotov. Jiný agent už pracuje ve stejných cestách. Relace skončí dřív, než diff někdo přečte, a další relace začne tím, co si chat pamatoval. Každá z těchto věcí je běžná a žádná není problém modelu.
start: nárokuje cesty, kterých se úloha smí dotknout, a hlásí, že je už nárokuje jiný worker
check: odmítne dotčený soubor mimo nárokované cesty
finish: vyhodnotí kontrakt dokončení řádek po řádku a nezapíše nic, dokud některý řádek selhává
handover: zapíše do repozitáře stav, od kterého začíná další relace
context: vrátí dalšímu workerovi tento stav, bez konverzace, která ho vytvořila
setup: challenge
given:
- 'a repository with Majordomus installed, and a second worktree whose worker already claims lib'
- 'a test, test/parse.sh, that passes only when the parser message names the column'
steps:
- id: claim-the-work
note: 'The task claims lib. Another worker already claims lib in a second worktree, and start says so before any file is touched.'
run: ['start', 'refuse tabs in the parser', '--scope', 'lib']
expect:
exit: 0
stdout_contains: ['^started t-', 'INFO overlap', 'claims lib']
- id: the-worker-strays
note: 'The worker makes the change it was asked for, and also edits a note under docs, which the task never claimed.'
worker: 'echo "tabs are refused" >> lib/a && echo "parser notes" >> docs/d'
expect:
exit: 0
- id: check-refuses-the-stray-file
note: 'check names the file outside the claimed scope and exits non-zero. It is a failure, not a warning.'
run: ['check']
expect:
exit: 10
stdout_contains: ['FAIL scope', 'docs/d']
- id: the-worker-says-it-is-done
note: 'The worker reports the task finished. finish evaluates the contract instead of believing it, and refuses.'
run: ['finish', '--outcome', 'completed', '--verify-command', 'sh test/parse.sh']
expect:
exit: 10
stdout_contains: ['FAIL scope', 'FAIL verification', 'refused']
- id: the-worker-reverts-the-stray-file
note: 'The stray edit is taken back.'
worker: 'git checkout -- docs/d'
expect:
exit: 0
- id: hand-over
note: 'The session ends. What the next one needs is written into the repository, not left in a transcript.'
run: ['handover']
stdin: challenge-handover.md
expect:
exit: 0
files_exist: ['.ai/local/state/handovers']
- id: the-next-session-resumes
note: 'A new session asks the repository what it needs to know, and gets the task, its scope and the handover back.'
run: ['context']
expect:
exit: 0
stdout_contains: ['## TASK', 'LATEST COMPATIBLE HANDOVER', 'name the column']
- id: finish-refuses-a-failing-verification
note: 'Scope is clean now, but the repository''s own test still fails. finish runs it and refuses again.'
run: ['finish', '--outcome', 'completed', '--verify-command', 'sh test/parse.sh']
expect:
exit: 10
stdout_contains: ['OK +scope', 'FAIL verification', 'refused']
stdout_not_contains: ['FAIL scope']
- id: the-worker-finishes-the-work
note: 'The worker does what the handover said was left.'
worker: 'echo "the message names the column" >> lib/a'
expect:
exit: 0
- id: finish-accepts
note: 'Every line of the contract passes, so the outcome is recorded, with the verification that proved it.'
run: ['finish', '--outcome', 'completed', '--verify-command', 'sh test/parse.sh']
expect:
exit: 0
stdout_contains: ['OK +scope', 'OK +verification', 'completed']
stdout_not_contains: ['FAIL']
then:
- 'a file outside the claimed scope is refused by check and by finish'
- 'a worker saying it is done is a claim finish evaluates, and a failing verification keeps it refused'
- 'the next session resumes from what the repository recorded, not from the conversation'
- 'the work is accepted only when every line of the contract passes'
Práce je přijata právě jednou, když projde vlastní test repozitáře a nic mimo nárokované cesty se nezměnilo. Dvě dřívější tvrzení, že je hotovo, byla odmítnuta s uvedeným důvodem a příkazem, který jej reprodukuje. Další relace začala z předávky, kterou repozitář držel, a druhý worker ve stejných cestách byl jmenován dřív, než se cokoli upravilo.
-
Úloha si nárokuje lib. Jiný pracovník už si lib nárokuje v druhém worktree a start to řekne dřív, než se dotkne jakéhokoli souboru.
started t-<id> profile=implementation scope=lib
INFO overlap repo-other — claims lib — contains your lib [reproduce: majordomus check --overlap]
next: majordomus context; checkpoint every 15m; majordomus check before claiming anything
- exit 0
- stdout_contains /^started t-/
- stdout_contains /INFO overlap/
- stdout_contains /claims lib/
-
2worker$ echo "tabs are refused" >> lib/a && echo "parser notes" >> docs/d
exit 0
Worker provede změnu, o kterou byl požádán, a upraví také poznámku v docs, kterou úloha nikdy nenárokovala.
-
check pojmenuje soubor mimo zabraný rozsah a skončí nenulovým kódem. Je to selhání, ne varování.
OK knowledge records — 0 record(s) valid against knowledge/v1; every reference resolves [reproduce: majordomus knowledge check]
· checkpoint t-<id> — <timed against the checkpoint interval>
OK records ledger.jsonl — every line is a well-formed event
OK blockers t-<id> — none open
OK records decisions.md — every entry is attributable
FAIL scope docs/d — outside claimed scope (lib) [reproduce: git status --porcelain; git log --first-parent --no-merges --name-only --format= <sha>..HEAD]
OK state t-<id> — exact (head <head>)
INFO mesh t-<id> — the repository declares no enabled mesh
INFO use-case 30 advisory gap(s) — not covered by an active use case, and the policy does not require it: command:init command:update command:doctor command:watch command:start command:context command:checkpoint command:handover command:check command:finish command:history command:decision command:question command:prompt command:evidence command:skills command:capture command:search command:doctrine command:plan command:version command:session command:knowledge command:adr command:usecase command:rules command:migrate command:recover command:bench command:archive [reproduce: majordomus usecase coverage]
OK use-case 0 of 30 target(s) covered — every public command the policy requires is named and run by an active use case (policy use_cases.coverage)
INFO obligation t-<id> — the task declares no obligations
INFO gate t-<id> — this repository declares no CI model at .ai/repo/ci/gates.yaml; nothing can be planned
check: 12 finding(s), 1 failing
- exit 10
- stdout_contains /FAIL scope/
- stdout_contains /docs/d/
-
Worker ohlásí úlohu jako dokončenou. finish smlouvu vyhodnotí, místo aby jí věřil, a odmítne.
OK blockers t-<id> — none open
FAIL note t-<id> — no --note file and no handover for this task [reproduce: majordomus handover < note.md]
INFO regression t-<id> — profile implementation adds no requirement beyond the shared contract
FAIL scope docs/d — outside claimed scope (lib) [reproduce: git status --porcelain; git log --first-parent --no-merges --name-only --format= <sha>..HEAD]
OK state t-<id> — exact (head <head>)
INFO continuity t-<id> — applies to partial and blocked
INFO mesh t-<id> — the repository declares no enabled mesh
INFO use-case 30 advisory gap(s) — not covered by an active use case, and the policy does not require it: command:init command:update command:doctor command:watch command:start command:context command:checkpoint command:handover command:check command:finish command:history command:decision command:question command:prompt command:evidence command:skills command:capture command:search command:doctrine command:plan command:version command:session command:knowledge command:adr command:usecase command:rules command:migrate command:recover command:bench command:archive [reproduce: majordomus usecase coverage]
OK use-case 0 of 30 target(s) covered — every public command the policy requires is named and run by an active use case (policy use_cases.coverage)
FAIL verification t-<id> — sh test/parse.sh — exit 1, <s>s [reproduce: sh test/parse.sh]
INFO obligation t-<id> — the task declares no obligations
INFO gate t-<id> — this repository declares no CI model at .ai/repo/ci/gates.yaml; nothing can be planned
INFO gate t-<id> — not in verification.finish_requires
finish: refused, 3 unmet
blocking doctrines:
- majordomus.note-integrity
- majordomus.scope-integrity
- majordomus.verification-integrity
- exit 10
- stdout_contains /FAIL scope/
- stdout_contains /FAIL verification/
- stdout_contains /refused/
-
5worker$ git checkout -- docs/d
exit 0
Zbloudilá úprava je vzata zpět.
-
Relace končí. To, co potřebuje další, je zapsáno do repozitáře, ne ponecháno v přepisu.
.ai/local/state/handovers/<time>--main--<head>--<hash>.md
- exit 0
- file_exists .ai/local/state/handovers
-
Nová relace se ptá repozitáře, co potřebuje vědět, a dostane zpět úlohu, její rozsah a předávku.
# Majordomus context — <time>
# a projection of durable state, not a source of truth: validate every line against git
## GIT
repository <repo>
branch main
head <sha>
working_tree dirty
task_record exact (recorded head <head>)
## TASK
id t-<id>
task refuse tabs in the parser
profile implementation
owner <owner>
outcome active
scope lib
started <time> (<age> ago)
checkpoint <time> (<age> ago, interval 15m)
## PROFILE implementation
capability standard
effort medium
verbosity concise
presentation engineering
verification verify command
output outcome, changes, verification, blockers, next_action
## CONTEXT DOCUMENTS (for the scope, root first; majordomus context explain <path>)
lib ai.layer
## KNOWLEDGE (candidates awaiting review on this branch; majordomus knowledge candidates)
No knowledge candidates await review on this branch. That is an answer, not a gap: `majordomus knowledge candidates` lists every branch.
## DECISIONS (5 most recent for this task)
(none)
## LATEST COMPATIBLE HANDOVER (.ai/local/state/handovers/<time>--main--<head>--<hash>.md)
match same_worktree_same_branch
git state exact
created <time> (<age> ago)
task t-<id>
# Objective
refuse tabs in the parser
# Current State
tabs are refused; the stray note under docs is reverted; the parser's test still fails
# Next Action
make the message name the column, then run the parser's test again
## FILES TOUCHED IN SCOPE (1)
lib/a
## EXCLUDED
- history — profile implementation sets context.recent_history_depth: 0
## BUDGET
57 of 300 lines
- exit 0
- stdout_contains /## TASK/
- stdout_contains /LATEST COMPATIBLE HANDOVER/
- stdout_contains /name the column/
-
Rozsah je teď čistý, ale vlastní test repozitáře stále selhává. finish jej spustí a znovu odmítne.
OK blockers t-<id> — none open
OK note t-<id> — <time>--main--<head>--<hash>.md
INFO regression t-<id> — profile implementation adds no requirement beyond the shared contract
OK scope t-<id> — 1 touched file(s), all within scope
OK state t-<id> — exact (head <head>)
INFO continuity t-<id> — applies to partial and blocked
INFO mesh t-<id> — the repository declares no enabled mesh
INFO use-case 30 advisory gap(s) — not covered by an active use case, and the policy does not require it: command:init command:update command:doctor command:watch command:start command:context command:checkpoint command:handover command:check command:finish command:history command:decision command:question command:prompt command:evidence command:skills command:capture command:search command:doctrine command:plan command:version command:session command:knowledge command:adr command:usecase command:rules command:migrate command:recover command:bench command:archive [reproduce: majordomus usecase coverage]
OK use-case 0 of 30 target(s) covered — every public command the policy requires is named and run by an active use case (policy use_cases.coverage)
FAIL verification t-<id> — sh test/parse.sh — exit 1, <s>s [reproduce: sh test/parse.sh]
INFO obligation t-<id> — the task declares no obligations
INFO gate t-<id> — this repository declares no CI model at .ai/repo/ci/gates.yaml; nothing can be planned
INFO gate t-<id> — not in verification.finish_requires
finish: refused, 1 unmet
blocking doctrines:
- majordomus.verification-integrity
- exit 10
- stdout_contains /OK +scope/
- stdout_contains /FAIL verification/
- stdout_contains /refused/
- stdout_not_contains /FAIL scope/
-
9worker$ echo "the message names the column" >> lib/a
exit 0
Pracovník udělá to, co předávka označila jako zbývající.
-
Každý řádek smlouvy projde, takže se výsledek zaznamená spolu s ověřením, které jej dokázalo.
OK blockers t-<id> — none open
OK note t-<id> — <time>--main--<head>--<hash>.md
INFO regression t-<id> — profile implementation adds no requirement beyond the shared contract
OK scope t-<id> — 1 touched file(s), all within scope
OK state t-<id> — exact (head <head>)
INFO continuity t-<id> — applies to partial and blocked
INFO mesh t-<id> — the repository declares no enabled mesh
INFO use-case 30 advisory gap(s) — not covered by an active use case, and the policy does not require it: command:init command:update command:doctor command:watch command:start command:context command:checkpoint command:handover command:check command:finish command:history command:decision command:question command:prompt command:evidence command:skills command:capture command:search command:doctrine command:plan command:version command:session command:knowledge command:adr command:usecase command:rules command:migrate command:recover command:bench command:archive [reproduce: majordomus usecase coverage]
OK use-case 0 of 30 target(s) covered — every public command the policy requires is named and run by an active use case (policy use_cases.coverage)
OK verification t-<id> — sh test/parse.sh — exit 0, <s>s, tree <tree>
INFO obligation t-<id> — the task declares no obligations
INFO gate t-<id> — this repository declares no CI model at .ai/repo/ci/gates.yaml; nothing can be planned
INFO gate t-<id> — not in verification.finish_requires
finish: t-<id> completed
- exit 0
- stdout_contains /OK +scope/
- stdout_contains /OK +verification/
- stdout_contains /completed/
- stdout_not_contains /FAIL/
Řetězec od této stránky ke kódu: případ užití jmenuje příkazy, pravidla a tvrzení; každé pravidlo se dispatchuje z registru a každé tvrzení jmenuje test, který ho dokazuje; scénář výše provedl příkazy. Nic v tomto řetězci není text o záměru.
Vypočteno z toho, co sdílejí: tvrzení, pravidla, příkazy, kategorie, aplikace. Tento seznam nikdo neudržuje.