Worker, který čte všechno, nečte nic dobře. Stav je rozprostřen přes záznam úlohy, dokumenty vrstvy vázané na rozsah, úložiště otázek, rozhodnutí a kontrolní body a čerstvá relace nemůže vědět, co z toho teď záleží. Vložit to všechno do promptu je drahé a pokaždé špatné jinak.
context: sestaveno z trvalého stavu v pevném pořadí autority, tvarováno profilem úlohy
context --budget-lines <n>: totéž, v rámci rozpočtu; vypuštěné sekce jsou vypsány jménem a s důvodem
context --json: totéž jako jeden dokument
check --explain: politika a profil, které ho utvářely
setup: active-task-records
given:
- 'an active task that has already produced a checkpoint, a decision and an open question'
steps:
- id: everything
run: ['context']
note: 'git identity, the task and its profile, the scoped documents, open questions, decisions and the newest checkpoint, in authority order'
expect:
exit: 0
stdout_contains: ['^## GIT', '^## TASK', '^## PROFILE']
- id: budgeted
run: ['context', '--budget-lines', '30']
note: 'the same, cut to a budget; what is dropped is named with its reason rather than silently truncated'
expect:
exit: 10
stdout_contains: ['^## GIT', '^## EXCLUDED', 'context budget 30 lines']
- id: machine
run: ['context', '--json']
note: 'the same body as one JSON document for a client that composes its own prompt'
expect:
exit: 0
stdout_contains: ['^\{']
- id: explained
run: ['check', '--explain']
note: 'the effective policy and profile the context was assembled under'
expect:
exit: 0
stdout_contains: ['^# task', 'profile']
then:
- 'authority order is fixed: git, task, profile, documents, questions, decisions, checkpoint'
- 'a dropped section is named, never lost without a trace'
- 'the JSON form carries the same content as the text form'
Další worker čte krátký, uspořádaný, dostatečně úplný kontext a ví přesně, co bylo vynecháno. Není v něm nic, co profil vylučuje, a nic není vymyšleno.
-
identita gitu, úloha a její profil, vymezené dokumenty, otevřené otázky, rozhodnutí a nejnovější checkpoint, v pořadí autority
# 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 narrow 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
## OPEN QUESTIONS (1 unresolved — every one refuses finish --outcome completed)
- should tabs be an error or a warning? (<date>)
## 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)
## <date> — refuse tabs in the parser
Task: t-<id>
Head: <sha>
Why: two encodings for one token
Rejected: -
Evidence: -
Supersedes: -
## LATEST CHECKPOINT (.ai/local/state/checkpoints/<time>--main--<head>--<hash>.md, <age> ago, exact)
the parser now refuses tabs
## FILES TOUCHED IN SCOPE (1)
lib/a
## EXCLUDED
- handover — no record for this worktree and branch — absence, not a stale match
- history — profile implementation sets context.recent_history_depth: 0
## BUDGET
58 of 300 lines
- exit 0
- stdout_contains /^## GIT/
- stdout_contains /^## TASK/
- stdout_contains /^## PROFILE/
-
totéž, oříznuté na rozpočet; co se vypustí, je pojmenováno s důvodem, nikoli tiše zkráceno
# 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 narrow 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
## OPEN QUESTIONS (1 unresolved — every one refuses finish --outcome completed)
- should tabs be an error or a warning? (<date>)
## LATEST CHECKPOINT (.ai/local/state/checkpoints/<time>--main--<head>--<hash>.md, <age> ago, exact)
body omitted for budget — read .ai/local/state/checkpoints/<time>--main--<head>--<hash>.md
## EXCLUDED
- handover — no record for this worktree and branch — absence, not a stale match
- history — profile implementation sets context.recent_history_depth: 0
- files — context budget 30 lines
- context documents — context budget 30 lines; run: majordomus context resolve <path>
- knowledge — context budget 30 lines
- decisions — context budget 30 lines
- checkpoint body — context budget 30 lines
## BUDGET
45 of 30 lines (dropped: files documents knowledge decisions checkpoint-body)
majordomus: context: 45 lines over the budget of 30 with nothing left to drop
- exit 10
- stdout_contains /^## GIT/
- stdout_contains /^## EXCLUDED/
- stdout_contains /context budget 30 lines/
-
totéž tělo jako jeden dokument JSON pro klienta, který si sestavuje vlastní prompt
{"schema":1,"generated_at":"<time>","git":{"repository":"<repo>","branch":"main","head":"<sha>","working_tree":"dirty","task_record":"exact"},"task":{"id":"t-<id>","task":"narrow the parser","profile":"implementation","owner":"<owner>","outcome":"active","started_at":"<time>","checkpoint_at":"<time>","scope":["lib"]},"sections":[{"id":"profile","lines":7,"text":"## PROFILE implementation\ncapability standard\neffort medium\nverbosity concise\npresentation engineering\nverification verify command\noutput outcome, changes, verification, blockers, next_action\n"},{"id":"documents","lines":2,"text":"## CONTEXT DOCUMENTS (for the scope, root first; majordomus context explain <path>)\nlib ai.layer\n"},{"id":"questions","lines":2,"text":"## OPEN QUESTIONS (1 unresolved — every one refuses finish --outcome completed)\n- should tabs be an error or a warning? (<date>)\n"},{"id":"knowledge","lines":2,"text":"## KNOWLEDGE (candidates awaiting review on this branch; majordomus knowledge candidates)\nNo knowledge candidates await review on this branch. That is an answer, not a gap: `majordomus knowledge candidates` lists every branch.\n"},{"id":"decisions","lines":8,"text":"## DECISIONS (5 most recent for this task)\n## <date> — refuse tabs in the parser\nTask: t-<id>\nHead: <sha>\nWhy: two encodings for one token\nRejected: -\nEvidence: -\nSupersedes: -\n"},{"id":"checkpoint","lines":2,"text":"## LATEST CHECKPOINT (.ai/local/state/checkpoints/<time>--main--<head>--<hash>.md, <age> ago, exact)\nthe parser now refuses tabs\n"},{"id":"files","lines":2,"text":"## FILES TOUCHED IN SCOPE (1)\nlib/a\n"}],"excluded":[{"item":"handover","reason":"no record for this worktree and branch — absence, not a stale match"},{"item":"history","reason":"profile implementation sets context.recent_history_depth: 0"}],"budget":{"lines":58,"limit":300,"dropped":[]}}
- exit 0
- stdout_contains /^\{/
-
efektivní politika a profil, pod nimiž byl kontext sestaven
# task
id=t-<id>
task=narrow the parser
profile=implementation
owner=<owner>
scope.0=lib
started_at=<time>
checkpoint_at=<time>
outcome=active
repository_id=<repo>/.git
worktree=<repo>
branch=main
head=<sha>
working_tree=clean
# profile implementation
name=implementation
description=build a described feature or change within a known design
capability=standard
effort=medium
verbosity=concise
presentation=engineering
context.task=true
context.current_state=true
context.decisions=true
context.relevant_files=true
context.failing_output=false
context.recent_history_depth=0
context.architecture_notes=false
context.knowledge=true
context.knowledge_max_items=8
verification.verify_command_required=true
verification.regression_test_required=false
verification.decision_record_required=false
checkpoint_interval=15m
output_contract.0=outcome
output_contract.1=changes
output_contract.2=verification
output_contract.3=blockers
output_contract.4=next_action
# policy
version=1
context.always_loaded_budget_lines=150
context.builder_budget_lines=300
context.recent_decisions=5
context.max_list_items=20
context.strategy=minimum-sufficient
context.transcript_is_state=false
profiles.default=implementation
profiles.checkpoint_interval_default=15m
verification.required_for_changes=true
verification.finish_requires.0=scope_respected
verification.finish_requires.1=verification_ran
verification.finish_requires.2=state_updated
verification.finish_requires.3=no_open_blockers
verification.finish_requires.4=note_present
handover.required_sections.0=Objective
handover.required_sections.1=Current State
handover.required_sections.2=Next Action
handover.retention_max_files=200
# doctrines enforced by check
majordomus.knowledge-integrity (blocking)
majordomus.checkpoint-freshness (advisory)
majordomus.ledger-integrity (blocking)
majordomus.blocker-resolution (blocking)
majordomus.decision-records (advisory)
majordomus.scope-integrity (blocking)
majordomus.state-consistency (blocking)
majordomus.task-on-the-mesh (blocking)
majordomus.use-case-coverage (blocking)
majordomus.obligation-closure (blocking)
majordomus.completion-gates (blocking)
- exit 0
- stdout_contains /^# task/
- stdout_contains /profile/
Ř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.