feat(core): mine durable decisions from agent session transcripts#775
Conversation
Sessions are the highest-grade decision source a repo has: a user correcting the agent, a choice made for a stated reason, a failed approach replaced by a working one. Today that evaporates when the session ends. This adds session mining on top of the shared core/sessions layer: - core/sessions/miners/decisions.py: deterministic candidate gates over the Event stream (user corrections via interrupts/pushback, explicit choices pairing a decision verb with a causal cue near file activity, dead ends of repeated failures followed by a pivot), then one batched LLM structuring pass per update over pending candidates. - core/sessions/staging.py: .repowise/sessions/sessions.db WAL sidecar (OmissionStore pattern) holding the raw candidate queue, observation counts per distinct session, and DB-backed transcript cursors that only advance in the same commit that stages what was read under them. A failed LLM call leaves candidates staged for the next update. - Grounding: source_quote must verify verbatim against the transcript excerpt; the decision text is held to a punctuation-stripped content-word overlap; an ungrounded rationale is dropped rather than invented. - Promotion: 2+ distinct sessions, or one observation for a user correction, upserts through the existing bulk_upsert_decisions path as active with source "session" (rank 7). Re-observations emit proposed evidence and never overwrite a human-set status. Dismissals stay sticky. - Config gate decisions.session_mining (default on), documented in CONFIG.md. Everything stays local. Dogfood over this repo's full 342-transcript history: 250 candidates staged, 184 rejected by the LLM and grounding gates, 64 staged decisions, 10 promoted.
|
✅ Health: 7.6 (unchanged) 📋 At a glance 🚨 Change risk: high (riskier than 89% of this repo's commits · raw 9.7/10)
🩹 Review priority (files here with the most recent bug-fix history — defects cluster, so review these first)
🔎 More signals (2)🔥 Hotspots touched (3)
🔗 Hidden coupling (1 file)
📊 Full report · ⭐ Star Repowise · 📥 Install bot · Last updated 2026-07-11 07:31 UTC |
A repo indexed for the first time on a machine that already has agent session history gets its session-sourced decisions from day zero: the full-index decision phase now runs the transcript miner after extract_all (appended past the substring gate on purpose, since the miner enforces its own grounding contract) under the same decisions.session_mining config gate. Server-side indexing has no transcript directory and no-ops. The cold-start cap still bounds the LLM pass; the backlog drains over later updates.
|
Went through the bot's coupling flags one by one:
On the risk callouts: the two hotspots got additive, pattern-matching changes (the mining block mirrors the adjacent decision re-scan block, incl. the degraded-step contract), and the new-findings count is concentrated in the new miner module, where the gate loop is one function by design. Full suite green at 6978 passed. |
What
repowise initandrepowise updatenow mine coding-agent session transcripts for durable decisions and promote them into the decision layer. A repo indexed for the first time on a machine with existing session history gets them from day zero. A user correcting the agent, a choice made for a stated reason, or a failed approach replaced by a working one no longer evaporates when the session ends.How
core/sessions/miners/decisions.py, pure pass over the shared Event stream, no LLM):Each candidate carries verbatim transcript quotes plus the files in play.
source_quotemust verify exact/fuzzy, the decision text is held to a content-word overlap, and an ungrounded rationale is dropped rather than invented..repowise/sessions/sessions.db(WAL, same pattern as the omissions store): raw candidate queue, observation counts per distinct session, and DB-backed transcript cursors that only advance in the same commit that stages what was read under them. A failed LLM call leaves candidates staged for the next update; only appended transcript lines are ever re-read.bulk_upsert_decisionspath asactivewithsource: session(rank 7, below cli/adr, above commit archaeology). Re-observations addproposedevidence rows and can never overwrite a status a human set; dismissals stay sticky. Everything downstream (get_why, evidence, node links, CLAUDE.md standing decisions) comes for free.Config and privacy
decisions.session_mining: trueby default;falseturns the whole pipeline off (documented in CONFIG.md). Transcripts never leave the machine; only distilled decision text about the codebase is stored, with the verbatim quote as evidence.Validation