diff --git a/.agents/artifacts/HANDOFF.md b/.agents/artifacts/HANDOFF.md index 3496a9b..ef6c42c 100644 --- a/.agents/artifacts/HANDOFF.md +++ b/.agents/artifacts/HANDOFF.md @@ -1,24 +1,60 @@ -# HANDOFF — 2026-10-24T11:46:48Z -branch: `dev` | phase: **v3.1.0 released to `main`** — tag `v3.1.0`, GitHub release published, release train empty +# HANDOFF — 2026-10-24T16:19:41Z +branch: `dev` | phase: **T-405 + T-406 fix trains landed on `dev`** — v3.1.0 on `main`, release train empty ## Next Step -Resume the backlog. The two filed issues are the highest-value defects the -last two waves surfaced, and both are ready: +The two filed issues (#313, #314) are landed — see *Fix trains, this session* +below. Backlog in priority order: -- **#313 (T-405, HIGH)** — conflicted memories are still injected into agent - prompts. Three retrieval paths (`src/retrieval.ts:1686-1701`, - `src/retrieval/ranking.ts:272-273`, `src/orchestrator/context.ts:144-147`) - exclude `superseded`/`rejected`/`archived`/`expired` but not `conflicted`; - the soft −0.8 `STATUS_PENALTY` (`src/types.ts:342`) is a discount, not a - filter. It changes retrieval output, so the golden recall fixtures must be - regenerated in the same PR. -- **#314 (T-406, LOW)** — `--project` matches case-sensitively and an - exact-match miss returns an empty report whose label still reads the input - (e.g. `--project ALPHA` against `alpha`). +1. **Optional patch release `v3.1.1`** — both trains are behavior fixes on + `dev`; cut via the 11-phase release engine when the principal says go + (same governance disclosure would apply on `main`). +2. **Production-Grade Showcase Demo** — re-record the terminal demo (see + `current.md` → *Next Up*). +3. **Wave 24 remainder** — T-316 (Hebbian co-activation edges, unblocked), + T-318 (ROI auto-tuner, unblocked); T-317 stays blocked on T-178. +4. **Silent-casing fan-out** — `muse_tech_debt`, `memory_anchor_audit`, + `memory_drift_audit`, `/api/drift`, `/api/cognition/*` still silently + accept casing misses; the resolution helper + (`src/health/resolve.ts`) is ready to fan out as one small train. +5. **T-405/T-406 closeout filings** — ambiguous-case wording (say the case + collision), Studio client 404 echo (`fetchHealth` shows placeholders), + wikilink hop-gate conflicted filter (retrieval.ts ~1462), `get_context` + handler hardcoding `includeSuperseded:false` while the schema advertises + it, hybrid-path `status` plumbing (pre-existing for every status), + queryContext superseded/rejected gate status guard (same class T-405 + fixed). +6. **Consolidation wave** — duplicate TTL tables, nine token estimators, + clamp ceilings, zero-caller exports (behaviour-changing; `current.md` → + *Next Up*). +7. Also waiting on the principal: the parked spec PRs (#52–#56, R28–R32) each + carry a `feat/*` spec branch and need review before their waves can start. -Both are recorded in `current.md` → *Next Up* and in `.agents/context/ticket-plan.md`. -Also waiting on the principal: the parked spec PRs (#52–#56, R28–R32) each -carry a `feat/*` spec branch and need review before their waves can start. +## Fix trains (this session) +- **T-405 (#313)** — PR #321 merged into `dev` at `e30a1b7` (2026-10-24). + Conflicted memories are withheld from prompts by default via one shared + `includeConflicted` opt-in honored at every consumer gate (queryContext + + cache key, FTS + overfetch connective, vector row gate, engine passthrough, + ranking veto, muse pool choke point + anchor/route lens strips + + constraints + withheld notice, MCP schemas/mapping, CLI flag). Golden + recall fixture untouched — the frozen corpus carries zero conflicted + entries (verified). Tests-first RED receipts (2 fail → 7 files, suite + 1408/0 across 213 files); Fresh Critic verdicts 8 → **9.5/10** with a + mutation-verified overfetch test (revert-in-isolation → exactly the new + test fails, restore byte-identical). Artifacts: + `.agents/artifacts/GAUNTLET_JOB_CONTRACT.md`, `ITERATION_LEDGER.md`, + `ACCEPTANCE_PACKET.md` (uncommitted working copies). +- **T-406 (#314)** — PR #322 merged into `dev` at `d3a8f6b` (2026-10-24). + `resolveProjectName`/`listProjectNames`/`formatAvailable` + (`src/health/resolve.ts`) resolve health-scoping requests case-insensitively + and fail loud on unknown/ambiguous asks (CLI exit 1 · MCP isError · Studio + 404); the gate stays a pure exact-canonical reporter; `--json` stdout kept + parseable (critic probe STDOUT_LINES 1/0). Tests-first RED receipts (2 pass + by construction / 6 fail on wiring → 8/0 full file, suite 1408/0); Fresh + Critic verdicts 8 → **9/10**. Artifacts: + `GAUNTLET_JOB_CONTRACT-T406.md`, `ITERATION_LEDGER-T406.md`, + `ACCEPTANCE_PACKET-T406.md`. +- Both tickets carry landing notes in `.agents/context/ticket-plan.md` + (T-405, T-406) and a joint block in `current.md` → *Recently Landed Waves*. ## Released (this session) - **v3.1.0** — PR #318 merged into `main` at `c5a141d` (*"Release: v3.1.0"*), diff --git a/.agents/context/current.md b/.agents/context/current.md index 33bfcc4..f660e90 100644 --- a/.agents/context/current.md +++ b/.agents/context/current.md @@ -126,16 +126,18 @@ on any blocking failure, so CI runs it. Report: --- ## ⏭️ Next Up (Post-Release Focus) -- **Production-Grade Showcase Demo**: Re-record high-fidelity terminal demo video/GIF reflecting v3.0.0 capabilities (failure attribution, HOT.md compounding, memory branch/checkout, MCP context recall) to replace removed legacy demo. -- **Wave 24 remainder**: `T-316` (Hebbian co-activation edges into write-time `linked_memory_ids` seeding — **unblocked**, dep `T-095` landed; note the ticket premise is partly stale: `T-307` already landed the retrieval-expansion side) and `T-318` (retrieval weight auto-tuner from ROI telemetry — **unblocked**, deps `T-127` + `T-140` both landed). `T-317` (query-seeded PPR restart set) stays **blocked** on `T-178` (graph retrieval A/B gate). -- **Conflicted memories are still served into agent prompts** (found while fixing `T-320`, tracked as **`T-405`** / [issue #313](https://github.com/harshsinghmp/musememory/issues/313)): the status filters in `src/retrieval.ts:1686-1701`, `src/retrieval/ranking.ts:272-273` and `src/orchestrator/context.ts:144-147` exclude `superseded`/`rejected`/`archived`/`expired` but not `conflicted`, so a genuinely contradicted memory is injected with no badge. It *is* soft-penalised (−0.8 via `STATUS_PENALTY`, `src/types.ts:342`) and removed from sync broadcasts — but a rank discount is not a filter, and the gap is **wider** than originally recorded (three retrieval paths, not one). Deliberately left out of `T-320` — it changes retrieval output and therefore the golden recall fixtures; it needs its own ticket and test pass. +- **Production-Grade Showcase Demo**: Re-record high-fidelity terminal demo video/GIF reflecting v3.0.0 capabilities (failure attribution, HOT.md compounding, memory branch/checkout, MCP context recall) to replace removed legacy demo.- **Wave 24 remainder**: `T-316` (Hebbian co-activation edges into write-time `linked_memory_ids` seeding — **unblocked**, dep `T-095` landed; note the ticket premise is partly stale: `T-307` already landed the retrieval-expansion side) and `T-318` (retrieval weight auto-tuner from ROI telemetry — **unblocked**, deps `T-127` + `T-140` both landed). `T-317` (query-seeded PPR restart set) stays **blocked** on `T-178` (graph retrieval A/B gate). - **Consolidate the remaining duplicated tables** (deferred from this session as behaviour-changing; full detail with exact locations in [`docs/roadmap.md`](../../docs/roadmap.md) → *Engineering debt*): the three divergent per-type TTL tables (`src/retention.ts` **and** `src/retention/expiry_policy.ts` — only two of the three are in `retention.ts`), the **nine** separate token estimators (across nine files, plus six inline expressions — the collapse is *not* behaviour-neutral, because `src/orchestrator/context.ts` deliberately consumes the pessimistic measure), the divergent limit-clamping ceilings across retrieval paths (**seven** sites in `src/mcp.ts` alone), and the remaining zero-caller exports (twelve genuinely dead; 74 exported with no external caller). -- **`--project` matching is case-sensitive** (**`T-406`** / [issue #314](https://github.com/harshsinghmp/musememory/issues/314)): `memory health --project ALPHA` against a store holding `alpha` returns an empty report whose label still reads `ALPHA`. Exact-match is honest but silent. - **Remove the legacy `web/` directory** — done in this session. It was a second, hand-written copy of the site that `apps/website/` superseded; keeping it was the same "second copy that gets forgotten" failure mode this session fixed everywhere else. --- ## 🏁 Recently Landed Waves (Verified on `dev`) +- [x] **Fix trains: T-405 + T-406** (2026-10-24) — issues #313/#314, delivered through the gauntlet-loop + code-review engines (contract-frozen scope, blind Fresh Critic, mutation-verified tests): + - **T-405** ([#313](https://github.com/harshsinghmp/musememory/issues/313)): PR #321 merged at `e30a1b7`. Conflicted memories are now excluded **by default** from every prompt-serving retrieval path — queryContext lifecycle gate (hidden_count-aware, status-scoped-guarded), FTS store gate with the overfetch connective armed iff any post-fetch hide-gate stays active, vector row gate + engine passthrough, ranking candidate veto before scoring, muse-context pool choke point + anchor/route lens strips + constraint projection + withheld notice — all sharing one `includeConflicted` opt-in (`SearchOptions` cascade; MCP `include_conflicted` schema symmetry on both search/memory_recall tools; CLI `--include-conflicted`). The frozen golden recall fixture was deliberately untouched — the eval corpus carries zero conflicted entries (verified, not assumed); new tests use a self-contained corpus (T-143 promotion discipline respected). RED receipts real (conflicted entry served `kept:high_relevance` into `confident_answers`); critic verdict **9.5/10** with a mutation-verified overfetch test. As-of/temporal queries deliberately keep serving state-at-the-time (documented decision). + - **T-406** ([#314](https://github.com/harshsinghmp/musememory/issues/314)): PR #322 merged at `d3a8f6b`. Project names resolve case-insensitively (`resolveProjectName`/`listProjectNames`/`formatAvailable`, `src/health/resolve.ts`) on all three health surfaces, failing **loud** (CLI exit 1 · MCP isError · Studio 404) with the requested name echoed and the available list; resolved-with-case-diff surfaces the canonical label plus a note naming the requested form; `--json` stdout stays pure JSON (probe-verified). The gate stays a pure exact-canonical reporter — `git diff test/health_project_scope.test.ts` empty. Final critic verdict **9/10**. + - Full-suite receipts at merge time: `bun test` **1408 pass / 0 fail** (213 files, +13 tests); `tsc --noEmit` clean; claims `1400→1408`; docs links all resolve; secret scan clean; `check:landed:pr` → `RESULT: REVIEWABLE` before both merges, `check:landed` → **`RESULT: LANDED`** after (at `e30a1b7`, then at `d3a8f6b`). + - Filed follow-ups (deliberate ledger, see HANDOFF): ambiguous-case wording, Studio client 404 echo, silent-casing fan-out (`muse_tech_debt`, anchor/drift audits, `/api/drift`, `/api/cognition/*`), wikilink hop-gate conflicted filter, `get_context` include_superseded schema-vs-handler mismatch, hybrid-path status plumbing, queryContext superseded-gate status guard. - [x] **Released: v3.1.0** (2026-10-24) — Waves 23–26 shipped to `main`: - PR #318 merged at `c5a141d` (*"Release: v3.1.0"*); annotated tag [`v3.1.0`](https://github.com/harshsinghmp/musememory/releases/tag/v3.1.0) diff --git a/.agents/context/ticket-plan.md b/.agents/context/ticket-plan.md index b97ceca..3d02aa0 100644 --- a/.agents/context/ticket-plan.md +++ b/.agents/context/ticket-plan.md @@ -524,8 +524,8 @@ Canonical detailed artifact: `.agents/artifacts/audit-and-realigned-roadmap-2026 - [x] T-403 · HIGH · Stored-command doctor sweep: sanitize/migrate legacy non-template `test_command`s across `.memory/memories/*.yaml` to restore 100% clean validation · src/doctor.ts, .memory/ · F - [x] T-404 · HIGH · Stdin TTY decoupling: add `process.stdin.isTTY` check in `src/hooks/pack.ts:readStdinJson()` to prevent test runner hanging in interactive terminals · src/hooks/pack.ts · F - [x] T-401 · MEDIUM · Bunfig surface hardening: configure explicit test runner timeout and isolation defaults · bunfig.toml · N -- [ ] T-405 · HIGH · [#313](https://github.com/harshsinghmp/musememory/issues/313) · Conflicted memories are still injected into agent prompts with no badge: the status filters in `src/retrieval.ts:1686-1701`, `src/retrieval/ranking.ts:272-273` and `src/orchestrator/context.ts:144-147` exclude `superseded`/`rejected`/`archived`/`expired` but not `conflicted`. A contradicted memory is −0.8 rank-penalised (`STATUS_PENALTY`, `src/types.ts:342`) and removed from sync broadcasts, yet it is still served. Note: the gap is **wider** than the original note — three retrieval paths are affected, not one. Needs its own ticket and test pass because it changes retrieval output and therefore the golden recall fixtures · retrieval, orchestrator · U -- [ ] T-406 · LOW · [#314](https://github.com/harshsinghmp/musememory/issues/314) · `memory health --project P` matches the project name case-sensitively, so `--project ALPHA` against a store holding `alpha` returns an empty report whose label still reads `ALPHA`. Exact-match is honest but silent. Needs either a case-insensitive match or an explicit "no memories for project X" line · cli/health · U +- [x] T-405 · HIGH · [#313](https://github.com/harshsinghmp/musememory/issues/313) · Conflicted memories are still injected into agent prompts with no badge: the status filters in `src/retrieval.ts:1686-1701`, `src/retrieval/ranking.ts:272-273` and `src/orchestrator/context.ts:144-147` exclude `superseded`/`rejected`/`archived`/`expired` but not `conflicted`. A contradicted memory is −0.8 rank-penalised (`STATUS_PENALTY`, `src/types.ts:342`) and removed from sync broadcasts, yet it is still served. Note: the gap is **wider** than the original note — three retrieval paths are affected, not one. Needs its own ticket and test pass because it changes retrieval output and therefore the golden recall fixtures · retrieval, orchestrator · U — **LANDED 2026-10-24**: PR #321 (`fix/T-405-conflicted-injection`) merged into `dev` at `e30a1b7`; a single shared `includeConflicted` opt-in now gates every prompt-serving read path (shown wider still by the build-out: tiered context, FTS/gate, vector, engine passthrough, muse pool/lenses all inherit or take the flag); the golden recall fixture was deliberately untouched — the frozen corpus carries zero conflicted entries, verified, so no regen was required; cryptic-suite delta +7 tests (1408/0); Fresh Critic 9.5/10 with a mutation-verified overfetch test. +- [x] T-406 · LOW · [#314](https://github.com/harshsinghmp/musememory/issues/314) · `memory health --project P` matches the project name case-sensitively, so `--project ALPHA` against a store holding `alpha` returns an empty report whose label still reads `ALPHA`. Exact-match is honest but silent. Needs either a case-insensitive match or an explicit "no memories for project X" line · cli/health · U — **LANDED 2026-10-24**: PR #322 (`fix/T-406-case-sensitive-project`) merged into `dev` at `d3a8f6b`; new `src/health/resolve.ts` owns the resolution (`resolveProjectName`: exact wins → unique case-insensitive → loud unresolved), wired on CLI (exit 1 + available list, `--json` stdout kept pure), MCP `muse_health` (isError) and Studio `/api/health` (404 + JSON); the gate stays a pure exact-canonical reporter (scope-case tests untouched); +8 tests (1408/0); Fresh Critic 9/10. - [x] T-105b · landed Wave 2 — Syntax-only promotion rule: enforce AST/schema verification before candidate confirmation · promotion · branch: feat/wave-2-trust-gates · F ## Realigned In-Line Execution Sequence