P1-03: unify memory selection and restore true abstention (closes #26) #208

Merged
conductor merged 20 commits from p1-03-memory-selection into master 2026-09-08 05:29:19 +01:00
20 Commits
Author SHA1 Message Date
Nick 1bfb56bf26 merge master (resolve: P1-03 feature sides win; master logging kept; PRD from master; join-point newline restored)
CI Pipeline / best-practices (pull_request) Successful in 3s
CI Pipeline / documentation (pull_request) Successful in 11s
CI Pipeline / lint (pull_request) Failing after 22s
CI Pipeline / canary (pull_request) Successful in 30s
CI Pipeline / unit-tests (pull_request) Failing after 47s
CI Pipeline / gitea-offline (pull_request) Successful in 14s
CI Pipeline / lint (push) Failing after 22s
CI Pipeline / best-practices (push) Successful in 2s
CI Pipeline / type-check (pull_request) Successful in 27s
CI Pipeline / documentation (push) Successful in 4s
CI Pipeline / canary (push) Successful in 26s
CI Pipeline / gitea-offline (push) Successful in 14s
CI Pipeline / required-checks (pull_request) Successful in 0s
Spec gate (headless) / spec-gate (pull_request) Successful in 6s
CI Pipeline / type-check (push) Successful in 25s
CI Pipeline / unit-tests (push) Failing after 45s
CI Pipeline / required-checks (push) Successful in 1s
Auto-version and Release / release (pull_request) Failing after 9s
2026-09-08 05:25:01 +01:00
Nick 8dd3dff9a9 fix(memory): get_shard ensures entries_vec schema idempotently — persistent shard files predate the vec schema; CREATE IF NOT EXISTS heals them on open
CI Pipeline / lint (pull_request) Successful in 53s
CI Pipeline / best-practices (pull_request) Successful in 2s
CI Pipeline / documentation (pull_request) Successful in 2s
CI Pipeline / canary (pull_request) Successful in 40s
CI Pipeline / unit-tests (pull_request) Successful in 1m22s
CI Pipeline / gitea-offline (pull_request) Successful in 14s
CI Pipeline / type-check (pull_request) Successful in 22s
CI Pipeline / required-checks (pull_request) Successful in 0s
CI Pipeline / lint (push) Successful in 59s
CI Pipeline / unit-tests (push) Successful in 2m43s
CI Pipeline / canary (push) Successful in 2m33s
CI Pipeline / best-practices (push) Successful in 6s
CI Pipeline / documentation (push) Successful in 3s
CI Pipeline / type-check (push) Successful in 52s
CI Pipeline / gitea-offline (push) Successful in 21s
CI Pipeline / required-checks (push) Skipped
2026-09-08 05:12:55 +01:00
Nick 01a0b9affe fix: version surfaces aligned to master's 0.54.1 (branch carried 0.54.0 — behind-base drift; surface gate caught it)
CI Pipeline / best-practices (push) Successful in 6s
CI Pipeline / documentation (push) Successful in 4s
CI Pipeline / lint (push) Successful in 1m5s
CI Pipeline / type-check (push) Successful in 56s
CI Pipeline / gitea-offline (push) Successful in 14s
CI Pipeline / canary (push) Failing after 1m20s
CI Pipeline / lint (pull_request) Failing after 19s
CI Pipeline / unit-tests (push) Successful in 1m30s
CI Pipeline / required-checks (push) Skipped
CI Pipeline / best-practices (pull_request) Successful in 2s
CI Pipeline / documentation (pull_request) Successful in 3s
CI Pipeline / canary (pull_request) Failing after 29s
CI Pipeline / unit-tests (pull_request) Successful in 35s
CI Pipeline / gitea-offline (pull_request) Successful in 13s
CI Pipeline / type-check (pull_request) Successful in 33s
CI Pipeline / required-checks (pull_request) Skipped
2026-09-08 04:45:45 +01:00
Nick 6807c2560a merge master (PRD: master's generated state wins — gen_prd_state is the authority) 2026-09-08 04:40:39 +01:00
Nick e0de002efa fix(memory): shard connections load sqlite-vec per connection; shard schema includes entries_vec (#26 red-first)
CI Pipeline / best-practices (push) Successful in 3s
CI Pipeline / documentation (push) Successful in 2s
CI Pipeline / lint (push) Failing after 19s
CI Pipeline / type-check (push) Successful in 29s
CI Pipeline / gitea-offline (push) Successful in 19s
CI Pipeline / lint (pull_request) Failing after 30s
CI Pipeline / canary (push) Failing after 1m33s
CI Pipeline / best-practices (pull_request) Successful in 4s
CI Pipeline / documentation (pull_request) Successful in 4s
CI Pipeline / unit-tests (push) Successful in 1m47s
CI Pipeline / required-checks (push) Skipped
CI Pipeline / canary (pull_request) Failing after 44s
CI Pipeline / unit-tests (pull_request) Successful in 1m14s
CI Pipeline / gitea-offline (pull_request) Successful in 14s
CI Pipeline / type-check (pull_request) Successful in 22s
CI Pipeline / required-checks (pull_request) Skipped
CI canary root cause: get_shard() returned a raw sqlite3 connection —
virtual tables need the extension loaded PER CONNECTION, so recall() on a
shard crashed 'no such table: entries_vec' in clean environments. Also:
create_shard's schema lacked entries_vec entirely (main store had it,
shards didn't — recall routes to shards). Both fixed; 3 red-first tests
frozen green (canary failure class, schema completeness, shard reuse).
2026-09-08 04:36:42 +01:00
Nick 15119ebb6e Merge remote-tracking branch 'gitea/master' into p1-03-memory-selection
CI Pipeline / lint (pull_request) Successful in 24s
CI Pipeline / unit-tests (pull_request) Successful in 32s
CI Pipeline / canary (pull_request) Failing after 25s
CI Pipeline / best-practices (pull_request) Successful in 2s
CI Pipeline / documentation (pull_request) Successful in 2s
CI Pipeline / type-check (pull_request) Successful in 21s
CI Pipeline / gitea-offline (pull_request) Successful in 13s
CI Pipeline / required-checks (pull_request) Skipped
auto-version.yml (push) Invalid workflow file
CI Pipeline / best-practices (push) Successful in 2s
CI Pipeline / documentation (push) Successful in 1s
CI Pipeline / gitea-offline (push) Successful in 14s
CI Pipeline / lint (push) Successful in 44s
CI Pipeline / canary (push) Failing after 37s
CI Pipeline / type-check (push) Successful in 33s
CI Pipeline / unit-tests (push) Failing after 44s
CI Pipeline / required-checks (push) Skipped
2026-09-07 21:01:24 +01:00
Nick 1de937d898 Merge remote-tracking branch 'gitea/master' into p1-03-memory-selection
Auto-label / priority-gate (pull_request) Skipped
Auto-label / auto-label (pull_request) Successful in 3s
CI Pipeline / lint (push) Successful in 23s
CI Pipeline / unit-tests (push) Successful in 30s
CI Pipeline / canary (push) Failing after 25s
CI Pipeline / best-practices (push) Successful in 2s
CI Pipeline / documentation (push) Successful in 2s
CI Pipeline / type-check (push) Successful in 21s
CI Pipeline / gitea-offline (push) Successful in 14s
CI Pipeline / required-checks (push) Skipped
CI Pipeline / lint (pull_request) Successful in 24s
CI Pipeline / unit-tests (pull_request) Successful in 36s
CI Pipeline / canary (pull_request) Failing after 25s
CI Pipeline / best-practices (pull_request) Successful in 2s
CI Pipeline / documentation (pull_request) Successful in 2s
CI Pipeline / type-check (pull_request) Successful in 21s
CI Pipeline / gitea-offline (pull_request) Successful in 14s
CI Pipeline / required-checks (pull_request) Skipped
2026-09-07 17:15:23 +01:00
Nick 6b6ddd1a3d test(p1-03): seed canary trivial-check distractor; discharge record (#26)
Gate finding 8: the canary's trivial-task check ran on an EMPTY store —
the capsule-level zero-memory proof was vacuous. It now seeds a
high-importance fact distractor plus a personality row before
assembling; the trivial task must still produce zero memory blocks and
zero memory tokens.

Also lands the discharge record: docs updated (floor-in-every-mode
claim, known ranking bias, typed persona lane, write-time memory_type,
migration-time backfill) and the plan's Completion Record gains the
Discharge Record section mapping every gate finding to its commit and
red-first evidence.
2026-09-07 17:10:41 +01:00
Nick 3175ece37c refactor(p1-03): canary proves gate_consolidated retirement via AST (#26)
Gate finding 7 follow-up: gate_consolidated itself is deleted (it rode
into the finding-1 commit with the memory_store rewrite); this commit
fixes canary_query_memory's gate check, which inspected whichever
memory_store a sys.path shim resolved first (the DEPLOYED scripts copy,
in practice) — it now proves the retirement deterministically via an
AST parse of the repo copy. Suite and canary battery stay green.
2026-09-07 17:05:28 +01:00
Nick 29d03beb25 test(p1-03): strengthen vacuous selector + weak fallback assertions (#26)
Gate findings 5+6 (test-only):
- finding 5: the operator-level tests passed trivially on empty tmp
  stores ('block is None or ...'). They now seed the store and assert
  the positive branch — a real selector-sourced block with exact source,
  and the history test seeds a completed past task through the canonical
  ledger so the priority/label assertions are positive.
- finding 6: test_cached_recall_never_returns_flat_eight_tenths escaped
  via 'or source==consolidated'; it now asserts the calibrated recall
  shape (rrf/confidence/id present, relevance != 0.8) with shard routing
  disabled (it silently rerouted to an empty shard, vacating the old
  assertion), plus abstention + positive twins. The importance-fallback
  grep now covers ALL fallback slice patterns plus a behavioral twin
  (off-trigger high-importance neuron does not inject through the
  operator).
2026-09-07 17:01:19 +01:00
Nick ea5de21d2f fix(p1-03): neuron backfill runs at migration time only (#26)
Gate finding 4: ensure_memory_type_column ran an unindexed
UPDATE ... WHERE kind='neuron' scan on EVERY connect, and the selector
opens a fresh connection per turn — pure per-turn overhead. connect()
now invokes the migration only when the column is actually missing
(the ALTER stays idempotent); explicit ensure_memory_type_column()
keeps the frozen self-healing semantics (re-classifies unclassified
neuron rows, never touches explicit classifications).

Red-first evidence: a NULL marker row planted on an already-migrated
store was flipped back to 'associative' by a second connect — now the
per-connect scan is gone while explicit ensure() still self-heals.
2026-09-07 17:00:02 +01:00
Nick 70c20072fe feat(p1-03): typed persona lane + write-time memory_type classification (#26)
Gate finding 2: the typed persona source was dead in production — the
operator's single memory contributor calls select_for_task WITHOUT
types, so _persona_recall always returned []; and no production writer
ever set memory_type. The store source now always runs a SECOND typed
query (self/personality) merged into the candidates — still thresholded
inside the store's gate, deduplicated by entry id, may abstain (a
trivial task still gets zero persona rows). add_entry gains an additive
memory_type param (default None = unclassified, eligible everywhere)
plus a --memory-type store CLI flag wired through the dedupe gate;
wired where the writer genuinely knows the type: warm-router neuron
writer -> associative, sleep-time growth sync -> personality
(persona-targeted) / semantic.

Gate finding 3: _persona_recall ignored the selector's pinned db_path
(bare memory_store.connect() opened the module-default store). The pin
is now bound into sources that declare db_path at registration time;
both store-backed sources honor it.

Red-first evidence: no typed call in the live contributor path;
add_entry TypeError; persona block missing from the pinned-only store.
2026-09-07 16:55:10 +01:00
Nick 3f53d93525 fix(p1-03): recall applies the ONE floor in every mode (#26)
Gate finding 1: min_score was only enforced in recall's dense-only
branch — lexical-only and hybrid paths returned below-floor store rows,
and the selector's store_scored exemption then injected them. The floor
now applies in EVERY mode inside the store's calibrated gate (lexical
best-relevance check additive to the conjunctive FTS gate; hybrid gates
on the dense cosine, the scale min_score was calibrated against); the
selector docstring claim was rewritten to match reality.

Also documents the known ranking-scale mix (finding 9): lexical store
~4-6 vs dense/hybrid RRF ~0-0.13 vs self-scored 0-1 ranked raw together
— abstention unaffected, per-source rank normalization deliberately
deferred (renormalizing the calibrated scales risked false abstentions).

Red-first evidence: lexical-only rows returned at floor 5.5; hybrid
cos~0.37 row injected at floor 0.42 — both abstain after the fix, with
above-floor positive controls.
2026-09-07 16:53:30 +01:00
Nick cbb15fe788 docs(p1-03): plan completion record (#26) 2026-09-07 12:39:55 +01:00
Nick 57c0fafa8f fix(p1-03): prior canary trace-version pins follow the schema constant (#26) 2026-09-07 12:34:41 +01:00
Nick 7101087afa feat(p1-03): memory budget, trace v5, canary (#26) 2026-09-07 12:24:51 +01:00
Nick 32de159e3c feat(p1-03): single memory contributor, TaskState supremacy (#26) 2026-09-07 12:00:35 +01:00
Nick ff04888508 feat(p1-03): selector sources unified, bypasses removed (#26) 2026-09-07 11:44:11 +01:00
Nick f998768622 feat(p1-03): MemorySelector with threshold abstention (#26) 2026-09-07 11:08:26 +01:00
Nick fde27d73f5 feat(p1-03): memory_type column + typed recall filter (#26) 2026-09-07 10:55:37 +01:00