Kontext není jeden soubor. Adresář nese vlastní dokument, kořen další a změna hluboko ve stromu může spadat pod dokument, o kterém nikdo neví, že ho psal. Když se dokument změní, kterých cest a kterých projekcí se to týká? Hádání je způsob, jak zastaralé pravidlo přežije kontrolu.
context list: každý dokument s rozsahem, jeho rozsah a složení
context resolve <path> a context explain <path>: co se vztahuje na cestu, v jakém pořadí a proč
context affected: dokumenty, kterých se sada změn dotýká, z gitu
context check-sync: ověř strom, potom projekce vůči jejich razítkům, potom dotčenou množinu
setup: installed
given:
- 'a repository with Majordomus installed and projections generated, and one commit of work'
steps:
- id: list
run: ['context', 'list']
note: 'every scoped document: id, path, scope, composition, providers, status'
expect:
exit: 0
stdout_contains: ['ai.layer']
- id: resolve
run: ['context', 'resolve', 'lib']
note: 'the documents that apply to a path, root to target, in effective order with provenance'
expect:
exit: 0
stdout_contains: ['^01 ai.layer']
- id: explain
run: ['context', 'explain', 'lib']
note: 'the same, with why each applies and why each candidate was left out'
expect:
exit: 0
stdout_contains: ['ai.layer']
- id: affected
run: ['context', 'affected']
note: 'which documents the working tree’s changes touch; nothing is changed here, so nothing is affected'
expect:
exit: 0
tree_unchanged: true
- id: sync
run: ['context', 'check-sync']
note: 'the tree validates, every projection matches its stamp, and nothing is affected'
expect:
exit: 0
stdout_contains: ['in sync']
then:
- 'resolution is deterministic: the same path gives the same ordered list'
- 'a change under a scope names the document that governs it'
- 'the projections are checked against the documents they were rendered from'
Každá cesta má jednu deterministickou odpověď na „co mě řídí“, každá změna má jednu odpověď na „čeho jsem se dotkl“ a projekce vykreslená z dokumentu, který se mezitím změnil, se hlásí, nepovažuje se za důvěryhodnou.
-
každý dokument s rozsahem: id, cesta, rozsah, složení, poskytovatelé, stav
ai.layer .ai/README.md subtree final * active
ai.repo .ai/repo/README.md subtree extend * active
ai.repo.adrs .ai/repo/adrs/README.md subtree extend * active
ai.repo.applications .ai/repo/applications/README.md subtree extend * active
ai.repo.deployments .ai/repo/deployments/README.md subtree extend * active
ai.repo.features .ai/repo/features/README.md subtree extend * active
ai.repo.knowledge .ai/repo/knowledge/README.md subtree extend * active
ai.repo.profiles .ai/repo/profiles/README.md subtree extend * active
ai.repo.project .ai/repo/project/README.md subtree extend * active
ai.repo.prompts .ai/repo/prompts/README.md subtree extend * active
ai.repo.rules .ai/repo/rules/README.md subtree extend * active
ai.repo.sessions .ai/repo/sessions/README.md subtree extend * active
ai.repo.skills .ai/repo/skills/README.md subtree extend * active
ai.repo.use-cases .ai/repo/use-cases/README.md subtree extend * active
ai.repo.why .ai/repo/why/README.md subtree extend * active
ai.repo.workflows .ai/repo/workflows/README.md subtree extend * active
ai.repo.knowledge.candidates .ai/repo/knowledge/candidates/README.md subtree extend * active
ai.repo.knowledge.curated .ai/repo/knowledge/curated/README.md subtree extend * active
ai.repo.rules.project .ai/repo/rules/project/README.md subtree extend * active
- exit 0
- stdout_contains /ai.layer/
-
dokumenty, které platí pro cestu, od kořene k cíli, v efektivním pořadí s původem
# effective context for lib
01 ai.layer .ai/README.md subtree final *
- exit 0
- stdout_contains /^01 ai.layer/
-
totéž, s důvodem, proč se každý uplatňuje a proč byl každý kandidát vynechán
# effective context for lib
01 ai.layer .ai/README.md subtree final *
applies: the tree root; the target is outside .ai/
# left out
(nothing: every candidate applies)
# order
depth (tree root first), then order, then path; never the order the filesystem lists files in
fingerprint <sha><hash16>ef77ca97
- exit 0
- stdout_contains /ai.layer/
-
kterých dokumentů se změny pracovního stromu dotýkají; nic se tu nemění, takže nic není dotčeno
-
strom projde validací, každá projekce odpovídá svému razítku a nic není dotčeno
OK context .ai/ — 19 document(s) validate
OK context AGENTS.md — projection for agents matches its stamp and the policy as it is
OK context CLAUDE.md — projection for claude-code matches its stamp and the policy as it is
OK context GEMINI.md — projection for gemini matches its stamp and the policy as it is
context check-sync: in sync (19 document(s), 3 projection(s), 0 affected)
- exit 0
- stdout_contains /in sync/
Ř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.