Skip to content

Readable session layout, folded raw traces, prune-raw (0.10.0) - #82

Merged
fazpu merged 4 commits into
mainfrom
session-layout-and-ids
Jul 19, 2026
Merged

Readable session layout, folded raw traces, prune-raw (0.10.0)#82
fazpu merged 4 commits into
mainfrom
session-layout-and-ids

Conversation

@fazpu

@fazpu fazpu commented Jul 18, 2026

Copy link
Copy Markdown
Member

Summary

Wave 2 of the simplification designs (design/designs/session-layout-and-ids.md), stacked on #81. New sessions get a reviewable tree; legacy sessions keep working unchanged.

  • Readable IDs: root sessions are NNN_<slug> (slug from the goal), children NN_<slug> (slug from the request id): sessions/001_ship-the-ultimate-memory-program/children/01_phase-0-foundations/. Timestamp/goal-hash/uuid become session.json fields. IDs derive exactly once at creation — the truncated-hash trace-dir bug class is gone by construction.
  • Folded raw plane: the parallel traces/ mirror tree is retired for new sessions. Per-attempt raw artifacts live in sessions/<id>/raw/<NNNN>_<workflow>/ (git/, harness/, protocol/, eval/, service/) with no hash nesting, no trace_manifest.json, no trace_seals/, no finalization outbox. trace_ref.json is a plain relative path. Both stock preambles now carry the placement rule: scratch → raw/, anything citable as evidence → durable tree.
  • Self-describing receipts: git + delivery receipts merge into receipts/ named by iteration (0026_outer_git_after.json). Eval receipts keep their dir — their raw-report provenance binding is load-bearing v3 machinery and is now folded-layout aware.
  • Pruning: raw/ is gitignored per session; new loopy prune-raw [--older-than DAYS] [--session ID] [--legacy-traces] deletes raw planes and never touches durable files. Deleting raw/ leaves every plan/handoff/receipt ref resolvable.
  • docs/session-layout.md rewritten (it was stale against v0.8) with a legacy appendix. Version: 0.10.0.

Deferred, per the design's own escape hatch: collapsing the four frozen roster/contract files into session.json — 45+ references across hash-pinned frozen-state machinery; worth its own change if still wanted.

Test plan

  • 444 passed (+16 new: slug/ordinal incl. collisions + legacy-sibling ignore + empty-goal fallback, folded tree shape, receipt routing/naming, raw placement without manifest, legacy mirror-layout compat, prune-raw durability guarantees); ruff check/format clean; pyright 0 errors.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EPYwF6cRYs2mfsfHF1hibc

fazpu and others added 2 commits July 18, 2026 17:52
Implements design/designs/session-layout-and-ids.md for new sessions;
legacy timestamp-style sessions and mirror traces stay readable through
their lifetime via the centralized sessions.py helpers.

- Session dirs are ordinal+slug (001_ship-the-ultimate-memory-program,
  children/01_phase-0-foundations); timestamp, goal hash, and uuid move
  into session.json. IDs derive once at creation; nothing re-parses
  paths or re-hashes content to reconstruct them.
- The traces mirror tree is gone for new sessions: per-attempt raw
  artifacts live under sessions/<id>/raw/<NNNN>_<workflow>/ with no
  two-level hash nesting, no trace_manifest.json, no trace_seals/, no
  finalization outbox. trace_ref.json carries a plain relative path.
  Evidence documents belong in the durable tree; both stock preambles
  now state the placement rule.
- Git and delivery receipts merge into receipts/ with self-describing
  names (0026_outer_git_after.json). Eval receipts keep their dir --
  their raw-report provenance binding is load-bearing and is now
  folded-layout aware.
- raw/ is gitignored per session (plus template ignore lines); new
  `loopy prune-raw [--older-than] [--session] [--legacy-traces]`
  deletes raw planes without ever touching the durable tree.
- docs/session-layout.md rewritten for the folded layout with a legacy
  appendix.

Deferred per the design's own escape hatch: collapsing the four frozen
roster/contract files into session.json (45+ references across the
frozen-state machinery; separate change if still wanted).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPYwF6cRYs2mfsfHF1hibc
The rewritten outer/planner prompts described handoff.json as "summary,
status, open_work, risks, and refs", but LayerHandoff is extra="forbid"
and has no status or refs fields -- an orchestrator following the prompt
produces a handoff the engine rejects, which then invalidates its
terminal control ("cited handoff observation is invalid") and blocks
layer completion indefinitely. Observed live in the ultimate-memory-cloud
program (4 rejected control publications). Prompts now state the exact
schema: schema_version, session_id, goal_sha256, revision, producer,
summary, accepted_outcomes, open_work, risks, decision_refs,
evidence_refs, delivery_refs, eval_refs, updated_at.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPYwF6cRYs2mfsfHF1hibc
@fazpu

fazpu commented Jul 18, 2026

Copy link
Copy Markdown
Member Author

Rode along on this branch: fix(templates) commit correcting the handoff contract in the outer/planner prompts — the wave-1 rewrite described handoff.json with status and refs fields that LayerHandoff (extra=forbid) rejects, which blocked layer completion in the live ultimate-memory-cloud run (4 rejected terminal-control publications, 'cited handoff observation is invalid'). Prompts now state the exact schema. Follow-up worth considering: have the engine emit the LayerHandoff JSON schema as a file referenced from paths.json so prompts never restate it.

Three consecutive live children each burned one rejected terminal-control
cycle guessing the evidence-ref format (a URL + bare git SHA, repo:path
without the slash, absolute filesystem paths). The control example now
states the grammar: <scope>:/<path> with scopes repo, session, parent,
root; URLs/SHAs/absolute paths belong inside a referenced file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EPYwF6cRYs2mfsfHF1hibc
@fazpu
fazpu changed the base branch from single-goal-assignments-and-prompt-diet to main July 19, 2026 11:10
@fazpu
fazpu merged commit ceb7d02 into main Jul 19, 2026
2 checks passed
@fazpu
fazpu deleted the session-layout-and-ids branch July 19, 2026 11:11
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.

1 participant