Context is a tree, not one file: the documents that apply to a path are resolved from the root down, the nearest one adds and never silently replaces, and a worker loads what its task needs and nothing more.
- status
- stable
majordomus context resolve <path> prints the documents that apply to a path, least
specific first; context explain says why each is in or out; context validate refuses a
tree with a missing contract, a duplicate identity, a broken or cyclic override, or an
override of a document marked final; context affected names the documents a change set
touches. The repository scope is declared once, out over in, and the executable discovers,
indexes and serves nothing outside it.
A provider's own nested-file loading is an optimisation the tool does not replace; the
resolution is what applies. The checkout-local half of the layer is never context and never
published.
The capabilities behind it
The capability modules of the executable this feature names, each with the capabilities it composes. The command line, the HTTP route, the MCP tool and the reference beside every row are projections of one declaration, not four registrations.
Directory contracts
directories
behaviorally verified
The layer's directories as a hierarchy: the contract each one declares, what it owes and which contract said so, and the chain that applies to it once inheritance is resolved.
apps/majordomus-cli/src/capability/builtin/directories.rs
Repository
repository
behaviorally verified
The repository this process serves: its layer, its git state, the state of the index built from it, and its scope: what a worker reads of it and what it never reads.
apps/majordomus-cli/src/capability/builtin/repository.rs
The commands that run it
-
majordomus context
work · read-only
What the next worker needs to know now, in authority order and within a budget.
The objects it is made of
Kinds of the layer. Each is a schema, a source class and a file on disk; the number beside it is what this repository holds today, counted at build time.
What it answers
Operational moments from the Why catalogue that name one of this feature's mechanisms. Nothing here was assigned: a moment appears because it names a rule, a command, a capability or a claim this feature also names.
The rules that hold it
-
blockingContext integrity
majordomus.context-integrity
-
advisoryLoad minimum sufficient context
majordomus.minimum-sufficient-context
-
blockingContext locality
project.context-locality
-
blockingWhat a worker reads is declared once, and nothing outside it is read or served
project.scope-is-declared
-
advisoryLayout integrity
majordomus.layout-integrity
-
blockingAI layer integrity
majordomus.ai-layout-integrity
What is guaranteed
-
guaranteed
The context that applies to a path is composed from the layer's scoped documents, root to target, in one deterministic order with provenance, and a tree that does not validate resolves nothing
-
guaranteed
Every directory of the layer carries a context document, the exemption is declared by the contract that governs the subtree, and a descendant may narrow that requirement but never weaken it
-
guaranteed
The impact of a change set on the scoped context is reported from git — the documents, the scopes below them, moves with their ancestry, tracked sources to review, and stale projections — and an unrelated change reports nothing
-
guaranteed
The assembled context obeys a line budget, and every section it drops is named with its reason
-
advisory
A profile declares which context a worker should load and no more
-
guaranteed
What a worker reads of the repository is declared once in .ai/repo/scope.yaml, out wins over in, and the Rust executable discovers, indexes and serves nothing outside it
-
guaranteed
The repository's AI layer is one directory whose manifest names every section, readable without the tool
-
guaranteed
Checkout-local state lives under .ai/local/, is ignored by git, and is absent on a fresh clone or worktree
-
guaranteed
A hardcoded count in the always-loaded file is a failure
Executable use cases