docs(adr): ADR-081 recall retune driver#400
Open
ohdearquant wants to merge 3 commits into
Open
Conversation
Governed ingestion of implicit feedback: fractional weight (0.1) with per-batch cap and per-target clamp, scorer signal mapping, brain-owned cross-session serve ledger with decay-based suppression, serve-time served_by attribution stamp (separate gated impl PR), emission surface, and the #394 instrumentation rider. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Weight ownership moved to the brain weight table (amends update_weight, implicit 0.5 -> 0.1, comparator C=1.5); invariant restated with exact scope and fold-time enforcement math (key, decayed mass, fold gate, idempotency); ADR-035 correctly credited for the three-tier feedback resolution (the stale-comment claim was wrong); query class defined deterministically; full ledger schema with attribution fields; emission surface non-atomicity resolved by fold-side enforcement. Adds the ADR-032 served_by_profile_id surface cite. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…per-serve-row dedup, accounting profile rule, DB-level fold serialization Resolves the four round-2 findings: (1) brain.feedback/auto_feedback gain additive optional scorer_run_id + serve_ledger_id parameters (supplied together or rejected; absent = unchanged behavior), named in the Amends header; (2) idempotency dedup key widened to (scorer_run_id, serve_ledger_id) so one run can grade multiple serve rows per target; (3) ledger gains a normative accounting_profile_id = COALESCE(served_by_profile_id, resolved_profile_id) with a non-null-before-fold rule, zero-weight fail-safe, and the accounting-key index expression; (4) fold gate serialization moved from the proposed ADR-067 write-owner lane to a BEGIN IMMEDIATE SQLite transaction, race-free under current daemon concurrency with no new ADR dependency. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
Spec-first ADR for the recall retune driver: governed ingestion of implicit feedback from the out-of-band session scorer into brain posteriors.
FeedbackEventKind::update_weight(), khive-brain-core) — implicit drops 0.5 → 0.1 before the first high-volume implicit emitter goes live; explicit comparator C = 1.5.(profile_id, namespace, target_id)never exceeds C. Enforced structurally at fold time (mass check + fold in one transaction on the serialized write lane), so no emission-surface property can breach it. Idempotent replay viascorer_run_iddedup.used→implicit_positive,ignored→implicit_negative,contradictedemits nothing automatically (wrong/correctionstay caller-judged per ADR-014).(target, query_class)as a decaying score penalty, never a hard filter.served_by_profile_idon recall responses completes ADR-032's declared event surface; ships as a separate impl PR gated on latency measurement (perf: embedding-bearing verbs cost ~2s per op inside the warm daemon (recall/search); non-embedding verbs are at the 20-50ms floor #394).brain.auto_feedbackDSL batches (correctness lives at the fold, not the surface);brain.feedback_batchcarried as an option behind an adoption rule.Evidence
Hook scorer v0 dry run (2026-07-02): 14 serves across 7 sessions returned the same two junk-tier memories on the same static query, all graded ignored — the exact signal shape this ADR trains away. Co-designed with lambda:leo.
Review history
Codex round 1: REQUEST CHANGES, 6 Major — invariant math unproven across windows, weight constant assigned to the wrong owner, ADR-035 misidentified as stale (it correctly governs the three-tier feedback resolution; the round-1 claim was the error), query class undefined, ledger schema missing attribution, emission surface non-atomicity. All six resolved in round 2 (
cb6f4089).Codex round 2: REQUEST CHANGES, 4 Major — the adopted
brain.auto_feedbacksurface could not carry scorer provenance (deny_unknown_fields), the dedup key was coarser than the serve rows it protects, the fold accounting key had no defined ledger profile column, and the race-free claim rested on the still-Proposed ADR-067 write lane. All four resolved in round 3 (33e6e7c9): explicit additive parameter-surface amendment (scorer_run_id+serve_ledger_id, together-or-rejected), dedup by(scorer_run_id, serve_ledger_id), normativeaccounting_profile_idcoalesce rule with a zero-weight fail-safe, and aBEGIN IMMEDIATEtransaction relying only on SQLite single-writer semantics.Codex round 3: APPROVE, zero findings.
Test plan
🤖 Generated with Claude Code