feat(boatstack): retromine — offline recurrence detection over transcripts - #242
Merged
Conversation
…ripts New pure package internal/retromine: the sensor for the control law that a recurring operator instruction is steady-state error. Neutral JSONL event schema; adapters for Claude Code session JSONL and prefix-annotated plain text (lossy projection: skip unknown shapes, typed error on unparseable lines); deterministic recurrence detection (normalize, strip fenced payloads, token 3-shingles, Jaccard >= 0.6, greedy clustering in sorted order) with recurrence defined as >= 3 occurrences across >= 2 sessions. Per-session event indexes are parser-assigned so caller concatenation order cannot change the report. Capability-free by construction: no network, subprocesses, filesystem, clocks, or randomness — the import list is conformance-tested. Synthetic fixtures only. No user-facing verb yet; retro derive follows. control-law: retro-derivation-is-offline-and-deterministic Disclosure-Reviewed: reviewed — public-safe only, private facet kept out of this commit
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Seventh slice of the published → merged program (follows #241) — the first half of Phase D. The program's general law: a recurring operator instruction is steady-state error — evidence the controller is missing a typed observation, verb, setpoint, or guard. This PR builds the sensor for that law.
What changed
New pure package
internal/retromine:source, session_id, ts?, role: operator|agent|tool, text, index) any tool can emit — the miner is agent-agnostic by contract.User:/Agent:/>), plus the neutral format, with per-file content sniffing. Lossy projection is one-directional by design: unknown entry shapes are skipped (host formats grow constantly), but an unparseable line is a typed error naming its line — mis-parsing can never silently become "no recurrence found".retro derive(classifier + proposals + CLI) is the next slice.Boundary conformance
retro-derivation-is-offline-and-deterministic— no network, no subprocesses, no filesystem, no clocks, no randomness; identical inputs in any order produce identical output.retromine_conformance_test.go— positive (planted 3×/2-session instruction clusters; both adapters project equivalent content to equivalent instruction streams; fenced-payload variance does not split clusters), negative (2 occurrences or 1 session never clusters), relation (input order cannot change the report), failure-state (malformed lines are typed errors), bypass (the package's import list is conformance-tested to grant no I/O capability at all — the boundary is structural, not behavioral), plus a golden report over synthetic fixtures.product-engineering-loop/ships verbatim to the public repo); no real transcript content, paths, or session IDs anywhere.Evidence
go build ./... && go vet ./... && go test ./...— pass.2026-07-28-retromine-recurrence-detector.md.Final slice next:
retro derive— gap classification (observation/verb/setpoint/guard) + reviewable proposals, derive-only.