A snapshot: read at commit 707a04c7ce8 on 2026-10-18T00:06:01Z by majordomus 0.29.0. Nothing on this page is read again. See it live
I0803
Open a session and report its status
Where it stands
devtask.issueMoves
plan.transitionWhat it is
- Objective
- Implement lib/session.sh with `session start` and `session status`: one active session per worktree in .majordomus/state/session-current.yaml, its identity and git facts computed, a second start refused rather than silently replacing the first, and a status that reports the active session against current git or says plainly that none is open.
- Why
- The active record is the anchor every later command reads. It has to refuse rather than overwrite, because an execution episode that silently replaces another one loses the boundary the whole object exists to draw.
- Now
- There is no session command and no session state file. bin/majordomus dispatches its subcommands from a fixed case list.
- Wanted
- `majordomus session start` writes the active record atomically at mode 0600, records session_id, started_at, owner, an optionally supplied worker identity, and the computed repository_id, worktree, branch, start_head and start_working_tree. It refuses when a session is already open in this worktree and names the command that closes it. `session status` prints the open session with its divergence label, or reports absence. Both are dispatched from bin/majordomus and appear in its usage.
- Done when
- unknown: the record declares no `completion`
- Risk
- One active session per worktree is the same rule current.yaml already has, and current.yaml is tracked, so it travels with the branch and appears active in a checkout that never started it. The session record has to record its worktree and be read with the same foreign-record rule.
Acceptance
- The command has a section in docs/CLI.md, because the site generator refuses a dispatched command with none, and it documents only what is implemented
- A session starts, the active record exists, and its identity fields match git
- A second start is refused with a non-zero exit and names the closing command
- A session started in one worktree does not appear as active in another
- status reports absence as absence rather than as an error
- The active record's unknown keys are rejected by an allowlist like every other Majordomus YAML file
- Validation
bash test/run.sh 60_session_lifecycleshellcheck -x -s bash lib/session.sh- Evidence required
session_opens- Evidence present
session_opens
Scope
- Touches
lib/session.shbin/majordomusshare/allowdocs/CLI.mdtest/cases/60_session_lifecycle.sh- Not
Closing a sessionAny reading of the ledgerKnowledge- Depends on
- Priority
- p1
- Profile
- implementation
- Parallel safe
- false
- Owner
- unknown: the record declares no `owner`
The work so far
- Branches
- none
- Merged
- none
- Commits
0- Trunk
- master
- Sessions
- none
- Created
- 2026-09-04
- Updated
- 2026-09-04T16:29:23Z
- Started
- unknown: the record declares no `started_at`
- Verified
- unknown: the record declares no `verified_at`
- Completed
- 2026-09-04T16:29:23Z
Synchronisation
- Adapter
scripts/github-sync- Repository
- unknown: the derived plan's header carries no repository
- External issue
- unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it
- State there
- unknown: a live GitHub state; this executable makes no network call, so only `scripts/github-sync --check` can answer it
Findings
Nothing is wrong with these records.