feat: index reasoning, and close the two-minute freshness gap #19
Reference in New Issue
Block a user
Delete Branch "feat/session-freshness"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #18.
Index reasoning
The model's own justification lives in
reasoningparts, which were deliberately excluded ("reasoning and tool parts are not indexed"). That made "why did we do this" unsearchable — the half of the transcript a reader never sees but most needs to recall.They are also enormous: the largest parts in this store are 175 KB. So:
content(FTS) but excluded fromsummary, which is what search results and MCP output show.The existing test asserted the old contract (
content leaked "thinking hard"); it now asserts the new one — reasoning present in content, absent from summary,ContentHashset.The bug this uncovered
Sessions were skipped when
created_atandsummarymatched. Content that gained reasoning behind unchanged prose was therefore never written — the feature would have been a no-op for existing sessions.IngestResultnow carries a content hash andsessionNeedsWritecompares it. The observation layer already used that signal internally; only the watcher's pre-check bypassed it.Close the freshness gap
The watcher polls every 2 minutes, so a finished turn stayed unsearchable for up to that long.
knox ingest)IngestSessionsNowis extracted so the watcher and the CLI share one implementation. It sweeps only sessions newer thanopencode_sync_max_updated, and only advances the watermark after a completed pass, so a failed run re-reads its range.The plugin calls
knox ingest sessionsat prompt admission, fire-and-forget, with an overlap guard. It never delays the turn that triggers it.Side effect worth having: the watcher's own 2-minute sweep drops from ~20 s of CPU to ~45 ms.
Verification
go vet ./...,go test ./...greentsc --strictclean and reportsactive