Context is not one file. A directory carries its own document, the root carries another, and a change deep in the tree may fall under a document nobody remembers writing. When a document changes, which paths and which projections does it affect? Guessing is how a stale rule survives a review.
context list: every scoped document with its scope and composition
context resolve <path> and context explain <path>: what applies to a path, in order, and why
context affected: the documents a change set touches, from git
context check-sync: validate the tree, then the projections against their stamps, then the affected set
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'
Every path has one deterministic answer to “what governs me”, every change has one answer to “what did I touch”, and a projection rendered from a document that has since changed is reported, not trusted.
-
every scoped document: id, path, scope, composition, providers, status
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.mesh .ai/repo/mesh/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/
-
the documents that apply to a path, root to target, in effective order with provenance
# effective context for lib
01 ai.layer .ai/README.md subtree final *
- exit 0
- stdout_contains /^01 ai.layer/
-
the same, with why each applies and why each candidate was left out
# 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/
-
which documents the working tree’s changes touch; nothing is changed here, so nothing is affected
-
the tree validates, every projection matches its stamp, and nothing is affected
OK context .ai/ — 20 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 (20 document(s), 3 projection(s), 0 affected)
- exit 0
- stdout_contains /in sync/
The chain from this page to the code: the use case names commands, rules and claims; each rule is dispatched from the registry and each claim names the test that proves it; the scenario above executed the commands. Nothing in this chain is prose about intent.
Computed from what they share: claims, rules, commands, category, applications. Nobody maintains this list.