feat: add feedback_history table and Store helpers - #18
Merged
Conversation
Adds the audit table that records every successful Bayesian update. Closes the v2.0 gap surfaced in the round-9 instrumentation review, where the audit log only fired on ignored/superseded events. Without this table, the project's feedback regime is not recoverable after the fact and the regime classifier downstream has no real telemetry. Schema: id (autoinc), belief_id, valence (signed float), source (text), created_at (ISO timestamp). Indexed on belief_id for per-belief lookups. New FeedbackEvent dataclass; Store gains insert_feedback_event(), list_feedback_events(belief_id=None, limit=100), and count_feedback_events(belief_id=None). The insert path is callable but no production code writes to it yet; apply_feedback in the next commit becomes the single writer. Nine atomic short tests cover: empty state, single insert returns rowid, distinct rowids per insert, total/per-belief counts, typed-object round-trip, ordering by id DESC, limit clamp, per-belief filter.
5 tasks
robotrocketscience
added a commit
that referenced
this pull request
Apr 28, 2026
… ROADMAP split (#202) ## Summary Eight atomic doc commits resulting from a parity audit against the archived agentmemory research codebase. Splits the coarse v2.0 \`wonder\` line in ROADMAP into substrate / frontend / lifecycle tracks, cross-links 7 newly-filed parity issues (#193–#201), and lands long-overdue scope clarifications in PHILOSOPHY / LIMITATIONS / ARCHITECTURE. The audit itself lives in the private aelfrice-lab workspace; this PR contains only the public-facing doc edits derived from it. ## Commits (subject + intent) 1. \`f4faaec\` — PHILOSOPHY: import research-line scope clarifications. Resolves REQ-004, REQ-005, REQ-027, design-principle #18; introduces the Tier 1–6 \"What we can and can't guarantee\" decomposition. 2. \`9147f1f\` — LIMITATIONS: tighten Sharp edges for research-line gap parity. Cross-references core-promises #4/#6/#7 and design-principles #16/#18. 3. \`337da56\` — ROADMAP: extend recovery inventory with parked research-line capabilities. Adds five \"v1.x candidate / v2.0 candidate\" rows + new \"Deliberately not on this list\" subsection naming \`obsidian\`, \`vault_store\`, \`shared_scopes\` (the deprecate-explicitly recommendations). 4. \`c978c1d\` — ARCHITECTURE: name the research-line edge-type narrowing (17 → 6). 5. \`812e7c9\` — PHILOSOPHY: reframe exploration deferral as solution-agnostic gap (was Thompson-specific; now states the underlying filter-bubble requirement and acknowledges the gap). 6. \`1e8f458\` — PHILOSOPHY: state v1 immutable substrate is \`feedback_history\`, not observations. Cross-references \`docs/design/write-log-as-truth.md\` for the v2.0 ingest-log contract. 7. \`e01492a\` — ROADMAP: split v2.0 \`wonder\` line + add graph-traversal prep + cross-link audit issues. The single \`wonder / reason / core / unlock / delete / confirm\` row becomes 5 separate rows; new v1.5/v1.6 prep row for graph-traversal store methods. 8. \`1afdc04\` — PHILOSOPHY: declare single-axis posterior; cross-link multi-axis substrate decision (#196). ## Companion GitHub issues filed - [#193](#193) — Sentiment-from-prose feedback (v2.0 evaluation) - [#194](#194) — \`ingest_turn(bulk=)\` parameter (v2.0 wonder prep) - [#195](#195) — \`scoring.uncertainty_score\` (v2.0 wonder prep, post-substrate-decision) - [#196](#196) — v2.0 substrate decision: multi-axis vs single-axis uncertainty (load-bearing) - [#197](#197) — Deduplication module (v2.0 evaluation) - [#198](#198) — Multi-LLM consensus module (v2.0 evaluation) - [#199](#199) — Enforcement module: directive detection + compliance audit + selective injection - [#201](#201) — Semantic contradiction detector (v2.0 evaluation) ## Test plan - [ ] \`docs/ROADMAP.md\` recovery inventory parses as a valid markdown table; all issue links resolve. - [ ] \`docs/PHILOSOPHY.md\` renders cleanly (no broken cross-refs to \`design/write-log-as-truth.md\`). - [ ] \`docs/LIMITATIONS.md\` Sharp edges section reads coherently with the new bullets in context. - [ ] commit-msg-prefix CI job passes (all 8 commits use \`docs:\` or \`docs(scope):\` prefix). - [ ] PR-body issue-link advisory check passes (this PR body contains issue references). <!-- no-issue -->
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
feedback_historytable:(id, belief_id, valence, source, created_at), indexed onbelief_id.FeedbackEventdataclass inmodels.py.Storegainsinsert_feedback_event(),list_feedback_events(belief_id=None, limit=100),count_feedback_events(belief_id=None).The insert path is callable but unused by production code in this PR.
apply_feedbackin the next PR becomes the single writer. This split keeps the schema change reviewable in isolation.Test plan
uv run pytest -q→ 45 passed (was 36, +9 new), 0.06suv run pyright src/aelfrice tests→ 0/0/0