I3142 — An episode opens through the typed domain and records the task and issue it began on
ADR 0047 step 2 plus the missing attribution: session start delegates to the domain's opener, and session.started carries the task the episode began on as an Option<TaskId> taken from a ledger fact of its own provider session; the closer derives the bound issue from that task's own ledger events and folds both into tasks and issues.
BLOCKED wave 2 · p1 · implementation profile · parallel safe
Blocked. This issue cannot start until I3141, I3320 are done. The status is derived from that, not declared.
Objective
ADR 0047 step 2 plus the missing attribution: session start delegates to the domain's opener, and session.started carries the task the episode began on as an Option<TaskId> taken from a ledger fact of its own provider session; the closer derives the bound issue from that task's own ledger events and folds both into tasks and issues.
Why
On 2026-09-11 a record could say task_id: t-... and tasks: [] at once, and a ten-hour session on an active issue reported issues: []: the task had been started in an earlier episode and no task event fell inside the window. Proposed in ADR 0182 (A closed session record is judged by what it can attribute, not only by its schema) (proposed; it carries no authority until the owner accepts it). Sources: chatgpt-majordomus:c116#3.
Current state
lib/session.sh opens episodes; tasks/issues in the record come only from ledger events inside the episode; Episode carries Option<TaskId> in session/episode.rs but nothing populates it at open; mj_load_current reads the checkout's current.yaml, which two windows of one checkout share.
Desired state
session.started names the task the episode began on and nothing else of it; the record's tasks and issues are the union of open, transitions and close.
Scope
- lib/session.sh
- lib/start.sh
- apps/majordomus-cli/src/session
- share/events.yaml
- share/allow/session.txt
- share/allow/session-record.txt
- share/schemas/majordomus/session/session.v1.schema.json
- share/schemas/majordomus/session-record/session-record.v1.schema.json
- apps/majordomus-cli/tests/session_domain.rs
- test/cases/60_session_lifecycle.sh
Out of scope
- Binding a task to an intent, which I2001 owns
Dependencies
- I3141BLOCKED majordomus session close writes its record through the typed domain's closer, and the shell closer is deleted
- I3320READY A lifecycle command run against an absent or stale executable fails loudly and never falls back to a shell writer
What waits on this
- I3143BLOCKED Each provider lifecycle event leaves a typed receipt written by the domain before any guard can return early
- I3144BLOCKED Checkpoints and handovers are recorded against the episode, and the shell only parses and renders them
- I3146BLOCKED A closed session record says whether it is complete, and one that changed the tree without saying what it served is not
- I3148BLOCKED An episode records the governance digest and the briefing digest it was handed at start
- I3311BLOCKED Generated sequences of episode events never move an episode in a way its transition table forbids
Acceptance criteria
- A session opened on a task started in an earlier episode lists it in tasks and its issue in issues
- task_id and tasks can no longer disagree
- Shell output of session start unchanged
Validation
- bash test/run.sh --no-skips 60_session_lifecycle 111_session_per_provider 130_lifecycle_survives_a_stale_task
- cargo test --manifest-path apps/majordomus-cli/Cargo.toml --test session_domain
Evidence required
- test_session_open_records_its_task
Evidence
None recorded. Every token above needs a command or an artifact behind it before this issue can be completed; narrative is refused.
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/I3142.yaml. Read it back with majordomus plan show I3142.