Skip to content

feat: store-quality loop — episodic discipline + consolidation hygiene + /status - #60

Merged
aspotton merged 9 commits into
mainfrom
feat/store-quality-loop
Oct 25, 2026
Merged

aspotton merged 9 commits into
mainfrom
feat/store-quality-loop

Conversation

@aspotton

@aspotton aspotton commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

What this changes for the daily driver

  • Near-verbatim episodic re-narration no longer mints duplicate memories/topics: a deterministic skip guard in the learner's apply path drops candidates that are near-verbatim equal to a recent active episodic, plus one broadened extraction-prompt rule banning boilerplate recaps.
  • Stale, never-reinforced episodic rows self-archive after 30 days via a new memory.episodic_retention_days knob (0 disables), with topic summaries rebuilt for touched topics. Events are untouched — retirement is a derived-status flip.
  • Consolidation stops wasting LLM passes on sub-floor topics (churn floor now gates the enqueue, mirroring the run-time predicate) and stops discarding pending churn (the checkpoint stamps only when a pass actually executed).
  • New read-only GET /status operator window: consolidated health + store/jobs/consolidation/skip counters.

Evidence (live store, 2026-10-17)

Measured on the production store (v0.6.2): 2,385 active memories across 1,744 topics; episodic is the largest type at 941 (39%); 84% of memories were never reinforced; consolidation recorded 8 merges across 5,086 passes, of which 2,937 were zero-churn no-ops.

What we expect to move

  • Episodic share declines over the following weeks as the retirement pass drains the stale cohort.
  • Sub-floor consolidation enqueues → ~0 (churn floor gates the sweep at enqueue time).
  • Churn preservation is locked by the checkpoint-stamp regression tests in tests/test_consolidation.py.

Deviation note

The corpus runner unpins episodic_retention_days to the production 30.0 default (commit 21e4806). The runner's 0.0 retirement pin shared the skip guard's recency knob and deadened the skip guard offline; with the unpin, retirement stays inert in the corpus scenarios.

Do not merge — review rounds pending.

Review round 1 notes (gap review)

  • Pre-push local amend occurred during todo-6 execution (ledger records 568d5c6 as amend of afb2586); the branch was unpushed at the time and final history is linear, one commit per plan todo.
  • Expected behavior: a near-verbatim re-narration after >30 days of silence re-mints a fresh episodic memory and dated topic — the skip guard anchors on active matches only, so a post-retirement restatement is a new fact by design.
  • IS-1 "compiled block carries no archived content" is locked by the pre-existing archive lock test in tests/test_compiler.py; the summary-side and empty-stub locks live in tests/test_episodic_retirement.py.
  • Ops note: episodic retirement rides the learning worker tick, so learning.enabled: false or upstream-busy deferral pauses retirement too (by design, invariant 5).

Proves the deterministic episodic duplicate-skip must prevent a near-verbatim
(0.945 lexical) episodic re-propose under a digit-distinct date-slug topic from
minting a duplicate: turn 2 expects ignored, never the skip counter. The corpus
gate parametrizes a glob, so the YAML alone is the registration.

Deviation from the task brief (forced): runner.py's episodic_retention_days
pin 0.0 shared the guard's recency knob, making the cutoff 'now' and deadening
the guard offline (scenario fails WITH the guard in the tree at the pin).
Unpinned to the production default 30.0; retirement stays inert corpus-wide
(fresh temp DB rows are always inside the window, no scenario uses episodic
candidates besides this one - all 15 others re-verified green).
…on floor

Metis gap review (round 1, MINOR items):
- compiler: a topic whose summary was cleared to "" by full episodic
  retirement still passed the relevance gate on its slug and injected a
  header-only [topic-summary | memories=0] stub; skip empty summaries.
- config: episodic_retention_days comment claims >=0 but negatives were
  accepted; enforce with Field(ge=0) so validation backs the comment.
- tests: stub-absence lock in test_episodic_retirement.py (fails without
  the guard) + ValidationError-on-negative config test.
@aspotton
aspotton merged commit d794201 into main Oct 25, 2026
1 check passed
@aspotton
aspotton deleted the feat/store-quality-loop branch October 25, 2026 01:57
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