# Phase 24 Discussion Log

**Discussed:** 2026-05-20 (resumed after scheduled wake from 1:20 AM PDT cron)

Audit trail for downstream-agent reference. Canonical record is `24-CONTEXT.md`.

---

## Selected Areas

User selected all four presented gray areas:
1. Git library + missing-git fallback
2. Working-tree topology
3. Commit msg format (+ SEED-004)
4. Sessions log + migration

## Area 1: Git library + missing-git fallback

### Q: Git library choice
- Options: shell system `git` (Recommended) / link git2-rs / hybrid
- **Selected:** Shell system `git`
- Rationale: matches Phase 23's `src/common/git.rs` Stamp helpers; zero binary
  growth; operator-reproducible commands.
- → **D-01**

### Q: Missing-git fallback behavior
- Options: degrade silently (Recommended) / hard-require git / bundle MinGit
- **Selected:** Degrade silently
- Rationale: never block commune/signoff; raw files still land on disk.
- → **D-02**

## Area 2: Working-tree topology

### Q: Initial topology choice
- Options: N full clones (ROADMAP shape, Recommended) / bare seed + worktrees /
  single working repo
- **User asked for tradeoff analysis** before locking
- Claude returned a long-form caveats / GitHub Desktop / Phase 35 swap / unique
  benefits breakdown
- Key tradeoff points: worktrees win on disk + atomic push + unified log;
  lose on cleanup ergonomics (must `git worktree remove`) + gc-safety config
  (must set `gc.worktreePruneExpire=never`)

### Q: After tradeoff dump — lock topology?
- Options: bare seed + worktrees (Recommended) / N full clones / need more info
- **Selected:** Bare seed + worktrees
- → **D-03, D-05, D-06**

### Q: (user-driven) Worktree branch naming
- User-added concern: agent name and project name could collide in branch
  namespace
- **Selected (user freeform):** Prefix branch names — `a-{agent_id}` and
  `p-{project_name}`. Folder names stay prefix-less.
- → **D-04**

## Area 3: Commit msg format (+ SEED-004)

### Q: Adopt SEED-004 stamp trailers in Phase 24, or defer?
- Options: adopt SEED-004 now (Recommended) / minimal subject only, defer /
  compact stamp in subject
- **Selected:** Adopt SEED-004 now
- Rationale: SEED-004 was planted this session for exactly this phase; commit
  trailers + per-scope field set (agent worktrees carry project, project
  worktrees omit it) lock cleanly here.
- → **D-07, D-08**
- Action: SEED-004 marked `status: folded` in this commit.

## Area 4: Sessions log + migration

### Q: Sessions log format
- Options: JSONL (Recommended) / plain TSV / markdown bullets
- **User clarification:** filename should be `sessions.log` (singular, no
  `{gen}` suffix). Prev-gen versions tracked naturally by git. Drop
  `gen`, `machine`, `project` fields from per-line entries — already covered
  by git history + SEED-004 commit trailers.
- **User clarification:** worktree branch names should prefix `a-` / `p-` to
  prevent collisions. Folder names stay prefix-less. (Captured as D-04 above.)
- Resulting format: JSONL with `ts`, `session_uuid`, `trigger`.
- → **D-09, D-10**

### Q: Rollover trigger
- Options: generation change only (Recommended) / gen OR size cap / daily
- **Selected:** Generation change only
- Combined with user's "tracked via git" clarification → seal-on-roll becomes
  truncate-on-roll mechanism.
- → **D-12**

### Q: Trigger enum
- Options: minimal 3 (Recommended) / expanded 5 / freeform string
- **User refinement:** 4 values — `boot` (covers revive), `pulse`, `commune`,
  `signoff`. Maps to existing wake paths: boot = initial spawn or `/spt:revive`;
  pulse = touch_loop; commune = echo_commune; signoff = init_signoff.
- → **D-11**

### Q: Legacy-flat migration policy
- Options: auto-migrate on first boot (Recommended) / coexist as legacy /
  explicit `$LIVE migrate` only
- **Selected:** Auto-migrate on first boot
- → **D-15**

---

## Deferred / Out-of-Scope

- Per-machine UUID alternative to hostname → Phase 35
- seed/ history squash / shallow clones → revisit only when measured
- `$LIVE migrate` opt-in subcommand → auto-migrate default suffices
- Sessions log retention pruning → unbounded for now
- Cross-machine concurrent push conflict policy → explicitly Phase 35
- Project worktree pre-creation in migration → projects stay lazy

## Claude's Discretion (planner-decided)

- Subject-line truncation algorithm (D-07 50-char `{short}`)
- Migration detection location (`src/live/start.rs` vs `src/common/owlery.rs`)
- `Stamp::commit_trailers()` return type shape (String vs Vec<(&str, String)>)
- Empty initial commit author identity (likely `spt-bootstrap <noreply@spt>`)
- Test coverage breakdown across unit/golden/integration
- `$LIVE doctor` table rendering polish

---

*Phase: 24-tracked-dir-forked-repo-layout-agents-projects-branches-sess*
