I1406 — The plan's derivations are capabilities, so every surface reads the readiness the terminal reads
Make status, ready, blocked, waves, next and roadmap answerable through the capability registry, so that MCP, HTTP, OpenAPI and the Cockpit read the derived plan rather than only the raw documents.
DONE wave 0 · p1 · implementation profile · runs alone
Objective
Make status, ready, blocked, waves, next and roadmap answerable through the capability registry, so that MCP, HTTP, OpenAPI and the Cockpit read the derived plan rather than only the raw documents.
Why
Issues and milestones are already served as objects: `majordomus://issue/I0001` returns the record. What is not served is everything that makes the model worth having. The derivations live in lib/plan.sh and lib/project.awk, the Rust executable opens `.ai/repo/project/issues/` only to read filenames, and an agent asking the server what to work on next cannot be told.
Current state
lib/plan.sh, 520 lines, computes the derived states. apps/majordomus-cli/src/worktree/state.rs line 190 is the only place the executable touches the project directory, and it reads the directory listing. There is no plan capability and therefore no plan tool, route or Cockpit page.
Desired state
The derivations are declared where every other capability is declared and projected by the same generator. The shell keeps its command surface by calling the executable, or the two agree by construction and a test proves they agree.
Scope
- apps/majordomus-cli/src/capability/builtin
- apps/majordomus-cli/src
- lib/plan.sh
- docs/CAPABILITIES.md
- test/cases
Out of scope
- Changing what the derivations mean
- A second plan implementation that may disagree with the first
Dependencies
None. This issue is a root of the graph.
What waits on this
Acceptance criteria
- The derivations are declared once and projected to MCP, HTTP and OpenAPI with no transport registry edited by hand
- The executable and the shell answer identically for every record in this repository, proved by a test that compares them
- majordomus generate --check is clean after the declaration is added
- The Cockpit shows the derived plan and its drift
Validation
- cargo test --workspace --all-features
- majordomus generate --check
- bash test/run.sh
Evidence required
- derivations_projected
- shell_and_executable_agree
Evidence
| covers | type | command | result | at commit |
|---|---|---|---|---|
| derivations_projected | test | bash test/run.sh 99_plan_capabilities | eight plan capabilities (model/status/issues/waves/next/roadmap/validate/record) declared with capability! and projected by the generator to MCP tools, a majordomus://plan resource, eight /api/v1/plan routes and OpenAPI; no transport registry, OpenAPI file or documentation table was hand-edited | 0df29db |
| shell_and_executable_agree | test | bash test/run.sh 99_plan_capabilities | both engines run over every record of this repository and over a fixture carrying a cancellation, a milestone gate, a scope overlap, an unknown dependency and a cycle; status, wave, both dependency lists, milestone counts, roadmap rank and order, active milestone, next-ready, wave layering and every finding compared byte for byte | 0df29db |
Risk
Two implementations of one derivation is the failure this repository exists to prevent; the equality test is the acceptance criterion, not a nicety.
Timeline
- started
- 2026-09-09T22:00:16Z
- verified
- 2026-09-09T22:00:30Z
- completed
- 2026-09-09T22:00:36Z
Those three fields, the evidence above and the state of the dependencies are all the status is made of. There is no status field to disagree with them.
Canonical record: .ai/repo/project/issues/I1406.yaml. Read it back with majordomus plan show I1406.