feat(continuity): wire §6.3 shared-docs staleness notice

MarkdownChanges was deleted as dead code, but the underlying spec
requirement wasn't abandoned — rebuilt it independently. Adds
continuity.ConventionsHash for AGENTS.md/CLAUDE.md/VOCAB.md, tracks a
per-session snapshot on herdr.Session, and adds
Coordinator.checkConventions (run every Monitor tick) which compares
each active session's snapshot against its project's base repo and
pushes an in-pane notice via a new herdr.ConventionsNotifier
capability when they drift.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01W1rkJ2hBMybnJctPbcy4tT
This commit is contained in:
kami
2026-07-27 22:25:53 +04:00
parent 3fe3aee5b7
commit 0ca78243b9
7 changed files with 225 additions and 8 deletions
+18
View File
@@ -137,6 +137,24 @@ Fixed so far:
half-wired, per AUDIT.md's explicit "delete and record the deviation"
option. New tests: `TestReleaseScratchCommitsDirtyFilesBeforeUpload`,
`TestReleaseRefusesOnStaleDirtyFile` (internal/herdr/adapter_test.go).
**§6.3 rewired for real, 2026-07-27 (later same day):** the deleted
`MarkdownChanges` above was zero-caller dead code, but the underlying spec
requirement ("on update, the orchestra injects a notice to agents whose
current task is adjacent") wasn't abandoned — rebuilt independently.
`continuity.ConventionsHash(root)` hashes whichever of
`AGENTS.md`/`CLAUDE.md`/`VOCAB.md` exist at a path; `herdr.Session` gained
`ConventionsHash`, snapshotted from the fresh worktree at
`Coordinator.Start`; a new `Coordinator.checkConventions`, run every
`Monitor` tick, recomputes the hash of the project's *base repo* (via
`WorktreeSpec.Spec` — "adjacent" = same project) for every leased session
and compares it against that session's stored snapshot. A mismatch calls a
new optional `herdr.ConventionsNotifier` capability
(`CLIAdapter.NotifyConventionsChanged`, an in-pane `agent.prompt` telling
the agent to re-read the docs) and updates the stored hash so the notice
fires once per drift, not every tick. Covered by
`TestConventionsDriftNotifiesActiveSession`
(internal/orchestrator/rotation_test.go): asserts no notification while
the base repo is unchanged, then one once it diverges.
**Was still open:** Phase 4 item 2 — nothing drove *any* harness to write
`.orchestra-handoff.json`, since Release only validated a file whose
existence was never solicited. **Closed 2026-07-27:** `rotate()` now checks