every-task-states-its-delivery-economics — Every task states its delivery economics: wall time, typed human interventions, CI reruns, spend and acceptance, each from a named record or said not observed
One capability, economics.tasks, served by CLI, HTTP and MCP, answers one record per task with every field either a value with its class and record ids or not observed with a reason, never zero for an absence.
PLANNED 0 of 6 issues done
- ready
- 1
- blocked
- 5
- active
- 0
- verify
- 0
- done
- 0
- cancelled
- 0
Problem
The owner's report of 2026-10-19 asks, as T3, for real time, human interventions, CI reruns, spend and accepted results. The records exist only in pieces: each checkout's ledger holds task.started, task.refused and task.finished with their episode; the prompt archive holds prompts linked to episodes; the drain's trail holds refresh rounds; benchmark runs hold durations, tokens and hidden-test checks. Nothing joins them per task, interventions are not typed, a permission approval leaves no record, CI run attempts are not read (I3202 is not on master), session usage is not received (I3288, I3293) and accepted has no written definition (I0401).
Outcome
One capability, economics.tasks, served by CLI, HTTP and MCP, answers one record per task with every field either a value with its class and record ids or not observed with a reason, never zero for an absence.
Current state
lib/start.sh:158-160 writes task.started with task_id, profile, owner, scope and, when bound, issue and intent. apps/majordomus-cli/src/ledger.rs:10-12 says the ledger is per checkout and untracked. intent_realization.rs:1185 folds tasks from a ledger, but gather (intent_realization.rs:1282-1284) reads only the root checkout's. lib/capture.sh:286 and :1508-1512 wire SessionStart, SessionEnd and PreCompact and no permission event. grep -rn run_attempt apps/majordomus-cli/src/integration finds nothing. I2740 (plan.delivery) is merged as ee02079b1bc.
Desired state
majordomus economics tasks returns the typed record for every task of every checkout; the fields waiting on I3202, I3293 or I0401 read not observed with that reason until those land.
Scope
- apps/majordomus-cli/src/economics
- apps/majordomus-cli/src/economics/mod.rs
- apps/majordomus-cli/src/capability/builtin/economics.rs
- apps/majordomus-cli/src/commands/economics.rs
- apps/majordomus-cli/src/cli.rs
- apps/majordomus-cli/src/intent_realization.rs
- apps/majordomus-cli/tests/economics.rs
- docs/ECONOMICS.md
- lib/capture.sh
- .claude/settings.json
- .claude/hooks
- test/fixtures/commands/stdin
- .ai/repo/automation/inventory.jsonl
- test/cases/54_session_lifecycle_hooks.sh
- test/cases/3113_the_adoption_footprint_is_inventoried.sh
- docs/claims/session-lifecycle.md
- .ai/repo/mcp-tool-run-baseline.txt
Out of scope
- A second ledger, metrics store or stored join
- Receiving or attributing usage (I3288, I3293), reading Actions run attempts (I3202) or defining an accepted outcome (I0401)
- Publishing any figure (delivery-economics-are-measured-over-declared-windows)
- A productivity percentage, score or forecast
Acceptance criteria
- economics.tasks returns one record per distinct task_id among the task.started lines of every checkout read, and lists each ledger with its line and skipped-line counts
- Every record carries wall time, interventions by type, ci_reruns, spend and accepted, each a value with class and record ids or not_observed with a reason
- CLI JSON, HTTP and MCP return the same reading for the same fixture
Validation
- majordomus plan validate
Risks
- A removed worktree removes its ledger from the denominator; the reading lists what it read and the window measurement states the unread checkouts
- The prompt archive filters injected messages only by declared markers (lib/capture.sh:239-249), so prompt records overstate human prompts in a mesh; the field is named prompt records
- Approvals in auto-approval modes may never reach the person; the receipt counts requests unless the captured payload says how the request was decided
- I3377 to I3381 edit separate functions of tasks.rs after I3376 fixed the record shape, so they add no response-shape change
Issues
Each one is an execution contract with its own acceptance criteria, validation command and required evidence. The wave column is the layer of the dependency graph it sits in.
| issue | status | wave | depends on | title |
|---|---|---|---|---|
| I3376 | READY | 0 | — | One capability states each task's wall time and episodes from every checkout's ledger, and names every field it cannot yet fill as not observed |
| I3377 | BLOCKED | 1 | I3376 | A task's prompt records, restarts and manual changes are counted by type from the records that already hold them, each with the ids behind it |
| I3378 | BLOCKED | 1 | I3376 | A permission request the provider reports leaves a receipt with its own elapsed time, and economics.tasks counts it as an approval |
| I3379 | BLOCKED | 1 | I3376, I3202 | Each issue's CI reruns and rounds are counted from the Actions run record, attributed through plan.delivery |
| I3380 | BLOCKED | 3 | I3376, I3293 | A task's spend is the usage attributed to it, as reported tokens with their class, and money stays not observed until it is a separate field |
| I3381 | BLOCKED | 1 | I3376, I0401 | A task counts as accepted only by the written definition of an accepted outcome, with the issue's furthest delivery stage shown beside it |
The graph
flowchart LR
I3376["I3376<br/>One capability states each task's wall time and episodes from every checkout's ledger, and names every field it cannot yet fill as not observed"]:::ready
I3377["I3377<br/>A task's prompt records, restarts and manual changes are counted by type from the records that already hold them, each with the ids behind it"]:::blocked
I3378["I3378<br/>A permission request the provider reports leaves a receipt with its own elapsed time, and economics.tasks counts it as an approval"]:::blocked
I3379["I3379<br/>Each issue's CI reruns and rounds are counted from the Actions run record, attributed through plan.delivery"]:::blocked
I3380["I3380<br/>A task's spend is the usage attributed to it, as reported tokens with their class, and money stays not observed until it is a separate field"]:::blocked
I3381["I3381<br/>A task counts as accepted only by the written definition of an accepted outcome, with the issue's furthest delivery stage shown beside it"]:::blocked
I3376 --> I3377
I3376 --> I3378
I3376 --> I3379
I3376 --> I3380
I3376 --> I3381
classDef done stroke:#16a34a,fill:#dcfce7,color:#14532d,stroke-width:2px
classDef active stroke:#2563eb,fill:#eff6ff,color:#1e3a8a,stroke-width:2px
classDef verify stroke:#7c3aed,fill:#f5f3ff,color:#4c1d95,stroke-width:2px
classDef ready stroke:#0891b2,fill:#ecfeff,color:#164e63,stroke-width:2px
classDef planned stroke:#0891b2,fill:#ecfeff,color:#164e63,stroke-width:2px
classDef blocked stroke:#b45309,fill:#fffbeb,color:#78350f,stroke-width:2px
classDef cancelled stroke:#6b7280,fill:#f9fafb,color:#374151,stroke-width:2px
classDef superseded stroke:#6b7280,fill:#f9fafb,color:#374151,stroke-width:2pxLinked from this diagram (6)
- I3376 One capability states each task's wall time and episodes from every checkout's ledger, and names every field it cannot yet fill as not observed
- I3377 A task's prompt records, restarts and manual changes are counted by type from the records that already hold them, each with the ids behind it
- I3378 A permission request the provider reports leaves a receipt with its own elapsed time, and economics.tasks counts it as an approval
- I3379 Each issue's CI reruns and rounds are counted from the Actions run record, attributed through plan.delivery
- I3380 A task's spend is the usage attributed to it, as reported tokens with their class, and money stays not observed until it is a separate field
- I3381 A task counts as accepted only by the written definition of an accepted outcome, with the issue's furthest delivery stage shown beside it
Canonical record: .ai/repo/project/milestones/every-task-states-its-delivery-economics.yaml. Read it back with majordomus plan show every-task-states-its-delivery-economics.