Skip to content

Every directory of the layer carries its contract, and a worker reads what applies

Every README under .ai/ is a context document with an identity, a scope, the providers and audience it addresses and how it composes with its ancestors; the repository scope declares what a worker reads and what it never reads; and the briefing a worker gets is assembled from durable state within a line budget with every exclusion named.

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

What it does

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.

What it does not do

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.

  • context27
  • scope1

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 integritymajordomus.context-integrity
  • advisoryLoad minimum sufficient contextmajordomus.minimum-sufficient-context
  • blockingContext localityproject.context-locality
  • blockingWhat a worker reads is declared once, and nothing outside it is read or servedproject.scope-is-declared
  • advisoryLayout integritymajordomus.layout-integrity
  • blockingAI layer integritymajordomus.ai-layout-integrity

What is guaranteed

Executable use cases