I0703 — Implement the decision and prove it holds
Implement whatever I0702 decided across every command that writes a durable record, and turn the characterisation case into one that asserts the new behaviour.
READY wave 2 · p1 · debugging profile · runs alone
Part of M002 — A durable record names the worker that wrote it.
Ready. Every dependency is done, so majordomus plan start I0703 will be accepted.
Objective
Implement whatever I0702 decided across every command that writes a durable record, and turn the characterisation case into one that asserts the new behaviour.
Why
A defect is fixed when the case that reproduced it goes from describing the gap to describing the guarantee. Anything less leaves the next worker unable to tell which of the two the code is in.
Current state
The choice is recorded as ADR 0164, status proposed, so it carries no authority until the owner accepts it; implementation waits on that (3e and a3, 2026-10-21). Nothing of it is on master or on any branch. The writers are decision add (lib/decision.sh), question add and resolve (lib/question.sh), checkpoint (lib/checkpoint.sh), check --checkpoint (lib/check.sh), handover (lib/handover.sh) and knowledge observe (lib/knowledge.sh). All of them resolve the task from the checkout through mj_load_current, and all attribute through the envelope: mj_ledger_append calls mj_open_session_id, which falls back to the session pointer, which is the guess ADR 0164 forbids. Case 3049 opens no episode, so its workers cannot be told apart; it must open one episode per worker (session start --provider-session). Case 111:86-91 asserts the pointer fallback that ADR 0164 condition 2 removes. share/doctrines.yaml no longer exists (rules carry x-majordomus validators), and ADR 0164 refuses nothing, so the refusal and doctrine criteria have nothing to cover. Planned implementation: (1) one mj_record_session in lib/common.sh, used by mj_ledger_append: MJ_SESSION_KEY, else a provider session with an open episode, else the pointer only when at most one episode is open, else empty; (2) mj_record_task, which names the active task only when its task.started session equals the caller's; (3) every writer above uses it, and a foreign task leaves current.yaml untouched. Proposed answers awaiting the owner: with no episode anywhere the task is the caller's; a supplied identity with no open episode records no session; question add against a foreign task writes task_id none instead of failing; decision keeps Task: none; every writer is in scope.
Desired state
Every command that writes a durable record follows the decision, the case asserts the new behaviour, and a refusal — if that is what was chosen — names the rule that refused and what to run instead.
Scope
- lib
- share
- test/cases
Out of scope
- Any behaviour the decision did not choose
Dependencies
What waits on this
Acceptance criteria
- Every command that writes a durable record is covered, not only decision
- The case from I0701 asserts the guarantee rather than the gap
- A refusal names the rule and the command that resolves it
- If the rule is enforced, it is declared in share/doctrines.yaml and doctor proves it reaches its command
Validation
- bash test/run.sh
- bin/majordomus doctor
Evidence required
- suite
- doctor
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
Risk
Three commands share this resolution path; fixing one and not the others leaves a defect that looks fixed, which is worse than one that looks broken.
Timeline
- started
- —
- verified
- —
- completed
- —
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/I0703.yaml. Read it back with majordomus plan show I0703.