feat(mentor): research & library-light (S8) (#29)
CI / ci (push) Canceled after 0s

The mentor researches mid-pass and its findings arrive as candidate
source-notes with provenance inside their Session. A third museion-
tools tool, submit_research_notes, is the typed rail (ADR-0006
posture): decode-validate only, reply {"received": N}, write NOTHING
— the session is the holding area, and keeping is the writer's act.

Candidates ride the transcript as first-class rows (researchNote):
parsed from the tool call's rawInput by payload shape — the notes
array routes before the fix-card parse, titles are display text —
one row per note, all-or-nothing per batch, the wire's whitespace
rule mirrored so both boundaries agree. Resume re-materializes them
for free: replays re-run the same parse; dispositions reset honestly
(they were never persisted — engine-owned cargo, ADR-0007).

The writer curates in place (full cards in the shared transcript, no
palette — a handful curates where it lands): Keep opens the
ask-before sheet (G9; PromoteAskSheet posture — inline refusal,
buttons kept) and ONE confirm lands one plain markdown note with
provenance into the piece's research/ via writeResearchNote — the
one folder(of:) id lookup anchors it inside this Home, a symlinked
research/ refuses, collision -2; Reject vanishes, recording nothing.
The pass stub names the rail and forbids the engine writing
candidates itself; kept notes flip hasResearch, so every later pass
sees the research/ path (S8.3 at v1 depth).

Finish-audit (three reviewers) drove the whitespace-parity and
shape-routing fixes, the ResearchNoteContent dedup, and a poll-loop
fix for the debounce rig's sidecar half that the larger suite's load
had pushed past its fixed sleep — full suite green (373 tests).

Closes #29
This commit is contained in:
AlexKucera committed 2026-10-22 14:06:16 +02:00
1 parent 9895614b7e
commit b02d36bb5d
22 files changed
+977 -33

No files matched your search

+2 -2
View File
@@ -380,7 +380,7 @@ struct SessionLifecycleTests {
defer { mentor.shutdown() }
await mentor.openSession()
_ = await mentor.sendPrompt("hello") // a turn lands in the active session
#expect(!mentor.transcriptRows(of: try #require(mentor.activeEntry)).isEmpty)
#expect(try !mentor.transcriptRows(of: #require(mentor.activeEntry)).isEmpty)
if let pid = mentor.childProcessIdentifier {
kill(pid, SIGKILL) // crash the child
@@ -398,7 +398,7 @@ struct SessionLifecycleTests {
await mentor.restart()
// The post-restart transcript is the ENGINE's replay — the replay
// marker proves the words came from the engine, not the local copy.
let rows = mentor.transcriptRows(of: try #require(mentor.activeEntry))
let rows = try mentor.transcriptRows(of: #require(mentor.activeEntry))
#expect(rows.contains { row in
if case let .text(text) = row.content {
return text.contains("earlier ask")