Skip to content

feat: add feedback_history table and Store helpers - #18

Merged
robotrocketscience merged 1 commit into
mainfrom
feat/feedback-history-schema
Apr 27, 2026
Merged

feat: add feedback_history table and Store helpers#18
robotrocketscience merged 1 commit into
mainfrom
feat/feedback-history-schema

Conversation

@robotrocketscience

Copy link
Copy Markdown
Owner

Summary

  • New feedback_history table: (id, belief_id, valence, source, created_at), indexed on belief_id.
  • New FeedbackEvent dataclass in models.py.
  • Store gains insert_feedback_event(), list_feedback_events(belief_id=None, limit=100), count_feedback_events(belief_id=None).
  • 9 atomic short tests covering empty state, rowid assignment, ordering, limits, and per-belief filtering.

The insert path is callable but unused by production code in this PR. apply_feedback in 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.06s
  • uv run pyright src/aelfrice tests → 0/0/0
  • All tests under 5s timeout default
  • signed
  • staging-gate green

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.
@robotrocketscience
robotrocketscience merged commit 73fd5a0 into main Apr 27, 2026
8 checks passed
@robotrocketscience
robotrocketscience deleted the feat/feedback-history-schema branch April 27, 2026 02:22
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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant