Skip to content

Record the handoff session and per-session dir in seeded state records (#51)#52

Merged
drabaioli merged 4 commits into
mainfrom
gh_issue_51_record_handoff_session
Jul 20, 2026
Merged

Record the handoff session and per-session dir in seeded state records (#51)#52
drabaioli merged 4 commits into
mainfrom
gh_issue_51_record_handoff_session

Conversation

@drabaioli

Copy link
Copy Markdown
Owner

Summary

Writer half of issue #51: make the /cdd-next-step handoff session resumable and give every session entry a working directory.

  • cdd-state seed now records the handoff session (/cdd-next-step, on the main worktree) as the first sessions[] entry {id, stage: scoped, dir} — guarded on CLAUDE_CODE_SESSION_ID exactly like set's append (empty list when no id; no guessing).
  • Every session entry (seed and set) now carries dir, the worktree root (git rev-parse --show-toplevel) — the natural cd target before claude --resume.
  • Additive and optional: no schema_version bump, so old and new records interoperate; a consumer that finds dir absent falls back to the branch's known worktree path.

The reader half is cdd-dash PR #10.

Docs & tests

  • doc/architecture/shell-helpers.md: schema example, prose, and the scoped writer row updated to reflect dir and the handoff-session entry.
  • scripts/install-smoke-assert.sh: two new jq-guarded assertions — seed records {id, scoped, dir}, and seed omits the entry when no session id is set.
  • Roadmap: item ticked; reconciliation commit repoints the state-record items' file trails at shell-helpers.md (where Restore process doc to workflow altitude; relocate tooling mechanics (#47) #50 relocated the schema) instead of the process doc §2.13.

Verification

All CI gates pass locally: bash -n, shellcheck, command-set drift, prompt-seam, install-smoke (incl. the new seed assertions), worktree-resume, template smoke, and demo seed-overlay.

Closes #51

🤖 Generated with Claude Code

drabaioli and others added 4 commits July 19, 2026 20:23
cdd-state seed previously wrote sessions: [], so the /cdd-next-step
handoff session (which seeds the record on the main worktree) was never
recorded and could not be resumed; only the implementation session's
first `set` landed an id. Seed now records the current session as the
first {id, stage: scoped, dir} entry when CLAUDE_CODE_SESSION_ID is set
(empty list otherwise — older Claude Code, don't guess), and every
session entry in both seed and set carries a `dir` = the worktree root
(git rev-parse --show-toplevel), the natural cd target for
`claude --resume`.

`dir` is additive and optional: no CDD_STATE_SCHEMA_VERSION bump, so old
and new records interoperate (readers ignore unknown fields; the reader
half is cdd-dash PR #10, which falls back to the row's worktree path when
dir is absent). Closes the writer half of issue #51.

Docs updated to match: the helper header block, process doc §2.13
(schema example, append-only paragraph, scoped table row), and a checked
Phase 13 roadmap item. install-smoke-assert.sh gains a jq-guarded
assertion that seed records the handoff session with its dir, and omits
the entry when no session id is set.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…rs.md

Merge with origin/main (#50) relocated the state-record schema and
stage-to-writer table from process-doc §2.13 into
doc/architecture/shell-helpers.md. The §2.13 conflict was resolved by
taking #50's condensed version; this ports the issue #51 semantics into
their new home: the `dir` field on session entries, the schema note that
`dir` is additive/optional, that seeding records the handoff session as
the first entry, and the updated `scoped` writer row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
#50 relocated the state-record schema out of process doc §2.13 into
doc/architecture/shell-helpers.md. Update the two completed roadmap items
(#51 writer half, and the earlier per-task-record item) so their file trails
point at where the schema actually lives.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@drabaioli
drabaioli merged commit b2b012b into main Jul 20, 2026
1 check passed
@drabaioli
drabaioli deleted the gh_issue_51_record_handoff_session branch July 20, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record the handoff session (and per-session working dir) in seeded state records

1 participant