v1.9.0
·
4 commits
to main
since this release
Added
- Fail→success pattern mining:
SessionEndmineserror→successtool-call pairs from the session transcript into linkederror/patterngraph memories joined by aRESOLVESedge (items_patternsidecar, migration 0016). Mined error text and tool args are passed through best-effort secret redaction before storage (raw text still feeds the fingerprint, so dedup is unaffected); theSessionEndenvelope reports apatterns_redactedcount. Additive, non-blocking, embedder-free. recall --on-error: an error-shaped query boosts theRESOLVES-linked fix above the error node (retrieval.resolveOnErrorBonus, default 3.0). Under--on-error,pattern-type items are excluded from the FTS seed pool so a mined fix is reached only via theRESOLVESwalk and the bonus fires deterministically. Promotesretrieval.freshnessExponent/retrieval.hopDecayfrom hardcoded constants to operator-tunable config reads.patterns listread verb andpatterns.*config keys (patterns.enabled,patterns.pair_window_minutes(now>= 1),patterns.bash_target_tokens).- Maintenance
purge_legacy_stubsjob now also reaps orphanitems_contentrows (content with no referencing item) so cosmetic-variant re-mines of the same logical error do not strand rows. - Local pure-Go embedder (
internal/embed): an opt-inintake.ModelAdapter.Embedthat lights up the vector arm of recall, dark since launch (vec_index_map=0). Runsbge-small-en-v1.5(384-dim, CLS-pooled + L2-normalized) viaonnx-gomlx+ the SimpleGo pure-Go backend — no CGO, no cloud, inference 100% local (only the one-time SHA256-pinned model acquisition touches the network). Gated by seededembedder.{enabled,model,max_seq_tokens}keys (default off → byte-identical FTS-only behavior). Adds the missing knowledge-sideitems_vecwrite (sharedmemory.WriteItemVec, lifted from the codegraph indexer, which now embeds before its write tx for single-connection safety), amaintenance reindex --target {knowledge,code} [--dry-run]backfill emitting areindex/BACKFILL_COMPLETEevents row, and acore health"vec arm: live|stub" banner. No schema migration (items_vecis dimension-agnostic). Themaintenance reindexenvelope reportsskipped_empty(candidate rows with an empty body are accounted for, not silently dropped), and the knowledge intake path skips embedding an empty/whitespace body so it agrees with the backfill's skip rule. The headless-LLMExtractarm stays stubbed (separate task). - Automatic error-recall reflex (
internal/recallonerror): an always-onPostToolUseFailure/Bashhook that, when a Bash command fails, recalls theRESOLVES-linked prior fix mined from your own history and injects it asadditionalContextso it is in front of the model on the next turn. FTS-only recall (RunRecall(OnError:true), no embedder,NoRerank) gated by a per-error-fingerprint cooldown sentinel and arecall_on_error.min_scorefloor; the recalled fix is prefixed with an untrusted-input marker (treat-as-hint, not instruction). The hook ALWAYS exits 0 and emits{}on any fault — it never blocks or delays the tool. Seededrecall_on_error.{enabled,cooldown_seconds,min_score}keys (defaulttrue/30/0.5). Every terminal decision (injectedorsuppressed_*) is appended to the newevents.recall_on_error_logledger (migration 0017);recall-on-error statsrolls the ledger up by outcome (json/text) andrecall-on-error doctor --error <text>reports the candidate pattern + score + would-inject formin_scorecalibration. The query is FTS5-escaped (raw stderr metacharacters would otherwise breakitems_fts MATCH), and pattern detection is byitems_patternsidecar presence (walked RESOLVES nodes carry no type).
Security
- Pattern-mining redaction now masks compound OAuth credential keys (
client_secret,refresh_token, and any*_secret/*_token/*_keyform) that previously leaked through unmasked, plus JWTs andAuthorization: Basicheaders. The HTTP-Basic rule is anchored to the auth header so it does not over-mask the common adjective "basic".
Fixed
- Pattern mining writes each pair's error node, pattern node (with its sidecar), and
RESOLVESedge in a single transaction, so a mid-pair failure no longer strands a half-written pair — previously the walk-critical edge committed outside any transaction. SessionEndpattern-mining failures now emit aWARN/PATTERNS_FAILEDrow to the unified events log under thepatternssource (matching the subsystem spec), and thePATTERNS_MINEDsuccess event is filed underpatternsrather thanhooks.- A transcript line larger than the 4 MB cap is now drained-and-skipped rather than aborting the whole scan (a single giant tool result no longer costs a session's patterns), and the
SessionEndenvelope reportspatterns_lines_malformed/patterns_decode_degradedso silent reader-side drops are diagnosable. A typo'dpatterns.enabledvalue is logged before falling open.