Reading additional input from stdin...
OpenAI Codex v0.125.0 (research preview)
--------
workdir: /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
model: gpt-5.5
provider: openai
approval: never
sandbox: read-only
reasoning effort: medium
reasoning summaries: none
session id: 019dcf58-36c7-79e0-af5b-f110954b4c42
--------
user
Find stuff about memory.
hook: SessionStart
hook: SessionStart
hook: SessionStart Completed
hook: SessionStart Completed
hook: UserPromptSubmit
hook: UserPromptSubmit
hook: UserPromptSubmit Completed
hook: UserPromptSubmit Completed
codex
I’ll treat this as read-only research around the repo’s memory system. The advisor points to `system-spec-kit`, so I’m loading that workflow first and then I’ll search the local code/docs for the memory entry points.
exec
/bin/zsh -lc "sed -n '1,220p' /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/SKILL.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
name: system-spec-kit
description: "Unified documentation and context preservation: spec folder workflow (levels 1-3+), CORE + ADDENDUM template architecture (v2.2), validation, and Spec Kit Memory for context preservation. Mandatory for all file modifications."
allowed-tools: [Bash, Edit, Glob, Grep, Read, Task, Write]
version: 3.3.1.0
---

<!-- Keywords: spec-kit, speckit, documentation-workflow, spec-folder, template-enforcement, context-preservation, progressive-documentation, validation, spec-kit-memory, vector-search, hybrid-search, bm25, rrf-fusion, fsrs-decay, constitutional-tier, checkpoint, importance-tiers, cognitive-memory, co-activation, tiered-injection -->

# Spec Kit - Mandatory Conversation Documentation

Orchestrates mandatory spec folder creation for all conversations involving file modifications. Ensures proper documentation level selection (1-3+), template usage, and context preservation through AGENTS.md-enforced workflows.


<!-- ANCHOR:when-to-use -->
## 1. WHEN TO USE

### What is a Spec Folder?

A **spec folder** is a numbered directory (e.g., `007-auth-feature/`) that contains documentation for a single feature/task or a coordinated packet of related phase work:

Spec folders may also be nested as coordination-root packets with direct-child phase folders (e.g., `specs/02--track/022-feature/011-phase/002-child/`).

- **Purpose**: Track specifications, plans, tasks, and decisions for one unit of work
- **Location**: Under `specs/` using either `###-short-name/` at the root or nested packet paths for phased coordination
- **Contents**: Markdown files (spec.md, plan.md, tasks.md, and implementation-summary.md when work is complete) plus optional support folders such as `scratch/`, `research/`, or `review/`

Think of it as a "project folder" for AI-assisted development - it keeps context organized and enables session continuity.

### Activation Triggers

**MANDATORY for ALL file modifications:**
- Code files: JS, TS, Python, CSS, HTML
- Documentation: Markdown, README, guides
- Configuration: JSON, YAML, TOML, env templates
- Templates, knowledge base, build/tooling files

**Request patterns that trigger activation:**
- "Add/implement/create [feature]"
- "Fix/update/refactor [code]"
- "Modify/change [configuration]"
- Any keyword: add, implement, fix, update, create, modify, rename, delete, configure, analyze, phase

**Example triggers:**
- "Add email validation to the signup form" → Level 1-2
- "Refactor the authentication module" → Level 2-3
- "Fix the button alignment bug" → Level 1
- "Implement user dashboard with analytics" → Level 3

### When NOT to Use

- Pure exploration/reading (no file modifications)
- Single typo fixes (<5 characters in one file)
- Whitespace-only changes
- Auto-generated file updates (package-lock.json)
- User explicitly selects Option D (skip documentation)

**Rule of thumb:** If modifying ANY file content → Activate this skill.
Status: ✅ This requirement applies immediately once file edits are requested.

### Distributed Governance Rule

Any agent writing authored spec folder docs (`spec.md`, `plan.md`, `tasks.md`, `checklist.md`, `implementation-summary.md`, `decision-record.md`, `handover.md`, `review-report.md`, `debug-delegation.md`, `resource-map.md` (optional)) MUST use templates from .opencode/skills/system-spec-kit/templates/level_N/ for level-owned docs and the root cross-cutting templates where applicable, run `bash .opencode/skills/system-spec-kit/scripts/spec/validate.sh [spec_folder] --strict` after each file write, and route continuity updates through /memory:save. Deep-research workflow-owned packet markdown (`research/iterations/*.md`, `research/deep-research-*.md`, and progressive `research/research.md` loop updates) is exempt from that generic per-write rule; `/spec_kit:deep-research` must instead run targeted strict validation after every `spec.md` mutation it performs. @deep-research retains exclusive write access for `research/research.md`; @debug retains exclusive write access for `debug-delegation.md`.

- `handover.md` stays in the canonical recovery ladder and is maintained through `/memory:save` handover_state routing using `.opencode/skills/system-spec-kit/templates/handover.md` for initial creation.
- `review-report.md` remains owned by `@deep-review` when deep review workflows synthesize findings.
- `resource-map.md` is a peer cross-cutting template under `.opencode/skills/system-spec-kit/templates/`; it remains optional at any level and gives reviewers a lean file ledger alongside `implementation-summary.md`.

### Utility Template Triggers

| Template              | Trigger Keywords                                                                                                              | Action                    |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------- |
| `handover.md`         | "handover", "next session", "continue later", "pass context", "ending session", "save state", "multi-session", "for next AI"  | Suggest `/memory:save` handover maintenance |
| `debug-delegation.md` | "stuck", "can't fix", "tried everything", "same error", "fresh eyes", "hours on this", "still failing", "need help debugging" | Suggest Task-tool debug delegation |

**Rule:** When detected, proactively suggest the appropriate action.

---

<!-- /ANCHOR:when-to-use -->
<!-- ANCHOR:smart-routing -->
## 2. SMART ROUTING

### Resource Domains

The router discovers markdown resources recursively from `references/` and `assets/` and then applies intent scoring from `RESOURCE_MAP`. Keep this section domain-focused rather than static file inventories.

- `references/memory/` for context retrieval, save workflows, trigger behavior, and indexing.
- `references/templates/` for level selection, template composition, and structure guides.
- `references/validation/` for checklist policy, verification rules, decision formats, and template compliance contracts.
- `references/structure/` for folder organization and sub-folder versioning.
- `references/workflows/` for command workflows and worked examples.
- `references/debugging/` for troubleshooting and root-cause methodology.
- `references/config/` for runtime environment configuration.

### Template and Script Sources of Truth

- Level definitions and template size guidance: [level_specifications.md](./references/templates/level_specifications.md)
- Template usage and composition rules: [template_guide.md](./references/templates/template_guide.md)
- Use `templates/level_N/` for operational templates; `core/` and `addendum/` remain composition inputs.
- Use `templates/changelog/` for packet-local nested changelog generation at completion time.
- Script architecture, build outputs, and runtime entrypoints: [scripts/README.md](./scripts/README.md)
- Memory save JSON schema and workflow contracts: [save_workflow.md](./references/memory/save_workflow.md)
- Nested packet changelog workflow: [nested_changelog.md](./references/workflows/nested_changelog.md)

Primary operational scripts:
- `spec/validate.sh`
- `spec/create.sh`
- `spec/archive.sh`
- `spec/check-completion.sh`
- `spec/recommend-level.sh`
- `templates/compose.sh`

### Resource Loading Levels

| Level       | When to Load               | Resources                    |
| ----------- | -------------------------- | ---------------------------- |
| ALWAYS      | Every skill invocation     | Shared patterns + SKILL.md   |
| CONDITIONAL | If intent signals match   | Intent-mapped references     |
| ON_DEMAND   | Only on explicit request   | Deep-dive quality standards  |

`references/workflows/quick_reference.md` is the primary first-touch command surface. Keep the compact `spec_kit` and `memory` command map there, including `/spec_kit:plan --intake-only` as the standalone intake entry, `/spec_kit:plan` and `/spec_kit:complete` smart delegation notes, and the pointer from `/spec_kit:deep-research` to `../sk-deep-research/references/spec_check_protocol.md`, and use this file only to point readers to it rather than duplicating the full matrix.

### Smart Router Pseudocode

The authoritative routing logic for scoped loading, weighted intent scoring, and ambiguity handling.

```python
from pathlib import Path

SKILL_ROOT = Path(__file__).resolve().parent
RESOURCE_BASES = (SKILL_ROOT / "references", SKILL_ROOT / "assets")
DEFAULT_RESOURCE = "references/workflows/quick_reference.md"

INTENT_SIGNALS = {
    "PLAN": {"weight": 3, "keywords": ["plan", "design", "new spec", "level selection", "option b"]},
    "RESEARCH": {"weight": 3, "keywords": ["investigate", "explore", "analyze", "prior work", "evidence"]},
    "IMPLEMENT": {"weight": 3, "keywords": ["implement", "build", "execute", "workflow"]},
    "DEBUG": {"weight": 4, "keywords": ["stuck", "error", "not working", "failed", "debug"]},
    "COMPLETE": {"weight": 4, "keywords": ["done", "complete", "finish", "verify", "checklist"]},
    "MEMORY": {"weight": 4, "keywords": ["memory", "save context", "resume", "checkpoint", "context"]},
    "HANDOVER": {"weight": 4, "keywords": ["handover", "continue later", "next session", "pause"]},
    "PHASE": {"weight": 4, "keywords": ["phase", "decompose", "split", "workstream", "multi-phase", "phased approach", "phased", "multi-session"]},
    "RETRIEVAL_TUNING": {"weight": 3, "keywords": ["retrieval", "search tuning", "fusion", "scoring", "pipeline"]},
    "EVALUATION": {"weight": 3, "keywords": ["evaluate", "ablation", "benchmark", "baseline", "metrics"]},
    "SCORING_CALIBRATION": {"weight": 3, "keywords": ["calibration", "scoring", "normalization", "decay", "interference"]},
    "ROLLOUT_FLAGS": {"weight": 3, "keywords": ["feature flag", "rollout", "toggle", "enable", "disable"]},
    "GOVERNANCE": {"weight": 3, "keywords": ["governance", "tenant", "retention", "audit"]},
}

RESOURCE_MAP = {
    "PLAN": [
        "references/templates/level_specifications.md",
        "references/templates/template_guide.md",
        "references/validation/template_compliance_contract.md",
    ],
    "RESEARCH": [
        "references/workflows/quick_reference.md",
        "references/workflows/worked_examples.md",
        "references/memory/epistemic_vectors.md",
    ],
    "IMPLEMENT": [
        "references/validation/validation_rules.md",
        "references/validation/template_compliance_contract.md",
        "references/templates/template_guide.md",
    ],
    "DEBUG": [
        "references/debugging/troubleshooting.md",
        "references/workflows/quick_reference.md",
        "manual_testing_playbook/manual_testing_playbook.md",
    ],
    "COMPLETE": [
        "references/validation/validation_rules.md",
        "references/workflows/nested_changelog.md",
    ],
    "MEMORY": [
        "references/memory/memory_system.md",
        "references/memory/save_workflow.md",
        "references/memory/trigger_config.md",
    ],
    "HANDOVER": [
        "references/workflows/quick_reference.md",
    ],
    "PHASE": [
        "references/structure/phase_definitions.md",
        "references/structure/sub_folder_versioning.md",
        "references/validation/phase_checklists.md",
    ],
    "RETRIEVAL_TUNING": [
        "references/memory/embedding_resilience.md",
        "references/memory/trigger_config.md",
    ],
    "EVALUATION": [
        "references/memory/epistemic_vectors.md",
        "references/config/environment_variables.md",
        "manual_testing_playbook/manual_testing_playbook.md",
    ],
    "SCORING_CALIBRATION": [
        "references/config/environment_variables.md",
    ],
    "ROLLOUT_FLAGS": [
        "references/config/environment_variables.md",
        "feature_catalog/19--feature-flag-reference/",
    ],
    "GOVERNANCE": [
        "references/config/environment_variables.md",
    ],
}

COMMAND_BOOSTS = {
    "/spec_kit:plan": "PLAN",
    "/spec_kit:implement": "IMPLEMENT",
    "/spec_kit:complete": "COMPLETE",
    "/spec_kit:plan :with-phases": "PHASE",
    "/memory:search": "MEMORY",
    "/memory:save": "MEMORY",
    "/memory:manage": "MEMORY",
    "/memory:learn": "MEMORY",
    "/spec_kit:resume": "MEMORY",
}

exec
/bin/zsh -lc 'rg -n "memory|memory_context|memory_search|generate-context|Spec Kit Memory|/memory:save|handover" .opencode specs README.md AGENTS.md package.json 2>/dev/null' in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 306ms:
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/working-set-tracker.ts:15:/** In-memory working set for the current session */
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:18:// 2026-03-03: Thresholds audited — memory-crud.js tightened from 760→40 after decomposition into sub-modules.
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:19:// TODO: Extract quality gate, reconsolidation, chunked-indexing from memory-save (2,553 LOC source).
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:25:  'handlers/memory-search.js': 1450, // actual: 762 — Complex search logic with multiple strategies + Pipeline V2 integration
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:26:  'handlers/memory-triggers.js': 470, // actual: 454 — Trigger matching with cognitive features + governance/scope wiring
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:27:  'handlers/memory-crud.js': 40,    // actual: 32 — Re-export barrel (decomposed into memory-crud-{health,update,delete,stats,list,utils,types}.js)
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:28:  'handlers/memory-save.js': 2560,  // actual: 2524 — Save logic with parsing, validation, indexing + quality gate + reconsolidation + Phase 019 Wave A save_lineage option forwarding
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:29:  'handlers/memory-index.js': 700,  // actual: 421 — Index operations with scanning + spec document discovery (Spec 126)
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:31:  'hooks/memory-surface.js': 520,   // actual: 503 — Memory surface hooks with constitutional cache, auto-surface, attention-enriched hints, priming, session snapshots, and Phase 024 bootstrap telemetry
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:105:    'handlers/memory-search.js',
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:106:    'handlers/memory-triggers.js',
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:107:    'handlers/memory-crud.js',
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:108:    'handlers/memory-save.js',
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:109:    'handlers/memory-index.js',
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:116:    'hooks/memory-surface.js',
.opencode/skills/system-spec-kit/mcp_server/tests/modularization.vitest.ts:120:    'tools/memory-tools.js',
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/25-resource-map-template.md:13:This rollout ties the template into the main template README, every level README, the skill and references surfaces, the feature catalog, the manual testing playbook, and the spec-doc classification list. That keeps discovery, copy guidance, and memory classification aligned around one optional template.
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/145-contextual-tree-injection-p1-4.md:20:- Prompt: `As a retrieval-enhancement validation operator, validate Contextual tree injection (P1-4) against memory_search({ query:"spec folder context headers", includeContent:true, includeTrace:true, limit:5 }). Verify hierarchical spec-folder headers are injected into search results when SPECKIT_CONTEXT_HEADERS=true and suppressed when disabled. Return a concise pass/fail verdict with the main reason and cited evidence.`
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/145-contextual-tree-injection-p1-4.md:31:As a retrieval-enhancement validation operator, verify hierarchical spec-folder headers are injected into search results when SPECKIT_CONTEXT_HEADERS=true and suppressed when disabled against memory_search({ query:"spec folder context headers", includeContent:true, includeTrace:true, limit:5 }). Verify enabled: results with spec-folder paths have [parent > child — description] headers prepended, truncated at 100 chars; Disabled: no headers injected, content unchanged. Return a concise pass/fail verdict with the main reason and cited evidence.
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/145-contextual-tree-injection-p1-4.md:36:1. `memory_search({ query:"spec folder context headers", includeContent:true, includeTrace:true, limit:5 })` with `SPECKIT_CONTEXT_HEADERS=true` (default)
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-011.md:17:- [SOURCE: .opencode/commands/spec_kit/implement.md:151-205] `/spec_kit:implement` is explicitly a 9-step implementation workflow covering plan review, checklist handling, development, completion summary, memory save, and handover.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-011.md:19:- [SOURCE: .opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:313-518] The same YAML also owns task breakdown, checklist verification, development, completion, and mandatory memory save.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-011.md:22:Get It Right succeeds because its controller surface is small: one attempt loop, one feedback bridge, one stop condition. `/spec_kit:implement` is doing something materially different. It owns prerequisite enforcement, Level 1/2/3 doc expectations, checklist validation, completion summary generation, memory save, and handover. Those are durable packet-completion concerns, not attempt-scoped retry concerns. If retry logic is bolted into that same workflow, every change to attempt control inherits the branching and coupling of the full implementation lifecycle.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-011.md:37:- **Current system-spec-kit approach:** `/spec_kit:implement` is a 9-step packet-completion workflow with doc-level selection, checklist enforcement, completion summary generation, memory save, and optional handover.
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/query-intent-classifier.ts:8:// Phase 020: Integrated into memory_context handler for query-intent
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/118-error-response-credential-sanitization.md:37:2. Call memory_search to trigger provider error
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/22-lineage-state-active-projection-and-asof-resolution.md:35:| `mcp_server/handlers/memory-save.ts` | Handler | Save-path integration for lineage writes and projection updates |
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/22-lineage-state-active-projection-and-asof-resolution.md:41:| `mcp_server/tests/memory-lineage-state.vitest.ts` | Active projection and deterministic `asOf` selection |
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/22-lineage-state-active-projection-and-asof-resolution.md:42:| `mcp_server/tests/memory-lineage-backfill.vitest.ts` | Backfill planning, idempotent apply, and rollback restore behavior |
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:2:title: "093 -- Implemented: memory summary generation (R8)"
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:3:description: "This scenario validates Implemented: memory summary generation (R8) for `093`. It focuses on Confirm deferred->implemented status."
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:7:# 093 -- Implemented: memory summary generation (R8)
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:11:This scenario validates Implemented: memory summary generation (R8) for `093`. It focuses on Confirm deferred->implemented status.
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:20:- Prompt: `As a retrieval-enhancement validation operator, validate Implemented: memory summary generation (R8) against the documented validation surface. Verify summary generated for long memories; summary persisted in DB; scale gate prevents summary generation below corpus threshold. Return a concise pass/fail verdict with the main reason and cited evidence.`
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:36:1. save long memory
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:60:- Feature catalog: [15--retrieval-enhancements/05-memory-summary-search-channel.md](../../feature_catalog/15--retrieval-enhancements/05-memory-summary-search-channel.md)
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md:69:- Feature file path: `15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md`
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/17-session-health-tool.md:31:| `mcp_server/hooks/memory-surface.ts` | Hook | Provides isSessionPrimed(), getSessionTimestamps(), getCodeGraphStatusSnapshot() |
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/implementation-summary.md:2:title: "Implementation Summary [system-spec-kit/z_archive/014-memory-index-txt-support/implementation-summary]"
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/implementation-summary.md:5:  - "014-memory-index-txt-support"
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/implementation-summary.md:25:| **Spec Folder** | 014-memory-index-txt-support |
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md:2:title: "MPAB chunk-to-memory aggregation"
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md:3:description: "MPAB chunk-to-memory aggregation combines multiple chunk scores into a single memory-level score using a damped bonus formula."
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md:7:# MPAB chunk-to-memory aggregation
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md:11:MPAB chunk-to-memory aggregation combines multiple chunk scores into a single memory-level score using a damped bonus formula.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md:19:When a spec-doc record file splits into chunks, each chunk gets its own score. Multi-Parent Aggregated Bonus combines those chunk scores into a single memory-level score using the formula `sMax + 0.3 * sum(remaining) / sqrt(N)`. The top chunk score becomes the base, and the remaining chunks contribute a damped bonus.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md:44:- Source feature title: MPAB chunk-to-memory aggregation
.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts:6:import * as memorySaveHandler from '../handlers/memory-save';
.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts:15:const TEST_DB_PATH = path.join(TEST_DB_DIR, 'speckit-memory.db');
.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts:66:    '_memory:',
.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts:136:  const sourcePath = path.join(specFolder, 'memory', 'session.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts:171:      const plannerResult = await memorySaveHandler.atomicSaveMemory({
.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts:190:      const fullAutoResult = await memorySaveHandler.atomicSaveMemory({
.opencode/skills/system-spec-kit/mcp_server/tests/embedding-weighting.vitest.ts:95:      title: 'Rollback memory',
.opencode/skills/system-spec-kit/mcp_server/tests/embedding-weighting.vitest.ts:108:  it('ranks the decision-rich memory above a general memory for a decision-focused query with a deterministic provider', async () => {
.opencode/skills/system-spec-kit/scripts/utils/task-enrichment.ts:8:// Shared helpers for memory task title enrichment decisions
.opencode/skills/system-spec-kit/scripts/utils/task-enrichment.ts:16:/** Normalizes a spec title for reuse in memory task enrichment. */
.opencode/skills/system-spec-kit/scripts/utils/task-enrichment.ts:21:/** Returns whether the spec title should enrich the stored memory task. */
.opencode/skills/system-spec-kit/scripts/utils/task-enrichment.ts:35:/** Picks the preferred task label for memory storage. */
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/096-provenance-rich-response-envelopes-p0-2.md:37:2. `memory_search({query:"test", includeTrace:true})` → verify `scores`, `source`, `trace` objects in response
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/096-provenance-rich-response-envelopes-p0-2.md:38:3. `memory_search({query:"test"})` (no includeTrace, env unset) → verify these objects are absent
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/096-provenance-rich-response-envelopes-p0-2.md:57:Check `handlers/memory-search.ts` for includeTrace and env branching
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/19-query-intent-routing.md:3:description: "Automatic backend selection in memory_context that routes queries to code graph, CocoIndex, or both based on the query-intent classifier output."
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/19-query-intent-routing.md:11:Automatic backend selection in memory_context that routes queries to code graph, CocoIndex, or both based on the query-intent classifier output.
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/19-query-intent-routing.md:13:When memory_context receives a query, the query-intent classifier scores it against structural and semantic keyword dictionaries. Structural queries (e.g., "what calls functionX", "show imports") are routed to the code graph for symbol-level results. Semantic queries (e.g., "find examples of error handling") are routed to CocoIndex for vector-similarity results. Hybrid queries trigger both backends and merge the results. The routing is transparent to the caller; memory_context auto-selects the backend without requiring explicit mode parameters.
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/19-query-intent-routing.md:19:mcp_server/handlers/memory-context.ts (integration point)
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/19-query-intent-routing.md:29:| `mcp_server/handlers/memory-context.ts` | Handler | Integration: classifies intent and routes to backend |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:27:- **Source**: [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh#L129); [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh#L64); [mcp_server.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/mcp_server.py#L326); [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85); [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js#L396)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:29:- **Why it matters for us**: If we copy this pattern into Public, the biggest failure mode is a false sense of safety: the runtime is interrupted, but preservation quality still depends on the model following instructions correctly. That can yield duplicated memories, noisy categorization, partial saves, or blocked UX with no durable improvement. Public’s current compaction transport and JSON-primary `generate-context.js` path are much more deterministic.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:62:- **Why it matters**: This separation is architecturally sound. Public already has causal links and graph-aware retrieval, but not a true temporal fact store. A narrow temporal sidecar for changed facts, identities, and state transitions would reduce ambiguity without contaminating the main memory corpus.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:91:You are a research specialist in verbatim AI memory systems, ChromaDB-based semantic retrieval, navigable memory taxonomies, wake-up context layering, MCP tool design, hook-driven persistence, and local temporal knowledge graphs. Work like a systems analyst who can separate README positioning from verified Python mechanics, trace how MemPalace composes mining, storage, retrieval, hooks, and protocol guidance, and translate those choices into practical improvements for `Code_Environment/Public`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:95:Research MemPalace's raw-verbatim memory architecture, palace taxonomy, wake-up stack, MCP protocol/tooling, hook-driven save flow, and temporal knowledge-graph patterns to identify practical, evidence-backed improvements for `Code_Environment/Public`, especially around session continuity, compaction survival, memory hygiene, and agent-facing recall ergonomics. Determine which MemPalace ideas should be `adopt now`, `prototype later`, or `reject`. Keep the analysis honest about what is source-confirmed, what is README-documented, and what is benchmark-claim territory.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:101:MemPalace is a local Python memory system centered on a strong design claim: keep raw conversation and project text instead of extracting only summarized facts, then make that verbatim corpus searchable and navigable. The external repo exposes a CLI, an MCP server, hook scripts, a ChromaDB-backed drawer store, a wake-up layering system, and a separate SQLite temporal knowledge graph. Its storage model uses palace terminology: wings for people/projects/topics, halls for shared memory categories, rooms for named ideas, closets for compact summaries, and drawers for original verbatim content.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:105:The repo appears to support three ingestion shapes into one shared memory backend: project mining, conversation mining, and a general heuristic extraction mode. Retrieval then spans direct semantic search, wake-up text generation across L0-L3 layers, palace graph traversal via shared room metadata, and MCP tooling that teaches an operational memory protocol to the agent through the status response itself. Hook scripts add another layer: instead of a memory system that only responds to explicit search/save calls, MemPalace also tries to shape the timing of memory writes at stop and pre-compact boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:111:| 001 | Engram | MCP memory server (Go, SQLite+FTS5) | 005 (memory server), 004 (session continuity) | Focus tool profiles, session lifecycle, topic keys |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:113:| 003 | Modus Memory | FSRS spaced repetition + BM25 | 005 (local memory) | Focus FSRS decay, BM25, librarian expansion, cross-references |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:115:| 005 | MemPalace | Raw verbatim storage + palace taxonomy + hooks + temporal KG | 001 (MCP memory), 004 (compaction/helping memory survive), 003 (local memory) | Focus raw-no-extraction posture, wake-up layers, hooks, palace structure, temporal KG |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:119:`Code_Environment/Public` already has Spec Kit Memory with hybrid retrieval, `memory_search`, `memory_context`, `memory_match_triggers`, memory-save flows through `generate-context.js`, session/bootstrap handling in the memory MCP server, and compaction-oriented structural transport via `.opencode/plugins/spec-kit-compact-code-graph.js`. It also already has semantic code search via CocoIndex and structured graph context via Compact Code Graph.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:121:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:136:12. Compare MemPalace directly against current `Code_Environment/Public` code: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`, `.opencode/skills/system-spec-kit/mcp_server/context-server.ts`, `.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js`, and `.opencode/plugins/spec-kit-compact-code-graph.js`. Be explicit about what Public already covers better and what MemPalace still contributes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:143:    Research the external repository at /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external and identify concrete improvements for Code_Environment/Public, especially around raw verbatim memory storage, palace taxonomy (wings/halls/rooms), wake-up context layering, MCP protocol/tool design, hook-driven save flows, and temporal knowledge-graph patterns.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:145:15. Save all outputs inside `research/`, with `research/research.md` as the canonical report. Every meaningful finding must cite exact file paths, say whether the evidence is `source-confirmed`, `README-documented`, `benchmark-documented`, or mixed, explain why it matters for `Code_Environment/Public`, classify the recommendation as `adopt now`, `prototype later`, or `reject`, identify the affected subsystem, and note migration or truthfulness risk. When research is complete, update `checklist.md`, create `implementation-summary.md`, and save memory with:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:147:    cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js "/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace"
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:152:1. What does MemPalace gain from its raw-verbatim "store everything, then make it findable" posture, and where would that improve or conflict with Spec Kit Memory's more selective save and retrieval model?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:154:3. How does the L0/L1/L2/L3 wake-up stack compare with Public's `session_bootstrap`, `memory_context`, and compaction-recovery flows, and what parts of the layering model are reusable here?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:155:4. What does `mcp_server.py` gain by embedding `PALACE_PROTOCOL` and `AAAK_SPEC` directly in the status bootstrap, and could Public benefit from similarly direct memory-usage guidance without adding prompt clutter?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:156:5. How effective are the stop-hook and pre-compact-hook patterns at protecting context before loss, and how do they compare to Public's existing compaction-oriented structural plugin and memory-save workflows?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:160:9. Which MemPalace ideas most improve compaction survival and startup continuity for future Public sessions: wake-up layers, hook timing, memory protocol bootstrapping, diary writing, or taxonomy-based narrowing?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:172:- Do map strong findings to specific Public subsystems such as Spec Kit Memory retrieval, context bootstrap, save flows, or compaction handling.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:193:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:195:- Affected area: memory bootstrap UX, session recovery guidance, compaction recovery behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:206:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:208:- Affected area: memory save automation, compaction resilience, agent operating protocol
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:233:- comparison against current Public memory, bootstrap, save, and compaction flows
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:245:Rank findings in this order: leverage for Public session continuity, compaction-survival value, truthfulness and evidence quality, fit with current Spec Kit Memory capabilities, operational simplicity, memory-hygiene impact, and clean differentiation from phases `001` through `004`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:251:- explicit comparison against current Public memory retrieval, bootstrap, save, and compaction behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:255:- memory saved from this phase folder using `generate-context.js`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:272:  - **Role** is specialized in verbatim memory systems, wake-up layering, MCP protocol design, hooks, and temporal KG behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:287:- current `Code_Environment/Public` memory/bootstrap/compaction behavior was compared using code, not assumptions
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:294:- memory is saved successfully for `005-mempalace`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:322:I’m treating this as a read-only final synthesis pass over the existing `005-mempalace` phase folder. First I’m loading the most relevant memory/context hints, then I’ll verify the phase artifacts and read the current research plus the key external/Public source files before I consolidate the final recommendation set.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:331:464:- 023-hybrid-rag-fusion-refinement, memory_index_scan, memory_quick_search, parentChain, B3-hybrid-rag-fusion-refinement, .opencode/changelog
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:349:memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:472:allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Task, WebFetch, memory_context, memory_search]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:622:    │  - Save (memory context)        │
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:649:Each agent dispatch gets a fresh context window. State continuity comes from files, not memory. This solves context degradation in long research sessions.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:676:Save --> generate-context.js --> verify memory artifact
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:683:| **Externalized state** | All research continuity via files, not agent memory |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:710:You are a research specialist in verbatim AI memory systems, ChromaDB-based semantic retrieval, navigable memory taxonomies, wake-up context layering, MCP tool design, hook-driven persistence, and local temporal knowledge graphs. Work like a systems analyst who can separate README positioning from verified Python mechanics, trace how MemPalace composes mining, storage, retrieval, hooks, and protocol guidance, and translate those choices into practical improvements for `Code_Environment/Public`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:714:Research MemPalace's raw-verbatim memory architecture, palace taxonomy, wake-up stack, MCP protocol/tooling, hook-driven save flow, and temporal knowledge-graph patterns to identify practical, evidence-backed improvements for `Code_Environment/Public`, especially around session continuity, compaction survival, memory hygiene, and agent-facing recall ergonomics. Determine which MemPalace ideas should be `adopt now`, `prototype later`, or `reject`. Keep the analysis honest about what is source-confirmed, what is README-documented, and what is benchmark-claim territory.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:720:MemPalace is a local Python memory system centered on a strong design claim: keep raw conversation and project text instead of extracting only summarized facts, then make that verbatim corpus searchable and navigable. The external repo exposes a CLI, an MCP server, hook scripts, a ChromaDB-backed drawer store, a wake-up layering system, and a separate SQLite temporal knowledge graph. Its storage model uses palace terminology: wings for people/projects/topics, halls for shared memory categories, rooms for named ideas, closets for compact summaries, and drawers for original verbatim content.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:724:The repo appears to support three ingestion shapes into one shared memory backend: project mining, conversation mining, and a general heuristic extraction mode. Retrieval then spans direct semantic search, wake-up text generation across L0-L3 layers, palace graph traversal via shared room metadata, and MCP tooling that teaches an operational memory protocol to the agent through the status response itself. Hook scripts add another layer: instead of a memory system that only responds to explicit search/save calls, MemPalace also tries to shape the timing of memory writes at stop and pre-compact boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:730:| 001 | Engram | MCP memory server (Go, SQLite+FTS5) | 005 (memory server), 004 (session continuity) | Focus tool profiles, session lifecycle, topic keys |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:732:| 003 | Modus Memory | FSRS spaced repetition + BM25 | 005 (local memory) | Focus FSRS decay, BM25, librarian expansion, cross-references |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:734:| 005 | MemPalace | Raw verbatim storage + palace taxonomy + hooks + temporal KG | 001 (MCP memory), 004 (compaction/helping memory survive), 003 (local memory) | Focus raw-no-extraction posture, wake-up layers, hooks, palace structure, temporal KG |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:738:`Code_Environment/Public` already has Spec Kit Memory with hybrid retrieval, `memory_search`, `memory_context`, `memory_match_triggers`, memory-save flows through `generate-context.js`, session/bootstrap handling in the memory MCP server, and compaction-oriented structural transport via `.opencode/plugins/spec-kit-compact-code-graph.js`. It also already has semantic code search via CocoIndex and structured graph context via Compact Code Graph.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:740:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:755:12. Compare MemPalace directly against current `Code_Environment/Public` code: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`, `.opencode/skills/system-spec-kit/mcp_server/context-server.ts`, `.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js`, and `.opencode/plugins/spec-kit-compact-code-graph.js`. Be explicit about what Public already covers better and what MemPalace still contributes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:762:    Research the external repository at /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external and identify concrete improvements for Code_Environment/Public, especially around raw verbatim memory storage, palace taxonomy (wings/halls/rooms), wake-up context layering, MCP protocol/tool design, hook-driven save flows, and temporal knowledge-graph patterns.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:764:15. Save all outputs inside `research/`, with `research/research.md` as the canonical report. Every meaningful finding must cite exact file paths, say whether the evidence is `source-confirmed`, `README-documented`, `benchmark-documented`, or mixed, explain why it matters for `Code_Environment/Public`, classify the recommendation as `adopt now`, `prototype later`, or `reject`, identify the affected subsystem, and note migration or truthfulness risk. When research is complete, update `checklist.md`, create `implementation-summary.md`, and save memory with:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:766:    cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js "/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace"
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:771:1. What does MemPalace gain from its raw-verbatim "store everything, then make it findable" posture, and where would that improve or conflict with Spec Kit Memory's more selective save and retrieval model?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:773:3. How does the L0/L1/L2/L3 wake-up stack compare with Public's `session_bootstrap`, `memory_context`, and compaction-recovery flows, and what parts of the layering model are reusable here?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:774:4. What does `mcp_server.py` gain by embedding `PALACE_PROTOCOL` and `AAAK_SPEC` directly in the status bootstrap, and could Public benefit from similarly direct memory-usage guidance without adding prompt clutter?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:775:5. How effective are the stop-hook and pre-compact-hook patterns at protecting context before loss, and how do they compare to Public's existing compaction-oriented structural plugin and memory-save workflows?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:779:9. Which MemPalace ideas most improve compaction survival and startup continuity for future Public sessions: wake-up layers, hook timing, memory protocol bootstrapping, diary writing, or taxonomy-based narrowing?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:791:- Do map strong findings to specific Public subsystems such as Spec Kit Memory retrieval, context bootstrap, save flows, or compaction handling.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:812:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:814:- Affected area: memory bootstrap UX, session recovery guidance, compaction recovery behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:825:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:827:- Affected area: memory save automation, compaction resilience, agent operating protocol
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:852:- comparison against current Public memory, bootstrap, save, and compaction flows
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:864:Rank findings in this order: leverage for Public session continuity, compaction-survival value, truthfulness and evidence quality, fit with current Spec Kit Memory capabilities, operational simplicity, memory-hygiene impact, and clean differentiation from phases `001` through `004`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:870:- explicit comparison against current Public memory retrieval, bootstrap, save, and compaction behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:874:- memory saved from this phase folder using `generate-context.js`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:891:  - **Role** is specialized in verbatim memory systems, wake-up layering, MCP protocol design, hooks, and temporal KG behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:906:- current `Code_Environment/Public` memory/bootstrap/compaction behavior was compared using code, not assumptions
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:913:- memory is saved successfully for `005-mempalace`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:947:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/memory/.gitkeep
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:988:10504:### Finding 8: Public already beats MemPalace on session bootstrap sophistication, but MemPalace beats Public on memory protocol ergonomics
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1014:10606:### Finding 8: Public already beats MemPalace on session bootstrap sophistication, but MemPalace beats Public on memory protocol ergonomics
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1022:10657:### Finding 8: Public already beats MemPalace on session bootstrap sophistication, but MemPalace beats Public on memory protocol ergonomics
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1039:26382:### Finding 1: MemPalace is a sidecar-store architecture, not one unified memory database
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1069:26473:### Finding 1: MemPalace is a sidecar-store architecture, not one unified memory database
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1606:119849:.opencode/skills/system-spec-kit/manual_testing_playbook/05--lifecycle/144-advisory-ingest-lifecycle-forecast.md:29:| 144 | Advisory ingest lifecycle forecast | Verify `memory_ingest_status` exposes advisory forecast fields and degrades safely on sparse progress | `Validate ingest forecast contract and early-progress caveats. Capture the evidence needed to prove Status payloads always include a forecast object; sparse progress yields null or low-confidence fields plus caveat text; progressing jobs update ETA/risk fields without breaking the handler contract; optional telemetry remains additive. Return a concise user-facing pass/fail verdict with the main reason.` | 1) `memory_ingest_start({ paths:["specs/<target-spec>/memory/file1.md","specs/<target-spec>/memory/file2.md"] })` and capture `jobId` 2) Immediately call `memory_ingest_status({ jobId:"<job-id>" })` and verify `forecast` contains `etaSeconds`, `etaConfidence`, `failureRisk`, `riskSignals`, and `caveat` 3) Confirm early or queued states return a low-confidence caveat instead of throwing 4) Poll until indexing progresses and verify forecast values update while staying advisory 5) If extended telemetry is enabled, confirm lifecycle forecast diagnostics are attached without changing the status contract | Status payloads always include a `forecast` object; sparse progress yields null or low-confidence fields plus caveat text; progressing jobs update ETA/risk fields without breaking the handler contract; optional telemetry remains additive | Start/status transcript across early and progressing states + optional telemetry snapshot when enabled | PASS if forecast fields are always present, sparse states degrade safely, and progressing jobs update the advisory values without handler failure | Inspect `handlers/memory-ingest.ts`, `lib/ops/job-queue.ts`, and `lib/telemetry/retrieval-telemetry.ts` if forecast fields disappear or throw |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1607:120168:.opencode/skills/system-spec-kit/feature_catalog/05--lifecycle/05-async-ingestion-job-lifecycle.md:20:`memory_ingest_status` now also returns an advisory `forecast` object with `etaSeconds`, `etaConfidence`, `failureRisk`, `riskSignals`, and `caveat`. Terminal jobs return deterministic terminal forecasts, sparse queues degrade to null or low-confidence values instead of throwing, and forecast derivation failures fall back to a safe `"Forecast unavailable: ..."` response rather than failing the handler.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1611:123269:### Finding 1: Public lacks a first-class identity capsule separate from searchable memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1623:123297:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1628:123358:### Finding 1: Public lacks a first-class identity capsule separate from searchable memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1640:123386:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1648:123445:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1714:131368:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1731:131453:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1739:131507:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1775:141248:### Finding 3: A strong memory system can have multiple planes of truth without forcing them into one index
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1795:141325:### Finding 3: A strong memory system can have multiple planes of truth without forcing them into one index
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1829:148294:### Finding 1: MemPalace’s strongest pattern is lifecycle-enforced memory discipline, not just retrieval
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1851:148382:### Finding 1: MemPalace’s strongest pattern is lifecycle-enforced memory discipline, not just retrieval
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1923:158294:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1949:158388:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:1963:158449:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:2903:197204:### Finding 6: AAAK and diary-centric memory should stay out of the core recall path
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:2926:197309:### Finding 6: AAAK and diary-centric memory should stay out of the core recall path
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:2998:197166	MemPalace contributes two near-term ideas worth carrying into Public now: a compaction-time structured save checkpoint and a short bootstrap hint layer that teaches memory behavior. Everything else should stay scoped: selective verbatim evidence retention and layered wake-up are worth prototyping, a temporal fact plane is a separate net-new feature track, and full taxonomy plus AAAK/diary-centric recall should be rejected as primary architecture. I used prior phase memory only to recover continuity; the findings below are based on current-turn source reads.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3002:197170	- **Source**: [hooks/README.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/README.md), [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh), [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3004:197172	- **Why it matters for us**: This is the highest-leverage continuity improvement with the smallest architecture change. The safe Public version is one compaction-time checkpoint that writes curated JSON through `generate-context.js`, with dedupe/last-save guards.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3010:197178	- **What it does**: `mempalace_status` returns counts plus `PALACE_PROTOCOL`, telling the agent when to search, verify, diary-write, and invalidate facts. Public already emits recovery/bootstrap hints, so it can add a short memory-behavior hint block without inventing a second protocol surface.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3011:197179	- **Why it matters for us**: MemPalace’s strongest UX idea is not the palace metaphor; it is that the memory system teaches the agent how to use it. Public can get that benefit with 3-5 concrete hints, not a new subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3016:197184	- **Source**: [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py), [miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/miner.py), [convo_miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py), [general_extractor.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3023:197191	- **Source**: [layers.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/layers.py), [context-server.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/context-server.ts), [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3025:197193	- **Why it matters for us**: Public already has `session_bootstrap`, `memory_context`, hints, profiles, and progressive disclosure. The right transfer is a “wake-up profile” on the existing retrieval stack, not a second memory engine or AAAK-first startup contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3032:197200	- **Why it matters for us**: Public does not have this architecture today. It is the clearest long-term differentiator, but only if built with mandatory citations, authority tiers, correction review, and strict separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3036:197204	### Finding 6: AAAK and diary-centric memory should stay out of the core recall path
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3071:197239	- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3072:197240	- [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3083:197251	- What did not work: the phase folder still lacks the expected Level 3 docs, the strict validator reported `RESULT: PASSED` while also emitting `cannot create temp file for here document: Operation not permitted`, the environment is read-only so I could not update `research/research.md` or save memory, and CocoIndex was unavailable in this session
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3086:197254	1. Implement one compaction-time preservation checkpoint on Public’s existing `experimental.session.compacting` surface that writes only structured JSON through [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js).
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3087:197255	2. Add a 3-5 line memory-behavior hint block to bootstrap/status output, not a second protocol manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3089:197257	4. Test a wake-up/recovery profile on top of existing `session_bootstrap` and `memory_search`, not a separate L0-L3 storage system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3103:197271	MemPalace contributes two near-term ideas worth carrying into Public now: a compaction-time structured save checkpoint and a short bootstrap hint layer that teaches memory behavior. Everything else should stay scoped: selective verbatim evidence retention and layered wake-up are worth prototyping, a temporal fact plane is a separate net-new feature track, and full taxonomy plus AAAK/diary-centric recall should be rejected as primary architecture. I used prior phase memory only to recover continuity; the findings below are based on current-turn source reads.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3107:197275	- **Source**: [hooks/README.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/README.md), [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh), [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3109:197277	- **Why it matters for us**: This is the highest-leverage continuity improvement with the smallest architecture change. The safe Public version is one compaction-time checkpoint that writes curated JSON through `generate-context.js`, with dedupe/last-save guards.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3115:197283	- **What it does**: `mempalace_status` returns counts plus `PALACE_PROTOCOL`, telling the agent when to search, verify, diary-write, and invalidate facts. Public already emits recovery/bootstrap hints, so it can add a short memory-behavior hint block without inventing a second protocol surface.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3116:197284	- **Why it matters for us**: MemPalace’s strongest UX idea is not the palace metaphor; it is that the memory system teaches the agent how to use it. Public can get that benefit with 3-5 concrete hints, not a new subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3121:197289	- **Source**: [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py), [miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/miner.py), [convo_miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py), [general_extractor.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3128:197296	- **Source**: [layers.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/layers.py), [context-server.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/context-server.ts), [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3130:197298	- **Why it matters for us**: Public already has `session_bootstrap`, `memory_context`, hints, profiles, and progressive disclosure. The right transfer is a “wake-up profile” on the existing retrieval stack, not a second memory engine or AAAK-first startup contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3137:197305	- **Why it matters for us**: Public does not have this architecture today. It is the clearest long-term differentiator, but only if built with mandatory citations, authority tiers, correction review, and strict separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3141:197309	### Finding 6: AAAK and diary-centric memory should stay out of the core recall path
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3176:197344	- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3177:197345	- [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3188:197356	- What did not work: the phase folder still lacks the expected Level 3 docs, the strict validator reported `RESULT: PASSED` while also emitting `cannot create temp file for here document: Operation not permitted`, the environment is read-only so I could not update `research/research.md` or save memory, and CocoIndex was unavailable in this session
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3191:197359	1. Implement one compaction-time preservation checkpoint on Public’s existing `experimental.session.compacting` surface that writes only structured JSON through [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js).
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3192:197360	2. Add a 3-5 line memory-behavior hint block to bootstrap/status output, not a second protocol manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3194:197362	4. Test a wake-up/recovery profile on top of existing `session_bootstrap` and `memory_search`, not a separate L0-L3 storage system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3204:/bin/zsh -lc "cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && nl -ba .opencode/plugins/spec-kit-compact-code-graph.js | sed -n '388,430p' && printf '\\n---\\n' && nl -ba .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js | sed -n '78,115p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3240:    78	  echo '{"specFolder":"specs/001-feature/"}' | node generate-context.js --stdin
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3241:    79	  node generate-context.js --json '{"specFolder":"specs/001-feature/"}'
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3244:    82	  Creates a memory file in <spec-folder>/memory/ with ANCHOR format
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3245:    83	  for indexing by the Spec Kit Memory system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3309:    75	  "reason": "COMPACTION IMMINENT. Save ALL topics, decisions, quotes, code, and important context from this session to your memory system. Be thorough — after compaction, detailed context will be lost. Organize into appropriate categories. Use verbatim quotes where possible. Save everything, then allow compaction to proceed."
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3352:   148	  "reason": "AUTO-SAVE checkpoint. Save key topics, decisions, quotes, and code from this session to your memory system. Organize into appropriate categories. Use verbatim quotes where possible. Continue conversation after saving."
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3417:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/mcp_server.py:178:AAAK_SPEC = """AAAK is a compressed memory dialect that MemPalace uses for efficient storage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3479:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/benchmarks/BENCHMARKS.md:36:The 100% is the competitive story: a perfect score on the standard benchmark for AI memory, verified across all 500 questions and all 6 question types — reproducible with either Haiku or Sonnet as the reranker.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3523:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md:7:### The highest-scoring AI memory system ever benchmarked. And it's free.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3524:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md:15:**The Palace** — Ancient Greek orators memorized entire speeches by placing ideas in rooms of an imaginary building. Walk through the building, find the idea. MemPalace applies the same principle to AI memory: your conversations are organized into wings (people and projects), halls (types of memory), and rooms (specific ideas). No AI decides what matters — you keep every word, and the structure gives you a navigable map instead of a flat search index.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3540:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md:169:Either way — your entire memory stack runs offline. ChromaDB on your machine, Llama on your machine, AAAK for compression, zero cloud calls.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3568:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md:467:| `mempalace_status` | Palace overview + AAAK spec + memory protocol |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3574:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md:507:The AI learns AAAK and the memory protocol automatically from the `mempalace_status` response. No manual configuration.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3580:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md:636:| `mcp_server.py` | MCP server — 19 tools, AAAK auto-teach, memory protocol |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3760:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:295:            # Each chunk already has memory_type; use it as the room name
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3763:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:302:        # Detect room from content (general mode uses memory_type instead)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3766:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:312:                type_counts = Counter(c.get("memory_type", "general") for c in chunks)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3772:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:321:                    room_counts[c.get("memory_type", "general")] += 1
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3778:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:332:            chunk_room = chunk.get("memory_type", room) if extract_mode == "general" else room
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3909:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py:19:    # [{"content": "...", "memory_type": "decision", "chunk_index": 0}, ...]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:3916:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py:372:        List of dicts: {"content": str, "memory_type": str, "chunk_index": int}
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4119:   372	        List of dicts: {"content": str, "memory_type": str, "chunk_index": int}
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4163:   416	                "memory_type": max_type,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4670:/bin/zsh -lc "cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && nl -ba .opencode/skills/system-spec-kit/mcp_server/context-server.ts | sed -n '1,220p' && printf '\\n---\\n' && nl -ba .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts | sed -n '1,220p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4709:    38	import * as memoryIndexDiscovery from './handlers/memory-index-discovery.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4731:    60	import { primeSessionIfNeeded } from './hooks/memory-surface.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4759:    88	import * as memoryParser from './lib/parsing/memory-parser.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4774:   103	import * as workingMemory from './lib/cognitive/working-memory.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4913:    20	// Artifact-class routing (spec/plan/tasks/checklist/memory)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:4993:   100	// Feature catalog: Semantic and lexical search (memory_search)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5022:   129	  memoryState?: string;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5122:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:258:  surface: 'response-hints' | 'session-bootstrap' | 'memory-context';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5141:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:772:        snap.sessionQuality === 'critical' ? 'call memory_context(resume)' : 'ready';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5145:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:882:    if (name === 'memory_context' && args.mode === 'resume') {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5146:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:912:      name === 'memory_context' && args.mode === 'resume';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5165:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:59:  primePackage?: PrimePackage;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5166:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:70:  recommendedCalls: string[];
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5167:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:72:  structuralContext?: StructuralBootstrapContract;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5168:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:455:  const recommendedCalls: string[] = [];
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5169:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:457:    recommendedCalls.push('code_graph_scan');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5170:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:460:    recommendedCalls.push('memory_context({ input: "resume previous work", mode: "resume", profile: "resume" })');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5171:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:462:  if (cocoIndexAvailable && recommendedCalls.length === 0) {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5172:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:463:    recommendedCalls.push('memory_match_triggers({ prompt: "<your task>" })');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5173:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:476:  const structuralContext = buildStructuralBootstrapContract('auto-prime');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5174:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:479:    specFolder, currentTask, codeGraphStatus, cocoIndexAvailable, recommendedCalls,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5175:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:480:    structuralContext,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5176:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:517:    const primePackage = buildPrimePackage(toolArgs, codeGraphStatus);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5177:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:533:        primePackage,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5178:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:545:      primePackage,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5179:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:624: * autoSurfaceAtCompaction
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5180:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:640:async function autoSurfaceAtCompaction(
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5181:.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts:678:  autoSurfaceAtCompaction,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5189:.opencode/skills/system-spec-kit/mcp_server/hooks/claude/session-prime.ts:50:      content: 'Context was compacted. Call `memory_context({ mode: "resume", profile: "resume" })` to recover session state.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5190:.opencode/skills/system-spec-kit/mcp_server/hooks/claude/session-prime.ts:61:      content: 'Context was compacted. Call `memory_context({ mode: "resume", profile: "resume" })` to recover session state.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5191:.opencode/skills/system-spec-kit/mcp_server/hooks/claude/session-prime.ts:77:      content: 'Context was compacted and auto-recovered from the cached compact brief. For full session state, call `memory_context({ mode: "resume", profile: "resume" })`.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5195:.opencode/skills/system-spec-kit/mcp_server/hooks/claude/session-prime.ts:185:      content: `Last active spec folder: ${state.lastSpecFolder}\nCall \`memory_context({ input: "resume previous work", mode: "resume", profile: "resume" })\` for full context.`,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5196:.opencode/skills/system-spec-kit/mcp_server/hooks/claude/session-prime.ts:190:      content: 'Call `memory_context({ input: "resume previous work", mode: "resume", profile: "resume" })` to restore session state.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5202:.opencode/skills/system-spec-kit/mcp_server/hooks/claude/compact-inject.ts:19:import { autoSurfaceAtCompaction } from '../../hooks/memory-surface.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5214:.opencode/skills/system-spec-kit/mcp_server/hooks/gemini/session-prime.ts:51:      content: 'Context was compressed. Call `memory_context({ mode: "resume", profile: "resume" })` to recover session state.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5215:.opencode/skills/system-spec-kit/mcp_server/hooks/gemini/session-prime.ts:62:      content: 'Context was compressed. Call `memory_context({ mode: "resume", profile: "resume" })` to recover session state.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5216:.opencode/skills/system-spec-kit/mcp_server/hooks/gemini/session-prime.ts:73:      content: 'Context was compressed and auto-recovered. For full session state, call `memory_context({ mode: "resume", profile: "resume" })`.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5218:.opencode/skills/system-spec-kit/mcp_server/hooks/gemini/session-prime.ts:149:      content: `Last active spec folder: ${state.lastSpecFolder}\nCall \`memory_context({ input: "resume previous work", mode: "resume", profile: "resume" })\` for full context.`,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5219:.opencode/skills/system-spec-kit/mcp_server/hooks/gemini/session-prime.ts:155:    content: 'Call `memory_context({ input: "resume previous work", mode: "resume", profile: "resume" })` to restore session state.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5221:.opencode/skills/system-spec-kit/mcp_server/hooks/gemini/compact-inject.ts:63:    'Context was compressed and auto-recovered. For full session state, call `memory_context({ mode: "resume", profile: "resume" })`.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5265:   176	This protocol ensures the AI KNOWS before it speaks. Storage is not memory — but storage + this protocol = memory."""
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5267:   178	AAAK_SPEC = """AAAK is a compressed memory dialect that MemPalace uses for efficient storage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5578:I’ve got enough evidence to lock the final matrix now. One more quick pass is just to capture the exact memory lines I relied on for prior-phase continuity, then I’ll hand back the iteration-30 synthesis and call out the two important repo realities: no `iteration-030.md` exists yet, and I cannot write it in this read-only sandbox.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5599:   371	- after strict validation surfaced low-quality resume artifacts, the user said “do manually rewrite or adjust memories if you deemed quality low” -> manually repair latest `memory/*.md` snapshots when stale “Continue implementation” / `IN_PROGRESS` cues no longer match packet reality [Task 5]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5602:   374	- when closing packet work, the user expectation was explicit completion proof (`validate.sh --strict` + `check-completion.sh`) plus memory-index refresh before claiming done [Task 7]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5620:  6051	- **Source**: [miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/miner.py#L3), [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py#L21), [BENCHMARKS.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/benchmarks/BENCHMARKS.md#L16), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5622:  6053	- **Why it matters**: This is the right architectural center of gravity. Public should not become raw-everything-by-default, but it should preserve more verbatim evidence for high-value decisions, quotes, and failure context instead of forcing every useful memory into a compressed abstraction.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5633:  6064	### Finding 3: Status should teach the agent how to use memory, not just report health
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5635:  6066	- **What it does**: Source-confirmed. `mempalace_status` returns counts plus `PALACE_PROTOCOL` and `AAAK_SPEC`, so the first health call also trains behavior: verify before speaking, write a diary after sessions, invalidate stale facts. Public already computes startup instructions and recovery guidance, but it is broader and less memory-protocol-specific.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5636:  6067	- **Why it matters**: This is one of MemPalace’s best decisions. Public should add a compact, explicit memory-usage contract to bootstrap/status surfaces so agents are reminded when to search, when to trust structure, and when to save.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5650:  6081	- **Why it matters**: This separation is architecturally sound. Public already has causal links and graph-aware retrieval, but not a true temporal fact store. A narrow temporal sidecar for changed facts, identities, and state transitions would reduce ambiguity without contaminating the main memory corpus.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5750:    72	# This provides an audit trail for detecting memory poisoning and
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5972:- **Source**: [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh#L129), [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh#L64), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js#L396), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5980:### Finding 2: Add a tiny status/bootstrap memory-protocol hint block
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:5999:- **Source**: [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py#L21), [convo_miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py#L53), [general_extractor.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py#L363), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6007:### Finding 5: Treat L0-L3 wake-up as a retrieval profile, not a second memory system
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6046:- Operational note: strict validation returned `PASSED`, but also emitted a temp-file warning under the read-only sandbox; I could not update the phase files, create `implementation-summary.md`, or run the phase memory save.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6049:Implement the three `adopt now` items first in this order: compaction-time JSON-primary checkpoint, bootstrap memory-protocol hints, and audit/repair surfaces. After that, prototype selective verbatim evidence retention, a wake-up retrieval profile, and a citation-governed temporal fact sidecar; keep forced blocking saves, AAAK-first recall, and full palace taxonomy out of the near-term roadmap.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6063:- **Source**: [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh#L129), [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh#L64), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js#L396), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6071:### Finding 2: Add a tiny status/bootstrap memory-protocol hint block
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6090:- **Source**: [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py#L21), [convo_miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py#L53), [general_extractor.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py#L363), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6098:### Finding 5: Treat L0-L3 wake-up as a retrieval profile, not a second memory system
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6137:- Operational note: strict validation returned `PASSED`, but also emitted a temp-file warning under the read-only sandbox; I could not update the phase files, create `implementation-summary.md`, or run the phase memory save.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-030.md:6140:Implement the three `adopt now` items first in this order: compaction-time JSON-primary checkpoint, bootstrap memory-protocol hints, and audit/repair surfaces. After that, prototype selective verbatim evidence retention, a wake-up retrieval profile, and a citation-governed temporal fact sidecar; keep forced blocking saves, AAAK-first recall, and full palace taxonomy out of the near-term roadmap.
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/startup-brief.ts:109:  const memoryLine = args.sessionContinuity
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/startup-brief.ts:137:    `- Memory: ${memoryLine}`,
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/startup-brief.ts:139:    // distinct from the memory causal graph surfaced by memory_causal_stats.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/06-learned-relevance-feedback.md:13:When you mark a search result as useful, the system remembers which search terms led you to it. Next time similar terms appear in a question, the system gives that memory a small boost. Over time, the system learns which results are genuinely helpful based on your actual selections, like a music app that gets better at recommending songs the more you use it.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/06-learned-relevance-feedback.md:19:The system learns from user result selections. When a user marks a search result as useful via `memory_validate` with a `queryId`, query terms are extracted and stored in a separate `learned_triggers` column. This column is explicitly isolated from the FTS5 index to prevent contamination, which would be irreversible without a full re-index.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/06-learned-relevance-feedback.md:21:Ten safeguards protect against noise: a 100+ stop-word denylist, rate cap of 3 terms per selection and 8 per memory, 30-day TTL decay, FTS5 isolation verified by 5 critical tests, noise floor (top-3 exclusion), 1-week shadow period (log-but-don't-apply), rollback mechanism, provenance audit log, 72-hour minimum memory age and sprint gate review.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/06-learned-relevance-feedback.md:47:| `mcp_server/tests/memory-types.vitest.ts` | Memory type tests |
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:3:  "packet_id": "system-spec-kit/z_archive/014-memory-index-txt-support",
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:4:  "spec_folder": "system-spec-kit/z_archive/014-memory-index-txt-support",
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:14:      "014-memory-index-txt-support",
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:15:      "memory index txt support",
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:28:      "014-memory-index-txt-support",
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:29:      "memory",
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/graph-metadata.json:47:      ".opencode/commands/memory/README.txt",
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-eval-channels.vitest.ts:1:// TEST: memory_search per-channel eval logging (T056)
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-eval-channels.vitest.ts:21:  generateCacheKey: vi.fn(() => 'memory-search-test-cache-key'),
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-eval-channels.vitest.ts:104:import { handleMemorySearch, __testables } from '../handlers/memory-search';
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-eval-channels.vitest.ts:106:describe('T056: memory_search emits per-channel eval rows', () => {
.opencode/skills/system-spec-kit/scripts/utils/prompt-utils.ts:25:  console.error(`  node generate-context.js ${getSessionScopedSaveContextExample()} <spec-folder-path>`);
.opencode/skills/system-spec-kit/scripts/utils/prompt-utils.ts:28:  console.error('  node generate-context.js --json \'{"specFolder":"specs/003-memory-and-spec-kit/054-remaining-bugs-remediation"}\' specs/003-memory-and-spec-kit/054-remaining-bugs-remedation');
.opencode/skills/system-spec-kit/scripts/utils/prompt-utils.ts:42:    console.warn('[generate-context] Non-interactive mode: using default value');
.opencode/skills/system-spec-kit/scripts/utils/prompt-utils.ts:74:    console.warn(`[generate-context] Non-interactive mode: using default choice 1`);
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/117-sqlite-datetime-session-cleanup-p0-7.md:36:1. **Precondition:** Working memory database accessible.
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/117-sqlite-datetime-session-cleanup-p0-7.md:63:- Feature catalog: [08--bug-fixes-and-data-integrity/11-working-memory-timestamp-fix.md](../../feature_catalog/08--bug-fixes-and-data-integrity/11-working-memory-timestamp-fix.md)
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/compact-merger.ts:170:  pushSection(input.constitutional, 'constitutional', 'Constitutional Rules', 'memory');
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/compact-merger.ts:174:  pushSection(input.triggered, 'triggered', 'Triggered Memories', 'memory');
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/compact-merger.ts:203:              : 'memory',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:10:import { memoryBulkDeleteSchema } from '../schemas/tool-input-schemas';
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:34:    // Create memory_index table (required for joins)
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:36:      CREATE TABLE IF NOT EXISTS memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:48:    // Create memory_history table with legacy constraints to test migration
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:50:      CREATE TABLE IF NOT EXISTS memory_history (
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:52:        memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:59:        FOREIGN KEY (memory_id) REFERENCES memory_index(id)
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:64:    const insert = activeDb.prepare('INSERT INTO memory_index (id, title, spec_folder) VALUES (?, ?, ?)');
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:71:      INSERT INTO memory_history (id, memory_id, prev_value, new_value, event, actor)
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:111:      const row = activeDb.prepare('SELECT prev_value, new_value, actor, spec_folder FROM memory_history WHERE id = ?').get(id) as {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:127:      const row = activeDb.prepare('SELECT prev_value, new_value, actor FROM memory_history WHERE id = ?').get(id) as {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:157:      expect(entry.memory_id).toBeDefined();
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:166:      expect(anchors[0]?.memory_id).toBe(1);
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:217:    it('T508-05d: getHistoryStats includes delete events after memory row removal', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:221:      activeDb.prepare('INSERT INTO memory_index (id, title, spec_folder) VALUES (?, ?, ?)')
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:224:      activeDb.prepare('DELETE FROM memory_index WHERE id = ?').run(9);
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:229:        '/tmp/specs/001-test/memory/deleted-snapshot.md',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:231:        'mcp:memory_delete',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:233:      const row = activeDb.prepare('SELECT spec_folder FROM memory_history WHERE id = ?').get(id) as {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:243:    it('T508-05e: getHistoryStats fallback still counts rows with null spec_folder when memory exists', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:248:        INSERT INTO memory_history (id, memory_id, spec_folder, prev_value, new_value, event, actor)
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:265:    it('T508-05f: getHistoryStats counts legacy null-folder rows after memory deletion when earlier history captured the folder', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:269:      activeDb.prepare('INSERT INTO memory_index (id, title, spec_folder) VALUES (?, ?, ?)')
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:272:      activeDb.prepare('DELETE FROM memory_index WHERE id = ?').run(10);
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:275:        INSERT INTO memory_history (id, memory_id, spec_folder, prev_value, new_value, event, actor)
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:300:        "SELECT sql FROM sqlite_master WHERE type='table' AND name='memory_history'"
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:307:      const id = mod.recordHistory(1, 'ADD', null, 'reconsolidation test', 'mcp:memory_save');
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:314:      expect(entry!.actor).toBe('mcp:memory_save');
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:317:    it('T508-06c: mcp:memory_bulk_delete actor is accepted', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:318:      const id = mod.recordHistory(3, 'DELETE', 'old-path.md', null, 'mcp:memory_bulk_delete');
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:324:      expect(entry!.actor).toBe('mcp:memory_bulk_delete');
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:330:        SELECT id, memory_id, spec_folder, prev_value, new_value, event, actor
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:331:        FROM memory_history
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:335:        memory_id: number;
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:344:      expect(legacyRow!.memory_id).toBe(1);
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:353:      'mcp:memory_save',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:354:      'mcp:memory_update',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:355:      'mcp:memory_delete',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:356:      'mcp:memory_bulk_delete',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:359:      'mcp:memory_index_scan',
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:377:  describe('memory_bulk_delete olderThanDays boundaries', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:381:      const result = memoryBulkDeleteSchema.safeParse({ ...baseInput, olderThanDays: 0 });
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:386:      const result = memoryBulkDeleteSchema.safeParse({ ...baseInput, olderThanDays: -1 });
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:391:      const result = memoryBulkDeleteSchema.safeParse({ ...baseInput, olderThanDays: 1 });
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:396:      const result = memoryBulkDeleteSchema.safeParse({ ...baseInput, olderThanDays: 1.5 });
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:401:      const result = memoryBulkDeleteSchema.safeParse({ ...baseInput, olderThanDays: Number.NaN });
.opencode/skills/system-spec-kit/mcp_server/tests/history.vitest.ts:406:      const result = memoryBulkDeleteSchema.safeParse({ tier: 'normal', confirm: false });
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:6:Is the `/memory:*` command family too parallel to `/spec_kit:*`, creating a second operator surface that ordinary lifecycle work should not have to model directly?
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:9:Yes. The memory system is powerful, but too much of it is surfaced as a separate product instead of quietly supporting the main spec-kit lifecycle.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:12:I compared the external repo's lean context boundary model with the internal `memory:save`, `memory:search`, `memory:manage`, and `memory:learn` surfaces to see whether the current integration feels operator-centered or infrastructure-centered.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:16:- [SOURCE: .opencode/README.md:161-177] `system-spec-kit` exposes four `/memory:*` commands as a top-level peer surface to the eight `/spec_kit:*` commands.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:17:- [SOURCE: .opencode/commands/memory/search.md:53-92] `/memory:search` combines retrieval with epistemic baselines, causal graph operations, ablation, dashboards, and learning history.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:18:- [SOURCE: .opencode/commands/memory/manage.md:33-62] `/memory:manage` is a second large management product covering scan, cleanup, tier changes, delete flows, checkpoints, ingest jobs, and shared-memory rollout.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:19:- [SOURCE: .opencode/commands/memory/save.md:51-76] `/memory:save` has its own folder-resolution contract, script protocol, and validation rules.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:20:- [SOURCE: .opencode/commands/memory/learn.md:43-65] `/memory:learn` is a dedicated constitutional-memory manager with separate lifecycle rules.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:25:The memory platform is real infrastructure and deserves administrative tooling, but the operator experience is split between "do the work" and "manually understand the memory product." For normal feature work, save, resume, and lightweight search should feel like built-in affordances of the spec-kit lifecycle, not a separate command family the operator must consciously switch into. The external repo shows the opposite design instinct: context transfer is a workflow detail, not a top-level mode system. `system-spec-kit` can preserve its deep memory capabilities while demoting most of them from everyday operator consciousness.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:29:finding: `system-spec-kit` should merge routine memory actions into the primary spec-kit journey and reserve explicit `/memory:*` commands for power-user analysis and administration.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:32:- **Target file or module:** memory command architecture plus `/spec_kit:*` lifecycle integration
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:35:- **Prerequisites:** separate everyday memory actions from advanced diagnostics and admin workflows
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:40:- **Current system-spec-kit approach:** memory is both a support subsystem and a separate operator product.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:43:- **Why system-spec-kit's approach might still be correct:** advanced retrieval, causal analysis, and shared-memory management do need explicit tooling.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:45:- **If REFACTOR/PIVOT/SIMPLIFY — concrete proposal:** fold save/resume/basic-search into `/spec_kit` lifecycle commands and leave `/memory:manage` plus advanced analysis subcommands as expert tools.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:46:- **Blast radius of the change:** command docs, onboarding, wrappers, and memory UX guidance.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:47:- **Migration path:** keep `/memory:*` intact, but update docs and command wrappers so ordinary flows route through `/spec_kit:resume`, in-band save steps, and packet-aware context loading by default.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:51:- **Current system-spec-kit surface:** operators see a full memory product beside the spec-kit product, even when they only need save, resume, or lightweight recall.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:54:- **What system-spec-kit could DELETE to improve UX:** the expectation that ordinary feature work should explicitly traverse `/memory:*` commands.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:55:- **What system-spec-kit should ADD for better UX:** packet-aware inline memory actions inside planning, implementation, completion, and resume flows.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:59:I looked for evidence that normal lifecycle commands cannot reasonably own memory save/load behavior. Instead, both `implement` and `complete` already embed save-context steps, which suggests the separation is more historical than essential.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:62:- Which `/memory:*` actions are truly admin-only?
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:63:- Should `/memory:search` split into "recall" versus "analysis" surfaces?
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-022.md:64:- How should `/spec_kit:resume` absorb the most common memory workflows?
.opencode/skills/system-spec-kit/mcp_server/tests/mpab-aggregation.vitest.ts:2:// Multi-Parent Aggregated Bonus chunk-to-memory score aggregation
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/001-graph-channel-id-fix-g1.md:55:Verify causal edges exist via `memory_causal_stats()` → Check graph channel ID matches schema → Inspect channel activation flags
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:2:title: "Research: Memory Index TXT File Support [system-spec-kit/z_archive/014-memory-index-txt-support/research]"
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:3:description: "This research document captures technical investigation into adding .txt file indexing support to the Spec Kit Memory system. Focus areas: command folder structure, existing fil..."
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:6:  - "memory"
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:24:This research document captures technical investigation into adding `.txt` file indexing support to the Spec Kit Memory system. Focus areas: command folder structure, existing file discovery patterns, path validation logic, and command invocation safeguards.
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:41:- `.opencode/commands/memory/README.txt` contains memory command reference
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:44:**Significance**: These files are currently invisible to `memory_index_scan`, creating a documentation discovery gap.
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:56:// From memory-index.ts:247
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:62:// From memory-index.ts:289
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:70:**Source**: [grep output, memory-index.ts lines 247, 289]
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:76:**Context**: `memory-save.ts` validates paths before indexing to prevent arbitrary file system access.
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:80:// From memory-save.ts:1029
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:81:throw new Error('File must be a .md or .txt file in: specs/**/memory/, specs/**/ (spec docs), .opencode/skills/*/constitutional/, or README.md/README.txt paths');
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:86:**Source**: [grep output, memory-save.ts line 1029]
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:96:- Parser (`memory-parser.ts`) operates on file content, not extension
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:112:- Command invocation logic likely in separate handler (not examined in memory-index.ts)
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:116:**Source**: [Code inspection, memory-index.ts file operations]
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:126:// From memory-index.ts:440-451
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:137:**Source**: [Read tool output, memory-index.ts lines 440-451]
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:151:**Source**: [memory_context output, spec 126 reference]
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:198:### Discovery Function Changes (memory-index.ts)
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:201:- `findMemoryFiles()`: ~150-200 (specs/**/memory/)
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:223:### Validation Regex Update (memory-save.ts)
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:230:/(specs\/.*\/memory\/.*|\.opencode\/skill\/.*|\.opencode\/commands\/.*)\.md$/
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:233:/(specs\/.*\/memory\/.*|\.opencode\/skill\/.*|\.opencode\/commands\/.*)\.(md|txt)$/
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:280:- **memory-index.ts**: File discovery functions, incremental indexing
.opencode/specs/system-spec-kit/z_archive/014-memory-index-txt-support/research/research.md:281:- **memory-save.ts**: Path validation logic
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/22-context-preservation-metrics.md:3:description: "In-memory session quality scoring and event tracking that computes a QualityScore from recency, recovery, graph freshness, and continuity factors."
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/22-context-preservation-metrics.md:11:In-memory session quality scoring and event tracking that computes a QualityScore from recency, recovery, graph freshness, and continuity factors.
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/22-context-preservation-metrics.md:13:The context-metrics module maintains lightweight in-memory state for the current session: tool call count, memory recovery calls, code graph queries, spec folder transitions, and priming status. It computes a QualityScore (0.0-1.0) with 4 weighted factors: recency (time since last tool call, decays over time), recovery (1.0 if memory recovered this session), graphFreshness (1.0 fresh, 0.5 stale, 0.0 empty), and continuity (1.0 if spec folder stable, lower on transitions). Quality levels map to healthy (score >= 0.7), degraded (>= 0.4), or critical (< 0.4). No database persistence; state resets on server restart.
.opencode/skills/system-spec-kit/README.md:3:description: "Unified documentation and context preservation skill: spec folder workflows (Levels 1-3+), CORE + ADDENDUM v2.2 templates, validation scripts and Spec Kit Memory MCP with hybrid multi-channel retrieval."
.opencode/skills/system-spec-kit/README.md:7:  - "memory system"
.opencode/skills/system-spec-kit/README.md:11:  - "memory save"
.opencode/skills/system-spec-kit/README.md:17:> Documentation and memory for AI-assisted development. Every file change gets a spec folder. Every session gets persistent context.
.opencode/skills/system-spec-kit/README.md:29:  - [3.2 MEMORY SYSTEM](#32-memory-system)
.opencode/skills/system-spec-kit/README.md:54:Second, AI assistants have amnesia. Every conversation starts from a blank slate. You explain your architecture on Monday and by Wednesday the assistant has forgotten everything. Spec Kit fixes this with a **persistent memory system** -- an MCP server that stores decisions, context and project history in a local SQLite database so the next session can pick up where the last one left off, regardless of which AI model or tool you use.
.opencode/skills/system-spec-kit/README.md:56:Together, these two halves form a documentation-and-memory loop: spec folders capture what happened, the indexed-continuity store makes it searchable and the next session benefits from everything that came before.
.opencode/skills/system-spec-kit/README.md:58:> Note: When this skill says "memory," it means our local indexed-continuity store — the SQLite-backed spec-doc record index that ships with this skill. It is **not** Anthropic Claude Memory (the managed product surfaced in claude.ai) and it is **not** the MCP reference `memory` server (the upstream community example). Identifiers (`memory_*` MCP tools, `/memory:*` slash commands, `memory_*` SQL tables, `memory-*.ts` handlers, `references/memory/`, `MEMORY_*` constants, `_memory:` frontmatter) are frozen by REQ-001; the disambiguation lives in operator-facing prose only.
.opencode/skills/system-spec-kit/README.md:65:| **Commands**                | 13                   | 9 spec_kit + 4 memory                                                                           |
.opencode/skills/system-spec-kit/README.md:73:| **Script Modules**          | 12 spec + 10 memory  | TypeScript, JavaScript and Bash                                                                 |
.opencode/skills/system-spec-kit/README.md:82:| **Context across sessions** | Copy-paste from notes          | Stateless              | Persistent semantic memory with session recovery          |
.opencode/skills/system-spec-kit/README.md:86:| **Access control**          | Filesystem permissions         | None                   | Shared memory with deny-by-default membership             |
.opencode/skills/system-spec-kit/README.md:94:| **Spec Kit Memory MCP**       | 51-tool MCP server providing persistent semantic memory, graph intelligence, graph-first routing, and session orchestration across sessions, models and tools                                                 |
.opencode/skills/system-spec-kit/README.md:95:| **Startup / Recovery Surfaces** | `/spec_kit:resume` is the canonical operator-facing recovery surface. Under the hood, startup and recovery rebuild active context from `handover.md`, then `_memory.continuity`, then canonical spec docs |
.opencode/skills/system-spec-kit/README.md:98:| **Session Continuity**        | `generate-context.js` updates canonical continuity surfaces and refreshes packet metadata on every `/memory:save` invocation so `/spec_kit:resume` can rebuild the next session from packet-local sources     |
.opencode/skills/system-spec-kit/README.md:173:The script sets up the folder, copies the right templates for the chosen level, initializes `description.json`, and prepares the packet docs plus `scratch/` workspace. Continuity no longer writes to `[spec]/memory/*.md`; use `/memory:save` to route updates into canonical packet docs such as `implementation-summary.md`, `decision-record.md`, and `handover.md`.
.opencode/skills/system-spec-kit/README.md:181:node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js \
.opencode/skills/system-spec-kit/README.md:191:/memory:save 042-my-feature
.opencode/skills/system-spec-kit/README.md:194:Every canonical save now refreshes `description.json.lastUpdated` and `graph-metadata.json.derived.*`, so the default `/memory:save` path is no longer a metadata no-op.
.opencode/skills/system-spec-kit/README.md:204:The system rebuilds continuation context in a fixed order: `handover.md` first, then `_memory.continuity`, then the packet's canonical spec docs. It presents the current state, prior decisions, touched files, and next steps before you start.
.opencode/skills/system-spec-kit/README.md:211:/memory:search "how did we decide on the auth architecture?"
.opencode/skills/system-spec-kit/README.md:228:Check that Spec Kit Memory tools are available:
.opencode/skills/system-spec-kit/README.md:232:  "tool": "memory_health",
.opencode/skills/system-spec-kit/README.md:281:├── description.json             # Spec identity and memory tracking metadata
.opencode/skills/system-spec-kit/README.md:288:├── handover.md                  # Operator-facing session handoff for /spec_kit:resume
.opencode/skills/system-spec-kit/README.md:294:`generate-context.js` updates the packet's continuity state for `/spec_kit:resume`, refreshes `description.json.lastUpdated`, and rewrites `graph-metadata.json` derived fields on every canonical save; recovery then rebuilds context from `handover.md`, `_memory.continuity`, and the packet docs.
.opencode/skills/system-spec-kit/README.md:332:The `validate.sh` script runs 20+ rules against a spec folder and reports what passes and what needs fixing. Rules check for required files, template compliance, placeholder detection, anchor markers and cross-reference consistency. The new `PHASE_PARENT_CONTENT` rule (severity: warn) scans phase-parent `spec.md` for forbidden migration-history tokens (consolidation/merge/rename narratives) and is code-fence + HTML-comment aware. In strict flows, the validation surface includes `_memory.continuity` freshness checks plus strict `EVIDENCE` marker linting, with the bracket-depth audit script available for repair sweeps before rerunning validation.
.opencode/skills/system-spec-kit/README.md:348:The indexed-continuity store lives in an MCP server that gives AI assistants persistent memory across sessions, models and tools. It stores context in a local SQLite database and retrieves exactly what is relevant when a new session starts.
.opencode/skills/system-spec-kit/README.md:411:`memory_search` results now carry an additive `trustBadges` payload per `MemoryResultEnvelope`. The badges read existing causal-edge columns at response time, so callers can judge whether a causal claim looks fresh and well-supported without changing storage.
.opencode/skills/system-spec-kit/README.md:443:- **Synthetic ground truth corpus** -- 110 test questions with known correct answers for benchmarking, keyed to live parent-memory IDs; rerun `scripts/evals/map-ground-truth-ids.ts` after DB rebuilds or imports before trusting ablation or reporting comparisons
.opencode/skills/system-spec-kit/README.md:444:- **Reporting dashboard** -- performance trends across work periods and search channels, sourced from parent-memory-normalized eval rows even when retrieval hits came from chunks
.opencode/skills/system-spec-kit/README.md:452:Spec Kit exposes 13 top-level workflow commands: 9 `spec_kit` + 4 `memory` operations. Repository-wide command entry points total 22 when combined with 6 `create` commands, 2 `improve` commands, and 1 `agent_router` utility. Each command opens access to a specific set of tools.
.opencode/skills/system-spec-kit/README.md:481:| `/memory:save`   | 4          | Update packet continuity surfaces and supporting generated context artifacts with semantic indexing                                      |
.opencode/skills/system-spec-kit/README.md:482:| `/memory:search` | 13         | Search, retrieve and analyze knowledge. Auto-detects task intent from 7 types                                                           |
.opencode/skills/system-spec-kit/README.md:483:| `/memory:manage` | 20         | Database maintenance and lifecycle operations: stats, scan, cleanup, bulk-delete, checkpoints, and ingest |
.opencode/skills/system-spec-kit/README.md:484:| `/memory:learn`  | 6          | Constitutional memory manager: create, list, edit, remove always-surface rules                                                          |
.opencode/skills/system-spec-kit/README.md:486:Session recovery lives in `/spec_kit:resume`, which rebuilds packet context in this order: `handover.md`, then `_memory.continuity`, then canonical spec docs before deeper memory retrieval is needed.
.opencode/skills/system-spec-kit/README.md:488:Some commands own their tools (they are the primary home) while others borrow tools from `/memory:search` or `/memory:manage`. A borrowed tool works the same way -- it is just administered somewhere else.
.opencode/skills/system-spec-kit/README.md:490:**Command source files**: `.opencode/commands/memory/`
.opencode/skills/system-spec-kit/README.md:546:| `handover.md`                 | Session continuity template for handing off to the next AI      |
.opencode/skills/system-spec-kit/README.md:581:The `scripts/memory/` directory contains 10 scripts for the indexed-continuity store:
.opencode/skills/system-spec-kit/README.md:585:| `generate-context.ts`         | Source for the runtime memory-save entrypoint `scripts/dist/memory/generate-context.js` |
.opencode/skills/system-spec-kit/README.md:592:| `validate-memory-quality.ts`  | Run quality checks on stored spec-doc record content                 |
.opencode/skills/system-spec-kit/README.md:594:| `fix-memory-h1.mjs`           | Fix heading levels in older generated context artifacts     |
.opencode/skills/system-spec-kit/README.md:596:TypeScript sources compile to `scripts/dist/`. The runtime entry point for memory saves is `scripts/dist/memory/generate-context.js`.
.opencode/skills/system-spec-kit/README.md:604:| `continuity-freshness.ts`     | Warn when `_memory.continuity.last_updated_at` lags `graph-metadata.json` |
.opencode/skills/system-spec-kit/README.md:630:│   ├── handover.md             # Session continuity template
.opencode/skills/system-spec-kit/README.md:635:│   ├── memory/                 # Memory system scripts (10 scripts)
.opencode/skills/system-spec-kit/README.md:641:├── mcp_server/                 # Spec Kit Memory MCP (TypeScript)
.opencode/skills/system-spec-kit/README.md:672:| `scripts/dist/memory/generate-context.js`                                    | Primary workflow for updating packet continuity state from structured JSON                            |
.opencode/skills/system-spec-kit/README.md:681:The **memory system** is the librarian. When a session ends, `generate-context.js` updates the packet's canonical continuity surfaces so the next session can recover from packet-local sources first. The MCP server indexes those packet docs into vector, FTS5, and BM25 surfaces, while graph and degree signals are computed at retrieval time. When a new session starts, `/spec_kit:resume` rebuilds context from `handover.md`, `_memory.continuity`, and the packet docs. If you need deeper retrieval after that, `session_bootstrap()` bundles resume context, health, and structural readiness into one follow-up recovery call before broader `memory_context` work begins.
.opencode/skills/system-spec-kit/README.md:683:The **commands** are the doors into the system. Each command opens access to the tools it needs. `/spec_kit:plan --intake-only` owns the standalone intake surface, `/spec_kit:plan` and `/spec_kit:complete` reuse the shared intake contract from [intake-contract.md](./references/intake-contract.md) when the Step 0 local `folder_state` requires delegation, and downstream callers should consume the returned `start_state` as the canonical intake enum. `/spec_kit:deep-research` anchors research to `spec.md` through [spec_check_protocol.md](../sk-deep-research/references/spec_check_protocol.md). `/memory:save` updates packet continuity. `/spec_kit:resume` recovers or continues a previous session.
.opencode/skills/system-spec-kit/README.md:699:  └─► generate-context.js updates canonical continuity surfaces
.opencode/skills/system-spec-kit/README.md:704:  └─► /spec_kit:resume reads handover.md -> _memory.continuity -> packet docs
.opencode/skills/system-spec-kit/README.md:705:       └─► session_bootstrap() or memory_context() deepen retrieval when needed
.opencode/skills/system-spec-kit/README.md:741:For generic MCP clients that use `mcpServers` syntax (for example Claude Desktop), add the Spec Kit Memory server like this:
.opencode/skills/system-spec-kit/README.md:746:    "spec-kit-memory": {
.opencode/skills/system-spec-kit/README.md:827:# Using the generate-context.js script directly
.opencode/skills/system-spec-kit/README.md:828:node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js \
.opencode/skills/system-spec-kit/README.md:836:/memory:save 043-user-profile-update
.opencode/skills/system-spec-kit/README.md:887:| Save session progress         | `/memory:save [folder]`             | Before ending any session         |
.opencode/skills/system-spec-kit/README.md:889:| Check prior decisions         | `/memory:search "query"`            | Starting a related task           |
.opencode/skills/system-spec-kit/README.md:891:| Create always-surface rule    | `/memory:learn`                     | Team standards, workflow rules    |
.opencode/skills/system-spec-kit/README.md:903:**What you see**: Calling `memory_match_triggers()` returns an error or the tool is not recognized.
.opencode/skills/system-spec-kit/README.md:917:Verify `spec-kit-memory` appears in your `opencode.json` or equivalent MCP config file (see [Configuration](#5-configuration)).
.opencode/skills/system-spec-kit/README.md:923:**What you see**: `generate-context.js` runs but the output file is empty or the script exits with an error.
.opencode/skills/system-spec-kit/README.md:934:node scripts/dist/memory/generate-context.js \
.opencode/skills/system-spec-kit/README.md:947:**Fix**: Add more detail to the session summary. Use `dryRun: true` in the `memory_save` tool call to preview gate results without saving. Check the post-save quality review output for specific issues.
.opencode/skills/system-spec-kit/README.md:976:**What you see**: `memory_context()` returns irrelevant results or misses content you know exists.
.opencode/skills/system-spec-kit/README.md:984:# memory_index_scan({ specFolder: "NNN-feature" })
.opencode/skills/system-spec-kit/README.md:987:# memory_health({ reportMode: "full" })
.opencode/skills/system-spec-kit/README.md:990:# memory_context({ input: "find_decision: why did we choose JWT?", mode: "deep" })
.opencode/skills/system-spec-kit/README.md:997:| `generate-context.js` not found  | Run `npm run build` in `system-spec-kit/`                                       |
.opencode/skills/system-spec-kit/README.md:999:| Memory context seems wrong       | Call `memory_stats({})` to check index counts                                   |
.opencode/skills/system-spec-kit/README.md:1000:| Session context lost after crash | Use `/spec_kit:resume` to rebuild from `handover.md`, `_memory.continuity`, and packet docs |
.opencode/skills/system-spec-kit/README.md:1002:| Stale results after save         | Call `memory_index_scan({ specFolder: "..." })` to force re-index               |
.opencode/skills/system-spec-kit/README.md:1019:# View memory system health
.opencode/skills/system-spec-kit/README.md:1020:# memory_health({ reportMode: "full" })
.opencode/skills/system-spec-kit/README.md:1049:**Q: How do spec folders and memory work together?**
.opencode/skills/system-spec-kit/README.md:1051:A: Spec folders capture what happened in structured documentation. `generate-context.js` updates the packet's canonical continuity surfaces, and `/spec_kit:resume` rebuilds the next session from `handover.md`, `_memory.continuity`, and the packet docs. The MCP server indexes those packet-local sources so deeper retrieval can still use `session_bootstrap()`, `memory_context()`, or `memory_match_triggers()` after the canonical resume step. One side captures, the recovery surfaces retrieve.
.opencode/skills/system-spec-kit/README.md:1055:**Q: Can I use memory without spec folders?**
.opencode/skills/system-spec-kit/README.md:1057:A: The indexed-continuity store can index any markdown file, beyond spec folder contents. But for implementation work the canonical continuity path is the spec folder itself: `generate-context.js` updates packet-local continuity surfaces and `/spec_kit:resume` recovers from those packet sources first. You can still save standalone memories with `memory_save`, but Gate 3 will still ask about a spec folder for file modifications.
.opencode/skills/system-spec-kit/README.md:1075:A: Constitutional memories are rules that always surface in every retrieval, regardless of recency or score. They carry a 3.0x boost and never decay. Use `/memory:learn` to create them. Typical use cases: team coding standards, mandatory workflow steps, known failure modes. They work like pinned messages in a chat -- always visible, no matter how far you scroll.
.opencode/skills/system-spec-kit/README.md:1106:| [`references/memory/memory_system.md`](./references/memory/memory_system.md)                     | Detailed memory system reference                                                                     |
.opencode/skills/system-spec-kit/README.md:1131:| `.opencode/commands/memory/`   | Memory command definitions (4 top-level commands plus subcommand namespaces) |
.opencode/skills/system-spec-kit/README.md:1138:| [FSRS algorithm](https://github.com/open-spaced-repetition/fsrs4anki) | Free Spaced Repetition Scheduler (memory decay model) |
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:27:  const db = new Database(':memory:');
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:29:    CREATE TABLE memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:46:      document_type TEXT DEFAULT 'memory'
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:48:    CREATE TABLE active_memory_projection (
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:50:      root_memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:51:      active_memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:71:    INSERT INTO memory_index (title, trigger_phrases, spec_folder, parent_id, importance_tier, is_archived)
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:86:      INSERT INTO active_memory_projection (logical_key, root_memory_id, active_memory_id, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:150:  it('returns 0 for isolated memory (no siblings)', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:266:      title: 'test memory',
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:274:  it('returns 0 for non-existent memory', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/interference.vitest.ts:333:  it('returns 0 for non-existent memory IDs', () => {
.opencode/skills/system-spec-kit/scripts/utils/input-normalizer.ts:1180:  // P2-004: Array-length caps to prevent memory pressure from oversized inputs
.opencode/skills/system-spec-kit/scripts/utils/input-normalizer.ts:1296:// Words like 'testing', 'playbook', 'memory', 'session' are meaningful when from a path and should NOT be stopped.
.opencode/skills/system-spec-kit/scripts/utils/input-normalizer.ts:1419:  // OpenCode session) from polluting the memory file.
.opencode/skills/system-spec-kit/scripts/utils/input-normalizer.ts:1514:  // Content from leaking into unrelated memory files. When no keyword match
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/08-performance-improvements.md:21:**Quick wins:** `Math.max(...spread)` replaced with `reduce`-based max in `tfidf-summarizer.ts` (prevents RangeError on large arrays). Unbounded query in `memory-summaries.ts` gained a `LIMIT` clause. O(n) full scan in `mutation-ledger.ts` replaced with SQL `COUNT(*)` query using `json_extract`.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/08-performance-improvements.md:41:| `mcp_server/lib/search/memory-summaries.ts` | Lib | Summary query LIMIT and summary-channel operations |
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/08-performance-improvements.md:52:| `mcp_server/tests/memory-summaries.vitest.ts` | TF-IDF summary generation and summary query behavior |
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/ops-hardening.ts:31:    surface: 'memory_health';
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/ops-hardening.ts:88:      surface: 'memory_health',
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/ops-hardening.ts:100:      recommendedAction: 'Use memory_health({ autoRepair: true, confirmed: true }) for bounded repair workflows and transparent partial-success reporting.',
.opencode/skills/system-spec-kit/mcp_server/tests/intent-paraphrase-stability.vitest.ts:173:      'explain memory_context routing',
.opencode/skills/system-spec-kit/mcp_server/tests/intent-paraphrase-stability.vitest.ts:174:      'Please describe how memory_context routing works.',
.opencode/skills/system-spec-kit/mcp_server/tests/intent-paraphrase-stability.vitest.ts:175:      'What is the memory_context routing flow?',
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/002-chunk-collapse-deduplication-g3.md:20:- Prompt: `As a data-integrity validation operator, validate Chunk collapse deduplication (G3) against memory_search(includeContent:false). Verify no duplicate memory IDs in results; collapsed chunks yield unique parents only. Return a concise pass/fail verdict with the main reason and cited evidence.`
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/002-chunk-collapse-deduplication-g3.md:21:- Expected signals: No duplicate memory IDs in results; collapsed chunks yield unique parents only
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/002-chunk-collapse-deduplication-g3.md:31:As a data-integrity validation operator, confirm dedup in default mode against memory_search(includeContent:false). Verify no duplicate memory IDs in results; collapsed chunks yield unique parents only. Return a concise pass/fail verdict with the main reason and cited evidence.
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/002-chunk-collapse-deduplication-g3.md:37:2. `memory_search(includeContent:false)`
.opencode/skills/system-spec-kit/manual_testing_playbook/08--bug-fixes-and-data-integrity/002-chunk-collapse-deduplication-g3.md:42:No duplicate memory IDs in results; collapsed chunks yield unique parents only
.opencode/skills/system-spec-kit/mcp_server/code_graph/lib/code-graph-db.ts:5:// Uses separate code-graph.sqlite alongside the memory index DB.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/01-4-stage-pipeline-refactor.md:21:Stage 1 (Candidate Generation) executes search channels based on query type: multi-concept, deep mode with query expansion, embedding expansion with R15 mutual exclusion, or standard hybrid search. The R8 memory summary channel runs in parallel when the scale gate is met (>5K memories), merging and deduplicating results by memory ID. Summary candidates now pass through the same `minQualityScore` filter as other candidates (Sprint 8 fix). Constitutional memory injection and quality/tier filtering run at the end of Stage 1.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/01-4-stage-pipeline-refactor.md:31:Stage 4 (Filter and Annotate) enforces the "no score changes" invariant via dual enforcement: compile-time `Stage4ReadonlyRow` readonly fields plus runtime `verifyScoreInvariant()` assertion checking all six score fields. Within this invariant, it applies memory state filtering, TRM evidence gap detection and annotation metadata.
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:55:    const original = '/path/to/memory/file.md';
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:58:    expect(pending).toBe('/path/to/memory/file_pending.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:70:    const content = '# Test Content\n\nThis is a test memory file.';
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:83:    const filePath = path.join(TEST_DIR!, 'memory', 'success.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:104:    const filePath = path.join(TEST_DIR!, 'memory', 'rollback.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:122:    const filePath = path.join(TEST_DIR!, 'memory', 'pending.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:138:    const memoryDir = path.join(TEST_DIR!, 'specs', '001-test', 'memory');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:139:    fs.mkdirSync(memoryDir, { recursive: true });
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:141:    fs.writeFileSync(path.join(memoryDir, 'normal.md'), 'Normal file');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:142:    fs.writeFileSync(path.join(memoryDir, 'file1_pending.md'), 'Pending file 1');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:143:    fs.writeFileSync(path.join(memoryDir, 'file2_pending.md'), 'Pending file 2');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:153:    const memoryDir = path.join(TEST_DIR!, 'specs', '002-test', 'memory');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:154:    fs.mkdirSync(memoryDir, { recursive: true });
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:156:    const originalPath = path.join(memoryDir, 'recovered.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:174:    const memoryDir = path.join(TEST_DIR!, 'specs', '003-test', 'memory');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:175:    fs.mkdirSync(memoryDir, { recursive: true });
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:177:    fs.writeFileSync(path.join(memoryDir, 'file1_pending.md'), 'Content 1');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:178:    fs.writeFileSync(path.join(memoryDir, 'file2_pending.md'), 'Content 2');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:179:    fs.writeFileSync(path.join(memoryDir, 'file3_pending.md'), 'Content 3');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:186:    expect(fs.existsSync(path.join(memoryDir, 'file1.md'))).toBe(true);
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:187:    expect(fs.existsSync(path.join(memoryDir, 'file2.md'))).toBe(true);
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:188:    expect(fs.existsSync(path.join(memoryDir, 'file3.md'))).toBe(true);
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:261:    const filePath = path.join(TEST_DIR!, 'memory', 'atomic-test.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:300:    const filePath = path.join(TEST_DIR!, 'memory', 'rollback-test.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:321:    const filePath = '/test/memory/file.md';
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:334:    const memoryDir = path.join(TEST_DIR!, 'specs', 'crash-test', 'memory');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:335:    fs.mkdirSync(memoryDir, { recursive: true });
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:337:    const originalPath = path.join(memoryDir, 'recovered-startup.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:359:      path.join(TEST_DIR!, 'specs', 'project-a', 'memory'),
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:360:      path.join(TEST_DIR!, 'specs', 'project-b', 'memory'),
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:370:    fs.writeFileSync(path.join(dirs[3], 'memory1_pending.md'), 'Project A pending');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:371:    fs.writeFileSync(path.join(dirs[4], 'memory2_pending.md'), 'Project B pending');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:385:    expect(fileNames).toContain('memory1_pending.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:386:    expect(fileNames).toContain('memory2_pending.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:391:    const memoryDir = path.join(TEST_DIR!, 'specs', 'bulk-test', 'memory');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:392:    fs.mkdirSync(memoryDir, { recursive: true });
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:396:      const fileName = `memory${String(i).padStart(3, '0')}_pending.md`;
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:397:      fs.writeFileSync(path.join(memoryDir, fileName), `# Memory ${i}\n\nContent for file ${i}.`);
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:414:    const memoryDir = path.join(TEST_DIR!, 'specs', 'reindex-test', 'memory');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:415:    fs.mkdirSync(memoryDir, { recursive: true });
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:417:    const originalPath = path.join(memoryDir, 'reindex-memory.md');
.opencode/skills/system-spec-kit/mcp_server/tests/transaction-manager.vitest.ts:447:      const filePath = path.join(TEST_DIR!, 'memory', `error${i}.md`);
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:2:title: "Feature Specification: Generate Context Subfolder [system-spec-kit/z_archive/006-generate-context-subfolder/spec]"
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:27:| **Branch** | `006-generate-context-subfolder` |
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:36:This archived folder captures work that added subfolder support to generate-context behavior. The older archive shape no longer matched the active template contract, which caused strict validation errors.
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:39:Keep a concise archival summary of the generate-context subfolder support work in a format that passes the current validator.
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:48:- Preserve the archived topic and folder identity for generate-context subfolder support.
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:54:- Performing new generate-context changes outside this archived folder.
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:75:| REQ-001 | The archive must clearly state that the folder documents generate-context subfolder support. | A maintainer can identify the archived topic from spec.md alone. |
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/spec.md:85:- **Given** a maintainer opens this archived folder, **when** they read the core documents, **then** they can understand that the archived work added generate-context subfolder support.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-002.md:12:I traced where cross-attempt state is saved in the external workflow and compared that with `system-spec-kit`'s current research-state reducer and memory-save boundaries.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-002.md:20:- [SOURCE: .opencode/commands/spec_kit/assets/spec_kit_implement_auto.yaml:501-518] Durable memory is reserved for post-work session preservation through `generate-context.js`, not for noisy per-attempt telemetry.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-002.md:23:The external design is not merely "small context is better." It is a deliberate split between ephemeral attempt detail and durable inter-attempt guidance. That maps cleanly onto `system-spec-kit`'s existing distinction between packet artifacts and memory saves. The important portability lesson is not to persist every attempt transcript, but to define one concise reviewer-authored artifact that the next attempt can trust. This also avoids contaminating the durable memory system with half-right implementation detours.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-002.md:33:- **Prerequisites:** define a task-local storage convention, ideally under a retry subfolder in `scratch/` or `research/`, and explicitly exclude it from durable memory save flows
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:44:  return (_memory: NewMemoryData) => returnId;
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:47:/** Create a base valid new memory object */
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:51:    content: 'This is the content of the new memory that is being saved for testing purposes.',
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:53:    filePath: '/test/memory.md',
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:55:    triggerPhrases: ['test', 'memory'],
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:62:/** Create a base existing similar memory */
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:68:    content_text: 'This is the existing memory content that was previously stored.',
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:79:    FROM memory_index m
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:80:    JOIN active_memory_projection p ON p.active_memory_id = m.id
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:132:    testDb = new Database(':memory:');
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:134:    // Create memory_index table matching production schema
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:136:      CREATE TABLE IF NOT EXISTS memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:194:      CREATE TABLE IF NOT EXISTS memory_lineage (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:195:        memory_id INTEGER PRIMARY KEY,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:198:        root_memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:199:        predecessor_memory_id INTEGER,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:200:        superseded_by_memory_id INTEGER,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:211:      CREATE TABLE IF NOT EXISTS active_memory_projection (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:213:        root_memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:214:        active_memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:230:    testDb.exec('DELETE FROM memory_index');
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:233:    testDb.exec('DELETE FROM memory_lineage');
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:234:    testDb.exec('DELETE FROM active_memory_projection');
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:432:      // Seed existing memory in DB
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:434:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:455:      const oldRow = testDb.prepare('SELECT is_archived FROM memory_index WHERE id = 100').get() as {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:462:        'SELECT content_text, importance_weight FROM memory_index WHERE id > 100 ORDER BY id DESC LIMIT 1'
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:474:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:493:      const oldRow = testDb.prepare('SELECT is_archived FROM memory_index WHERE id = 101').get() as {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:499:        'SELECT importance_weight FROM memory_index WHERE id = ?'
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:508:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:530:        'SELECT is_archived FROM memory_index WHERE id = 102'
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:557:        INSERT INTO memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:590:        SELECT root_memory_id, active_memory_id
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:591:        FROM active_memory_projection
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:594:        root_memory_id: number;
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:595:        active_memory_id: number;
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:597:      expect(projectionRow.root_memory_id).toBe(103);
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:598:      expect(projectionRow.active_memory_id).toBe(result.newMemoryId);
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:606:        FROM memory_index
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:612:        SELECT predecessor_memory_id, root_memory_id
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:613:        FROM memory_lineage
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:614:        WHERE memory_id = ?
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:616:        predecessor_memory_id: number | null;
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:617:        root_memory_id: number;
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:619:      expect(newLineageRow.predecessor_memory_id).toBe(103);
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:620:      expect(newLineageRow.root_memory_id).toBe(103);
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:645:        INSERT INTO memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:678:        `BM25 repair failed after reconsolidation merge for memory ${result.newMemoryId}: repair merge BM25 failure`,
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:683:        FROM memory_index
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:691:        INSERT INTO memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:713:          UPDATE memory_index
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:735:        FROM memory_index
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:745:        INSERT INTO memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:779:        FROM memory_index
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:791:    it('CP1: Marks existing memory deprecated and adds supersedes edge', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:793:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:817:      // Verify superseded memory is preserved and demoted.
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:818:      const row = testDb.prepare('SELECT title, content_text, importance_tier FROM memory_index WHERE id = 200').get() as {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:836:      addColumnIfMissing(testDb, 'memory_index', 'anchor_id TEXT');
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:841:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, anchor_id, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:857:    it('CP3: Conflict with no new memory ID uses existing ID and avoids self-edge', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:859:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:876:      addColumnIfMissing(testDb, 'memory_index', 'tenant_id TEXT');
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:878:        INSERT INTO memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:907:        testDb.prepare('SELECT importance_tier FROM memory_index WHERE id = 230').get(),
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:914:        INSERT INTO memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:948:        testDb.prepare('SELECT title, content_text, content_hash FROM memory_index WHERE id = 240').get(),
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:963:    it('CMP1: Stores new memory unchanged', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:984:    it('CMP3: Calls storeMemory with the new memory', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1018:      // Seed existing memory
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1020:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1050:        'SELECT is_archived FROM memory_index WHERE id = 400'
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1057:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1135:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1170:        'SELECT is_archived FROM memory_index WHERE id = 450'
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1245:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1252:          INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1282:      const orphanRow = testDb.prepare('SELECT id FROM memory_index WHERE id = ?').get(orphanId);
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1289:        INSERT INTO memory_index (id, spec_folder, file_path, title, content_text, importance_weight, created_at, updated_at)
.opencode/skills/system-spec-kit/mcp_server/tests/reconsolidation.vitest.ts:1307:        'SELECT content_text FROM memory_index WHERE id = ?'
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:3:description: "This scenario validates Session transition trace contract for `142`. It focuses on Verify `memory_context` emits trace-only session transitions with no non-trace leakage."
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:11:This scenario validates Session transition trace contract for `142`. It focuses on Verify `memory_context` emits trace-only session transitions with no non-trace leakage.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:19:- Objective: Verify `memory_context` emits trace-only session transitions with no non-trace leakage
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:20:- Prompt: `As a retrieval validation operator, validate Session transition trace contract against memory_context({ input: "resume previous work on rollout hardening", mode: "resume", sessionId: "markovian-142", includeTrace: true }). Verify memory_context emits trace-only session transitions with no non-trace leakage. Return a concise pass/fail verdict with the main reason and cited evidence.`
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:31:As a retrieval validation operator, verify memory_context emits trace-only session transitions with no non-trace leakage against memory_context({ input: "resume previous work on rollout hardening", mode: "resume", sessionId: "markovian-142", includeTrace: true }). Verify trace-enabled responses include spec-shaped sessionTransition; non-trace responses omit it entirely; no top-level metadata leak appears when trace is disabled. Return a concise pass/fail verdict with the main reason and cited evidence.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:36:1. `memory_context({ input: "resume previous work on rollout hardening", mode: "resume", sessionId: "markovian-142", includeTrace: true })`
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:47:Two `memory_context` outputs with and without `includeTrace` + field-level comparison
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:56:Inspect `handlers/memory-context.ts`, `handlers/memory-search.ts`, and `lib/search/session-transition.ts` if fields leak or ordering drifts
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/142-session-transition-trace-contract.md:61:- Feature catalog: [01--retrieval/01-unified-context-retrieval-memorycontext.md](../../feature_catalog/01--retrieval/01-unified-context-retrieval-memorycontext.md)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:4:- **Why it matters for us**: Public genuinely lacks this architecture today. It is the clearest long-term differentiator from ordinary memory search, but it must be built with mandatory citations, authority tiers, correction review, and fact-versus-verbatim separation from day one.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:35:- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:36:- [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:50:1. Implement the smallest viable preservation experiment in Public: trigger one save checkpoint from the existing `experimental.session.compacting` surface, write only JSON-primary structured context through [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js), and add a “recently saved” dedupe guard.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:51:2. Add a 3-5 line memory-behavior hint block to startup/bootstrap output, not a second protocol manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:52:3. Prototype quote-carrying evidence retention inside saved memory artifacts so high-stakes decisions keep verbatim support without moving to full transcript mining.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:53:4. Treat layered wake-up as a presentation experiment on top of existing `session_bootstrap` and `memory_search`, not as a new storage model.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:55:6. Keep wings/halls/rooms, AAAK-first wake-up, and diary-centric memory out of the near-term roadmap.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:62:You are a research specialist in verbatim AI memory systems, ChromaDB-based semantic retrieval, navigable memory taxonomies, wake-up context layering, MCP tool design, hook-driven persistence, and local temporal knowledge graphs. Work like a systems analyst who can separate README positioning from verified Python mechanics, trace how MemPalace composes mining, storage, retrieval, hooks, and protocol guidance, and translate those choices into practical improvements for `Code_Environment/Public`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:66:Research MemPalace's raw-verbatim memory architecture, palace taxonomy, wake-up stack, MCP protocol/tooling, hook-driven save flow, and temporal knowledge-graph patterns to identify practical, evidence-backed improvements for `Code_Environment/Public`, especially around session continuity, compaction survival, memory hygiene, and agent-facing recall ergonomics. Determine which MemPalace ideas should be `adopt now`, `prototype later`, or `reject`. Keep the analysis honest about what is source-confirmed, what is README-documented, and what is benchmark-claim territory.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:72:MemPalace is a local Python memory system centered on a strong design claim: keep raw conversation and project text instead of extracting only summarized facts, then make that verbatim corpus searchable and navigable. The external repo exposes a CLI, an MCP server, hook scripts, a ChromaDB-backed drawer store, a wake-up layering system, and a separate SQLite temporal knowledge graph. Its storage model uses palace terminology: wings for people/projects/topics, halls for shared memory categories, rooms for named ideas, closets for compact summaries, and drawers for original verbatim content.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:76:The repo appears to support three ingestion shapes into one shared memory backend: project mining, conversation mining, and a general heuristic extraction mode. Retrieval then spans direct semantic search, wake-up text generation across L0-L3 layers, palace graph traversal via shared room metadata, and MCP tooling that teaches an operational memory protocol to the agent through the status response itself. Hook scripts add another layer: instead of a memory system that only responds to explicit search/save calls, MemPalace also tries to shape the timing of memory writes at stop and pre-compact boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:82:| 001 | Engram | MCP memory server (Go, SQLite+FTS5) | 005 (memory server), 004 (session continuity) | Focus tool profiles, session lifecycle, topic keys |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:84:| 003 | Modus Memory | FSRS spaced repetition + BM25 | 005 (local memory) | Focus FSRS decay, BM25, librarian expansion, cross-references |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:86:| 005 | MemPalace | Raw verbatim storage + palace taxonomy + hooks + temporal KG | 001 (MCP memory), 004 (compaction/helping memory survive), 003 (local memory) | Focus raw-no-extraction posture, wake-up layers, hooks, palace structure, temporal KG |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:90:`Code_Environment/Public` already has Spec Kit Memory with hybrid retrieval, `memory_search`, `memory_context`, `memory_match_triggers`, memory-save flows through `generate-context.js`, session/bootstrap handling in the memory MCP server, and compaction-oriented structural transport via `.opencode/plugins/spec-kit-compact-code-graph.js`. It also already has semantic code search via CocoIndex and structured graph context via Compact Code Graph.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:92:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:107:12. Compare MemPalace directly against current `Code_Environment/Public` code: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`, `.opencode/skills/system-spec-kit/mcp_server/context-server.ts`, `.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js`, and `.opencode/plugins/spec-kit-compact-code-graph.js`. Be explicit about what Public already covers better and what MemPalace still contributes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:114:    Research the external repository at /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external and identify concrete improvements for Code_Environment/Public, especially around raw verbatim memory storage, palace taxonomy (wings/halls/rooms), wake-up context layering, MCP protocol/tool design, hook-driven save flows, and temporal knowledge-graph patterns.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:116:15. Save all outputs inside `research/`, with `research/research.md` as the canonical report. Every meaningful finding must cite exact file paths, say whether the evidence is `source-confirmed`, `README-documented`, `benchmark-documented`, or mixed, explain why it matters for `Code_Environment/Public`, classify the recommendation as `adopt now`, `prototype later`, or `reject`, identify the affected subsystem, and note migration or truthfulness risk. When research is complete, update `checklist.md`, create `implementation-summary.md`, and save memory with:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:118:    cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js "/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace"
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:123:1. What does MemPalace gain from its raw-verbatim "store everything, then make it findable" posture, and where would that improve or conflict with Spec Kit Memory's more selective save and retrieval model?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:125:3. How does the L0/L1/L2/L3 wake-up stack compare with Public's `session_bootstrap`, `memory_context`, and compaction-recovery flows, and what parts of the layering model are reusable here?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:126:4. What does `mcp_server.py` gain by embedding `PALACE_PROTOCOL` and `AAAK_SPEC` directly in the status bootstrap, and could Public benefit from similarly direct memory-usage guidance without adding prompt clutter?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:127:5. How effective are the stop-hook and pre-compact-hook patterns at protecting context before loss, and how do they compare to Public's existing compaction-oriented structural plugin and memory-save workflows?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:131:9. Which MemPalace ideas most improve compaction survival and startup continuity for future Public sessions: wake-up layers, hook timing, memory protocol bootstrapping, diary writing, or taxonomy-based narrowing?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:143:- Do map strong findings to specific Public subsystems such as Spec Kit Memory retrieval, context bootstrap, save flows, or compaction handling.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:164:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:166:- Affected area: memory bootstrap UX, session recovery guidance, compaction recovery behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:177:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:179:- Affected area: memory save automation, compaction resilience, agent operating protocol
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:204:- comparison against current Public memory, bootstrap, save, and compaction flows
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:216:Rank findings in this order: leverage for Public session continuity, compaction-survival value, truthfulness and evidence quality, fit with current Spec Kit Memory capabilities, operational simplicity, memory-hygiene impact, and clean differentiation from phases `001` through `004`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:222:- explicit comparison against current Public memory retrieval, bootstrap, save, and compaction behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:226:- memory saved from this phase folder using `generate-context.js`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:243:  - **Role** is specialized in verbatim memory systems, wake-up layering, MCP protocol design, hooks, and temporal KG behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:258:- current `Code_Environment/Public` memory/bootstrap/compaction behavior was compared using code, not assumptions
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:265:- memory is saved successfully for `005-mempalace`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:303:I’m treating this as a read-only final synthesis pass over the MemPalace research, grounded in the actual source and compared directly against Public’s current memory stack. I’ll verify the scoped repo instructions under `external/`, do a quick memory pass for prior context, then trace the remaining source paths and collapse everything into the required iteration-020 format.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:307:13:- fix findings, review/review-report.md, 002-implement-cache-warning-hooks, 003-memory-quality-issues, 008-graph-first-routing-nudge, 010-sqlite-fts-helper, 013-analytics-token-contracts, 005-code-graph-upgrades, lexicalPath unavailable, Structural Routing Hint, validate.sh --strict
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:309:130:- docs(026-runtime), no runtime code edits, staged runtime packet docs first, validate.sh 002-implement-cache-warning-hooks, validate.sh 005-code-graph-upgrades, description.json memory/metadata.json untouched
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:311:242:scope: redundancy-driven doc updates in `002-implement-cache-warning-hooks` and `003-memory-quality-issues`, plus Phase 6 plan recall tied to completed research authority
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:312:253:- 002-implement-cache-warning-hooks, 003-memory-quality-issues, compact continuity wrapper, decision-record.md, implementation-summary.md, spec/validate.sh --strict, template-only anchor/header mismatch
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:321:464:- 023-hybrid-rag-fusion-refinement, memory_index_scan, memory_quick_search, parentChain, B3-hybrid-rag-fusion-refinement, .opencode/changelog
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:323:532:- query-flow-tracker, memory-search-ux-hooks.vitest.ts, feedback-ledger.vitest.ts, includeContent, search_shown, stale dist restart
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:328:731:- session_bootstrap, memory_context({mode:"resume",profile:"resume"}), mcp_server/hooks/claude, scripts/hooks/claude, workflow-session-id.vitest.ts, code-graph-query-handler.vitest.ts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:329:786:- `session_bootstrap()` is the primary recovery call for non-hook flows; docs should mention fallback `memory_context({mode:"resume",profile:"resume"})` only after bootstrap guidance [Task 4]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:337:1478:- memory_search cursor, progressive-disclosure, requestQuality, SPECKIT_RESULT_CONFIDENCE_V1, memory-search-ux-hooks.vitest.ts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:359:.opencode/specs/system-spec-kit/z_archive/020-mcp-working-memory-hybrid-rag/scratch/opencode-working-memory/AGENTS.md
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:381:I found an `external/AGENTS.md`, so this repo does carry additional scoped instructions under the MemPalace snapshot; I’m loading that next alongside the local deep-research guidance and the relevant memory note for this phase. After that I’ll run the requested strict validation command and finish the source trace against the current Public files.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:388:allowed-tools: [Read, Write, Edit, Bash, Grep, Glob, Task, WebFetch, memory_context, memory_search]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:538:    │  - Save (memory context)        │
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:565:Each agent dispatch gets a fresh context window. State continuity comes from files, not memory. This solves context degradation in long research sessions.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:592:Save --> generate-context.js --> verify memory artifact
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:599:| **Externalized state** | All research continuity via files, not agent memory |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:717:memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:748:The phase folder is thinner than the prompt expects: right now it only has `external/`, `memory/`, `phase-research-prompt.md`, and `research/`. I’ve started the exact strict validator next so I can report the real packet state rather than assume it.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:787:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:3:- **What it does**: MemPalace exposes `list_wings`, `list_rooms`, and `get_taxonomy` as first-class read tools, so an agent can orient itself before searching. Public’s reviewed memory surfaces are excellent at search/orchestration, but they are still fundamentally query-led rather than topology-led.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:791:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:792:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:10:- **What it does**: MemPalace builds a graph from shared room names and lets the agent traverse or ask “what topics connect these two wings?” without another database. Public has causal lineage and structural code-graph tooling, but in the reviewed memory surfaces I did not find a comparable memory-topic bridge navigator.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:796:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:93:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:798:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:165:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:801:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:178:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:809:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:836:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:811:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:908:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:814:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:921:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:822:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:1025:- **What it does**: Conversation ingest truncates AI responses to the first 8 lines, room assignment is keyword-scored, heuristic extraction only keeps paragraphs that clear a confidence floor, and project re-mines delete and reinsert prior drawers. That is not “unfiltered raw memory”; it is selective routing and reduction. Public is also selective, but it makes that explicit through trigger filtering and save quality controls instead of presenting the result as untouched raw capture.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:831:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:1095:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:833:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:1167:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:836:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:1180:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:844:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7600:- **What it does**: Conversation ingest truncates AI responses to the first 8 lines, room assignment is keyword-scored, heuristic extraction only keeps paragraphs that clear a confidence floor, and project re-mines delete and reinsert prior drawers. That is not “unfiltered raw memory”; it is selective routing and reduction. Public is also selective, but it makes that explicit through trigger filtering and save quality controls instead of presenting the result as untouched raw capture.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:853:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7670:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:856:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7905:- **What it does**: MemPalace makes `mempalace_status` double as health check plus behavior bootstrap by returning the protocol and AAAK spec, and its `MemoryStack` keeps wake-up, recall, search, and status in one surface. Public currently spreads startup/recovery semantics across `memory_context` resume heuristics, context-server bootstrap instructions, and compaction transport injection.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:857:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7906:- **Why it matters for us**: If we add a MemPalace-style wake-up layer as a separate feature, we risk creating another authority surface on top of `session_bootstrap`, `session_resume`, and `memory_context`. The cleaner direction is to refactor current bootstrap behavior so one Public surface owns startup semantics and the others delegate.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:867:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7920:- **Why it matters for us**: Public should not refactor `memory_search` or `memory_context` into room-first retrieval. If we add taxonomy, it should help an agent orient or narrow after the fact, while core ranking stays query-led and hybrid.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:871:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7926:- **What it does**: MemPalace’s layer stack is conceptually neat, but it duplicates search/filter logic already present in `searcher.py`, emits formatted text rather than one authoritative structured result shape, and still uses rough token heuristics (`len(...) // 4`). Public already has profile-aware orchestration and budget enforcement in `memory_context`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:872:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7927:- **Why it matters for us**: For Public, a separate wake-up engine would duplicate ranking, result formatting, and token-budget logic we already solved elsewhere. If we want L0/L1-like behavior, it should be expressed as an existing `memory_context`/`session_bootstrap` profile, not as a parallel retrieval subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:875:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7931:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:882:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7990:- **What it does**: MemPalace makes `mempalace_status` double as health check plus behavior bootstrap by returning the protocol and AAAK spec, and its `MemoryStack` keeps wake-up, recall, search, and status in one surface. Public currently spreads startup/recovery semantics across `memory_context` resume heuristics, context-server bootstrap instructions, and compaction transport injection.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:883:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7991:- **Why it matters for us**: If we add a MemPalace-style wake-up layer as a separate feature, we risk creating another authority surface on top of `session_bootstrap`, `session_resume`, and `memory_context`. The cleaner direction is to refactor current bootstrap behavior so one Public surface owns startup semantics and the others delegate.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:893:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8005:- **Why it matters for us**: Public should not refactor `memory_search` or `memory_context` into room-first retrieval. If we add taxonomy, it should help an agent orient or narrow after the fact, while core ranking stays query-led and hybrid.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:897:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8011:- **What it does**: MemPalace’s layer stack is conceptually neat, but it duplicates search/filter logic already present in `searcher.py`, emits formatted text rather than one authoritative structured result shape, and still uses rough token heuristics (`len(...) // 4`). Public already has profile-aware orchestration and budget enforcement in `memory_context`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:898:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8012:- **Why it matters for us**: For Public, a separate wake-up engine would duplicate ranking, result formatting, and token-budget logic we already solved elsewhere. If we want L0/L1-like behavior, it should be expressed as an existing `memory_context`/`session_bootstrap` profile, not as a parallel retrieval subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:901:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8016:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:907:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:3:- **What it does**: Public’s retrieval path normalizes scope across `tenantId`, `userId`, `agentId`, `sessionId`, and `sharedSpaceId`, binds continuation cursors to that scope, supports session dedup and intent-to-profile routing, and emits recovery hints. Startup instructions already advertise `session_bootstrap`, `session_resume`, and structural recovery order. Save authority is explicit in `generate-context.js`, where the CLI target spec folder is authoritative. Compaction transport is also already externalized into the compact-code-graph plugin, which injects transport blocks at message and compaction boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:908:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:4:- **Why it matters for us**: On agent integration and project safety, Public is ahead. MemPalace contributes a cleaner, more memorable behavioral surface, but not a safer one. The transferable parts are the small ones: one explicit memory protocol surface, and harness-level passive save timing. The scoping and multi-agent model should not be imported wholesale.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:911:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:80:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:913:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:152:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:916:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:165:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:928:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:658:    10	- **What it does**: Source-confirmed. Public reconsolidates on save, archives superseded rows instead of overwriting them, records `logical_key`, `version_number`, `valid_to`, and `superseded_by_memory_id`, repairs active projections when logical identity drifts, and keeps an append-only `mutation_ledger` guarded by triggers against update/delete.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:929:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:659:    11	- **Why it matters for us**: On memory hygiene specifically, Public is already beyond MemPalace. We should not import MemPalace’s drawer lifecycle wholesale; we should only cherry-pick targeted ideas like offline corruption repair or a canonical topic-key layer.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:932:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:738:    90	What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:934:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:810:   162	- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:937:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:823:   175	- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:949:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5289:- **Why it matters for us**: This is the strongest retrieval idea MemPalace actually ships for agent ergonomics: memorable human-facing narrowing. It is good browse UX, but it does not replace semantic memory search, semantic code search, or structural graph lookup.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:959:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5303:- **Why it matters for us**: MemPalace’s graph is useful for “nearby topics” in memory. It cannot answer callers, imports, dependency blast radius, or code ownership questions the way Public’s code-graph can, and it is also different from Public’s causal memory lineage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:963:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5309:- **What it does**: Public’s `memory_search` is hybrid by default, normalizes scope, traces retrieval, exposes rerank metadata, and binds progressive disclosure to scope-aware cursors. `context-server.ts` advertises channel availability and routes semantic code search to CocoIndex and structural queries to `code_graph_query`. The compact-code-graph plugin injects deduped transport blocks during message and compaction phases.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:964:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5310:- **Why it matters for us**: On retrieval architecture, Public should not collapse back to a single “drawer search” surface. MemPalace contributes a memorable vocabulary and a good browse mental model, but Public already has the better substrate split: memory retrieval, semantic code retrieval, structural code retrieval, and transport-safe continuity.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:975:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5365:- **Why it matters for us**: This is the strongest retrieval idea MemPalace actually ships for agent ergonomics: memorable human-facing narrowing. It is good browse UX, but it does not replace semantic memory search, semantic code search, or structural graph lookup.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:985:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5379:- **Why it matters for us**: MemPalace’s graph is useful for “nearby topics” in memory. It cannot answer callers, imports, dependency blast radius, or code ownership questions the way Public’s code-graph can, and it is also different from Public’s causal memory lineage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:989:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5385:- **What it does**: Public’s `memory_search` is hybrid by default, normalizes scope, traces retrieval, exposes rerank metadata, and binds progressive disclosure to scope-aware cursors. `context-server.ts` advertises channel availability and routes semantic code search to CocoIndex and structural queries to `code_graph_query`. The compact-code-graph plugin injects deduped transport blocks during message and compaction phases.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:990:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-008.md:5386:- **Why it matters for us**: On retrieval architecture, Public should not collapse back to a single “drawer search” surface. MemPalace contributes a memorable vocabulary and a good browse mental model, but Public already has the better substrate split: memory retrieval, semantic code retrieval, structural code retrieval, and transport-safe continuity.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:993:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:35:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:995:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:107:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:998:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:120:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1010:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10445:- **Why it matters for us**: This is a clean architectural separation: verbatim corpus, fact graph, and save-timing automation are not collapsed into one retrieval layer. Public already separates semantic memory, code search, and code graph; MemPalace reinforces that this split is a strength, not accidental complexity.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1020:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10459:- **Why it matters for us**: Public already has stronger recovery surfaces (`session_bootstrap`, `session_resume`, `memory_context`), but MemPalace is better at making the memory protocol agent-visible right where the agent starts. That could improve recall ergonomics without inventing a new retrieval backend.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1030:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10473:- **Why it matters for us**: This is a strong pattern for Public: keep verbatim memory provenance and fact-like temporal assertions separate, so invalidation and fact drift do not contaminate raw session evidence.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1035:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10480:- **Why it matters for us**: The useful lesson is selective restructuring by ingest mode, not a literal “never transform anything” dogma. Public should compare this carefully against `generate-context.js`, which preserves curated session semantics instead of blindly chunking transcripts.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1043:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10491:### Finding 8: Public already beats MemPalace on session bootstrap sophistication, but MemPalace beats Public on memory protocol ergonomics
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1044:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10493:- **What it does**: Public has a much deeper retrieval stack: hybrid pipeline search, session dedup, intent routing, `memory_context`, `session_resume`, `session_bootstrap`, JSON-primary context capture, and compaction-safe structural transport. MemPalace is simpler, but its status/bootstrap surface is better at teaching the agent when to query, verify, write diaries, and invalidate facts.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1045:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10494:- **Why it matters for us**: The architecture takeaway is asymmetric. Public should not copy MemPalace’s backend wholesale. It should selectively import raw-verbatim retention ideas, checkpoint hooks, and protocol-forward memory UX.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1051:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10547:- **Why it matters for us**: This is a clean architectural separation: verbatim corpus, fact graph, and save-timing automation are not collapsed into one retrieval layer. Public already separates semantic memory, code search, and code graph; MemPalace reinforces that this split is a strength, not accidental complexity.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1061:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10561:- **Why it matters for us**: Public already has stronger recovery surfaces (`session_bootstrap`, `session_resume`, `memory_context`), but MemPalace is better at making the memory protocol agent-visible right where the agent starts. That could improve recall ergonomics without inventing a new retrieval backend.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1071:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10575:- **Why it matters for us**: This is a strong pattern for Public: keep verbatim memory provenance and fact-like temporal assertions separate, so invalidation and fact drift do not contaminate raw session evidence.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1076:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10582:- **Why it matters for us**: The useful lesson is selective restructuring by ingest mode, not a literal “never transform anything” dogma. Public should compare this carefully against `generate-context.js`, which preserves curated session semantics instead of blindly chunking transcripts.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1084:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10593:### Finding 8: Public already beats MemPalace on session bootstrap sophistication, but MemPalace beats Public on memory protocol ergonomics
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1085:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10595:- **What it does**: Public has a much deeper retrieval stack: hybrid pipeline search, session dedup, intent routing, `memory_context`, `session_resume`, `session_bootstrap`, JSON-primary context capture, and compaction-safe structural transport. MemPalace is simpler, but its status/bootstrap surface is better at teaching the agent when to query, verify, write diaries, and invalidate facts.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1086:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-001.md:10596:- **Why it matters for us**: The architecture takeaway is asymmetric. Public should not copy MemPalace’s backend wholesale. It should selectively import raw-verbatim retention ideas, checkpoint hooks, and protocol-forward memory UX.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1096:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:11:- **Why it matters for us**: A memory system is not trustworthy if its interfaces blur what is stored, what is derived, what is experimental, and what is benchmark-only. Evidence tiering needs to be part of the product contract, not just a doc habit.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1099:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:74:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1101:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:146:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1104:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:159:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1113:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:6916:### Finding 1: MemPalace’s strongest pattern is lifecycle-enforced memory discipline, not just retrieval
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1114:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:6919:- **What it does**: The system teaches and enforces a full memory loop: `mempalace_status` returns counts plus `PALACE_PROTOCOL` and `AAAK_SPEC`; that protocol tells the agent to check memory before answering, write a diary after each session, and invalidate stale facts; the wake-up stack injects L0+L1 startup context; the Stop hook blocks every 15 user turns; the PreCompact hook always blocks before shrinkage. End-to-end, the agent is told what memory is for, when to read it, and when it must preserve state.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1115:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:6920:- **Why it matters for us**: This is the real differentiator. Public already has stronger save authority and recovery authority than MemPalace, via explicit-target JSON-primary saves, `session_bootstrap`, and compaction transport. What Public still lacks is the same enforced timing: a bounded preservation checkpoint before stop/compaction, plus one memory-facing bootstrap surface that teaches query/save discipline as directly as MemPalace does.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1124:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:6935:- **What it does**: Project files are chunked into 800-character drawers with overlap and room routing; convo mode chunks by exchange pairs; “general” mode stops being raw filing and instead heuristically extracts five memory classes. So the system keeps verbatim text, but it still normalizes, routes, segments, and occasionally restructures during ingest.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1135:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:6952:- **Why it matters for us**: Public is already closer to the right direction: confidence floors in `memory_search`, explicit recovery order in `context-server`, and authoritative save rules in `generate-context.js`. The next step is to surface evidence tiers more visibly in memory/status responses so benchmark-only, inferred, and source-confirmed facts stay separated at runtime too.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1139:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:7004:### Finding 1: MemPalace’s strongest pattern is lifecycle-enforced memory discipline, not just retrieval
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1140:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:7007:- **What it does**: The system teaches and enforces a full memory loop: `mempalace_status` returns counts plus `PALACE_PROTOCOL` and `AAAK_SPEC`; that protocol tells the agent to check memory before answering, write a diary after each session, and invalidate stale facts; the wake-up stack injects L0+L1 startup context; the Stop hook blocks every 15 user turns; the PreCompact hook always blocks before shrinkage. End-to-end, the agent is told what memory is for, when to read it, and when it must preserve state.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1141:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:7008:- **Why it matters for us**: This is the real differentiator. Public already has stronger save authority and recovery authority than MemPalace, via explicit-target JSON-primary saves, `session_bootstrap`, and compaction transport. What Public still lacks is the same enforced timing: a bounded preservation checkpoint before stop/compaction, plus one memory-facing bootstrap surface that teaches query/save discipline as directly as MemPalace does.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1150:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:7023:- **What it does**: Project files are chunked into 800-character drawers with overlap and room routing; convo mode chunks by exchange pairs; “general” mode stops being raw filing and instead heuristically extracts five memory classes. So the system keeps verbatim text, but it still normalizes, routes, segments, and occasionally restructures during ingest.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1161:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:7040:- **Why it matters for us**: Public is already closer to the right direction: confidence floors in `memory_search`, explicit recovery order in `context-server`, and authoritative save rules in `generate-context.js`. The next step is to surface evidence tiers more visibly in memory/status responses so benchmark-only, inferred, and source-confirmed facts stay separated at runtime too.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1165:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:3:- **What it does**: `mempalace_check_duplicate` performs semantic similarity search, but `mempalace_add_drawer` does not invoke it; it only relies on a deterministic ID for exact idempotency within the same `wing/room/content-prefix` combination. That means “check first” is a protocol rule, not a server-enforced invariant. Public’s save path is stronger: `memory_save` is explicitly preflighted and `generate-context.js` is JSON-primary and validation-led.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1170:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:10:- **What it does**: MemPalace exposes L0/L1/L2/L3 through `layers.py` and the CLI, but the MCP layer does not expose those as distinct profiles or modes; it mostly exposes search, taxonomy, KG, and diary tools. Public’s `memory_context` and `memory_search` do expose explicit modes and profiles (`auto`, `deep`, `resume`, `research`, `debug`) directly in the API contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1174:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:71:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1176:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:143:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1179:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:156:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1190:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:11882:- **Why it matters for us**: this is much weaker than Public’s explicit recovery surfaces and server-managed continuity, which already expose `memory_context(...resume)`, `session_resume`, `session_bootstrap`, priming state, and crash recovery.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1195:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:11889:- **Why it matters for us**: the timing idea is useful, but MemPalace leaves correctness to agent obedience. Public’s JSON-primary `generate-context.js` save contract and compaction surfaces are stronger because the save path itself is authoritative.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1200:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:11896:- **Why it matters for us**: MemPalace’s startup continuity is better described as “global memory boot text” than “resume my last session.” Public’s resume flow is already more explicit and session-shaped.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1221:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:11973:- **Why it matters for us**: this is much weaker than Public’s explicit recovery surfaces and server-managed continuity, which already expose `memory_context(...resume)`, `session_resume`, `session_bootstrap`, priming state, and crash recovery.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1226:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:11980:- **Why it matters for us**: the timing idea is useful, but MemPalace leaves correctness to agent obedience. Public’s JSON-primary `generate-context.js` save contract and compaction surfaces are stronger because the save path itself is authoritative.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1231:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-004.md:11987:- **Why it matters for us**: MemPalace’s startup continuity is better described as “global memory boot text” than “resume my last session.” Public’s resume flow is already more explicit and session-shaped.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1254:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:88:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1256:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:160:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1259:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:173:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1269:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5329:- **What it does**: MemPalace blocks on two timing edges: after enough user turns it emits a save instruction, and before compaction it always blocks and can optionally run synchronous ingest before context shrinks. Public already has a compaction hook surface, but it currently injects structural transport context rather than triggering a governed memory save.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1270:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5330:- **Why it matters for us**: This is the cleanest integration candidate because Public already has the compaction interception point and already prefers JSON-primary saves. Integration difficulty is **medium**: the hook surface exists, but we would need a strict contract so compaction can only trigger structured `generate-context.js` style evidence capture, not MemPalace’s free-form “save everything” prompt.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1274:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5336:- **What it does**: `mempalace_status` does more than health reporting: it returns the palace overview plus `PALACE_PROTOCOL` and `AAAK_SPEC`, explicitly teaching the agent when to query, when to write diaries, and when to invalidate facts. Public already emits recovery and routing guidance in `context-server.ts`, but not a short memory-discipline protocol this direct.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1275:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5337:- **Why it matters for us**: Public already has the right bootstrap surfaces, so this is a **low** integration lift. A small “memory operating protocol” added to `session_bootstrap` or an equivalent status surface would reinforce verify-before-answer and recovery order without importing MemPalace’s heavier framing.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1280:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5344:- **Why it matters for us**: Public already has `session_bootstrap`, `session_resume`, `memory_context(resume)`, and `memory_match_triggers`, so a full port would duplicate stronger existing recovery paths with a weaker ranking heuristic. Integration difficulty is **medium-high**. The reusable part is only a thin, project-scoped startup digest layer, not the entire MemPalace layering model.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1295:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5413:- **What it does**: MemPalace blocks on two timing edges: after enough user turns it emits a save instruction, and before compaction it always blocks and can optionally run synchronous ingest before context shrinks. Public already has a compaction hook surface, but it currently injects structural transport context rather than triggering a governed memory save.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1296:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5414:- **Why it matters for us**: This is the cleanest integration candidate because Public already has the compaction interception point and already prefers JSON-primary saves. Integration difficulty is **medium**: the hook surface exists, but we would need a strict contract so compaction can only trigger structured `generate-context.js` style evidence capture, not MemPalace’s free-form “save everything” prompt.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1300:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5420:- **What it does**: `mempalace_status` does more than health reporting: it returns the palace overview plus `PALACE_PROTOCOL` and `AAAK_SPEC`, explicitly teaching the agent when to query, when to write diaries, and when to invalidate facts. Public already emits recovery and routing guidance in `context-server.ts`, but not a short memory-discipline protocol this direct.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1301:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5421:- **Why it matters for us**: Public already has the right bootstrap surfaces, so this is a **low** integration lift. A small “memory operating protocol” added to `session_bootstrap` or an equivalent status surface would reinforce verify-before-answer and recovery order without importing MemPalace’s heavier framing.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1306:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-017.md:5428:- **Why it matters for us**: Public already has `session_bootstrap`, `session_resume`, `memory_context(resume)`, and `memory_match_triggers`, so a full port would duplicate stronger existing recovery paths with a weaker ranking heuristic. Integration difficulty is **medium-high**. The reusable part is only a thin, project-scoped startup digest layer, not the entire MemPalace layering model.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1325:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10:- **What it does**: Source-confirmed. Public reconsolidates on save, archives superseded rows instead of overwriting them, records `logical_key`, `version_number`, `valid_to`, and `superseded_by_memory_id`, repairs active projections when logical identity drifts, and keeps an append-only `mutation_ledger` guarded by triggers against update/delete.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1326:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:11:- **Why it matters for us**: On memory hygiene specifically, Public is already beyond MemPalace. We should not import MemPalace’s drawer lifecycle wholesale; we should only cherry-pick targeted ideas like offline corruption repair or a canonical topic-key layer.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1329:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:90:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1331:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:162:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1334:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:175:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1344:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10563:- **What it does**: `tool_status()` returns drawer counts plus two embedded instruction payloads: `PALACE_PROTOCOL` and `AAAK_SPEC`. The protocol explicitly tells the agent to call status on wake-up, query before answering, write a diary after each session, and invalidate stale KG facts before adding new ones. This makes the first memory call double as an operational contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1345:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10564:- **Why it matters for us**: This is the cleanest MemPalace agent-integration idea in the codebase. It reduces dependency on separate prompt docs because the memory surface itself teaches the right behavior. Public already has stronger startup guidance in MCP startup instructions and `session_bootstrap`, but it does not currently make one memory-facing tool return such a tight “how to use memory safely” contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1355:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10578:- **Why it matters for us**: This is a useful reminder that per-agent memory can start as simple namespaced journals, but it is not enough for multi-agent safety. MemPalace’s README sells stronger agent specialization than the implementation currently proves. For Public, this means we should treat diary-per-agent as a lightweight UX idea, not as an isolation or trust boundary.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1364:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10591:- **What it does**: Public’s retrieval path normalizes scope across `tenantId`, `userId`, `agentId`, `sessionId`, and `sharedSpaceId`, binds continuation cursors to that scope, supports session dedup and intent-to-profile routing, and emits recovery hints. Startup instructions already advertise `session_bootstrap`, `session_resume`, and structural recovery order. Save authority is explicit in `generate-context.js`, where the CLI target spec folder is authoritative. Compaction transport is also already externalized into the compact-code-graph plugin, which injects transport blocks at message and compaction boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1365:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10592:- **Why it matters for us**: On agent integration and project safety, Public is ahead. MemPalace contributes a cleaner, more memorable behavioral surface, but not a safer one. The transferable parts are the small ones: one explicit memory protocol surface, and harness-level passive save timing. The scoping and multi-agent model should not be imported wholesale.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1370:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10646:- **What it does**: `tool_status()` returns drawer counts plus two embedded instruction payloads: `PALACE_PROTOCOL` and `AAAK_SPEC`. The protocol explicitly tells the agent to call status on wake-up, query before answering, write a diary after each session, and invalidate stale KG facts before adding new ones. This makes the first memory call double as an operational contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1371:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10647:- **Why it matters for us**: This is the cleanest MemPalace agent-integration idea in the codebase. It reduces dependency on separate prompt docs because the memory surface itself teaches the right behavior. Public already has stronger startup guidance in MCP startup instructions and `session_bootstrap`, but it does not currently make one memory-facing tool return such a tight “how to use memory safely” contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1381:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10661:- **Why it matters for us**: This is a useful reminder that per-agent memory can start as simple namespaced journals, but it is not enough for multi-agent safety. MemPalace’s README sells stronger agent specialization than the implementation currently proves. For Public, this means we should treat diary-per-agent as a lightweight UX idea, not as an isolation or trust boundary.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1390:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10674:- **What it does**: Public’s retrieval path normalizes scope across `tenantId`, `userId`, `agentId`, `sessionId`, and `sharedSpaceId`, binds continuation cursors to that scope, supports session dedup and intent-to-profile routing, and emits recovery hints. Startup instructions already advertise `session_bootstrap`, `session_resume`, and structural recovery order. Save authority is explicit in `generate-context.js`, where the CLI target spec folder is authoritative. Compaction transport is also already externalized into the compact-code-graph plugin, which injects transport blocks at message and compaction boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1391:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-007.md:10675:- **Why it matters for us**: On agent integration and project safety, Public is ahead. MemPalace contributes a cleaner, more memorable behavioral surface, but not a safer one. The transferable parts are the small ones: one explicit memory protocol surface, and harness-level passive save timing. The scoping and multi-agent model should not be imported wholesale.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1395:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:3:- **What it does**: MemPalace’s layer stack is conceptually neat, but it duplicates search/filter logic already present in `searcher.py`, emits formatted text rather than one authoritative structured result shape, and still uses rough token heuristics (`len(...) // 4`). Public already has profile-aware orchestration and budget enforcement in `memory_context`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1396:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:4:- **Why it matters for us**: For Public, a separate wake-up engine would duplicate ranking, result formatting, and token-budget logic we already solved elsewhere. If we want L0/L1-like behavior, it should be expressed as an existing `memory_context`/`session_bootstrap` profile, not as a parallel retrieval subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1399:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:8:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1404:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:88:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1406:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:160:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1409:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:173:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1422:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:6102:    10	- **What it does**: Conversation ingest truncates AI responses to the first 8 lines, room assignment is keyword-scored, heuristic extraction only keeps paragraphs that clear a confidence floor, and project re-mines delete and reinsert prior drawers. That is not “unfiltered raw memory”; it is selective routing and reduction. Public is also selective, but it makes that explicit through trigger filtering and save quality controls instead of presenting the result as untouched raw capture.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1430:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:6172:    80	What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1432:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:6244:   152	- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1435:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:6257:   165	- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1439:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9737:- **What it does**: MemPalace treats memory as a timed operating discipline: `mempalace_status` teaches query/save behavior up front, the Stop hook blocks every 15 user turns, and PreCompact always blocks before loss. Public already primes sessions, auto-surfaces context, and injects compaction transport, but it mostly nudges rather than enforces preservation.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1440:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9738:- **Why it matters for us**: The deeper shift is that “memory architecture” includes lifecycle checkpoints and agent behavior contracts, not just storage and ranking. Public should think in terms of preservation policy surfaces, especially around compaction and long sessions.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1445:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9745:- **Why it matters for us**: The paradigm shift is to treat memory output as a compiled artifact shaped for task, pressure, and budget, not as a hardcoded layer stack. That makes wake-up/resume a profile problem, not a separate engine problem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1448:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9749:### Finding 3: A strong memory system can have multiple planes of truth without forcing them into one index
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1449:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9751:- **What it does**: MemPalace separates three representational planes: verbatim drawers in ChromaDB, a navigational graph derived from room metadata, and a separate temporal triple store with invalidation. Public already hints at the same architectural direction by keeping semantic memory, code-graph structure, and orchestration distinct.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1450:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9752:- **Why it matters for us**: The big shift is representational pluralism. If we need fact-time validity, it should likely live in its own bounded fact plane rather than being forced into causal links, search metadata, or the main memory row shape.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1455:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9759:- **Why it matters for us**: The paradigm shift is to architect memory around a few clear authority owners: who decides where memory is saved, who owns session recovery truth, who injects compaction transport, and who is allowed to write derived fact state. That is a better scaling principle than adding more tools.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1465:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9773:- **Why it matters for us**: A memory system is not trustworthy if its interfaces blur what is stored, what is derived, what is experimental, and what is benchmark-only. Evidence tiering needs to be part of the product contract, not just a doc habit.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1470:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9814:- **What it does**: MemPalace treats memory as a timed operating discipline: `mempalace_status` teaches query/save behavior up front, the Stop hook blocks every 15 user turns, and PreCompact always blocks before loss. Public already primes sessions, auto-surfaces context, and injects compaction transport, but it mostly nudges rather than enforces preservation.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1471:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9815:- **Why it matters for us**: The deeper shift is that “memory architecture” includes lifecycle checkpoints and agent behavior contracts, not just storage and ranking. Public should think in terms of preservation policy surfaces, especially around compaction and long sessions.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1476:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9822:- **Why it matters for us**: The paradigm shift is to treat memory output as a compiled artifact shaped for task, pressure, and budget, not as a hardcoded layer stack. That makes wake-up/resume a profile problem, not a separate engine problem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1479:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9826:### Finding 3: A strong memory system can have multiple planes of truth without forcing them into one index
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1480:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9828:- **What it does**: MemPalace separates three representational planes: verbatim drawers in ChromaDB, a navigational graph derived from room metadata, and a separate temporal triple store with invalidation. Public already hints at the same architectural direction by keeping semantic memory, code-graph structure, and orchestration distinct.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1481:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9829:- **Why it matters for us**: The big shift is representational pluralism. If we need fact-time validity, it should likely live in its own bounded fact plane rather than being forced into causal links, search metadata, or the main memory row shape.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1486:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9836:- **Why it matters for us**: The paradigm shift is to architect memory around a few clear authority owners: who decides where memory is saved, who owns session recovery truth, who injects compaction transport, and who is allowed to write derived fact state. That is a better scaling principle than adding more tools.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1496:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9850:- **Why it matters for us**: A memory system is not trustworthy if its interfaces blur what is stored, what is derived, what is experimental, and what is benchmark-only. Evidence tiering needs to be part of the product contract, not just a doc habit.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1499:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:1:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1500:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:4:- **What it does**: Public has causal relations, optional temporal columns on those edges, and correction-driven `supersedes` / `derived_from` linkage. But the exposed tool surface is still lineage-oriented: `memory_drift_why`, `memory_causal_link`, `memory_causal_stats`, `memory_causal_unlink`. There is no entity/predicate/object fact query, no `as_of`, and no fact timeline tool.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1510:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:20:- **What it does**: MemPalace’s palace graph is derived from Chroma metadata like shared rooms and wings; the KG is explicit temporal triples. Public has a similar architectural instinct already: structural bootstrap and routing are separate from memory tools.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1514:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:95:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1516:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:167:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1519:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:180:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1530:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11168:- **Why it matters for us**: this is the worst kind of failure mode for memory: silent false idempotency. Public’s JSON-primary save path is stricter about explicit inputs and validation; if we ever add free-form fact writes, we should not key them off truncated content prefixes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1534:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11174:- **What it does**: MemPalace has explicit `migrate`, `repair`, `scan`, `prune`, and rebuild flows, but they still extract large portions of the palace into memory. `migrate()` swaps the fresh palace into place before checking whether `final_count` matched expectation, and the simpler CLI `repair` path is still a full collection rebuild, while the more surgical `repair.py` flow is not the main CLI surface.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1540:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11182:- **Why it matters for us**: MemPalace’s own failure story shows why status tools need coverage metadata and truthfulness guards. Public is already closer to the right pattern: `session_bootstrap`, `context-server`, and `memory_search` expose stale warnings, recovery hints, and bounded fallback behavior instead of silent partial truth.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1545:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11189:- **Why it matters for us**: the timing idea is strong, but the implementation shows that save enforcement must be bounded and structured. Public’s compaction/recovery surfaces are already safer because `generate-context.js` is JSON-primary and explicit, and the compact-code-graph bridge fails closed on timeout instead of hanging the host.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1561:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11266:- **Why it matters for us**: this is the worst kind of failure mode for memory: silent false idempotency. Public’s JSON-primary save path is stricter about explicit inputs and validation; if we ever add free-form fact writes, we should not key them off truncated content prefixes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1565:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11272:- **What it does**: MemPalace has explicit `migrate`, `repair`, `scan`, `prune`, and rebuild flows, but they still extract large portions of the palace into memory. `migrate()` swaps the fresh palace into place before checking whether `final_count` matched expectation, and the simpler CLI `repair` path is still a full collection rebuild, while the more surgical `repair.py` flow is not the main CLI surface.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1571:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11280:- **Why it matters for us**: MemPalace’s own failure story shows why status tools need coverage metadata and truthfulness guards. Public is already closer to the right pattern: `session_bootstrap`, `context-server`, and `memory_search` expose stale warnings, recovery hints, and bounded fallback behavior instead of silent partial truth.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1576:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:11287:- **Why it matters for us**: the timing idea is strong, but the implementation shows that save enforcement must be bounded and structured. Public’s compaction/recovery surfaces are already safer because `generate-context.js` is JSON-primary and explicit, and the compact-code-graph bridge fails closed on timeout instead of hanging the host.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1599:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:87:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1601:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:159:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1604:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:172:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1615:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7101:- **Why it matters for us**: If we copy this pattern into Public, the biggest failure mode is a false sense of safety: the runtime is interrupted, but preservation quality still depends on the model following instructions correctly. That can yield duplicated memories, noisy categorization, partial saves, or blocked UX with no durable improvement. Public’s current compaction transport and JSON-primary `generate-context.js` path are much more deterministic.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1620:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7108:- **Why it matters for us**: A Public-native startup digest could still be useful, but adopting MemPalace’s ranking logic directly would privilege stale but highly weighted memories, flatten provenance, and compete with stronger existing recovery paths like `session_bootstrap`, `session_resume`, and `memory_context(resume)`. The risk is not just mediocre recall; it is confidently front-loading the wrong context.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1625:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7115:- **Why it matters for us**: The reusable idea is strong: one surface can teach memory behavior, not just expose health. The risk is that a MemPalace-sized protocol blob would become stale, conflict with Public’s existing bootstrap authority, and add prompt noise faster than it adds reliability. The safe version is a short, stable rule set, not a second operating manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1630:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7122:- **Why it matters for us**: This is the one new architecture that Public genuinely lacks. The risk is governance, not mechanics: uncited fact insertion, ambiguous invalidation, silent drift between fact rows and verbatim memory, and agent-written “truth” that outruns its evidence. If we build this, it needs mandatory citations, authority tiers, correction workflows, and separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1641:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7183:- **Why it matters for us**: If we copy this pattern into Public, the biggest failure mode is a false sense of safety: the runtime is interrupted, but preservation quality still depends on the model following instructions correctly. That can yield duplicated memories, noisy categorization, partial saves, or blocked UX with no durable improvement. Public’s current compaction transport and JSON-primary `generate-context.js` path are much more deterministic.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1646:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7190:- **Why it matters for us**: A Public-native startup digest could still be useful, but adopting MemPalace’s ranking logic directly would privilege stale but highly weighted memories, flatten provenance, and compete with stronger existing recovery paths like `session_bootstrap`, `session_resume`, and `memory_context(resume)`. The risk is not just mediocre recall; it is confidently front-loading the wrong context.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1651:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7197:- **Why it matters for us**: The reusable idea is strong: one surface can teach memory behavior, not just expose health. The risk is that a MemPalace-sized protocol blob would become stale, conflict with Public’s existing bootstrap authority, and add prompt noise faster than it adds reliability. The safe version is a short, stable rule set, not a second operating manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1656:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-018.md:7204:- **Why it matters for us**: This is the one new architecture that Public genuinely lacks. The risk is governance, not mechanics: uncited fact insertion, ambiguous invalidation, silent drift between fact rows and verbatim memory, and agent-written “truth” that outruns its evidence. If we build this, it needs mandatory citations, authority tiers, correction workflows, and separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1670:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:12:- **What it does**: Public persists a normalized `memory_index`, FTS5 mirror, chunk parent/child rows, active lineage projection, causal edges, BM25 rebuild, and enforced WAL mode. MemPalace persists a simpler raw drawer collection plus sidecar stores.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1674:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:75:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1676:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:147:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1679:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:160:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1709:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:8439:- **What it does**: `mempalace_check_duplicate` performs semantic similarity search, but `mempalace_add_drawer` does not invoke it; it only relies on a deterministic ID for exact idempotency within the same `wing/room/content-prefix` combination. That means “check first” is a protocol rule, not a server-enforced invariant. Public’s save path is stronger: `memory_save` is explicitly preflighted and `generate-context.js` is JSON-primary and validation-led.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1714:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:8446:- **What it does**: MemPalace exposes L0/L1/L2/L3 through `layers.py` and the CLI, but the MCP layer does not expose those as distinct profiles or modes; it mostly exposes search, taxonomy, KG, and diary tools. Public’s `memory_context` and `memory_search` do expose explicit modes and profiles (`auto`, `deep`, `resume`, `research`, `debug`) directly in the API contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1740:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:8513:- **What it does**: `mempalace_check_duplicate` performs semantic similarity search, but `mempalace_add_drawer` does not invoke it; it only relies on a deterministic ID for exact idempotency within the same `wing/room/content-prefix` combination. That means “check first” is a protocol rule, not a server-enforced invariant. Public’s save path is stronger: `memory_save` is explicitly preflighted and `generate-context.js` is JSON-primary and validation-led.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1745:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-003.md:8520:- **What it does**: MemPalace exposes L0/L1/L2/L3 through `layers.py` and the CLI, but the MCP layer does not expose those as distinct profiles or modes; it mostly exposes search, taxonomy, KG, and diary tools. Public’s `memory_context` and `memory_search` do expose explicit modes and profiles (`auto`, `deep`, `resume`, `research`, `debug`) directly in the API contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1756:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:11:- **Why it matters for us**: MemPalace’s graph is useful for “nearby topics” in memory. It cannot answer callers, imports, dependency blast radius, or code ownership questions the way Public’s code-graph can, and it is also different from Public’s causal memory lineage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1760:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:17:- **What it does**: Public’s `memory_search` is hybrid by default, normalizes scope, traces retrieval, exposes rerank metadata, and binds progressive disclosure to scope-aware cursors. `context-server.ts` advertises channel availability and routes semantic code search to CocoIndex and structural queries to `code_graph_query`. The compact-code-graph plugin injects deduped transport blocks during message and compaction phases.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1761:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:18:- **Why it matters for us**: On retrieval architecture, Public should not collapse back to a single “drawer search” surface. MemPalace contributes a memorable vocabulary and a good browse mental model, but Public already has the better substrate split: memory retrieval, semantic code retrieval, structural code retrieval, and transport-safe continuity.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1764:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:87:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1766:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:159:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1769:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:172:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1779:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8033:- **What it does**: `mempalace_status` returns counts plus an embedded `PALACE_PROTOCOL` and `AAAK_SPEC`, explicitly telling the agent to query before speaking, write a diary after each session, and invalidate changed facts. Public distributes this behavior across `session_bootstrap()`, `session_resume()`, dynamic server instructions, and structural routing nudges instead of one memory-facing bootstrap tool.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1784:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8040:- **What it does**: MemPalace `wake_up()` is `L0 identity.txt + L1 top 15 drawers`, with `L2` doing plain `col.get()` metadata filtering and `L3` doing the same Chroma query as normal search. Public’s resume path uses anchor-scoped `memory_search`, auto-resume heuristics, structural freshness, CocoIndex availability, and a shared payload contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1789:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8047:- **What it does**: MemPalace’s Stop hook blocks every `SAVE_INTERVAL` human turns and its PreCompact hook always blocks, emitting a system reason that tells the agent to save before stopping or compaction. Public has a strong explicit save path in `generate-context.js` and compaction-safe transport injection, but no equivalent forced preservation checkpoint before context loss.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1794:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8054:- **What it does**: MemPalace tracks save cycles with `stop_hook_active`, transcript counts, session IDs, and per-session last-save files under `~/.mempalace/hook_state/`. Public resolves trusted session IDs, preserves session lifecycle metadata, recovers interrupted sessions, recovers pending memory files on startup, and resets incomplete ingest jobs after crashes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1799:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8061:- **What it does**: MemPalace either mines/chunks text into drawers with heuristic room assignment or blocks the agent and asks it to organize/save using its own current context. Public’s `generate-context.js` is explicitly JSON-primary, treats caller-provided structured session data as authoritative, and preserves exact target-folder authority plus tool/exchange/preflight/postflight context.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1805:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8105:- **What it does**: `mempalace_status` returns counts plus an embedded `PALACE_PROTOCOL` and `AAAK_SPEC`, explicitly telling the agent to query before speaking, write a diary after each session, and invalidate changed facts. Public distributes this behavior across `session_bootstrap()`, `session_resume()`, dynamic server instructions, and structural routing nudges instead of one memory-facing bootstrap tool.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1810:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8112:- **What it does**: MemPalace `wake_up()` is `L0 identity.txt + L1 top 15 drawers`, with `L2` doing plain `col.get()` metadata filtering and `L3` doing the same Chroma query as normal search. Public’s resume path uses anchor-scoped `memory_search`, auto-resume heuristics, structural freshness, CocoIndex availability, and a shared payload contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1815:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8119:- **What it does**: MemPalace’s Stop hook blocks every `SAVE_INTERVAL` human turns and its PreCompact hook always blocks, emitting a system reason that tells the agent to save before stopping or compaction. Public has a strong explicit save path in `generate-context.js` and compaction-safe transport injection, but no equivalent forced preservation checkpoint before context loss.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1820:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8126:- **What it does**: MemPalace tracks save cycles with `stop_hook_active`, transcript counts, session IDs, and per-session last-save files under `~/.mempalace/hook_state/`. Public resolves trusted session IDs, preserves session lifecycle metadata, recovers interrupted sessions, recovers pending memory files on startup, and resets incomplete ingest jobs after crashes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1825:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-009.md:8133:- **What it does**: MemPalace either mines/chunks text into drawers with heuristic room assignment or blocks the agent and asks it to organize/save using its own current context. Public’s `generate-context.js` is explicitly JSON-primary, treats caller-provided structured session data as authoritative, and preserves exact target-folder authority plus tool/exchange/preflight/postflight context.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1830:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:3:- **What it does**: MemPalace tracks save cycles with `stop_hook_active`, transcript counts, session IDs, and per-session last-save files under `~/.mempalace/hook_state/`. Public resolves trusted session IDs, preserves session lifecycle metadata, recovers interrupted sessions, recovers pending memory files on startup, and resets incomplete ingest jobs after crashes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1835:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10:- **What it does**: MemPalace either mines/chunks text into drawers with heuristic room assignment or blocks the agent and asks it to organize/save using its own current context. Public’s `generate-context.js` is explicitly JSON-primary, treats caller-provided structured session data as authoritative, and preserves exact target-folder authority plus tool/exchange/preflight/postflight context.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1839:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:76:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1841:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:148:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1844:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:161:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1861:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10790:- **Why it matters for us**: This is the clearest hygiene gap in MemPalace. Its model is good at “roughly the same text already exists,” but weak at “is this a safe, in-scope, high-quality memory write.”
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1870:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10803:- **What it does**: MemPalace MCP `status` reports total drawers plus wing/room counts; CLI `repair` backs up the palace, deletes the collection, and rebuilds it from extracted drawers. Public `memory_health` checks schema state, FTS sync, alias divergence, provider readiness, and only runs repair after explicit confirmation, with targeted actions for FTS rebuild, trigger-cache refresh, orphan-edge cleanup, and vector/chunk cleanup.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1880:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10817:- **What it does**: Conversation ingest truncates AI responses to the first 8 lines, room assignment is keyword-scored, heuristic extraction only keeps paragraphs that clear a confidence floor, and project re-mines delete and reinsert prior drawers. That is not “unfiltered raw memory”; it is selective routing and reduction. Public is also selective, but it makes that explicit through trigger filtering and save quality controls instead of presenting the result as untouched raw capture.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1892:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10866:- **Why it matters for us**: This is the clearest hygiene gap in MemPalace. Its model is good at “roughly the same text already exists,” but weak at “is this a safe, in-scope, high-quality memory write.”
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1901:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10879:- **What it does**: MemPalace MCP `status` reports total drawers plus wing/room counts; CLI `repair` backs up the palace, deletes the collection, and rebuilds it from extracted drawers. Public `memory_health` checks schema state, FTS sync, alias divergence, provider readiness, and only runs repair after explicit confirmation, with targeted actions for FTS rebuild, trigger-cache refresh, orphan-edge cleanup, and vector/chunk cleanup.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1911:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-010.md:10893:- **What it does**: Conversation ingest truncates AI responses to the first 8 lines, room assignment is keyword-scored, heuristic extraction only keeps paragraphs that clear a confidence floor, and project re-mines delete and reinsert prior drawers. That is not “unfiltered raw memory”; it is selective routing and reduction. Public is also selective, but it makes that explicit through trigger filtering and save quality controls instead of presenting the result as untouched raw capture.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1922:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:4:- **Why it matters for us**: This is the one new architecture that Public genuinely lacks. The risk is governance, not mechanics: uncited fact insertion, ambiguous invalidation, silent drift between fact rows and verbatim memory, and agent-written “truth” that outruns its evidence. If we build this, it needs mandatory citations, authority tiers, correction workflows, and separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1930:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:86:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1932:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:158:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1935:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:171:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1954:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6324:    87	What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1956:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6396:   159	- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1959:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6409:   172	- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1977:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6790:- **Why it matters for us**: Public does not need a second operating manual; it does have room for a very short memory-behavior hint block that reinforces when to call `memory_search`, `memory_context`, and save before compaction or handoff.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:1992:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6811:- **Why it matters for us**: Public genuinely lacks this architecture today. It is the clearest long-term differentiator from ordinary memory search, but it must be built with mandatory citations, authority tiers, correction review, and fact-versus-verbatim separation from day one.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2008:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6887:- **Why it matters for us**: Public does not need a second operating manual; it does have room for a very short memory-behavior hint block that reinforces when to call `memory_search`, `memory_context`, and save before compaction or handoff.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2023:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-019.md:6908:- **Why it matters for us**: Public genuinely lacks this architecture today. It is the clearest long-term differentiator from ordinary memory search, but it must be built with mandatory citations, authority tiers, correction review, and fact-versus-verbatim separation from day one.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2038:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:13:- **Why it matters for us**: Public is already closer to the right direction: confidence floors in `memory_search`, explicit recovery order in `context-server`, and authoritative save rules in `generate-context.js`. The next step is to surface evidence tiers more visibly in memory/status responses so benchmark-only, inferred, and source-confirmed facts stay separated at runtime too.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2041:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:89:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2043:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:161:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2046:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:174:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2061:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:543:- **Why it matters for us**: A memory system is not trustworthy if its interfaces blur what is stored, what is derived, what is experimental, and what is benchmark-only. Evidence tiering needs to be part of the product contract, not just a doc habit.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2064:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:606:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2066:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:678:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2069:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:691:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2076:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9814:- **Why it matters for us**: This is the reusable architectural move. Public does not need to replace `memory_search`; it could add a bounded sidecar fact plane for “what was true when?” queries while leaving semantic retrieval, bootstrap, and compaction transport intact.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2081:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9822:- **Why it matters for us**: The practical gain is temporal state tracking, not magical truth maintenance. Public should evaluate this as a time-scoped fact API layered on governed memory, not as an “auto-fixes contradictions” system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2089:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9834:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2090:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9837:- **What it does**: Public has causal relations, optional temporal columns on those edges, and correction-driven `supersedes` / `derived_from` linkage. But the exposed tool surface is still lineage-oriented: `memory_drift_why`, `memory_causal_link`, `memory_causal_stats`, `memory_causal_unlink`. There is no entity/predicate/object fact query, no `as_of`, and no fact timeline tool.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2100:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9853:- **What it does**: MemPalace’s palace graph is derived from Chroma metadata like shared rooms and wings; the KG is explicit temporal triples. Public has a similar architectural instinct already: structural bootstrap and routing are separate from memory tools.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2107:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9908:- **Why it matters for us**: This is the reusable architectural move. Public does not need to replace `memory_search`; it could add a bounded sidecar fact plane for “what was true when?” queries while leaving semantic retrieval, bootstrap, and compaction transport intact.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2112:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9916:- **Why it matters for us**: The practical gain is temporal state tracking, not magical truth maintenance. Public should evaluate this as a time-scoped fact API layered on governed memory, not as an “auto-fixes contradictions” system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2120:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9928:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2121:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9931:- **What it does**: Public has causal relations, optional temporal columns on those edges, and correction-driven `supersedes` / `derived_from` linkage. But the exposed tool surface is still lineage-oriented: `memory_drift_why`, `memory_causal_link`, `memory_causal_stats`, `memory_causal_unlink`. There is no entity/predicate/object fact query, no `as_of`, and no fact timeline tool.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2131:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9947:- **What it does**: MemPalace’s palace graph is derived from Chroma metadata like shared rooms and wings; the KG is explicit temporal triples. Public has a similar architectural instinct already: structural bootstrap and routing are separate from memory tools.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2145:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:87:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2147:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:159:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2150:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:172:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2174:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:16281:- **Why it matters for us**: MemPalace’s startup and on-demand “recall” stack is cheaper than search, but it is not session-aware, not temporally ranked, and not query-intent aware. Public’s `session_bootstrap` plus `memory_context` is already more retrieval-native than this layered shortcut stack.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2183:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:16294:- **What it does**: Public exposes a 4-stage pipeline through `executePipeline`, advertises live search channels `vector, fts5, bm25, graph`, initializes hybrid search plus BM25 rebuild on startup, runs weighted BM25 FTS5 over `memory_fts`, falls back from vector to keyword search when embeddings/sqlite-vec are unavailable, and fuses session, recency, causal, co-activation, community, graph, and intent signals during ranking.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2200:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:16355:- **Why it matters for us**: MemPalace’s startup and on-demand “recall” stack is cheaper than search, but it is not session-aware, not temporally ranked, and not query-intent aware. Public’s `session_bootstrap` plus `memory_context` is already more retrieval-native than this layered shortcut stack.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2209:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-005.md:16368:- **What it does**: Public exposes a 4-stage pipeline through `executePipeline`, advertises live search channels `vector, fts5, bm25, graph`, initializes hybrid search plus BM25 rebuild on startup, runs weighted BM25 FTS5 over `memory_fts`, falls back from vector to keyword search when embeddings/sqlite-vec are unavailable, and fuses session, recency, causal, co-activation, community, graph, and intent signals during ranking.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2219:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:10:- **What it does**: Conversation ingest truncates AI responses to the first 8 lines, room assignment is keyword-scored, heuristic extraction only keeps paragraphs that clear a confidence floor, and project re-mines delete and reinsert prior drawers. That is not “unfiltered raw memory”; it is selective routing and reduction. Public is also selective, but it makes that explicit through trigger filtering and save quality controls instead of presenting the result as untouched raw capture.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2228:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:80:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2230:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:152:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2233:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:165:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2243:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12453:### Finding 1: Public lacks a first-class identity capsule separate from searchable memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2245:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12456:- **Why it matters for us**: This would give Public a stable, low-token “who am I / what world am I in” layer that survives search noise, stale sessions, and compaction without polluting `memory_search` results.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2259:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12476:- **What it does**: MemPalace exposes `list_wings`, `list_rooms`, and `get_taxonomy` as first-class read tools, so an agent can orient itself before searching. Public’s reviewed memory surfaces are excellent at search/orchestration, but they are still fundamentally query-led rather than topology-led.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2263:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12481:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2264:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12483:- **What it does**: MemPalace builds a graph from shared room names and lets the agent traverse or ask “what topics connect these two wings?” without another database. Public has causal lineage and structural code-graph tooling, but in the reviewed memory surfaces I did not find a comparable memory-topic bridge navigator.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2269:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12542:### Finding 1: Public lacks a first-class identity capsule separate from searchable memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2271:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12545:- **Why it matters for us**: This would give Public a stable, low-token “who am I / what world am I in” layer that survives search noise, stale sessions, and compaction without polluting `memory_search` results.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2285:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12565:- **What it does**: MemPalace exposes `list_wings`, `list_rooms`, and `get_taxonomy` as first-class read tools, so an agent can orient itself before searching. Public’s reviewed memory surfaces are excellent at search/orchestration, but they are still fundamentally query-led rather than topology-led.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2289:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12570:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2290:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12572:- **What it does**: MemPalace builds a graph from shared room names and lets the agent traverse or ask “what topics connect these two wings?” without another database. Public has causal lineage and structural code-graph tooling, but in the reviewed memory surfaces I did not find a comparable memory-topic bridge navigator.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2301:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11:- **Why it matters for us**: MemPalace’s startup and on-demand “recall” stack is cheaper than search, but it is not session-aware, not temporally ranked, and not query-intent aware. Public’s `session_bootstrap` plus `memory_context` is already more retrieval-native than this layered shortcut stack.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2310:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:24:- **What it does**: Public exposes a 4-stage pipeline through `executePipeline`, advertises live search channels `vector, fts5, bm25, graph`, initializes hybrid search plus BM25 rebuild on startup, runs weighted BM25 FTS5 over `memory_fts`, falls back from vector to keyword search when embeddings/sqlite-vec are unavailable, and fuses session, recency, causal, co-activation, community, graph, and intent signals during ranking.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2314:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:93:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2316:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:165:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2319:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:178:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2336:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11865:- **Why it matters for us**: This is practical store repair, not revision tracking. It keeps the active corpus clean enough, but old drawer versions simply disappear or get overwritten, so there is no append-only history for verbatim memory changes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2355:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11892:- **What it does**: Source-confirmed. Public reconsolidates on save, archives superseded rows instead of overwriting them, records `logical_key`, `version_number`, `valid_to`, and `superseded_by_memory_id`, repairs active projections when logical identity drifts, and keeps an append-only `mutation_ledger` guarded by triggers against update/delete.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2356:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11893:- **Why it matters for us**: On memory hygiene specifically, Public is already beyond MemPalace. We should not import MemPalace’s drawer lifecycle wholesale; we should only cherry-pick targeted ideas like offline corruption repair or a canonical topic-key layer.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2367:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11958:- **Why it matters for us**: This is practical store repair, not revision tracking. It keeps the active corpus clean enough, but old drawer versions simply disappear or get overwritten, so there is no append-only history for verbatim memory changes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2386:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11985:- **What it does**: Source-confirmed. Public reconsolidates on save, archives superseded rows instead of overwriting them, records `logical_key`, `version_number`, `valid_to`, and `superseded_by_memory_id`, repairs active projections when logical identity drifts, and keeps an append-only `mutation_ledger` guarded by triggers against update/delete.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2387:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-006.md:11986:- **Why it matters for us**: On memory hygiene specifically, Public is already beyond MemPalace. We should not import MemPalace’s drawer lifecycle wholesale; we should only cherry-pick targeted ideas like offline corruption repair or a canonical topic-key layer.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2395:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:8:### Finding 8: Public already beats MemPalace on session bootstrap sophistication, but MemPalace beats Public on memory protocol ergonomics
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2396:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:10:- **What it does**: Public has a much deeper retrieval stack: hybrid pipeline search, session dedup, intent routing, `memory_context`, `session_resume`, `session_bootstrap`, JSON-primary context capture, and compaction-safe structural transport. MemPalace is simpler, but its status/bootstrap surface is better at teaching the agent when to query, verify, write diaries, and invalidate facts.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2397:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:11:- **Why it matters for us**: The architecture takeaway is asymmetric. Public should not copy MemPalace’s backend wholesale. It should selectively import raw-verbatim retention ideas, checkpoint hooks, and protocol-forward memory UX.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2400:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:85:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2402:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:157:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2405:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:170:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2415:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15733:### Finding 1: MemPalace is a sidecar-store architecture, not one unified memory database
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2422:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15745:- **Why it matters for us**: This preserves verbatim text well, but it has no built-in parent/child chunk graph, active-version pointer, or append-only lineage model. Public’s `memory_index` plus chunk/lineage tables are materially richer.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2432:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15761:- **Why it matters for us**: This cleanly separates fact memory from verbatim memory. Public already has `causal_edges`, but MemPalace’s explicit temporal fact windows are a different and reusable boundary.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2446:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15784:- **What it does**: Public persists a normalized `memory_index`, FTS5 mirror, chunk parent/child rows, active lineage projection, causal edges, BM25 rebuild, and enforced WAL mode. MemPalace persists a simpler raw drawer collection plus sidecar stores.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2451:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15824:### Finding 1: MemPalace is a sidecar-store architecture, not one unified memory database
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2458:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15836:- **Why it matters for us**: This preserves verbatim text well, but it has no built-in parent/child chunk graph, active-version pointer, or append-only lineage model. Public’s `memory_index` plus chunk/lineage tables are materially richer.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2468:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15852:- **Why it matters for us**: This cleanly separates fact memory from verbatim memory. Public already has `causal_edges`, but MemPalace’s explicit temporal fact windows are a different and reusable boundary.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2482:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-002.md:15875:- **What it does**: Public persists a normalized `memory_index`, FTS5 mirror, chunk parent/child rows, active lineage projection, causal edges, BM25 rebuild, and enforced WAL mode. MemPalace persists a simpler raw drawer collection plus sidecar stores.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2492:7:### The highest-scoring AI memory system ever benchmarked. And it's free.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2493:15:**The Palace** — Ancient Greek orators memorized entire speeches by placing ideas in rooms of an imaginary building. Walk through the building, find the idea. MemPalace applies the same principle to AI memory: your conversations are organized into wings (people and projects), halls (types of memory), and rooms (specific ideas). No AI decides what matters — you keep every word, and the structure gives you a navigable map instead of a flat search index.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2510:169:Either way — your entire memory stack runs offline. ChromaDB on your machine, Llama on your machine, AAAK for compression, zero cloud calls.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2527:467:| `mempalace_status` | Palace overview + AAAK spec + memory protocol |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2530:507:The AI learns AAAK and the memory protocol automatically from the `mempalace_status` response. No manual configuration.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2538:636:| `mcp_server.py` | MCP server — 19 tools, AAAK auto-teach, memory protocol |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2569:178:AAAK_SPEC = """AAAK is a compressed memory dialect that MemPalace uses for efficient storage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2614:617:        "description": "Get the AAAK dialect specification — the compressed memory format MemPalace uses. Call this if you need to read or write AAAK-compressed memories.",
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2751:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/pyproject.toml:4:description = "Give your AI a memory — mine projects and conversations into a searchable palace. No API key required."
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2908:   176	This protocol ensures the AI KNOWS before it speaks. Storage is not memory — but storage + this protocol = memory."""
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:2910:   178	AAAK_SPEC = """AAAK is a compressed memory dialect that MemPalace uses for efficient storage.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:3913:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py:19:    # [{"content": "...", "memory_type": "decision", "chunk_index": 0}, ...]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:3914:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py:269:def _disambiguate(memory_type: str, text: str, scores: Dict[str, float]) -> str:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:3927:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py:372:        List of dicts: {"content": str, "memory_type": str, "chunk_index": int}
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:4199:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:295:            # Each chunk already has memory_type; use it as the room name
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:4203:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:312:                type_counts = Counter(c.get("memory_type", "general") for c in chunks)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:4211:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py:332:            chunk_room = chunk.get("memory_type", room) if extract_mode == "general" else room
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5256:   295	            # Each chunk already has memory_type; use it as the room name
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5263:   302	        # Detect room from content (general mode uses memory_type instead)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5273:   312	                type_counts = Counter(c.get("memory_type", "general") for c in chunks)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5282:   321	                    room_counts[c.get("memory_type", "general")] += 1
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5293:   332	            chunk_room = chunk.get("memory_type", room) if extract_mode == "general" else room
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5335:   372	        List of dicts: {"content": str, "memory_type": str, "chunk_index": int}
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5379:   416	                "memory_type": max_type,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5389:   426	    Split text into segments suitable for memory extraction.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:5939:    44	# The AI then saves to memory, and when it tries to stop again,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6043:   148	  "reason": "AUTO-SAVE checkpoint. Save key topics, decisions, quotes, and code from this session to your memory system. Organize into appropriate categories. Use verbatim quotes where possible. Continue conversation after saving."
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6128:    75	  "reason": "COMPACTION IMMINENT. Save ALL topics, decisions, quotes, code, and important context from this session to your memory system. Be thorough — after compaction, detailed context will be lost. Organize into appropriate categories. Use verbatim quotes where possible. Save everything, then allow compaction to proceed."
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6211:18:That's the finding. The field is over-engineering the memory extraction step. Raw verbatim text with good embeddings is a stronger baseline than anyone realized — because it doesn't lose information. When an LLM extracts "user prefers PostgreSQL" and throws away the original conversation, it loses the context of *why*, the alternatives considered, the tradeoffs discussed. MemPal keeps all of that, and the search model finds it.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6217:36:The 100% is the competitive story: a perfect score on the standard benchmark for AI memory, verified across all 500 questions and all 6 question types — reproducible with either Haiku or Sonnet as the reranker.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6299:514:**The LLM rerank is optional, not required.** The 96.6% baseline needs no API key at any stage — not for indexing, not for retrieval, not for scoring. The 99.4% result adds an optional Haiku rerank step that costs approximately $0.001 per question. This is standard practice: Supermemory ASMR, Mastra, and Hindsight all use LLMs in their retrieval pipelines.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6358:     9	Every competitive memory system uses an LLM to manage memory:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6361:    12	- Supermemory uses an LLM to run agentic search passes
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6367:    18	That's the finding. The field is over-engineering the memory extraction step. Raw verbatim text with good embeddings is a stronger baseline than anyone realized — because it doesn't lose information. When an LLM extracts "user prefers PostgreSQL" and throws away the original conversation, it loses the context of *why*, the alternatives considered, the tradeoffs discussed. MemPal keeps all of that, and the search model finds it.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6385:    36	The 100% is the competitive story: a perfect score on the standard benchmark for AI memory, verified across all 500 questions and all 6 question types — reproducible with either Haiku or Sonnet as the reranker.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6396:    47	| 2 | Supermemory ASMR | ~99% | Yes | Undisclosed | Research only, not in production |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6402:    53	| 7 | Supermemory (production) | ~85% | Yes | Undisclosed | — |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6426:    77	**Why MemPal beats Mem0 by 2×:** Mem0 uses an LLM to extract memories — it decides what to remember and discards the rest. When it extracts the wrong thing, the memory is gone. MemPal stores verbatim text. Nothing is discarded. The simpler approach wins because it doesn't lose information.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6474:/bin/zsh -lc "cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && rg -n \"session_bootstrap|memory_context|memory_search|memory_match_triggers|resume|protocol|hint|save|generate-context|compacting|experimental\\.session\\.compacting|memory save|trigger|dedup|cursor|includeContent|causal|lineage|quality|validate\" .opencode/skills/system-spec-kit/mcp_server/context-server.ts .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js .opencode/plugins/spec-kit-compact-code-graph.js" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6513:    38	import * as memoryIndexDiscovery from './handlers/memory-index-discovery.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6535:    60	import { primeSessionIfNeeded } from './hooks/memory-surface.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6563:    88	import * as memoryParser from './lib/parsing/memory-parser.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6578:   103	import * as workingMemory from './lib/cognitive/working-memory.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6733:   258	  surface: 'response-hints' | 'session-bootstrap' | 'memory-context';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6750:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:258:  surface: 'response-hints' | 'session-bootstrap' | 'memory-context';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6767:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:759:    'Key tools: memory_context, memory_search, memory_save, memory_index_scan, memory_stats.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6768:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:760:    'Graph retrieval: memory_search supports retrievalLevel (local/global/auto) for entity-level or community-level search. Graph provenance visible via graphEvidence in results.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6770:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:772:        snap.sessionQuality === 'critical' ? 'call memory_context(resume)' : 'ready';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6785:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:882:    if (name === 'memory_context' && args.mode === 'resume') {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6787:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:912:      name === 'memory_context' && args.mode === 'resume';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6788:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:964:    if (name !== 'memory_search' && name !== 'memory_context' && name !== 'memory_quick_search' && name !== 'session_health') {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6789:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:976:    // Phase 024: Code-search redirect hint for memory tools
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6790:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:977:    if ((name === 'memory_search' || name === 'memory_context') && result && !result.isError && result.content?.[0]?.text) {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6811:.opencode/skills/system-spec-kit/mcp_server/context-server.ts:1656:      console.error('[context-server] Auto-backfill triggered: %d rows seeded into active_memory_projection', result.seeded);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6825:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:53:import { validateQuery, requireDb, toErrorMessage } from '../utils/index.js';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6826:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:89:  deduplicateResults as deduplicateWithSessionState,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6827:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:100:// Feature catalog: Semantic and lexical search (memory_search)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6828:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:145:  dedupStats: Record<string, unknown>;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6829:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:151:  hints: string[];
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6830:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:176:  cursor?: string;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6831:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:191:  includeContent?: boolean;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6832:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:207:  min_quality_score?: number;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6833:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:211:  /** REQ-D5-003: Presentation profile ('quick'|'research'|'resume'|'debug'). Default: full response. */
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6834:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:281:    const hints = Array.isArray(envelope.hints)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6835:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:282:      ? envelope.hints.filter((hint): hint is string => typeof hint === 'string')
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6836:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:289:    return { summary, data, hints };
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6837:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:340:    tool: 'memory_search',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6838:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:343:    hints: payload.hints,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6839:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:454:      dedupStats: { enabled: false, sessionId: null }
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6840:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:458:  const { filtered, dedupStats } = sessionManager.filterSearchResults(sessionId, results as Parameters<typeof sessionManager.filterSearchResults>[1]);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6841:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:466:    dedupStats: {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6842:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:467:      ...dedupStats,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6843:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:482:/** Handle memory_search tool — performs hybrid vector/BM25 search with intent-aware ranking.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6844:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:493:    cursor,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6845:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:508:    includeContent: includeContent = false,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6846:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:517:    rerank = true, // Enable reranking by default for better result quality
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6847:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:524:    min_quality_score,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6848:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:543:  const hasCursor = typeof cursor === 'string' && cursor.trim().length > 0;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6849:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:547:    return { content: [{ type: 'text', text: JSON.stringify({ error: 'Either "query" (string), "concepts" (array with 2-5 items), or "cursor" (string) is required.' }) }] };
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6850:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:551:    const resolved = resolveCursor(cursor.trim(), undefined, { scopeKey: progressiveScopeKey });
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6851:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:554:        tool: 'memory_search',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6852:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:557:        details: { parameter: 'cursor' },
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6853:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:559:          hint: 'Retry the original search to generate a fresh continuation cursor',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6854:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:566:      tool: 'memory_search',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6855:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:578:  const qualityThreshold = resolveQualityThreshold(minQualityScore, min_quality_score);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6856:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:589:      normalizedQuery = validateQuery(query);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6857:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:594:          tool: 'memory_search',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6858:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:599:            hint: 'Provide a valid query string or use concepts array instead'
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6859:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:613:      tool: 'memory_search',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6860:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:614:      error: 'Either query (string), concepts (array of 2-5 strings), or cursor (string) is required',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6861:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:618:        hint: 'Provide a query string, concepts array with 2-5 entries, or a continuation cursor'
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6862:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:625:      tool: 'memory_search',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6863:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:630:        hint: 'Provide specFolder as a string path'
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6864:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:734:    qualityThreshold,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6865:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:738:    includeContent,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6866:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:751:  const cacheKey = toolCache.generateCacheKey('memory_search', cacheArgs);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6867:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:789:      includeContent,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6868:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:791:      qualityThreshold,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6869:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:834:                     quality_score, created_at
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6870:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:986:      causal: { applied: pipelineResult.metadata.stage2.causalBoostApplied },
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6871:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1000:      includeContent,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6872:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1044:      toolCache.set(cacheKey, cachePayload, { toolName: 'memory_search' });
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6873:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1062:      const deduped = deduplicateWithSessionState(existingResults, sessionId);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6874:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1063:      data.results = deduped.results as SessionAwareResult[];
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6875:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1064:      data.count = deduped.results.length;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6876:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1065:      data.sessionDedup = deduped.metadata;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6877:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1071:  // Apply session deduplication AFTER cache
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6878:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1079:        console.warn('[memory-search] Failed to parse cached response for dedup:', message);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6879:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1086:    // P1-018 — Validate response shape before dedup. If the cached response
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6880:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1087:    // Doesn't have the expected data.results array, log a warning and skip dedup
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6881:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1088:    // Rather than silently falling through to the un-deduped response.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6882:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1095:      console.warn('[memory-search] Cached response shape mismatch: missing "data" object, skipping dedup');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6883:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1097:      console.warn('[memory-search] Cached response shape mismatch: "data.results" is not an array, skipping dedup');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6884:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1101:      const { results: dedupedResults } = applySessionDedup(
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6885:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1108:      const dedupedCount = dedupedResults.length;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6886:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1109:      const filteredCount = originalCount - dedupedCount;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6887:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1116:      data.results = dedupedResults;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6888:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1117:      data.count = dedupedCount;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6889:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1119:      const dedupStats = {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6890:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1123:        returnedCount: dedupedCount,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6891:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1129:      resultsData.dedupStats = dedupStats;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6892:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1132:        (resultsData.meta as Record<string, unknown>).dedupStats = dedupStats;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6893:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1136:        resultsData.summary += ` (${filteredCount} duplicates filtered, ~${tokensSaved} tokens saved)`;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6894:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1283:  // REQ-014: Query flow tracking + result_cited for includeContent searches
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6895:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1317:        // Log result_cited for includeContent searches (content was embedded = cited)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6896:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1318:        if (includeContent && shownIds.length > 0) {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6897:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1374:const handle_memory_search = handleMemorySearch;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6898:.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1377:  handle_memory_search,
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6899:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:42:exports.validateArguments = validateArguments;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6900:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:48:// CLI entry point -- parses arguments, validates spec folder, and runs the memory workflow
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6901:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:62:Usage: node generate-context.js [options] <input>
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6902:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:66:                    - JSON file mode: node generate-context.js data.json [spec-folder]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6903:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:72:  --session-id <uuid>  Explicit session ID to attach to the saved memory metadata
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6904:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:75:  node generate-context.js /tmp/context-data.json
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6905:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:76:  node generate-context.js /tmp/context-data.json specs/001-feature/
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6906:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:77:  node generate-context.js /tmp/context-data.json .opencode/specs/001-feature/
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6907:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:78:  echo '{"specFolder":"specs/001-feature/"}' | node generate-context.js --stdin
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6908:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:79:  node generate-context.js --json '{"specFolder":"specs/001-feature/"}'
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6909:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:85:Preferred save path (JSON-PRIMARY):
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6910:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:93:    but they must not reroute the save to another folder.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6911:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:170:    return (0, path_security_1.validateFilePath)(path.resolve(core_1.CONFIG.PROJECT_ROOT, normalizedInput), (0, core_1.getSpecsDirectories)()) !== null;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6912:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:190:                        (0, path_security_1.validateFilePath)(candidate, (0, core_1.getSpecsDirectories)()) !== null) {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6913:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:219:        // (findChildFolderSync in validateArguments handles this, so just report the error here)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6914:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:391:function validateArguments() {
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6915:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:490:            console.error('[generate-context] Failed to list spec folders:', errMsg);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6916:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:493:    console.error('\nUsage: node generate-context.js [--stdin [spec-folder-name] | --json <json> [spec-folder-name] | <data-file> [spec-folder-name]]\n');
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6917:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:505:        validateArguments();
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6918:.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js:546://# sourceMappingURL=generate-context.js.map
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6921:/bin/zsh -lc "nl -ba /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts | sed -n '1,260p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:6942:    20	// Artifact-class routing (spec/plan/tasks/checklist/memory)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7022:   100	// Feature catalog: Semantic and lexical search (memory_search)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7051:   129	  memoryState?: string;
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7167:   245	    console.warn('[memory-search] Failed to attach telemetry payload:', message);
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7187:/bin/zsh -lc "nl -ba /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js | sed -n '62,120p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7215:    62	Usage: node generate-context.js [options] <input>
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7219:    66	                    - JSON file mode: node generate-context.js data.json [spec-folder]
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7225:    72	  --session-id <uuid>  Explicit session ID to attach to the saved memory metadata
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7228:    75	  node generate-context.js /tmp/context-data.json
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7229:    76	  node generate-context.js /tmp/context-data.json specs/001-feature/
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7230:    77	  node generate-context.js /tmp/context-data.json .opencode/specs/001-feature/
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7231:    78	  echo '{"specFolder":"specs/001-feature/"}' | node generate-context.js --stdin
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7232:    79	  node generate-context.js --json '{"specFolder":"specs/001-feature/"}'
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7235:    82	  Creates a memory file in <spec-folder>/memory/ with ANCHOR format
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7236:    83	  for indexing by the Spec Kit Memory system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7278:   759	    'Key tools: memory_context, memory_search, memory_save, memory_index_scan, memory_stats.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7279:   760	    'Graph retrieval: memory_search supports retrievalLevel (local/global/auto) for entity-level or community-level search. Graph provenance visible via graphEvidence in results.',
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7291:   772	        snap.sessionQuality === 'critical' ? 'call memory_context(resume)' : 'ready';
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7317:     4	- **Why it matters for us**: This is the one new architecture that Public genuinely lacks. The risk is governance, not mechanics: uncited fact insertion, ambiguous invalidation, silent drift between fact rows and verbatim memory, and agent-written “truth” that outruns its evidence. If we build this, it needs mandatory citations, authority tiers, correction workflows, and separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7347:    34	- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7349:    36	- [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7362:    49	Prototype the narrowest viable Public experiment: add a short, stable memory-behavior hint block to bootstrap/status output, and test one compaction-time preservation checkpoint that writes only JSON-primary evidence through `generate-context.js` without adopting MemPalace’s blocking auto-save loop or full taxonomy.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7369:    56	You are a research specialist in verbatim AI memory systems, ChromaDB-based semantic retrieval, navigable memory taxonomies, wake-up context layering, MCP tool design, hook-driven persistence, and local temporal knowledge graphs. Work like a systems analyst who can separate README positioning from verified Python mechanics, trace how MemPalace composes mining, storage, retrieval, hooks, and protocol guidance, and translate those choices into practical improvements for `Code_Environment/Public`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7373:    60	Research MemPalace's raw-verbatim memory architecture, palace taxonomy, wake-up stack, MCP protocol/tooling, hook-driven save flow, and temporal knowledge-graph patterns to identify practical, evidence-backed improvements for `Code_Environment/Public`, especially around session continuity, compaction survival, memory hygiene, and agent-facing recall ergonomics. Determine which MemPalace ideas should be `adopt now`, `prototype later`, or `reject`. Keep the analysis honest about what is source-confirmed, what is README-documented, and what is benchmark-claim territory.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7379:    66	MemPalace is a local Python memory system centered on a strong design claim: keep raw conversation and project text instead of extracting only summarized facts, then make that verbatim corpus searchable and navigable. The external repo exposes a CLI, an MCP server, hook scripts, a ChromaDB-backed drawer store, a wake-up layering system, and a separate SQLite temporal knowledge graph. Its storage model uses palace terminology: wings for people/projects/topics, halls for shared memory categories, rooms for named ideas, closets for compact summaries, and drawers for original verbatim content.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7383:    70	The repo appears to support three ingestion shapes into one shared memory backend: project mining, conversation mining, and a general heuristic extraction mode. Retrieval then spans direct semantic search, wake-up text generation across L0-L3 layers, palace graph traversal via shared room metadata, and MCP tooling that teaches an operational memory protocol to the agent through the status response itself. Hook scripts add another layer: instead of a memory system that only responds to explicit search/save calls, MemPalace also tries to shape the timing of memory writes at stop and pre-compact boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7389:    76	| 001 | Engram | MCP memory server (Go, SQLite+FTS5) | 005 (memory server), 004 (session continuity) | Focus tool profiles, session lifecycle, topic keys |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7391:    78	| 003 | Modus Memory | FSRS spaced repetition + BM25 | 005 (local memory) | Focus FSRS decay, BM25, librarian expansion, cross-references |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7393:    80	| 005 | MemPalace | Raw verbatim storage + palace taxonomy + hooks + temporal KG | 001 (MCP memory), 004 (compaction/helping memory survive), 003 (local memory) | Focus raw-no-extraction posture, wake-up layers, hooks, palace structure, temporal KG |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7397:    84	`Code_Environment/Public` already has Spec Kit Memory with hybrid retrieval, `memory_search`, `memory_context`, `memory_match_triggers`, memory-save flows through `generate-context.js`, session/bootstrap handling in the memory MCP server, and compaction-oriented structural transport via `.opencode/plugins/spec-kit-compact-code-graph.js`. It also already has semantic code search via CocoIndex and structured graph context via Compact Code Graph.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7399:    86	What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7414:   101	12. Compare MemPalace directly against current `Code_Environment/Public` code: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`, `.opencode/skills/system-spec-kit/mcp_server/context-server.ts`, `.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js`, and `.opencode/plugins/spec-kit-compact-code-graph.js`. Be explicit about what Public already covers better and what MemPalace still contributes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7421:   108	    Research the external repository at /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external and identify concrete improvements for Code_Environment/Public, especially around raw verbatim memory storage, palace taxonomy (wings/halls/rooms), wake-up context layering, MCP protocol/tool design, hook-driven save flows, and temporal knowledge-graph patterns.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7423:   110	15. Save all outputs inside `research/`, with `research/research.md` as the canonical report. Every meaningful finding must cite exact file paths, say whether the evidence is `source-confirmed`, `README-documented`, `benchmark-documented`, or mixed, explain why it matters for `Code_Environment/Public`, classify the recommendation as `adopt now`, `prototype later`, or `reject`, identify the affected subsystem, and note migration or truthfulness risk. When research is complete, update `checklist.md`, create `implementation-summary.md`, and save memory with:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7425:   112	    cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js "/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace"
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7430:   117	1. What does MemPalace gain from its raw-verbatim "store everything, then make it findable" posture, and where would that improve or conflict with Spec Kit Memory's more selective save and retrieval model?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7432:   119	3. How does the L0/L1/L2/L3 wake-up stack compare with Public's `session_bootstrap`, `memory_context`, and compaction-recovery flows, and what parts of the layering model are reusable here?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7433:   120	4. What does `mcp_server.py` gain by embedding `PALACE_PROTOCOL` and `AAAK_SPEC` directly in the status bootstrap, and could Public benefit from similarly direct memory-usage guidance without adding prompt clutter?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7434:   121	5. How effective are the stop-hook and pre-compact-hook patterns at protecting context before loss, and how do they compare to Public's existing compaction-oriented structural plugin and memory-save workflows?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7438:   125	9. Which MemPalace ideas most improve compaction survival and startup continuity for future Public sessions: wake-up layers, hook timing, memory protocol bootstrapping, diary writing, or taxonomy-based narrowing?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7450:   137	- Do map strong findings to specific Public subsystems such as Spec Kit Memory retrieval, context bootstrap, save flows, or compaction handling.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7471:   158	- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7473:   160	- Affected area: memory bootstrap UX, session recovery guidance, compaction recovery behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7484:   171	- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7486:   173	- Affected area: memory save automation, compaction resilience, agent operating protocol
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7511:   198	- comparison against current Public memory, bootstrap, save, and compaction flows
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7523:   210	Rank findings in this order: leverage for Public session continuity, compaction-survival value, truthfulness and evidence quality, fit with current Spec Kit Memory capabilities, operational simplicity, memory-hygiene impact, and clean differentiation from phases `001` through `004`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7529:   216	- explicit comparison against current Public memory retrieval, bootstrap, save, and compaction behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7533:   220	- memory saved from this phase folder using `generate-context.js`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7550:   237	  - **Role** is specialized in verbatim memory systems, wake-up layering, MCP protocol design, hooks, and temporal KG behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7567:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-013.md:9826:### Finding 3: A strong memory system can have multiple planes of truth without forcing them into one index
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7572:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7583:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:7931:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7588:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-012.md:8016:### Finding 5: Public should preserve its modular handler architecture and not absorb new memory features into a single giant server file
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7596:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9834:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7602:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-015.md:9928:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7605:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-016.md:1:### Finding 4: Public already has a partial analogue, but it stops at memory lineage rather than first-class facts
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7637:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12453:### Finding 1: Public lacks a first-class identity capsule separate from searchable memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7641:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12481:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7642:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12542:### Finding 1: Public lacks a first-class identity capsule separate from searchable memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7646:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-011.md:12570:### Finding 5: Public is missing topic-bridge navigation across memory domains
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7669:MemPalace contributes two near-term ideas worth carrying into Public now: a compaction-time structured save checkpoint and a short bootstrap hint layer that teaches memory behavior. Everything else should stay scoped: selective verbatim evidence retention and layered wake-up are worth prototyping, a temporal fact plane is a separate net-new feature track, and full taxonomy plus AAAK/diary-centric recall should be rejected as primary architecture. I used prior phase memory only to recover continuity; the findings below are based on current-turn source reads.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7673:- **Source**: [hooks/README.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/README.md), [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh), [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7675:- **Why it matters for us**: This is the highest-leverage continuity improvement with the smallest architecture change. The safe Public version is one compaction-time checkpoint that writes curated JSON through `generate-context.js`, with dedupe/last-save guards.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7681:- **What it does**: `mempalace_status` returns counts plus `PALACE_PROTOCOL`, telling the agent when to search, verify, diary-write, and invalidate facts. Public already emits recovery/bootstrap hints, so it can add a short memory-behavior hint block without inventing a second protocol surface.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7682:- **Why it matters for us**: MemPalace’s strongest UX idea is not the palace metaphor; it is that the memory system teaches the agent how to use it. Public can get that benefit with 3-5 concrete hints, not a new subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7687:- **Source**: [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py), [miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/miner.py), [convo_miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py), [general_extractor.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7694:- **Source**: [layers.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/layers.py), [context-server.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/context-server.ts), [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7696:- **Why it matters for us**: Public already has `session_bootstrap`, `memory_context`, hints, profiles, and progressive disclosure. The right transfer is a “wake-up profile” on the existing retrieval stack, not a second memory engine or AAAK-first startup contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7703:- **Why it matters for us**: Public does not have this architecture today. It is the clearest long-term differentiator, but only if built with mandatory citations, authority tiers, correction review, and strict separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7707:### Finding 6: AAAK and diary-centric memory should stay out of the core recall path
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7742:- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7743:- [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7754:- What did not work: the phase folder still lacks the expected Level 3 docs, the strict validator reported `RESULT: PASSED` while also emitting `cannot create temp file for here document: Operation not permitted`, the environment is read-only so I could not update `research/research.md` or save memory, and CocoIndex was unavailable in this session
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7757:1. Implement one compaction-time preservation checkpoint on Public’s existing `experimental.session.compacting` surface that writes only structured JSON through [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js).
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7758:2. Add a 3-5 line memory-behavior hint block to bootstrap/status output, not a second protocol manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7760:4. Test a wake-up/recovery profile on top of existing `session_bootstrap` and `memory_search`, not a separate L0-L3 storage system.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7774:MemPalace contributes two near-term ideas worth carrying into Public now: a compaction-time structured save checkpoint and a short bootstrap hint layer that teaches memory behavior. Everything else should stay scoped: selective verbatim evidence retention and layered wake-up are worth prototyping, a temporal fact plane is a separate net-new feature track, and full taxonomy plus AAAK/diary-centric recall should be rejected as primary architecture. I used prior phase memory only to recover continuity; the findings below are based on current-turn source reads.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7778:- **Source**: [hooks/README.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/README.md), [mempal_save_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_save_hook.sh), [mempal_precompact_hook.sh](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/hooks/mempal_precompact_hook.sh), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7780:- **Why it matters for us**: This is the highest-leverage continuity improvement with the smallest architecture change. The safe Public version is one compaction-time checkpoint that writes curated JSON through `generate-context.js`, with dedupe/last-save guards.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7786:- **What it does**: `mempalace_status` returns counts plus `PALACE_PROTOCOL`, telling the agent when to search, verify, diary-write, and invalidate facts. Public already emits recovery/bootstrap hints, so it can add a short memory-behavior hint block without inventing a second protocol surface.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7787:- **Why it matters for us**: MemPalace’s strongest UX idea is not the palace metaphor; it is that the memory system teaches the agent how to use it. Public can get that benefit with 3-5 concrete hints, not a new subsystem.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7792:- **Source**: [searcher.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/searcher.py), [miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/miner.py), [convo_miner.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/convo_miner.py), [general_extractor.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/general_extractor.py), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7799:- **Source**: [layers.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/layers.py), [context-server.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/context-server.ts), [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7801:- **Why it matters for us**: Public already has `session_bootstrap`, `memory_context`, hints, profiles, and progressive disclosure. The right transfer is a “wake-up profile” on the existing retrieval stack, not a second memory engine or AAAK-first startup contract.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7808:- **Why it matters for us**: Public does not have this architecture today. It is the clearest long-term differentiator, but only if built with mandatory citations, authority tiers, correction review, and strict separation from ordinary memory writes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7812:### Finding 6: AAAK and diary-centric memory should stay out of the core recall path
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7847:- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7848:- [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7859:- What did not work: the phase folder still lacks the expected Level 3 docs, the strict validator reported `RESULT: PASSED` while also emitting `cannot create temp file for here document: Operation not permitted`, the environment is read-only so I could not update `research/research.md` or save memory, and CocoIndex was unavailable in this session
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7862:1. Implement one compaction-time preservation checkpoint on Public’s existing `experimental.session.compacting` surface that writes only structured JSON through [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js).
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7863:2. Add a 3-5 line memory-behavior hint block to bootstrap/status output, not a second protocol manual.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-020.md:7865:4. Test a wake-up/recovery profile on top of existing `session_bootstrap` and `memory_search`, not a separate L0-L3 storage system.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-012.md:18:- [SOURCE: .opencode/skills/system-spec-kit/scripts/spec/create.sh:590-880] Phase mode injects parent maps, handoff tables, child folders, `memory/`, `scratch/`, and description generation for each phase child.
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:45: * Creates an in-memory SQLite database with the surrogate table.
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:48:  const db = new Database(':memory:');
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:583:  it('returns null for non-existent memory ID', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:599:  it('handles multiple memory IDs independently', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:655:    const db = new Database(':memory:');
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:656:    // Do NOT create memory_surrogates table
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:662:    const db = new Database(':memory:');
.opencode/skills/system-spec-kit/mcp_server/tests/query-surrogates.vitest.ts:807:    const db = new Database(':memory:');
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/plan.md:2:title: "Implementation Plan: Generate Context Subfolder [system-spec-kit/z_archive/006-generate-context-subfolder/plan]"
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/plan.md:31:This archive repair keeps the original generate-context subfolder support topic but reduces the folder to a clean Level 1 archive package. The plan is to restore the core documents and validate until the folder reports zero errors.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/18-atomic-write-then-index-api.md:5:phase_018_change: "Phase 018 kept the atomic write/index/rename behavior but moved the canonical writer helper into handlers/save/atomic-index-memory.ts behind the spec-doc record-save wrapper."
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/18-atomic-write-then-index-api.md:20:The `memory_save` path now delegates the canonical atomic writer to `handlers/save/atomic-index-memory.ts`. It still computes a unique pending path, writes the spec-doc record content to that pending file, runs async indexing against the target file path before promotion, retries indexing once on transient failure, and only then renames the pending file into place. If validation, rejection, or indexing fails, the handler deletes the pending file so the original file remains untouched.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/18-atomic-write-then-index-api.md:22:This means the current implementation is a compatibility wrapper in `memory-save.ts` with the writer helper living in `handlers/save/atomic-index-memory.ts`, while `transaction-manager.ts` still supplies pending-path and cleanup helpers. The result is atomic file promotion plus guarded best-effort index consistency: a failed index attempt rolls back before rename, while a post-index rename failure leaves the pending file in place for recovery and returns `dbCommitted: true`.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/18-atomic-write-then-index-api.md:32:| `mcp_server/handlers/memory-save.ts` | Handler | Direct pending-write, async index, rollback, and final rename orchestration |
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/18-atomic-write-then-index-api.md:33:| `mcp_server/handlers/save/atomic-index-memory.ts` | Handler | Canonical atomic writer helper behind the save wrapper |
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/18-atomic-write-then-index-api.md:43:| `mcp_server/tests/handler-memory-save.vitest.ts` | Atomic-save retry and rollback behavior in handler flow |
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:78:/** Create a fresh test database with memory_index table + FTS5. */
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:84:    CREATE TABLE IF NOT EXISTS memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:103:    CREATE VIRTUAL TABLE IF NOT EXISTS memory_fts USING fts5(
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:108:      content='memory_index',
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:116:/** Insert a test memory with known created_at timestamp. */
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:135:    INSERT INTO memory_index (id, title, trigger_phrases, created_at, importance_tier, validation_count, confidence)
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:167:    const expected = ['memory', 'session', 'context', 'spec', 'folder'];
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:215:    const columns = testDb.prepare('PRAGMA table_info(memory_index)').all() as Array<{ name: string }>;
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:238:    badDb.exec('DROP TABLE IF EXISTS memory_fts');
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:240:      CREATE VIRTUAL TABLE memory_fts USING fts5(
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:246:        content='memory_index',
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:262:    const columns = testDb.prepare('PRAGMA table_info(memory_index)').all();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:421:        memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:430:      'INSERT INTO learned_feedback_audit (memory_id, action, terms, timestamp, source, shadow_mode) VALUES (?, ?, ?, ?, ?, ?)'
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:475:    expect(result.reason).toBe('memory_too_new');
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:482:      'INSERT INTO learned_feedback_audit (memory_id, action, terms, timestamp, source, shadow_mode) VALUES (?, ?, ?, ?, ?, ?)'
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:491:    const row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get() as { learned_triggers?: string };
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:508:    const row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:514:  it('R11-CO06: rate cap - max 8 terms per memory (Safeguard #4)', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:521:    const row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:529:    const row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:541:    const match = matches.find((m) => m.memoryId === 1);
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:557:      'INSERT INTO learned_feedback_audit (memory_id, action, terms, timestamp, source, shadow_mode) VALUES (?, ?, ?, ?, ?, ?)'
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:603:    testDb.prepare('UPDATE memory_index SET learned_triggers = ? WHERE id = 1')
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:609:    const row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:619:    let row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:628:    row = testDb.prepare('SELECT learned_triggers FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:675:    expect(audit[0].memoryId).toBe(1);
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:689:  it('R11-AL03: getAuditLog supports global query (no memoryId)', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:776:    const row = testDb.prepare('SELECT importance_tier FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:785:    const row = testDb.prepare('SELECT importance_tier FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:794:    const row = testDb.prepare('SELECT importance_tier FROM memory_index WHERE id = 1').get();
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:807:  it('R11-AP11: memory_not_found returns safe default', () => {
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:810:    expect(result.reason).toBe('memory_not_found');
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:836:      CREATE TABLE IF NOT EXISTS memory_promotion_audit (
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:838:        memory_id INTEGER NOT NULL,
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:849:        INSERT INTO memory_promotion_audit
.opencode/skills/system-spec-kit/mcp_server/tests/learned-feedback.vitest.ts:850:          (memory_id, previous_tier, new_tier, validation_count, promoted_at)
.opencode/skills/system-spec-kit/mcp_server/code_graph/README.md:3:description: "Structural code graph indexer, query handlers, scan-scope defaults, and context-surface contracts for the Spec Kit Memory MCP server."
.opencode/skills/system-spec-kit/mcp_server/code_graph/README.md:15:> Structural code graph for the Spec Kit Memory MCP server. Indexes functions, classes, imports, and call edges into SQLite for `code_graph_*` MCP tools and OpenCode plugin context surfaces.
.opencode/skills/system-spec-kit/mcp_server/code_graph/README.md:256:| [Spec Kit Memory MCP Server README](../README.md) | Parent MCP server documentation |
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/03-session-start-priming.md:16:This hook handles four session start scenarios: after compaction it reads the cached PreCompact payload, on fresh startup it surfaces a Spec Kit Memory overview plus the shared startup payload (`graphQualitySummary`, `sharedPayloadTransport`), on resume it loads prior session state, and after /clear it provides minimal context. The output is written to stdout for Claude Code to inject into the conversation. The same payload shape is transported by `hooks/gemini/session-prime.ts`, `hooks/copilot/session-prime.ts`, and `hooks/codex/session-start.ts`.
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/03-session-start-priming.md:22:The SessionStart hook routes by `source` field from stdin JSON. For `compact`: reads cached payload from hook state, injects, clears cache. For `startup`: outputs Spec Kit Memory tool overview. For `resume`: loads lastSpecFolder from hook state and points recovery back to `/spec_kit:resume` with the `handover.md -> _memory.continuity -> spec docs` chain. For `clear`: minimal output. Token budget: 2000 for startup/resume, 4000 for compact.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:2:title: "EX-002 -- Semantic and lexical search (memory_search)"
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:3:description: "This scenario validates Semantic and lexical search (memory_search) for `EX-002`. It focuses on Hybrid precision check."
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:7:# EX-002 -- Semantic and lexical search (memory_search)
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:11:This scenario validates Semantic and lexical search (memory_search) for `EX-002`. It focuses on Hybrid precision check.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:20:- Prompt: `As a retrieval validation operator, validate Semantic and lexical search (memory_search) against memory_search({ query:"checkpoint restore clearExisting transaction rollback", limit:20 }). Verify relevant ranked results with hybrid signals. Return a concise pass/fail verdict with the main reason and cited evidence.`
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:31:As a retrieval validation operator, validate Hybrid precision check against memory_search({ query:"checkpoint restore clearExisting transaction rollback", limit:20 }). Verify relevant ranked results with hybrid signals. Return a concise pass/fail verdict with the main reason and cited evidence.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:36:1. memory_search({ query:"checkpoint restore clearExisting transaction rollback", limit:20 })
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:37:2. memory_search({ query:"checkpoint restore clearExisting transaction rollback", limit:20, bypassCache:true })
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:59:- Feature catalog: [01--retrieval/02-semantic-and-lexical-search-memorysearch.md](../../feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md)
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md:68:- Feature file path: `01--retrieval/002-semantic-and-lexical-search-memory-search.md`
.opencode/skills/system-spec-kit/scripts/utils/README.md:36:These shared helpers support the Gate E continuity model where `/spec_kit:resume` is the recovery surface and packet continuity is rebuilt from `handover.md` -> `_memory.continuity` -> spec docs. Generated continuity support artifacts remain supporting only.
.opencode/skills/system-spec-kit/scripts/utils/README.md:137:├── memory-frontmatter.ts      # Memory document frontmatter parsing and formatting
.opencode/skills/system-spec-kit/scripts/utils/README.md:145:├── task-enrichment.ts         # Task title enrichment from spec titles and memory context
.opencode/skills/system-spec-kit/scripts/utils/README.md:161:├── memory-frontmatter.js
.opencode/skills/system-spec-kit/scripts/utils/README.md:190:| `memory-frontmatter.ts` | Builds and normalizes frontmatter metadata for memory documents |
.opencode/skills/system-spec-kit/scripts/utils/README.md:199:| `task-enrichment.ts` | Task title enrichment from spec titles and memory context for higher-quality memory naming |
.opencode/skills/system-spec-kit/scripts/utils/README.md:331:| [Memory System](../../references/memory/memory_system.md) | Uses input-normalizer for memory save data |
.opencode/skills/system-spec-kit/mcp_server/tests/empty-result-recovery.vitest.ts:18:  'save_memory',
.opencode/skills/system-spec-kit/mcp_server/tests/empty-result-recovery.vitest.ts:237:        query: 'memory search response policy',
.opencode/skills/system-spec-kit/mcp_server/tests/empty-result-recovery.vitest.ts:238:        normalizedQuery: 'memory search response policy',
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:9:Yes. The internal roster likely needs to stay richer than the external repo's, but the current public role taxonomy is broader than most operators need to hold in working memory.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:12:I compared the internal agent inventory, orchestrator routing table, and handover specialization against the external repo's much smaller visible role set to identify where role granularity is helping versus fragmenting the UX.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:15:- [SOURCE: .opencode/README.md:97-117] The framework documents a 12-agent model with explicit user-facing descriptions for orchestration, context, research, review, write, handover, ultra-think, and more.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:18:- [SOURCE: .opencode/agents/handover.md:22-32] `@handover` is a dedicated continuation specialist with its own template and lifecycle contract.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:19:- [SOURCE: .opencode/agents/handover.md:40-58] Its actual work is focused and useful, but narrow.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:24:Phase 2 already showed that collapsing everything into three roles would be wrong for `system-spec-kit`; research, docs, and debug specialists are real value. But Phase 3 surfaces a different problem: too many of those distinctions are operator-visible. The result is a roster that reads more like an internal microservice map than a human-friendly collaboration model. `@handover` is the clearest example. It makes sense as a specialized implementation detail, yet the user usually thinks in terms of "end session" or "continue later," not "invoke the handover role." The external repo's lesson is not "use only three agents." It is "make visible roles correspond to distinct user intents."
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:28:finding: keep specialist internals, but reduce the visible agent taxonomy to a smaller set of user-intent roles and demote narrow utilities like handover into command-owned behaviors where possible.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:44:- **If REFACTOR/PIVOT/SIMPLIFY — concrete proposal:** keep the internal specialist files, but group public roles into a smaller set such as build, review, research, docs, and recovery, with utilities like handover hidden behind commands.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:53:- **What system-spec-kit could DELETE to improve UX:** public emphasis on narrow utility roles such as `@handover` as peer concepts to core execution roles.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-026.md:62:- Should handover and write stay separate public agents or become command behaviors?
.opencode/skills/system-spec-kit/mcp_server/tests/copilot-hook-wiring.vitest.ts:79:    expect(written).toContain('Spec Kit Memory Auto-Generated Context');
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/03-chunk-ordering-preservation.md:19:When multi-chunk results collapse back into a single memory during MPAB aggregation, chunks are now sorted by their original `chunk_index` so the consuming agent reads content in document order rather than score order. The reassembly helper also reads both snake_case and camelCase chunk metadata (`parent_id`/`parentId`, `chunk_index`/`chunkIndex`, `chunk_label`/`chunkLabel`), so callers using formatter-style keys still hit the collapse path instead of silently passing through as separate rows. Full parent content is loaded from the database when possible. On DB failure, the best-scoring chunk is emitted as a fallback with `contentSource: 'file_read_fallback'` metadata.
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:8:// Content-aware slug generation for memory filenames
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:29:  /^to promote a memory\b/i,
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:69: * Normalizes a raw memory name candidate by stripping filename artifacts
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:91:  // Strip memory filename artifacts: "DD-MM-YY_HH-MM__content.md" → "content"
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:110: * Checks if a memory name candidate contains timestamp or filename artifacts,
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:113: * @param candidate - The candidate memory name to check.
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:191: * Ensure a memory filename is unique within a context directory.
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:194: * @param contextDir - Absolute path to the memory directory.
.opencode/skills/system-spec-kit/scripts/utils/slug-utils.ts:260: * @returns A truncated, word-boundary-aware slug for use in memory filenames.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-003.md:29:finding: Fresh context per attempt is portable and already culturally compatible with `system-spec-kit`. The repo does not need to invent a new memory model for retries; it can extend the existing fresh-context plus externalized-state pattern from deep research into implementation retry flows.
.opencode/specs/system-spec-kit/z_future/agentic-system-upgrade/001-research-agentic-systems/004-get-it-right-main/research/iterations/iteration-003.md:39:I looked for evidence that internal long-running workflows prefer cumulative thread memory. The dominant internal deep-research contract points the other way: fresh dispatches with externalized state are already the standard for iterative work.
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:2:title: Repeated CHANGELOG review for generate-context-subfolder 2026-02-15 [123-generate-context-subfolder/15-02-26_13-39__generate-context-subfolder]
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:4:  CHANGELOG format for generate-context-subfolder. The session used read/glob/bash
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:19:  To promote a memory to constitutional tier (always surfaced):
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:22:     memory_update({ id: <memory_id>, importanceTier: 'constitutional' })
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:30:     memory_update({ 
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:31:       id: <memory_id>, 
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:39:     - "Memory files MUST use generate-context.js script"
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:50:| Spec Folder | system-spec-kit/z_archive/006-generate-context-subfolder |
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:99:- [Memory Metadata](#memory-metadata)
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:108:**Quick resume context for session continuation and handover.**
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:140:/spec_kit:resume system-spec-kit/z_archive/006-generate-context-subfolder
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:146:Spec: system-spec-kit/z_archive/006-generate-context-subfolder
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:368:| Context Loss | Agent doesn't remember prior work | Run `/spec_kit:resume system-spec-kit/z_archive/006-generate-context-subfolder` |
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:370:| Memory Not Found | Search returns no results | Check `memory_search({ specFolder: "system-spec-kit/z_archive/006-generate-context-subfolder" })` |
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:373:| Dedup Collision | Wrong memory surfaced | Check `fingerprint_hash` for conflicts |
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:378:# Check memory index health
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:382:memory_search({ specFolder: "system-spec-kit/z_archive/006-generate-context-subfolder", limit: 10 })
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:384:# Verify memory file integrity
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:385:ls -la system-spec-kit/z_archive/006-generate-context-subfolder/memory/
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:388:memory_search({ query: "orphaned", anchors: ["state"] })
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:391:node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js system-spec-kit/z_archive/006-generate-context-subfolder --force
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:397:2. **Load memory context** - Use memory_search to surface prior work
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:400:5. **Resume with handover prompt** - Use continuation template above
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:453:<a id="memory-metadata"></a>
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:459:> **Machine-Readable Section** - This YAML block is parsed by the semantic memory indexer for search optimization and decay calculations.
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:464:spec_folder: "system-spec-kit/z_archive/006-generate-context-subfolder"
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:472:memory_classification:
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:473:  memory_type: ""         # episodic|procedural|semantic|constitutional
.opencode/specs/system-spec-kit/z_archive/006-generate-context-subfolder/scratch/legacy-memory-quarantine/15-02-26_13-39__generate-context-subfolder.md:576:parent_spec: "system-spec-kit/z_archive/006-generate-context-subfolder"
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:2:title: "EX-003 -- Trigger phrase matching (memory_match_triggers)"
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:3:description: "This scenario validates Trigger phrase matching (memory_match_triggers) for `EX-003`. It focuses on Fast recall path."
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:7:# EX-003 -- Trigger phrase matching (memory_match_triggers)
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:11:This scenario validates Trigger phrase matching (memory_match_triggers) for `EX-003`. It focuses on Fast recall path plus trigger-cache reload efficiency.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:20:- Prompt: `As a retrieval validation operator, validate Trigger phrase matching (memory_match_triggers) against memory_match_triggers(prompt,include_cognitive:true,sessionId:ex003). Verify fast trigger hits + cognitive enrichment + partial-index-backed trigger-cache reload + per-connection prepared-statement reuse. Return a concise pass/fail verdict with the main reason and cited evidence.`
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:31:As a retrieval validation operator, validate Fast recall path plus trigger-cache reload efficiency against memory_match_triggers(prompt,include_cognitive:true,sessionId:ex003). Verify fast trigger hits + cognitive enrichment + partial-index-backed trigger-cache reload + per-connection prepared-statement reuse. Return a concise pass/fail verdict with the main reason and cited evidence.
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:36:1. Run `memory_match_triggers(prompt,include_cognitive:true,sessionId:ex003)` and capture the returned matches
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:61:- Feature catalog: [01--retrieval/03-trigger-phrase-matching-memorymatchtriggers.md](../../feature_catalog/01--retrieval/03-trigger-phrase-matching-memorymatchtriggers.md)
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md:70:- Feature file path: `01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md`
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-regression-reconsolidation.vitest.ts:66:vi.mock('../handlers/memory-crud-utils', () => ({
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-regression-reconsolidation.vitest.ts:95:    memoryType: 'memory',
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-regression-reconsolidation.vitest.ts:96:    memoryTypeSource: 'test',
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/19-embedding-retry-orchestrator.md:19:The retry manager (`lib/providers/retry-manager.ts`) orchestrates background retry of failed embedding operations. When the primary embedding provider is unavailable or returns errors during `memory_save` or `memory_index_scan`, the affected memories are marked with `embedding_status = 'pending'` and stored without vectors (lexical-only fallback). The retry manager runs as a background job with configurable interval and batch size, picking up pending memories and re-attempting embedding generation.
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/19-embedding-retry-orchestrator.md:21:Each retry attempt uses the embedding cache to avoid redundant API calls for content that was previously embedded successfully. The retry stats (`pending`, `retry`, `failed` counts) are exposed for monitoring. Failed memories increment a `retry_count` for progressive backoff. On success, the retry manager itself updates `memory_index`, clears any prior `vec_memories` row for the spec-doc record, and inserts the refreshed embedding buffer as part of its transaction.
.opencode/skills/system-spec-kit/mcp_server/tests/edge-density.vitest.ts:18:   HELPERS — build an in-memory test DB with required tables
.opencode/skills/system-spec-kit/mcp_server/tests/edge-density.vitest.ts:22:  const db = new Database(':memory:');
.opencode/skills/system-spec-kit/mcp_server/tests/edge-density.vitest.ts:49:    CREATE TABLE IF NOT EXISTS memory_index (
.opencode/skills/system-spec-kit/mcp_server/tests/edge-density.vitest.ts:69:/** Insert N memory rows (IDs 1..n). */
.opencode/skills/system-spec-kit/mcp_server/tests/edge-density.vitest.ts:72:    'INSERT INTO memory_index (id, title) VALUES (?, ?)',
.opencode/skills/system-spec-kit/mcp_server/tests/edge-density.vitest.ts:292:    it('totalMemories reflects memory_index count', () => {
.opencode/skills/system-spec-kit/scripts/utils/memory-frontmatter.ts:14:} from '../lib/memory-frontmatter.js';
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:2:title: "Single and folder delete (memory_delete)"
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:8:# Single and folder delete (memory_delete)
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:14:You can remove one memory at a time or clear out an entire folder at once. Before a big deletion, the system takes a snapshot so you can undo it if you change your mind. Deletions are all-or-nothing: either everything you asked to remove is gone or nothing changes at all. This prevents situations where only half the data gets deleted and the rest is left in a messy state.
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:34:| `mcp_server/handlers/memory-crud-delete.ts` | Handler | Delete handler: single-ID and bulk-folder delete with atomic transactions |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:35:| `mcp_server/handlers/memory-crud-utils.ts` | Handler | Shared CRUD utility helpers (ledger append, hash snapshot) |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:36:| `mcp_server/handlers/memory-crud-types.ts` | Handler | Delete argument type definitions |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:40:| `mcp_server/lib/storage/causal-edges.ts` | Lib | Causal edge cleanup per deleted memory |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:43:| `mcp_server/lib/storage/history.ts` | Lib | Per-memory DELETE history writes |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:51:| `mcp_server/tests/handler-memory-crud.vitest.ts` | CRUD handler validation |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:52:| `mcp_server/tests/memory-crud-extended.vitest.ts` | Extended transactional mutation scenarios |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:53:| `mcp_server/tests/memory-delete-cascade.vitest.ts` | Delete cascade behavior |
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md:63:- Source feature title: Single and folder delete (memory_delete)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:2:- **Source**: [onboarding.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/onboarding.py#L28), [onboarding.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/onboarding.py#L120), [onboarding.py](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/mempalace/onboarding.py#L175), [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts#L533), [memory-context.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts#L827) (source-confirmed)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:9:- **Source**: [README.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md#L52), [README.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/README.md#L262), [BENCHMARKS.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external/benchmarks/BENCHMARKS.md#L24), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js#L85), [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts#L682) (mixed: source-confirmed + README-documented + benchmark-documented)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:11:- **Why it matters for us**: A memory system is not trustworthy if its interfaces blur what is stored, what is derived, what is experimental, and what is benchmark-only. Evidence tiering needs to be part of the product contract, not just a doc habit.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:24:- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts), [memory-context.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts), [context-server.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/context-server.ts), [generate-context.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js), [spec-kit-compact-code-graph.js](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/plugins/spec-kit-compact-code-graph.js)
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:29:- Questions addressed: lifecycle-timed preservation, wake-up vs response compilation, separate memory planes, authority boundaries, identity/taxonomy layering, truthfulness boundaries
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:30:- Questions answered: the biggest shift MemPalace suggests is not room-first retrieval but a broader model where memory is lifecycle policy plus multiple bounded representations; Public should preserve its query-led, governed architecture and selectively borrow checkpointing and temporal-fact ideas
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:44:You are a research specialist in verbatim AI memory systems, ChromaDB-based semantic retrieval, navigable memory taxonomies, wake-up context layering, MCP tool design, hook-driven persistence, and local temporal knowledge graphs. Work like a systems analyst who can separate README positioning from verified Python mechanics, trace how MemPalace composes mining, storage, retrieval, hooks, and protocol guidance, and translate those choices into practical improvements for `Code_Environment/Public`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:48:Research MemPalace's raw-verbatim memory architecture, palace taxonomy, wake-up stack, MCP protocol/tooling, hook-driven save flow, and temporal knowledge-graph patterns to identify practical, evidence-backed improvements for `Code_Environment/Public`, especially around session continuity, compaction survival, memory hygiene, and agent-facing recall ergonomics. Determine which MemPalace ideas should be `adopt now`, `prototype later`, or `reject`. Keep the analysis honest about what is source-confirmed, what is README-documented, and what is benchmark-claim territory.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:54:MemPalace is a local Python memory system centered on a strong design claim: keep raw conversation and project text instead of extracting only summarized facts, then make that verbatim corpus searchable and navigable. The external repo exposes a CLI, an MCP server, hook scripts, a ChromaDB-backed drawer store, a wake-up layering system, and a separate SQLite temporal knowledge graph. Its storage model uses palace terminology: wings for people/projects/topics, halls for shared memory categories, rooms for named ideas, closets for compact summaries, and drawers for original verbatim content.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:58:The repo appears to support three ingestion shapes into one shared memory backend: project mining, conversation mining, and a general heuristic extraction mode. Retrieval then spans direct semantic search, wake-up text generation across L0-L3 layers, palace graph traversal via shared room metadata, and MCP tooling that teaches an operational memory protocol to the agent through the status response itself. Hook scripts add another layer: instead of a memory system that only responds to explicit search/save calls, MemPalace also tries to shape the timing of memory writes at stop and pre-compact boundaries.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:64:| 001 | Engram | MCP memory server (Go, SQLite+FTS5) | 005 (memory server), 004 (session continuity) | Focus tool profiles, session lifecycle, topic keys |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:66:| 003 | Modus Memory | FSRS spaced repetition + BM25 | 005 (local memory) | Focus FSRS decay, BM25, librarian expansion, cross-references |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:68:| 005 | MemPalace | Raw verbatim storage + palace taxonomy + hooks + temporal KG | 001 (MCP memory), 004 (compaction/helping memory survive), 003 (local memory) | Focus raw-no-extraction posture, wake-up layers, hooks, palace structure, temporal KG |
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:72:`Code_Environment/Public` already has Spec Kit Memory with hybrid retrieval, `memory_search`, `memory_context`, `memory_match_triggers`, memory-save flows through `generate-context.js`, session/bootstrap handling in the memory MCP server, and compaction-oriented structural transport via `.opencode/plugins/spec-kit-compact-code-graph.js`. It also already has semantic code search via CocoIndex and structured graph context via Compact Code Graph.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:74:What it does **not** currently have is a raw-verbatim-by-default memory posture comparable to MemPalace's drawer model, a first-class wing/hall/room taxonomy for agent memory navigation, a dedicated L0/L1/L2/L3 wake-up stack for context loading, MemPalace-style stop/pre-compact save hooks that actively block to force preservation, or a separate temporal entity-triple knowledge graph with explicit invalidation alongside the main memory store. The comparison should stay anchored to those gaps rather than repeating generic hybrid-RAG analysis already covered elsewhere.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:89:12. Compare MemPalace directly against current `Code_Environment/Public` code: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`, `.opencode/skills/system-spec-kit/mcp_server/context-server.ts`, `.opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js`, and `.opencode/plugins/spec-kit-compact-code-graph.js`. Be explicit about what Public already covers better and what MemPalace still contributes.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:96:    Research the external repository at /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/external and identify concrete improvements for Code_Environment/Public, especially around raw verbatim memory storage, palace taxonomy (wings/halls/rooms), wake-up context layering, MCP protocol/tool design, hook-driven save flows, and temporal knowledge-graph patterns.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:98:15. Save all outputs inside `research/`, with `research/research.md` as the canonical report. Every meaningful finding must cite exact file paths, say whether the evidence is `source-confirmed`, `README-documented`, `benchmark-documented`, or mixed, explain why it matters for `Code_Environment/Public`, classify the recommendation as `adopt now`, `prototype later`, or `reject`, identify the affected subsystem, and note migration or truthfulness risk. When research is complete, update `checklist.md`, create `implementation-summary.md`, and save memory with:
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:100:    cd /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public && node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js "/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace"
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:105:1. What does MemPalace gain from its raw-verbatim "store everything, then make it findable" posture, and where would that improve or conflict with Spec Kit Memory's more selective save and retrieval model?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:107:3. How does the L0/L1/L2/L3 wake-up stack compare with Public's `session_bootstrap`, `memory_context`, and compaction-recovery flows, and what parts of the layering model are reusable here?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:108:4. What does `mcp_server.py` gain by embedding `PALACE_PROTOCOL` and `AAAK_SPEC` directly in the status bootstrap, and could Public benefit from similarly direct memory-usage guidance without adding prompt clutter?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:109:5. How effective are the stop-hook and pre-compact-hook patterns at protecting context before loss, and how do they compare to Public's existing compaction-oriented structural plugin and memory-save workflows?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:113:9. Which MemPalace ideas most improve compaction survival and startup continuity for future Public sessions: wake-up layers, hook timing, memory protocol bootstrapping, diary writing, or taxonomy-based narrowing?
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:125:- Do map strong findings to specific Public subsystems such as Spec Kit Memory retrieval, context bootstrap, save flows, or compaction handling.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:146:- Why it matters: Public already has resume/bootstrap tooling, but it does not currently use one memory-facing status surface to teach concrete retrieval and save behavior this directly.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:148:- Affected area: memory bootstrap UX, session recovery guidance, compaction recovery behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:159:- Why it matters: Public has compaction-oriented structural transport, but it does not currently enforce a comparable memory-preservation checkpoint before context collapse.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:161:- Affected area: memory save automation, compaction resilience, agent operating protocol
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:186:- comparison against current Public memory, bootstrap, save, and compaction flows
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:198:Rank findings in this order: leverage for Public session continuity, compaction-survival value, truthfulness and evidence quality, fit with current Spec Kit Memory capabilities, operational simplicity, memory-hygiene impact, and clean differentiation from phases `001` through `004`.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:204:- explicit comparison against current Public memory retrieval, bootstrap, save, and compaction behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:208:- memory saved from this phase folder using `generate-context.js`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:225:  - **Role** is specialized in verbatim memory systems, wake-up layering, MCP protocol design, hooks, and temporal KG behavior
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:240:- current `Code_Environment/Public` memory/bootstrap/compaction behavior was compared using code, not assumptions
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:247:- memory is saved successfully for `005-mempalace`
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:285:I’m treating this as a read-only deep research pass on the pre-approved `005-mempalace` phase folder. I’ll verify the scoped instructions and phase health first, then trace the strongest pattern end-to-end through MemPalace’s source and compare it directly against Public’s live memory/bootstrap code.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:297:464:- 023-hybrid-rag-fusion-refinement, memory_index_scan, memory_quick_search, parentChain, B3-hybrid-rag-fusion-refinement, .opencode/changelog
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:553:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/memory
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:554:.opencode/specs/system-spec-kit/999-hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/memory/.gitkeep
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:600:I’ve confirmed the strict validator currently passes only because the phase is being inferred as Level 1, even though the brief expects Level 3 artifacts that are absent on disk. Next I’m tracing the code path that looks most consequential so far: MemPalace treats memory as an enforced lifecycle protocol, not just a search backend.
.opencode/specs/system-spec-kit/z_future/hybrid-rag-fusion-upgrade/001-research-hybrid-rag-fusion-systems/005-mempalace/research/iterations/iteration-014.md:607:/bin/zsh -lc 'rg -n "session_bootstrap|session_resume|memory_context|memory_search|generate-context|precompact|compact|code graph|save|protocol|status" .opencode/skills/sy10-search-and-routing-tuning-pt-01/iterations/iteration-035.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-035.md:22:- `.opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/15-ascii-box-card.md:11:  • #1263 Graph Memory Survey [22/89] (6.07) — 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/15-ascii-box-card.md:12:  • #1315 Graph Memory Survey [55/89] (5.98) — 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/15-ascii-box-card.md:13:  • #1355 Graph Memory Survey [85/89] (5.94) — 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:52:| `skill/system-spec-kit/mcp_server/lib/parsing/memory-parser.ts` | 1       | 1               | D2               |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:53:| `skill/system-spec-kit/mcp_server/handlers/memory-save.ts` / `save/response-builder.ts` | 2 | 2 | D2 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:142:8. **`intent_signals` loaded but silently discarded at scoring** (R43-001, R44-001 / P1) [NEW since 41]. The live skill router does not consume per-skill `intent_signals` or `derived.trigger_phrases` from `graph-metadata.json`. Instead, it scores requests through hard-coded `INTENT_BOOSTERS`, `MULTI_SKILL_BOOSTERS`, and `PHRASE_INTENT_BOOSTERS` tables plus graph topology boosts. The compiler faithfully copies `intent_signals` into the compiled graph, and the runtime loader faithfully loads them into the in-memory `"signals"` map — but no scoring consumer reads the `"signals"` field. Live repro (2026-04-16): `python3 skill_advisor.py "natural language code retrieval" --threshold 0.8` returned `sk-code-opencode` with `_graph_boost_count: 0`, proving the metadata phrase is not a live signal.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:160:The routing pipeline has four distinct stages: (1) `skill_graph_compiler.py compile_graph()` copies `intent_signals` from each skill's `graph-metadata.json` into the compiled graph payload; (2) `_load_skill_graph_sqlite()` / `_load_skill_graph_json()` reads the compiled graph and populates a `"signals"` key in the in-memory graph dict; (3) `analyze_request()` calls `get_cached_skill_records()` to build the lexical match corpus; (4) scoring combines lexical matches against the corpus with graph topology boosts. Stages 1 and 2 correctly carry `intent_signals` through. Stage 3 builds the corpus exclusively from `SKILL.md` frontmatter `name` and `description` fields. Stage 4 applies graph boosts from `adjacency` and `families`, not from `signals`. The `"signals"` key in the in-memory graph dict is populated but has no consumer in stages 3 or 4. There is no log line indicating signals were evaluated or skipped, and `health_check()` does not verify routing-signal coverage. The result: every graph-metadata routing phrase that has been carefully curated by skill authors is permanently inert at Gate 2, but looks authoritative to anyone reading the metadata or the compiler output.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:168:- `generate-context.js` trigger-word surface for memory category / triggers / scope
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:169:- Handover-state routing rules (`handover_state` enum with no runtime validator)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:198:- `memory-save-planner-first.vitest.ts:12-214` — covers response shaping only; no Gate 3 trigger-classification verification (R41-002).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:259:- **R44-001 (intent_signals discarded) + R44-002 (keyword comments stripped) + R42-002 (health reports ok despite inventory mismatch):** Together, three different mechanisms make the skill routing stack look healthy while operating exclusively from hand-maintained Python tables. `intent_signals` reach the in-memory graph but not the scorer; `SKILL.md` keyword comments reach the file parser but not the record builder; the health probe confirms "ok" even when discovered-skill count diverges from graph-skill count. All three failures are invisible at CI time. The combined effect is that any operator who follows the documented "edit graph-metadata to tune routing" workflow is operating on inert data; only operators who know to edit Python source in `INTENT_BOOSTERS` can actually change routing behavior.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:495:4. **`generate-context.js` trigger-word surface** (iteration 48 candidate). The memory save script uses string-based category, trigger-phrase, and scope fields that feed into semantic search indexing. If those fields are manually authored prose without schema validation, they share the same "looks mechanically enforced" property as the skill routing metadata. The pass should audit whether the field values are validated against any schema at write time.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:497:5. **Handover-state routing rules** (iteration 48 candidate, combinable with #4). The `handover_state` routing in `handover.md` uses a prose-defined enum of states (`in_progress`, `complete`, etc.). Whether any runtime validator checks that the value written to `handover.md` is a valid enum member — or whether runtimes that read it silently fall back on any unrecognized value — is not established.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:510:6. **End-to-end save-path integration tests** — currently mostly helper-level. Add at least one end-to-end path covering: `memory-save.ts` → `reconsolidation-bridge.ts` → SQLite write → `session-stop.ts` autosave read-back.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:526:| `mcp_server/lib/search/entity-linker.ts` | Is the stale-entity blast radius per-memory or cross-memory? (R7-002 did not fully investigate) |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:527:| `mcp_server/handlers/memory-save.ts` | What is the real timeline between reconsolidation planning and `writeTransaction` acquisition under load? |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:550:R43-002 | spec_kit_plan_auto.yaml:343-372,375-392; plan.md:93-99; transcript-planner-export.vitest.ts:146-217; memory-save-planner-first.vitest.ts:12-214 | P2 | /spec_kit:plan Step 0 folder_state and intake_only branches are untyped string predicates with no automated coverage of the predicate evaluation itself
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-44-iterations.md:551:R44-001 | skill_graph_compiler.py:501-568; graph-metadata.json:37-42; skill_advisor.py:105-189,250-339,1185-1200,1629-1694; test_skill_advisor.py:61-186 | P1 | intent_signals compiled into graph, loaded into in-memory signals map, but no scoring consumer reads the signals field; discard is silent at analyze_request() boundary
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:19:2. `handlers/memory-*.ts` (module-root — context, resume, bootstrap, health, save, search, etc.)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:52:Files inspected under `handlers/memory-*.ts`:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:54:- `handlers/memory-context.ts` — lines 200 and 425 declare `readiness: 'ready'` as a literal-narrow in a structural routing nudge. This is NOT the canonical 3-state vocabulary (`ready`/`stale`/`missing`) and emits no trustState, no canonicalReadiness, no lastPersistedAt. Line 1382 uses `source: 'unavailable' as const` — adjacent vocabulary but not wired to a sibling trust contract.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:55:- `handlers/memory-search.ts`, `handlers/memory-crud-*.ts`, `handlers/memory-ingest.ts`, `handlers/memory-triggers.ts`, `handlers/memory-index*.ts`, `handlers/memory-bulk-delete.ts` — zero tokens.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:56:- `handlers/memory-save.ts` — zero tokens (despite being the terminal surface for continuity writes).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:58:**Finding**: The memory handler family has NO hardened sibling to form an asymmetry pair — this is a **whole-family gap** rather than a sibling-asymmetry, so it does not recur the R6-P1-001 pattern. However, `memory-context.ts` advertising a narrow literal `readiness: 'ready'` in an advisory block creates **vocabulary drift** that is worth tracking separately (a consumer keying on `readiness.canonicalReadiness` will find `undefined` on this surface).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:76:- `atomic-index-memory.ts`, `create-record.ts`, `dedup.ts`, `embedding-pipeline.ts`, `pe-orchestration.ts`, `reconsolidation-bridge.ts`, `validation-responses.ts`, `markdown-evidence-builder.ts`, `spec-folder-mutex.ts` — all zero
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:78:**Finding**: Like the memory family, the save family has NO hardened sibling — this is **whole-family gap**, not sibling asymmetry. R6-P2-001 covers this as a broad-stroke observation; T-RBD-01/02/03 did not propagate the hardening vocabulary here. The closest adjacent signal is `response-builder.ts:649` mentioning "graph/search freshness" in a hint string, but no structured `trustState`/`canonicalReadiness` field.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:158:**Blast radius**: Copilot-driven sessions that undergo compaction lose the trust-state provenance that Claude and Gemini sessions preserve. After a Copilot compaction the recovered context has no `[PROVENANCE: ... trustState=...]` breadcrumb, so downstream `memory_context({ mode: 'resume' })` calls and session-health readouts cannot tell whether the Copilot runtime's recovered payload is `live` / `stale` / `absent` / `unavailable`. This creates a third-class experience for Copilot users even though the underlying MCP tools support the full vocabulary. If Phase 017 work adds Copilot-first autonomous iteration (per `feedback_copilot_concurrency_override.md`), this gap becomes a blocker for cross-iteration continuity.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:186:### R52-P2-002 | memory-context.ts advertises non-canonical readiness vocabulary in structural routing nudge | vocabulary-drift
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:190:- Drifted usage: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:200` (`readiness: 'ready'` as a literal-narrow in `StructuralRoutingNudgeMeta`) and `memory-context.ts:425` (construction of that advisory block)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:194:**Un-hardened sibling**: `handlers/memory-context.ts:200-204` and `:423-429`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:206:- [x] KQ-51-2: Yes. The R6-P1-001 sibling-asymmetry pattern recurs in TWO additional families: (i) the code-graph handler family (6 un-hardened peers vs 1 hardened `query.ts`) and (ii) the hooks runtime family (Copilot missing the full compact-cycle trustState writer + reader that both Claude and Gemini have). A third instance is the Gemini shared.ts transitively importing from Claude (R52-P2-001 structural asymmetry). The pattern does NOT recur as sibling-asymmetry in the memory or save handler families — those are whole-family gaps, not asymmetry pairs.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:211:- **Memory handler family sibling-asymmetry** — `memory-*.ts` files have zero tokens uniformly; no sibling to form an asymmetry pair. The memory-context vocabulary drift is filed as R52-P2-002 but is not the R6-P1-001 pattern.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:213:- **`hooks/index.ts` / `hooks/memory-surface.ts` / `hooks/response-hints.ts` / `hooks/mutation-feedback.ts`** — these are runtime-agnostic dispatchers/formatters. `memory-surface.ts` emits `codeGraphStatus: 'fresh'|'stale'|'empty'` but does NOT emit trustState, not flagged as a sibling-asymmetry because there is no parallel hardened sibling — it is the single point where the hook-level codeGraphStatus is derived.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-052.md:220:- Files grep-scanned: 47 (.ts files across handlers/code-graph, handlers/memory-*, handlers/save, handlers/session-*, hooks/claude, hooks/gemini, hooks/copilot)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-001.md:9:3. The reranker keeps a 5-minute in-memory cache with a 200-entry bound and distinct fallback score band `0.0-0.5`, but it does not yet expose hit-rate telemetry. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:115] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:399]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/25-hybrid-compact-detail.md:14:               007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/25-hybrid-compact-detail.md:15:  5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/25-hybrid-compact-detail.md:16:  5.94  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/18-color-coded-sidebar.md:11:  6.07  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/18-color-coded-sidebar.md:12:    5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/18-color-coded-sidebar.md:13:  5.94  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:12:- **Description:** Gate 3's file-modification trigger list has a concrete false-negative for the repository's own memory-save workflow. The hard-block trigger words omit `save context`, `save memory`, and `/memory:save`, even though the same instruction file treats `/memory:save` as a first-class write workflow and later gives it its own hard-block save rule. Other runtime surfaces already model the same phrases mechanically, so the pre-flight gate is the outlier.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:13:- **Evidence:** `AGENTS.md` says Gate 3 fires on the literal list `rename, move, delete, create, add, remove, update, change, modify, edit, fix, refactor, implement, build, write, generate, configure, analyze, decompose, phase` (`AGENTS.md:182-185`), but the same file separately documents `Save context` / `End session` as `/memory:save` workflows and then declares a hard-block `MEMORY SAVE RULE` triggered by `"save context", "save memory", "/memory:save"` (`AGENTS.md:138-145,201-204`). The advisor command bridge also treats `/memory:save` as an explicit command and boosts natural-language memory-save phrases through a dedicated `memory` intent bucket (`skill_advisor.py:980-988,1112-1115`). The MCP server test suite likewise treats `save context` / `save memory` as exact trigger phrases with routing consequences (`query-classifier.vitest.ts:24-37,45,170-175,479-489`; `query-router.vitest.ts:68-74,290-295`).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:14:- **Downstream Impact:** A first-turn request like `save context` or `/memory:save` is a real file-mutating workflow, but Gate 3's published trigger list does not mechanically identify it as one. Different runtimes can therefore diverge on whether they must stop for the spec-folder question before touching canonical continuity files, even though later layers in the same repository already recognize the request as a memory-save operation.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:17:- **File:** `.opencode/commands/spec_kit/assets/spec_kit_plan_auto.yaml`; `.opencode/commands/spec_kit/assets/spec_kit_plan_confirm.yaml`; `.opencode/commands/spec_kit/assets/spec_kit_complete_auto.yaml`; `.opencode/skills/system-spec-kit/mcp_server/tests/transcript-planner-export.vitest.ts`; `.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-planner-first.vitest.ts`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:18:- **Lines:** `spec_kit_plan_auto.yaml:354-391,548-555`; `spec_kit_plan_confirm.yaml:372-416,606-612`; `spec_kit_complete_auto.yaml:465-483,1008-1012`; `transcript-planner-export.vitest.ts:146-217`; `memory-save-planner-first.vitest.ts:1-40`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:21:- **Evidence:** In `spec_kit_plan_auto.yaml`, `when:` is used for executable conditions like `folder_state != populated`, `folder_state == populated`, `intake_only == TRUE`, and `intake_only == FALSE` (`spec_kit_plan_auto.yaml:354-391`), but the same asset later uses `when: "Immediately after the canonical spec document is refreshed on disk"` as a scheduling note under `post_save_indexing` (`spec_kit_plan_auto.yaml:548-555`). The same overload appears in `spec_kit_plan_confirm.yaml` and `spec_kit_complete_auto.yaml`, where predicate-style `when:` clauses coexist with prose-only timing strings like `Immediately after the generated continuity artifact is written to disk` and `Immediately after the canonical spec document is refreshed on disk` (`spec_kit_plan_confirm.yaml:372-416,606-612`; `spec_kit_complete_auto.yaml:465-483,1008-1012`). The nearby automated coverage exercises save/planner behavior and response shaping, not the YAML asset grammar: `transcript-planner-export.vitest.ts` drives `atomicSaveMemory()` end-to-end, and `memory-save-planner-first.vitest.ts` tests response-builder serialization (`transcript-planner-export.vitest.ts:146-217`; `memory-save-planner-first.vitest.ts:1-40`). A repo search on 2026-04-16 found no direct test references to `spec_kit_plan_auto.yaml`, `spec_kit_plan_confirm.yaml`, `spec_kit_complete_auto.yaml`, or `intake_triggered` / `intake_completed` payload evaluation under `.opencode/skills/system-spec-kit/mcp_server/tests`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-048.md:27:- The most striking cross-system pattern in this pass is asymmetry of rigor: memory-save phrases are mechanically recognized in routing/tests, but the pre-flight safety gate that is supposed to run earlier still relies on a narrower English list.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/description.json:22:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/description.json:23:  "memoryNameHistory": [],
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:15:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:19:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:20:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:41:Phase 015 ran a 120-iteration deep review across 920 files but concentrated its audit pressure on packets 009 (validation-infrastructure), 010 (retrieval-observability), 012 (intake-reconsolidation), and 014 (reconsolidation-bridge). The 026 train's earlier foundational packets -- 002 (cache-warning-hooks), 003 (memory-quality-remediation), 005 (code-graph-upgrades), and 008 (cleanup-and-audit) -- received meaningfully less scrutiny despite anchoring high-leverage runtime seams: session lifecycle, hook state, trust-vocabulary emission, graph-metadata migration, save-time reconsolidation, post-insert enrichment, and skill routing.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:70:- `memory_save` returns `status: "success"`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:79:- Two concurrent governed saves forking the memory-graph lineage by both superseding the same predecessor.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:91:- **P0-B (reconsolidation conflict + complement duplicate/corruption window):** two concurrent governed saves can fork memory-graph lineage. Fix requires predecessor-hash CAS at conflict commit, same-transaction re-read of similarity and scope, and batched scope snapshots.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:143:- `scripts/tests/generate-context-cli-authority.vitest.ts` correctly tests `--stdin` and `--json` modes. The `/tmp/save-context-data.json` file handoff is the exception that should be removed.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:155:2. **State promotion at consumer layers.** Readiness vocabulary diverges across surfaces (`empty` vs `missing` vs `stale`). Fallback-recovered metadata gets `qualityScore: 1` and empty `qualityFlags: []` from `memory-parser.ts`, then +0.12 boost in stage-1 retrieval. Cache expiry becomes observationally identical to cache absence.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:171:| R21-001 | `response-builder.ts:311-322,569-573` | P1 | `memory_save` response collapses post-insert truth further than `post-insert.ts` does |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:174:| R22-002 | `memory-parser.ts:293-330` | P1 | Fallback-recovered graph-metadata gets `qualityScore: 1` + 0.12 boost |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:223:| R34-002 | `reconsolidation-bridge.ts` + `memory-save.ts:2159-2171,2250-2304` | P1 | Complement: stale-search duplicate window between plan and commit |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:254:| Load | In-memory `signals` map | `analyze_request()` | Dropped; no consumer at scoring | R43-001, R44-001 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:261:| Classifier | `save` intent | Gate 3 trigger list | Absent; memory-save separately enforced later | R48-001, R49-001 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:285:- `handler-memory-save.vitest.ts` correctly asserts reconsolidation planning completes before writer-lock acquisition. The pre-transaction-snapshot problem is not that this test is wrong; it's that the test never exercises per-candidate scope mutation during the planning window.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:303:| `handler-memory-save.vitest.ts:546-557,2286-2307` | Post-insert all-true | Enum status | M13 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:330:- `save context` / `save memory` / `/memory:save` prompts DO trigger Gate 3 (R48-001, R49-001, S5)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:389:**Iteration 21 -- State-laundering boundaries.** Three findings on state promotion: `memory_save` response collapses post-insert truth further than `post-insert.ts` does; `JSON.parse(raw) as HookState` with no validation feeds prompt replay + autosave routing; `refreshGraphMetadataForSpecFolder()` launders malformed modern JSON into canonical refreshed artifact.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:391:**Iteration 22 -- Self-contradictory payloads + quality boost.** Found self-contradictory success payload: readiness `empty` + `detectorProvenance: structured`. Also found fallback-recovered `graph-metadata` gets `qualityScore: 1` and +0.12 packet boost in `memory-parser.ts`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:447:**Iteration 48 -- Gate 3 false-negatives for memory-save.** Gate 3's file-modification trigger list omits `save context`, `save memory`, `/memory:save` even though same file declares `MEMORY SAVE RULE` keyed on these phrases. `when:` field overloaded as both executable predicate and prose timing note within same asset.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:451:**Iteration 50 -- Gate 3 false-negative for deep-research resume + playbook dialect drift.** Gate 3 hard-block trigger list has false-negative hole for write-producing deep-research resume flows. Live corpus contains two incompatible argument dialects for the same tool family (`memory_ingest_status({jobId})` vs `memory_ingest_status({ jobId:"<job-id>" })`); shorthand form depends on undefined JS scoping.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:511:**Attack/failure scenario.** Two concurrent governed `memory_save` requests planning against overlapping candidates can:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:523:**Severity justification (blast radius).** Permanent data corruption: unlike continuity loss, conflict-fork lineage and duplicate complement rows are written to persistent storage and propagate into every downstream search, causal traversal, and graph-backed retrieval forever. Silent: all five decisions produce success-shaped results. Violates a core invariant: the memory graph's "single active successor per predecessor" invariant is silently broken.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:539:**Constituent findings:** R11-002, R13-002, R20-002, R21-003, R22-002, R23-002 (6 findings across `graph-metadata-parser.ts`, `memory-parser.ts`, and the refresh + indexing pipelines).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:547:5. Gets `qualityScore: 1` and empty `qualityFlags: []` assigned by `memory-parser.ts` (R22-002), because the fallback path treats recovery as first-class.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:560:| C1 | `validateGraphMetadataContent()` returns `{ ok: true, metadata, migrated: boolean, migrationSource?: 'legacy' }`; consumers propagate `migrated` all the way through `memory-parser` and ranking | Medium | R11-002, R18-002, R20-002, R21-003, R22-002, R23-002, R25-003 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:687:1. **Remove `/tmp/save-context-data.json` from all four surfaces.** (AGENTS.md, CLAUDE.md, CODEX.md, GEMINI.md; four command YAMLs; `data-loader.ts` `NO_DATA_FILE` error text; `generate-context.ts` CLI help stays preferring `--stdin`/`--json`.) This is ~1 day of doc editing.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:716:| Gate 3 false-negatives (memory-save, deep-research resume) | R48-001, R49-001, R50-001 | R49-001 + R50-001 | Trigger list omits real write-producing flows |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:896:- `mcp_server/lib/search/entity-linker.ts:527-550,608-640,1096-1132` -- R7-002 identified soft-fail + subsequent stale-row linking; cross-memory blast radius or per-memory containment not investigated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:897:- `mcp_server/handlers/memory-save.ts:2159-2171,2250-2304` -- R34-002 hypothesized timeline between reconsolidation planning and `writeTransaction` acquisition; not measured under real load.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:901:- `scripts/memory/generate-context.js` trigger-word surface for memory category / triggers / scope -- proposed but not investigated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:902:- Handover-state routing rules (`handover_state` enum) -- proposed but not investigated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:971:**File thesis.** `session-stop.ts` is the highest-leverage continuity-capture surface in the runtime. It runs at every Claude session stop; it must persist transcript fingerprints, producer metadata, spec-folder detection, and session summary to hook-state; it must trigger `runContextAutosave()` to commit the session summary to a spec-folder packet. Phase 016 found 10 distinct issues spanning fail-open patterns (D1), state contract honesty (D2), and concurrency (D3). The dominant pattern is **split-brain state** -- the stop hook makes three independent `recordStateUpdate()` calls plus a final disk reload, so the in-memory result flags can disagree with the persisted state.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:995:3. **R32-001 -- `updateState` returns merged after failed persist** (`hook-state.ts:170-176, 221-241`). `updateState` loads current JSON, overlays the patch, and returns the in-memory object even if persistence fails or another writer wins later. Consumer sees an "updated" object that is not on disk.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1008:**File thesis.** `reconsolidation-bridge.ts` is the pre-transaction planning layer between `memory_save` and the SQLite writer transaction. It runs vector search, scope filtering, similarity scoring, and action classification (merge / conflict / complement) before the writer lock is acquired. The central failure mode: **decisions made from pre-transaction snapshots are authoritative post-transaction**, so concurrent saves can fork lineage, double-insert complements, or admit candidates based on stale scope.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1015:4. **R34-002 -- Complement stale-search duplicate window** (`reconsolidation-bridge.ts:261-306`; `reconsolidation.ts:599-694`; `memory-save.ts:2159-2171, 2250-2304`). Reconsolidation planning performs vector search and scope filtering before the save path takes its writer transaction. If another save inserts or upgrades a near-duplicate after that search but before the later `writeTransaction`, the current save still proceeds as a normal complement and creates a second memory without re-running similarity search.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1016:5. **R35-001 -- Conflict lane not single-winner** (`reconsolidation-bridge.ts:270-295`; `reconsolidation.ts:467-508, 610-658, 952-993`). `insertSupersedesEdge()` deduplicates only by `(source_id, target_id, relation)`. Two concurrent saves with different new memory IDs can both create `supersedes` edges to the same predecessor. Violates the memory graph's "single active successor per predecessor" invariant.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1019:**Downstream consumers.** `memory-save.ts`, `response-builder.ts`, memory graph (lineage edges, supersedes edges, complement rows), vector search index.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1025:**File thesis.** `post-insert.ts` runs after a new memory is inserted. It coordinates causal-link resolution, entity extraction, summary generation, entity linking, and graph-lifecycle indexing. All five enrichment steps are tracked in an `enrichmentStatus` boolean record. The dominant pattern: **a single `true` flag conflates four different outcomes (ran / skipped / deferred / failed)**, which `response-builder.ts` then amplifies by surfacing at most one generic warning.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1033:5. **R25-001 -- All-true booleans codified by tests** (`post-insert.ts:223-237`). Deferred-enrichment branch returns all five `enrichmentStatus` booleans as `true`. `tests/post-insert-deferred.vitest.ts:11-48` explicitly asserts this shape; `tests/handler-memory-save.vitest.ts:2590-2607` reuses it as the default post-insert stub. Fixing the runtime requires fixing the tests.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1036:**Downstream consumers.** `memory-save.ts`, `response-builder.ts`, `runEnrichmentBackfill`, follow-up-action API, MCP client (sees the response).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1060:**File thesis.** `graph-metadata-parser.ts` parses `graph-metadata.json` files from spec-folder packets and feeds downstream indexing, search ranking, and memory-parser quality assignment. It has a modern schema + a legacy fallback. The legacy fallback is the **root of P0-C graph-metadata laundering** -- malformed modern JSON gets accepted as legacy with no migration marker, then downstream consumers treat it as first-class canonical metadata with +0.12 retrieval boost.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1069:**Downstream consumers.** `memory-parser.ts` (assigns `qualityScore: 1` to fallback-recovered entries), stage-1 candidate generation (+0.12 packet boost), `refreshGraphMetadataForSpecFolder()`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1071:**Recommended remediation entry point.** Structural refactor S3 (Graph-metadata migration propagation). Start with C1: `validateGraphMetadataContent()` returns `{ ok, metadata, migrated, migrationSource? }`. Propagate `migrated` flag through `memory-parser.ts` and stage-1 ranking. Either drop the +0.12 boost for `migrated=true` rows or reverse it to a penalty until human review.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1098:4. **R50-002 -- Dialect drift in live corpus** (`097-async-ingestion-job-lifecycle-p0-3.md:35-37`; `144-advisory-ingest-lifecycle-forecast.md:35-36`; `manual-playbook-runner.ts:438-445, 544-548, 612-616`). Checked-in lifecycle scenarios use two incompatible argument dialects: `memory_ingest_status({jobId})` shorthand (depends on undefined JS scoping) vs `memory_ingest_status({ jobId:"<job-id>" })` explicit form. Shorthand form returns `ReferenceError: jobId is not defined` on direct Node repro.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/research.md:1138:Phase 016's 50 iterations reveal a runtime where **every failure is silent**. There are no crashes, no thrown exceptions that stop the pipeline, no compile errors, no test failures. The system looks healthy by every observable metric -- health checks return `ok`, validations print `VALIDATION PASSED`, `memory_save` returns `status: "success"`, skill routing reports `0.95` confidence -- while operating with reduced fidelity across at least 37 surfaces.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-013.md:12:- **Description:** Claude stop-hook autosave silently skips the entire `generate-context` call when the temp-state record lacks either `lastSpecFolder` or `sessionSummary`. Caller perception: stop processing completed normally, so continuity capture was attempted if autosave was enabled. Reality: `runContextAutosave()` returns before logging anything, and `processStopHook()` still logs `Session ... stop processing complete`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-013.md:14:- **Downstream Impact:** Any earlier ambiguity or state-write miss that leaves `lastSpecFolder` / `sessionSummary` unset turns into silent continuity loss at session end. Resume and memory-search consumers keep relying on stale prior saves, but the hook surface looks indistinguishable from a healthy stop event.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-013.md:54:Trace the caller-visible envelopes that consume these branches: `memory-save` result building, any session-stop autosave telemetry/health surface, and graph-query callers that treat `status: "ok"` plus empty payloads as authoritative. The next pass should map exactly where these low-level degradations are preserved, downgraded to hints, or erased entirely.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/30-recommended-synthesis.md:14:  6.07  #1263  Graph Memory Survey (×4 chunks) · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-011.md:8:2. The blast radius is wider than one file because `applyLengthPenalty` is a public search argument: it is accepted by the tool schemas, typed in tool args, defaulted in `memory-search.ts`, included in the cache key, and forwarded into the pipeline config. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/schemas/tool-input-schemas.ts:160] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tool-schemas.ts:137] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tools/types.ts:69] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:643] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/search-utils.ts:50] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/types.ts:144]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-011.md:20:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-019.md:22:- **Downstream Impact:** `memory_save` responses can lose near-duplicate review guidance without surfacing that the assistive mechanism failed, so operators and automation see “no recommendation” instead of “recommendation path degraded.”
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-019.md:30:Trace the first consumer layer above these residual seams: which `code_graph_context` or MCP callers trust transitive nodes with null provenance fields, and which `memory_save` response builders or follow-up APIs distinguish “no assistive recommendation” from “assistive recommendation path failed.”
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-027.md:13:- **Evidence:** `post-insert.ts:187-200` sets `enrichmentStatus.graphLifecycle = true` after every successful `onIndex(...)` call and only logs when `indexResult.skipped` is false. But `graph-lifecycle.ts:495-513` returns `{ skipped: true }` when graph refresh is off, entity linking is disabled, or content is empty, and the direct suite asserts those no-work branches in `tests/graph-lifecycle.vitest.ts:652-668`. The follow-up API only flips `SPECKIT_POST_INSERT_ENRICHMENT_ENABLED` before rerunning the index scan (`api/indexing.ts:111-129`), as confirmed by `tests/follow-up-api.vitest.ts:102-130`; it does not enable `SPECKIT_GRAPH_REFRESH_MODE` or `SPECKIT_ENTITY_LINKING`, which are the gates that drive `onIndex(...)` skipping. Meanwhile the save-path harness still normalizes post-insert to all-green `graphLifecycle: true` / `executionStatus: { status: 'ran' }` stubs (`tests/handler-memory-save.vitest.ts:546-557`, `2287-2307`).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:52:| `skill/system-spec-kit/mcp_server/lib/parsing/memory-parser.ts` | 1       | 1               | D2               |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:53:| `skill/system-spec-kit/mcp_server/handlers/memory-save.ts` / `save/response-builder.ts` | 2 | 2 | D2 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:199:- `memory-save-planner-first.vitest.ts:12-214` — covers response shaping only; no Gate 3 trigger-classification verification (R41-002).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:330:| Load | In-memory `"signals"` map | `analyze_request()` | Dropped; no consumer at scoring boundary |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:392:| R45-001 | P2 | `AGENTS.md`, `002-confirm-mode-checkpointed-review.md`, `memory-save-planner-first.vitest.ts` | Gate 3 overbroad trigger list misclassifies read-only deep-review prompts as file-modifying; `analyze`/`phase` overlap with research vocabulary | B4 |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:514:2. **`generate-context.js` trigger-word surface** (iteration 48 candidate, combinable with #1). The memory save script uses string-based category, trigger-phrase, and scope fields that feed into semantic search indexing. If those fields are manually authored prose without schema validation, they share the same "looks mechanically enforced" property as the skill routing metadata.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:516:3. **Handover-state routing rules** (iteration 49 candidate). `handover_state` routing uses a prose-defined enum in `handover.md`. Whether any runtime validator checks the written value against a valid enum, or whether runtimes silently fall back on unrecognized values, is not established.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:557:          memory-save-planner-first.vitest.ts:12-214 | P2
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/interim-synthesis-47-iterations.md:576:          001-context-recovery-and-continuation.md, 005-outsourced-agent-memory-capture-round-trip.md,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/05-minimal-one-liner.md:11:  6.07  #1263  Graph Memory Survey [22/89] (007-graph-memory)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/05-minimal-one-liner.md:12:  5.98  #1315  Graph Memory Survey [55/89] (007-graph-memory)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/05-minimal-one-liner.md:13:  5.94  #1355  Graph Memory Survey [85/89] (007-graph-memory)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-023.md:21:- **Evidence:** After any primary parse failure, the validator retries `parseLegacyGraphMetadataContent(content)` and returns `{ ok: true, metadata, errors: [] }` on success (`lib/graph/graph-metadata-parser.ts:223-233`). `memory-parser` then trusts that result and emits a `graph_metadata` document row for indexing (`lib/parsing/memory-parser.ts:293-320`). Stage 1 candidate generation adds a +0.12 score boost to every `graph_metadata` row for packet-oriented queries (`lib/search/pipeline/stage1-candidate-gen.ts:261-286`), and the direct integration suite locks that boost in place (`tests/graph-metadata-integration.vitest.ts:139-150`).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:30:1. User runs `/memory:save` (or `generate-context.js --json …`) with default `plannerMode = 'plan-only'` (`generate-context.ts:415`).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:37:- `description.json.memorySequence` / `memoryNameHistory` (inside dead-code block)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:70:- The R53-P1w-001 shared-tmpfs surface concerns **hook state files** (`PersistedHookState`), NOT the **memory CAS (dedup/create-record)**. Those are SQLite-based and located in the memory DB path, not `/tmp`. Grep for `normalize.*scope|scopeCas` locates scope-confusion in `handlers/save/dedup.ts:63-66`, `save/create-record.ts:161-164, 207-209`, `save/reconsolidation-bridge.ts:243-246`, `lib/session/session-manager.ts:361-371` — ALL operate on SQLite-backed memory rows, not `/tmp` hook state.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:97:1. R3-P1-002: research folders (`research/NNN-*/`) lack `description.json` + `graph-metadata.json` — meaning memory search and code_graph cannot discover or rank them.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:98:2. R51-P1-003: `_memory.continuity` frontmatter in `implementation-summary.md` has zero programmatic writers — so even spec folders WITH metadata have stale continuity.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:101:Compound result: The two signals that tell the memory search layer "this folder exists + last action was X" are BOTH absent or stale for research folders. A caller asking `memory_search({ query: 'deep-research iterations' })` will either miss the research folder entirely (no description.json indexed) OR find it with continuity pointing to a stale/non-existent iteration. Cross-referencing with CLAUDE.md mandatory-metadata rule ("Spec folders without these files are invisible to memory search and graph traversal") confirms the design intent is violated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:103:This is a CONFIRMED compound risk because it instantiates trivially: any `/spec_kit:deep-research` session creates iteration files under `research/016-.../iterations/` — those paths have no `description.json`. So the deep-research loop itself produces artifacts that are invisible to the memory layer that `/spec_kit:resume` and `memory_context` rely on. Segment-2's own workflow is a standing instance of the attack.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:114:**Confirmed attack chain**: Default `/memory:save` → plan-only mode → workflow.ts:1259 `ctxFileWritten = false` (description block unreachable) → workflow.ts:1333 plan-only skips refreshGraphMetadata → returns with zero metadata writes.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:115:**Prerequisites**: User invokes `/memory:save` or `generate-context.js --json` without `--full-auto`. This IS the documented default.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:116:**Evidence**: `scripts/core/workflow.ts:1259` (`const ctxFileWritten = false`), `1333` (`shouldRunExplicitSaveFollowUps = options.plannerMode === 'full-auto'`), `1352` (logs "Deferred graph metadata refresh"). `scripts/memory/generate-context.ts:415` (`let plannerMode: ... = 'plan-only'`).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:131:### R56-P1-NEW-003 | Research-iteration folders invisible to memory layer | compound-hypothesis
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:134:**Confirmed attack chain**: `/spec_kit:deep-research` creates `research/NNN-.../iterations/iteration-NNN.md` → no description.json generator runs on the nested folder → memory_search / code_graph_query cannot index or discover → `/spec_kit:resume` may also miss the research state.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:136:**Evidence**: CLAUDE.md mandatory-metadata rule explicitly warns "Spec folders without these files are invisible to memory search and graph traversal." R51-P1-003: zero programmatic `_memory.continuity` writers. R4-P1-002: no auto-repair.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-056.md:163:- **H-56-3 CAS contamination via shared tmpfs**: SQLite CAS store lives in project-tree memory DB, not `/tmp`. Shared-tmpfs attacks reach hook state but NOT CAS. The 5-normalizer duplication surface is not co-located with the tmpfs surface.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/06-indented-tree.md:11:  6.07  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/06-indented-tree.md:12:  5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/06-indented-tree.md:13:  5.94  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-017.md:21:- **Evidence:** Each enrichment lane catches its own exception and only logs a warning [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/save/post-insert.ts:106-109`, `.opencode/skills/system-spec-kit/mcp_server/handlers/save/post-insert.ts:126-129`, `.opencode/skills/system-spec-kit/mcp_server/handlers/save/post-insert.ts:148-151`, `.opencode/skills/system-spec-kit/mcp_server/handlers/save/post-insert.ts:174-177`, `.opencode/skills/system-spec-kit/mcp_server/handlers/save/post-insert.ts:201-203`]. Even after those failures, the function always returns `executionStatus: { status: 'ran' }` [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/save/post-insert.ts:210-214`]. The response builder forwards that status unchanged and only adds a generic warning when some enrichment boolean is `false` [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/save/response-builder.ts:311-321`]. Existing tests only lock in the all-success `status: 'ran'` stub and the separate deferred contract; there is no regression for a throwing-step branch [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:546-557`, `.opencode/skills/system-spec-kit/mcp_server/tests/post-insert-deferred.vitest.ts:11-47`].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-056.jsonl:7:{"type":"finding","id":"R56-P1-upgrade-001","severity":"P1-upgrade","title":"Default-path canonical save is a metadata-freshness no-op","composedOf":["R51-P1-001","R51-P1-002","R4-P1-002"],"filesCited":[".opencode/skills/system-spec-kit/scripts/core/workflow.ts:1259",".opencode/skills/system-spec-kit/scripts/core/workflow.ts:1333",".opencode/skills/system-spec-kit/scripts/memory/generate-context.ts:415"],"confidence":0.93,"iteration":56,"blastRadius":"every default /memory:save produces zero metadata writes"}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-056.jsonl:9:{"type":"finding","id":"R56-P1-NEW-003","severity":"P1-broader","title":"Research-iteration folders invisible to memory layer","composedOf":["R3-P1-002","R51-P1-003","R4-P1-002"],"filesCited":["CLAUDE.md mandatory-metadata rule",".opencode/specs/system-spec-kit/026-*/research/016-*/iterations/"],"confidence":0.85,"iteration":56,"blastRadius":"every skill-owned deep-research/deep-review loop produces unindexed iteration artifacts"}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-046.md:29:- **Evidence:** `parsedStepArgs()` routes brace-prefixed argument text to `evaluateObjectLiteral()` (`manual-playbook-runner.ts:181-194`). `substitutePlaceholders()` splices both fixture placeholders and `<job-id>` using `runtimeState.lastJobId` into the raw string, then `evaluateObjectLiteral()` executes `Function(\`return (${replaced});\`)()` with no parser or escaping layer (`manual-playbook-runner.ts:427-445`). The runtime state feeding that substitution is mutated from prior steps, including `jobId` extracted out of tool payloads after `memory_ingest_start` succeeds (`manual-playbook-runner.ts:930-943,1112-1117`).
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-032.md:9:3. The remaining cost is maintenance, not ranking quality: the handler and Stage 3 still thread the compatibility flag, the source-analysis tests still assert that plumbing exists, and `generateCacheKey()` keeps a stale "option bits" signature/comment even though option bits are no longer used in the key. That is low runtime risk but real post-removal cleanup debt. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:923] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/search-limits-scoring.vitest.ts:229] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:246]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-032.md:19:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-007.md:4:I traced the planner-first save follow-up path for deferred enrichment: `memory-save.ts` -> `api/indexing.ts` -> `memory-index.ts` -> `post-insert.ts`, then cross-checked the entity-extraction and entity-linking substeps to see whether the runtime truthfully replays deferred work and surfaces soft failures.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-007.md:12:- **Description:** The explicit `runEnrichmentBackfill` follow-up can be a no-op for the exact documents it claims to backfill. It only flips `SPECKIT_POST_INSERT_ENRICHMENT_ENABLED` and then calls `memory_index_scan` with `incremental: true` and `force: false`, so already-indexed unchanged files are fast-path skipped before they ever re-enter `indexMemoryFile()` and the post-insert enrichment pipeline.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-007.md:13:- **Evidence:** `api/indexing.ts:111-122` wires `runEnrichmentBackfill()` to `runMemoryIndexScan({ specFolder, includeSpecDocs: true, includeConstitutional: false, incremental: true, force: false })`; `handlers/memory-index.ts:368-388` turns `categorized.toSkip` into `unchanged`/`fast_path_skips` instead of indexing those files; `lib/storage/incremental-index.ts:172-186` returns `'skip'` whenever `file_mtime_ms` is unchanged and `embedding_status` is not pending/failed. The existing tests only assert the env flip and the response hint (`tests/follow-up-api.vitest.ts:102-149`, `tests/post-insert-deferred.vitest.ts:50-81`); none verify that an unchanged deferred document is actually reprocessed.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-007.md:20:- **Description:** Entity extraction can soft-fail while still being recorded as a success, and the pipeline then proceeds into cross-document entity linking using whatever entity rows were already in the database. That means stale `memory_entities` data can drive new cross-document edges without any warning surfaced to the caller.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-007.md:21:- **Evidence:** `post-insert.ts:118-125` calls `refreshAutoEntitiesForMemory()` and then unconditionally sets `enrichmentStatus.entityExtraction = true` without checking the returned `{ removed, stored, catalogRebuilt }`; `lib/extraction/entity-extractor.ts:198-240` catches refresh failures and returns `{ removed: 0, stored: 0, catalogRebuilt: false }` instead of throwing; `post-insert.ts:159-173` runs `runEntityLinkingForMemory()` based only on feature flags; `lib/search/entity-linker.ts:527-550,608-640,1096-1132` reads `memory_entities` for the current memory and builds incremental cross-document matches from those rows. `handlers/save/response-builder.ts:311-321` only emits a partial-enrichment warning when a status flag is `false`, so this soft failure path remains invisible. Coverage is missing: `tests/post-insert-deferred.vitest.ts:11-47` only locks the deferred path, and `tests/handler-memory-save.vitest.ts:546-557,2286-2308` mocks post-insert as all-true success instead of exercising a zero-store/failed-refresh branch.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/09-split-panel.md:11:  007-graph-memory        6.07  #1263  Graph Memory Survey [22/89]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/09-split-panel.md:12:  007-graph-memory        5.98  #1315  Graph Memory Survey [55/89]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/09-split-panel.md:13:  007-graph-memory        5.94  #1355  Graph Memory Survey [85/89]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-054.jsonl:10:{"type":"test_coupling","testFile":"scripts/tests/generate-context-lastUpdated-refresh.vitest.ts (new)","tasks":["T-CNS-01","T-W1-CNS-04"],"coupling":"New test asserts lastUpdated monotonic advancement — cannot land before CNS-01 + W1-CNS-04","iteration":54}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-033.md:14:- **Downstream Impact:** A fresh compact brief can be deleted by an older recovery consumer, so the next post-compaction or startup recovery falls back to the generic "call memory_context" path even though a newer cached payload had already been produced.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/iterations/iteration-033.md:29:- **Evidence:** `saveState()` returns `false` on write or rename failure (`hook-state.ts:170-180`), but `updateState()` only logs `State update was not persisted` and still returns the in-memory merged object (`hook-state.ts:237-240`). `recordStateUpdate()` ignores persistence outcome entirely (`session-stop.ts:119-125`). Later in the same flow, `runContextAutosave()` reloads `lastSpecFolder` and `sessionSummary` from disk (`session-stop.ts:60-67`) after the three independent state writes (`session-stop.ts:261-304`) and is invoked unconditionally when autosave is enabled (`session-stop.ts:308-309`). The current tests only cover success-path helper behavior (`tests/hook-session-stop.vitest.ts:17-88`) or replay with autosave disabled (`tests/hook-session-stop-replay.vitest.ts:14-56`); none simulate a failed `saveState()` before autosave.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/checklist.md:10:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-052.jsonl:5:{"type":"finding","id":"R52-P2-002","severity":"P2","cluster":"memory-context-vocabulary-drift","hardenedSibling":".opencode/skills/system-spec-kit/mcp_server/handlers/session-bootstrap.ts","unhardenedSibling":".opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts","missingFields":["canonicalReadiness","trustState","lastPersistedAt (overloaded literal 'readiness: ready' field)"],"confidence":0.75,"iteration":52}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-052.jsonl:8:{"type":"ruled_out","direction":"Memory handler family sibling-asymmetry","reason":"All memory-*.ts files have zero tokens uniformly; no hardened sibling to form asymmetry pair (whole-family gap, not the R6-P1-001 pattern)","iteration":52}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-052.jsonl:10:{"type":"ruled_out","direction":"Runtime-agnostic hooks (index.ts, memory-surface.ts, response-hints.ts, mutation-feedback.ts) as asymmetry candidates","reason":"These are dispatchers/formatters with no parallel sibling pair; memory-surface.ts emits codeGraphStatus but is the single point of derivation, not an asymmetric pair","iteration":52}
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/24-metadata-footer.md:10:  6.07  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/24-metadata-footer.md:11:  5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/24-metadata-footer.md:12:  5.94  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/tasks.md:13:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/review-archive-r01-copilot/iterations/iteration-003.md:7:- `.opencode/skills/system-spec-kit/mcp_server/lib/skill-advisor/prompt-cache.ts:8-17` and `:60-129` → prompt cache is an in-memory HMAC-keyed exact-match cache with a 5-minute TTL and source-signature invalidation.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/review-archive-r01-copilot/iterations/iteration-003.md:9:- `.opencode/skills/system-spec-kit/mcp_server/lib/skill-advisor/metrics.ts:249-302` → diagnostics serialize to prompt-free JSONL and health summaries are computed from in-memory records.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/21-folderless-with-tooltip.md:11:  6.07  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/21-folderless-with-tooltip.md:12:  5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/21-folderless-with-tooltip.md:13:  5.94  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/21-folderless-with-tooltip.md:16:  5.88  #1285  Graph Memory Survey [37/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/01-compact-type-first.md:11:  6.07  #1263  Graph Memory Survey [22/89]  007-graph-memory-research
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/01-compact-type-first.md:12:  5.98  #1315  Graph Memory Survey [55/89]  007-graph-memory-research
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/01-compact-type-first.md:13:  5.94  #1355  Graph Memory Survey [85/89]  007-graph-memory-research
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/01-compact-type-first.md:15:  5.88  #1285  Graph Memory Survey [37/89]  007-graph-memory-research
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/002-skill-graph-daemon-native-advisor-tools/research/deep-research-config.json:50:    {"iter":16,"track":"C","question":"C1","title":"Available memory-MCP primitives"},
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/002-skill-graph-daemon-native-advisor-tools/research/deep-research-config.json:51:    {"iter":17,"track":"C","question":"C2","title":"Mapping memory concepts to advisor"},
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/description.json:19:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/description.json:20:  "memoryNameHistory": []
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:1:# Review Iteration 02 — Initialization & State (Part 2): active_memory_projection
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:4:**Dimension:** Module initialization ordering and the active_memory_projection table JOIN  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:11:### F02-1: P0 — Normal startup can leave `active_memory_projection` empty (CRITICAL)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:15:- **Description:** `initialize_db()` creates schema and runs migrations, but does NOT backfill `active_memory_projection` from existing `memory_index` rows on normal startup. The schema code only creates the table and copies rows from migration-era tables, not from current memories. If this table is empty, every search query returns 0 results.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:16:- **Fix:** After schema init, detect `memory_index` non-empty + `active_memory_projection` empty, then run lineage/projection backfill before serving queries.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:22:- **Description:** `vector_search`, `multi_concept_search`, and keyword search all use `INNER JOIN active_memory_projection p ON p.active_memory_id = m.id`. If that table has no rows, the join removes every candidate, even when `memory_index`, `vec_memories`, and FTS contain matches. This is an INNER JOIN on an empty table = 0 results guaranteed.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:29:- **Description:** Counts, folder counts, path lookups, stats, list views, and constitutional retrieval all inner-join `active_memory_projection`. An empty table makes the ENTIRE search subsystem appear empty, not just vector search. This explains why `memory_stats` might report 0 memories even when the database has data.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:36:- **Description:** Normal save/update paths call `upsert_active_projection()`, so new/touched memories get rows. But the "find existing row" path uses `get_by_folder_and_path`, whose prepared statement ALSO inner-joins `active_memory_projection`. If projection is already empty, old rows are not found, so untouched existing memories stay invisible.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:50:**The `active_memory_projection` table is the most probable root cause of 0 search results.** It acts as a gatekeeper via INNER JOIN on every search path (vector, FTS, BM25 via count/stats, keyword). If it is empty — which can happen after schema creation without migration data — all searches return 0 results even though `memory_index`, `vec_memories`, and `memory_fts` have data.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:52:The FTS5 fix (sqlite-fts.ts double-quoting) was correct but secondary. FTS results also go through the vector-index-queries path which JOINs active_memory_projection, so the fix would have been masked.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-02.md:54:**Verification query:** Run `SELECT COUNT(*) FROM active_memory_projection;` on the production database. If 0, this is confirmed.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/28-channel-annotated.md:11:  1263  Graph Memory Survey [22/89]                           6.07  007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/28-channel-annotated.md:12:  1315  Graph Memory Survey [55/89]                           5.98  007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-026.md:7:1. `handleMemorySearch()` now keeps two separate intent values in play: `detectedIntent` remains the public classifier result, while `adaptiveFusionIntent` is rewritten to `continuity` when `effectiveProfile === 'resume'`. Both values are then copied into the cache key and the pipeline config. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:816] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:846] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:900]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-026.md:18:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/07-score-heatmap.md:11:  ◆ 6.07  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/07-score-heatmap.md:12:  ◇ 5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/07-score-heatmap.md:13:  ◇ 5.94  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-053.jsonl:5:{"type":"resolved_question","id":"KQ-51-3","resolution":"No P0 escalation confirmed under expanded scope. One P1-worsened (R2-P1-001 under Docker shared-tmp, blast-radius only, operator-misconfig-gated). One P1 confirmed (R6-P1-001 sibling asymmetry is parity-only, no cache-poisoning because no caller consumes both context.ts and query.ts in a single decision path). Supply-chain (single benign postinstall), MCP args injection (memory-ingest traversal checks + allow-list, no other fs/shell sinks), and prototype-pollution (Zod strips unknown keys, no spread-into-target spread) surfaces are clean.","confidence":0.88,"iteration":53}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-053.jsonl:10:{"type":"ruled_out","direction":"MCP args injection into readFileSync/spawn","reason":"memory-ingest.ts uses hasTraversalSegment() + fs.realpathSync() + ALLOWED_BASE_PATHS allow-list. No other handler takes args.filePath or args.specFolder directly into fs/shell sinks","iteration":53}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/implementation-summary.md:10:_memory:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:4:**Dimension:** Trace query from memory_search handler through orchestrator to stage1  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:5:**Files reviewed:** `handlers/memory-search.ts`, `lib/search/pipeline/orchestrator.ts`, `lib/search/pipeline/stage1-candidate-gen.ts`, `utils/validators.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:15:- **Description:** In the hybrid branch, `hybridSearch.collectRawCandidates(...)` returning `[]` is treated as success. Vector fallback only runs inside `catch` (on thrown error). If the hybrid SQL path succeeds but an INNER JOIN drops all rows (e.g., empty `active_memory_projection`), the pipeline silently propagates 0 candidates through all remaining stages.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:20:- **File:** `handlers/memory-search.ts:683-689`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:27:- **File:** `handlers/memory-search.ts:663-673`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:38:| 1 | `memory-search.ts:498-521` | Handler validates query via `validateQuery()` (trim-only) |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:39:| 2 | `memory-search.ts:683-689` | Sets `searchType: 'hybrid'` |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-03.md:40:| 3 | `memory-search.ts:721` | Calls `executePipeline(config)` |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:11:### F09-1: P0 — active_memory_projection created but never backfilled from existing memory_index (CONFIRMED)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:15:- **Description:** `active_memory_projection` is created, but migration v22 only calls `ensureLineageTables()` which creates the table plus copies from legacy `hydra_*` tables. On any DB upgraded from pre-v22 without legacy lineage tables, `active_memory_projection` exists but is empty. Meanwhile, ALL search/count queries use `INNER JOIN active_memory_projection p ON p.active_memory_id = m.id`. Empty table = 0 results guaranteed.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:16:- **Fix:** In v22/bootstrap, backfill one projection row per active `memory_index` row. Or temporarily change to `LEFT JOIN` until projection repair completes.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:22:- **Description:** `validate_backward_compatibility()` only requires `memory_index` and `schema_version`. `validateLineageSchemaSupport()` exists separately but is not used in bootstrap path. The search layer unconditionally depends on `active_memory_projection`, but startup does not enforce that dependency.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:23:- **Fix:** Fold `validateLineageSchemaSupport()` into normal startup validation, or add `active_memory_projection` to the main compatibility contract.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:38:| `memory_fts` columns match sqlite-fts.ts? | YES. `title, trigger_phrases, file_path, content_text` in correct order | `vector-index-schema.ts:2384-2387`, `schema-downgrade.ts:205-208`, `sqlite-fts.ts:76-81` |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-09.md:40:| `active_memory_projection` created before first search? | YES (table exists). But may be EMPTY. | `vector-index-store.ts:822-823`, `vector-index-schema.ts:2280-2282,1291-1404` |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/16-horizontal-rule-separator.md:14:        └ 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:12:_memory:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:17:    recent_action: "Backfilled memory block"
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:52:- [x] T004 Apply Design 10 (folder-as-tree-group) to search command (`.opencode/commands/memory/search.md`)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:53:- [x] T005 Apply Design 10 to agent command definition (`.agents/commands/memory/search.toml`)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:73:- [x] T013 Add startup health check: query `memory_index` row count and `active_memory_projection` row count at server init; log counts
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:74:- [x] T014 Trigger `runLineageBackfill()` when `memory_index` has rows but `active_memory_projection` is empty (`mcp_server/core/db-state.ts` or init sequence)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:93:- [x] T023 [P] Run multi-word MCP search; confirm FTS5 and vector results both present in response [Evidence: memory_search("semantic search") returned 5 results via hybrid pipeline, 812ms]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/tasks.md:96:- [x] T026 Test startup health check: confirm `runLineageBackfill()` is triggered when `active_memory_projection` is empty and `memory_index` has rows [Evidence: context-server.ts lines 1368-1374 init sequence]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/08-numbered-list.md:11:   3.  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/08-numbered-list.md:12:   4.  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/08-numbered-list.md:13:   5.  #1355  Graph Memory Survey [85/89] · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/review/iterations/iteration-017.md:28:**P1-017-01 (D3): The shipped live-session wrapper setup never calls the required per-prompt finalizer, so the Phase 025 prompt-aggregation fix is not operationally reachable from the documented runtime contract.** Evidence: the wrapper only writes a compliance JSONL row when `finalizePrompt()` delegates to `finalizeSmartRouterCompliancePrompt()` (`.opencode/skills/system-spec-kit/scripts/observability/live-session-wrapper.ts:190-197`) and the telemetry layer only persists records through `recordSmartRouterCompliance()` / `appendJsonl()` after that finalization step (`.opencode/skills/system-spec-kit/scripts/observability/smart-router-telemetry.ts:245-251`, `.opencode/skills/system-spec-kit/scripts/observability/smart-router-telemetry.ts:254-300`). But the published setup guide shows only `configureSmartRouterSession()` plus `onToolCall()` in the generic example and in every Claude/Codex/Gemini/Copilot snippet, with no `finalizeSmartRouterPrompt(promptId)` call at all (`.opencode/skills/system-spec-kit/scripts/observability/LIVE_SESSION_WRAPPER_SETUP.md:48-64`, `.opencode/skills/system-spec-kit/scripts/observability/LIVE_SESSION_WRAPPER_SETUP.md:68-124`). Impact: operators following the shipped integration guide will not flush one aggregate record per prompt, so zero-read prompts disappear entirely and multi-read prompts can remain stranded in in-memory state instead of reaching the analyzer/reporting path that Phase 025 claims to have fixed (`.opencode/skills/skill-advisor/feature_catalog/feature_catalog.md:649-653`, `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/009-hook-package/003-hook-parity-remediation/implementation-summary.md:45-49`). Remediation: update the runtime setup contract to require exactly one `finalizeSmartRouterPrompt(promptId)` call when a prompt completes, and add an end-to-end integration/regression that follows the documented setup flow and proves a prompt produces a persisted compliance row.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/22-pipe-separated.md:11:  #1263  Graph Memory Survey [22/89] (6.07) — 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/22-pipe-separated.md:12:  #1315  Graph Memory Survey [55/89] (5.98) — 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/22-pipe-separated.md:13:  #1355  Graph Memory Survey [85/89] (5.94) — 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-051.jsonl:2:{"type":"finding","id":"R51-P1-001","severity":"P1","cluster":"B","extends":"R4-P1-002","file":"scripts/core/workflow.ts:1259","title":"const ctxFileWritten = false hardcodes description-update guard; savePFD block is unreachable dead code and never writes lastUpdated","confidence":0.92,"dimension":"root-cause","evidence":"workflow.ts:1259 sets ctxFileWritten=false literal. Block at 1261-1331 is unreachable. Even if reached, only memorySequence/memoryNameHistory are updated (1302-1307), never lastUpdated. Only other lastUpdated writer is spec-folder/generate-description.ts:79 (create-time only).","iteration":51}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-051.jsonl:3:{"type":"finding","id":"R51-P1-002","severity":"P1","cluster":"B","extends":"R3-P2-001,R5-P1-001","file":"scripts/core/workflow.ts:1333,scripts/memory/generate-context.ts:415","title":"Default planner-mode plan-only skips refreshGraphMetadata entirely; derived.last_save_at/status/source_docs never refresh under default save path","confidence":0.93,"dimension":"root-cause","evidence":"workflow.ts:1333 guards refreshGraphMetadata on shouldRunExplicitSaveFollowUps=options.plannerMode==='full-auto'. generate-context.ts:415 declares default plannerMode='plan-only'. /memory:save and generate-context.js --json both use plan-only by default. Refresh fires only on explicit --full-auto.","iteration":51}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-051.jsonl:4:{"type":"finding","id":"R51-P1-003","severity":"P1","cluster":"B","extends":null,"file":"scripts/,mcp_server/ (whole tree, grep miss)","title":"implementation-summary.md._memory.continuity has zero programmatic writers; maintenance is 100% manual hand-editing with no freshness validator","confidence":0.85,"dimension":"cross-cutting-coverage","evidence":"Grep _memory.continuity|continuity_freshness across scripts/ and mcp_server/ source returns zero programmatic writer hits. Only reads at spec-doc-structure.ts:513-555 (validator) and resume-ladder.ts:361-372 (resume). CLAUDE.md permits AI hand-edit but no automated stamp on canonical save. Extends Cluster B by a fourth surface.","iteration":51}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-051.jsonl:6:{"type":"resolved_question","id":"KQ-51-1","resolution":"Cluster B infrastructure gap reaches FOUR canonical-save surfaces (not two). Beyond known description.json.lastUpdated (R4-P1-002) and checklist.md markers (R3-P2-002): (a) graph-metadata.json.derived.* fields only refresh on --full-auto saves per workflow.ts:1333 (R51-P1-002); (b) _memory.continuity frontmatter has zero programmatic writers anywhere (R51-P1-003); (c) existing savePerFolderDescription block in workflow.ts:1259 is unreachable dead code due to const ctxFileWritten = false stub (R51-P1-001).","confidence":0.91,"iteration":51}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/research/deltas/iter-051.jsonl:8:{"type":"ruled_out","direction":"dist/memory/generate-context.js differs from .ts source in a way that hides lastUpdated writer","reason":"Line counts differ (647 src / 571 dist) but plannerMode='plan-only' default and shouldRunExplicitSaveFollowUps guard are preserved identically. Description-update code lives in workflow.ts/.js not generate-context.","iteration":51}
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-07.md:11:No single feature flag or breaker cleanly explains "0 results for any query." Configuration can suppress individual lanes, but the `active_memory_projection` INNER JOIN remains the stronger universal-root-cause candidate.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/description.json:21:  "memorySequence": 1,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/description.json:22:  "memoryNameHistory": [
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/description.json:23:    "01-04-26_19-35__diagnosed-and-fixed-memory-search-0-results-bug.md"
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/26-two-column-kv.md:11:  6.07  #1263  Graph Memory Survey (×4 chunks) · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/27-dot-leader.md:11:  ████░  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/27-dot-leader.md:12:  ████░  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-027.md:4:Determine whether the operator-facing resume flow uses the same continuity profile and Stage 3 MMR path as `memory_search()`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-027.md:7:1. `memory_context` does not treat `resume` as a search mode. The mode table routes `resume` to a dedicated `executeResumeStrategy()`, and that strategy returns canonical ladder content directly from `handover.md -> _memory.continuity -> spec docs`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:776] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:900] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:1097]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-027.md:8:2. The resume-mode regression test makes that contract explicit by throwing if `handleMemorySearch()` is called during resume-mode execution. In other words, the canonical resume ladder intentionally bypasses the 4-stage retrieval pipeline. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts:6]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-027.md:9:3. `session_resume` documents its first sub-call as `memory_context(mode=resume, profile=resume)`, so the operator-facing recovery surface inherits that ladder behavior rather than the adaptive-fusion/MMR search path. This means the continuity profile currently affects search-style `profile='resume'` calls, not the canonical `/spec_kit:resume` ladder. [SOURCE: .opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/18-session-resume-tool.md:14]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-027.md:18:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-027.md:19:- `.opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-09.md:252:- inside individual handlers such as `memory-search.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-09.md:270:[SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:399-403`]  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:44:      ".opencode/commands/memory/search.md",
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:52:      "mcp_server/handlers/memory-context.ts",
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:59:      "handlers/memory-context.ts",
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:69:        "path": ".opencode/commands/memory/search.md",
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:115:        "name": "memory-context.ts",
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:117:        "path": "mcp_server/handlers/memory-context.ts",
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/graph-metadata.json:222:      "handover.md"
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/10-tag-cloud.md:15:  007-external-graph-memory-research/
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/12-breadcrumb-folder.md:12:  6.07  #1263  Graph Memory Survey [22/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/12-breadcrumb-folder.md:13:  5.98  #1315  Graph Memory Survey [55/89] · 007-graph-memory
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:10:_memory:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:15:    recent_action: "Backfilled memory block"
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:51:The `/memory:search` output groups results by spec folder using leaf folder names (Design 10: folder-as-tree-group). Paths are no longer rendered at full length, making results scannable. Applied to both `.opencode/commands/memory/search.md` and `.agents/commands/memory/search.toml`.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:77:| `.opencode/commands/memory/search.md` | Modified | Design 10 dashboard applied |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:78:| `.agents/commands/memory/search.toml` | Modified | Design 10 dashboard applied |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:79:| `mcp_server/handlers/memory-context.ts` | Modified | P0: folder discovery no longer promotes to specFolder filter |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:90:All fixes applied directly to TypeScript source, compiled with `bun run build` (1210+ dist files), and verified at runtime. `memory_search("semantic search")` confirmed returning 5 results via hybrid pipeline (vector + keyword channels, cross-encoder reranking) in 812ms. Root cause investigation: 10 deep-research iterations + 10 deep-review iterations via Copilot CLI GPT 5.4 (documented in `scratch/`).
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:120:| Runtime: memory_search returns results | PASS — 5 results, 812ms, hybrid pipeline |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/implementation-summary.md:121:| P0: memory_context focused mode returns results | PASS — 5 candidates found (was 0); folder discovery no longer filters |
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-06.md:5:**Files reviewed:** `pipeline/orchestrator.ts`, `handlers/memory-search.ts`, `vector-index-queries.ts`, `bm25-index.ts`, `pipeline/stage2-fusion.ts`, `pipeline/stage3-rerank.ts`, `pipeline/stage4-filter.ts`, `formatters/search-results.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-06.md:20:- **File:** `handlers/memory-search.ts:721-723,816-909`, `formatters/search-results.ts:400-433`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/review-06.md:34:- **File:** `handlers/memory-search.ts:721-909,1083-1145`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:7:1. Whether `isFtsAvailable()` could be returning `false` because the `memory_fts` table is actually missing or empty.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:17:- Otherwise it runs `SELECT name FROM sqlite_master WHERE type='table' AND name='memory_fts'`.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:33:1. `SELECT name FROM sqlite_master WHERE type='table' AND name='memory_fts'`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:34:   - Returned: `memory_fts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:35:2. `SELECT COUNT(*) FROM memory_fts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:38:So the concrete on-disk database file currently in use **does contain** the `memory_fts` table, and it is **not empty**.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:42:For this database file, a `false` result from `isFtsAvailable()` is **not explained** by a missing or empty `memory_fts` table.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-02.md:196:1. The inspected `context-index.sqlite` file is not missing `memory_fts`.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:48:- `memory_index = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:49:- `active_memory_projection = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:234:in `memory-search.ts`, and:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:260:[SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:399-403`]  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:263:[SOURCE: `.opencode/skills/system-spec-kit/scripts/core/memory-indexer.ts:39-44`]  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:338:- `memory_index = 1728`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:339:- `active_memory_projection = 1708`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:345:- `memory_index = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-08.md:346:- `active_memory_projection = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-01.md:14:- `isFtsAvailable()` also depends on the same `db` handle to query `sqlite_master` for `memory_fts` in `.opencode/skills/system-spec-kit/mcp_server/lib/search/hybrid-search.ts:426-433`.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-01.md:65:3. Verify whether the runtime process handling the failing request is entering `main()` and reaching `.opencode/skills/system-spec-kit/mcp_server/context-server.ts:1448` before the first memory search request.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-033.md:9:3. The continuity split matters here too. When a search call carries `adaptiveFusionIntent='continuity'` but `detectedIntent='understand'`, Stage 2 will score/fuse with continuity weights and Stage 3 small-set MMR will still diversify with the `understand` lambda. This is the clearest remaining behavioral mismatch after implementation. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/adaptive-ranking.vitest.ts:260] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/iterations/iteration-033.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:9:- the `active_memory_projection` join still left 1701 active vector rows?
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:34:- `memory_index = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:35:- `active_memory_projection = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:69:SELECT COUNT(*) FROM memory_index WHERE embedding_status = "success";
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:181:SELECT COUNT(*) FROM vec_memories vm JOIN active_memory_projection p ON p.active_memory_id = vm.rowid;
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:335:- `memory_index = 1728`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:336:- `active_memory_projection = 1708`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:342:- `memory_index = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:343:- `active_memory_projection = 0`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-07.md:383:- `memory_index WHERE embedding_status='success'` = `1728`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:11:5. the script-side indexer path used by `memory-indexer.ts`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:34:[SOURCE: `.opencode/skills/system-spec-kit/scripts/core/memory-indexer.ts:63-92`]  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:174:    "memory_index": 1728,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:187:    "memory_index": 0,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:331:`memory-indexer.ts` does two important things in this order:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:341:memoryId = vectorIndex.indexMemory({ ... });
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:344:[SOURCE: `.opencode/skills/system-spec-kit/scripts/core/memory-indexer.ts:72-92`]  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:345:[SOURCE: `.opencode/skills/system-spec-kit/scripts/core/memory-indexer.ts:159-172`]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:355:And `index_memory(...)` defaults to:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:367:- then the later `initialize_db()` call inside `index_memory(...)` can resolve to the provider-specific DB
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:404:4. The provider-specific Voyage DB in this workspace is empty: `memory_index = 0`, `active_memory_projection = 0`, `vec_memories = 0`.  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:407:5. The legacy DB is populated: `memory_index = 1728`, `active_memory_projection = 1708`, `vec_memories = 1721`.  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-10.md:419:   [SOURCE: `.opencode/skills/system-spec-kit/scripts/core/memory-indexer.ts:72-92`]  
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-05.md:171:`ftsSearch()` short-circuits to `[]` if `db` is missing or `memory_fts` is unavailable, and otherwise catches any query failure and returns `[]`. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/hybrid-search.ts:426-437`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/hybrid-search.ts:446-471`]
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-05.md:173:From prior iterations, we already know `db` is present and `memory_fts` exists, so the most likely remaining FTS-empty case is simply "no lexical matches for this query" rather than missing infrastructure.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-03.md:9:3. How `memory_search` invokes the pipeline.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-03.md:16:### 1. `memory_search` does **not** use the query router to choose `searchType`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-03.md:18:`memory_search` builds `PipelineConfig` directly and sets:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-03.md:27:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:684-721`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-03.md:235:1. `memory_search` chose the Stage 1 `hybrid` branch at the pipeline level.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:1:# Research Iteration 4: `active_memory_projection` reality check
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:5:Is the `JOIN active_memory_projection p ON p.active_memory_id = m.id` filtering out **all** vector search results?
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:17:- `SELECT COUNT(*) FROM active_memory_projection` → **1708**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:18:- `SELECT COUNT(*) FROM memory_index` → **1728**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:29:- Command result from `sqlite3 ... COUNT(*) FROM active_memory_projection`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:30:- Command result from `sqlite3 ... COUNT(*) FROM memory_index`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:40:- `memory_index`: **1728** rows
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:41:- `active_memory_projection`: **1708** rows
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:44:So the active projection JOIN narrows the working set from all historical memory versions down to active versions, but it does **not** collapse the candidate set to zero globally.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:50:- `memory_index m JOIN active_memory_projection p ON p.active_memory_id = m.id` → **1708** rows
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:51:- `memory_index m JOIN active_memory_projection p ... JOIN vec_memories v ON v.rowid = m.id` → **1701** rows
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:52:- `active_memory_projection` rows with no matching `memory_index` row → **0**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:53:- `active_memory_projection` rows with no matching `vec_memories` row → **7**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:59:If `active_memory_projection` were empty or structurally broken, those joins would be `0`.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:63:- projection→memory coverage is **1708 / 1708**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:68:## What `active_memory_projection` is for
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:70:`active_memory_projection` is defined as a compact table of the currently active memory version per logical key:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:73:CREATE TABLE IF NOT EXISTS active_memory_projection (
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:75:  root_memory_id INTEGER NOT NULL,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:76:  active_memory_id INTEGER NOT NULL UNIQUE,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:81:The schema initializer also creates an index on `active_memory_id`:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:84:CREATE INDEX IF NOT EXISTS idx_active_memory_projection_active
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:85:  ON active_memory_projection(active_memory_id)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:100:- first deletes any stale row that points the same `active_memory_id` at a different `logical_key`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:104:DELETE FROM active_memory_projection WHERE active_memory_id = ? AND logical_key != ?
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:105:INSERT INTO active_memory_projection (logical_key, root_memory_id, active_memory_id, updated_at)
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:108:  root_memory_id = excluded.root_memory_id,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:109:  active_memory_id = excluded.active_memory_id,
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:123:- inserts into `memory_lineage`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:127:database.prepare(`INSERT INTO memory_lineage ...`).run(...);
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:128:upsertActiveProjection(database, logicalKey, rootMemoryId, memoryId, validFrom);
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:139:When a new append-only memory row is created, `insertAppendOnlyMemoryIndexRow()` inserts into `vec_memories` if an embedding exists and sqlite-vec is available:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:146:  `).run(BigInt(memoryId), to_embedding_buffer(embedding));
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:150:Then `createAppendOnlyMemoryRecord()` records the lineage transition, which in turn upserts `active_memory_projection`.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:183:> all vector searches return 0 because every query joins through `active_memory_projection`, and that table may be empty.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:190:- the projection rows all map to real `memory_index` rows
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:208:- `.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/011-indexing-and-adaptive-fusion/007-external-graph-memory-research/research/research.md`
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:213:- `memory_index.embedding_status` says success
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:214:- `active_memory_projection` marks the row active
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:221:**Answer:** `active_memory_projection` is **not** filtering out all results.
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:225:- `active_memory_projection` = **1708**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-04.md:226:- `memory_index` = **1728**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-06.md:22:- `SELECT COUNT(*) FROM memory_fts WHERE memory_fts MATCH "semantic"` -> **337**
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/013-fts5-fix-and-search-dashboard/scratch/deep-research/research-06.md:437:- `SELECT COUNT(*) FROM memory_fts WHERE memory_fts MATCH "semantic"` -> **337**
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:29:      "id": "finding-1-3-the-reranker-keeps-a-5-minute-in-memory-cache-with-a-200-entry-bound-and-distinc",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:30:      "text": "The reranker keeps a 5-minute in-memory cache with a 200-entry bound and distinct fallback score band `0.0-0.5`, but it does not yet expose hit-rate telemetry. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:115] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:399]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:358:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:373:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:384:      "text": "The blast radius is wider than one file because `applyLengthPenalty` is a public search argument: it is accepted by the tool schemas, typed in tool args, defaulted in `memory-search.ts`, included in the cache key, and forwarded into the pipeline config. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/schemas/tool-input-schemas.ts:160] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tool-schemas.ts:137] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tools/types.ts:69] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:643] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/search-utils.ts:50] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/types.ts:144]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:388:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:403:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:1101:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:1116:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:1131:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:1139:      "text": "There is no contradiction between \"remove the length penalty\" and \"keep `applyLengthPenalty` as a compatibility no-op\". The scoring behavior is localized inside `cross-encoder.ts`, while the flag still appears in schemas, handler defaults, and cache-key construction. That means behavior can be removed without deleting the public contract in the same phase. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:212] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:389] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/schemas/tool-input-schemas.ts:160] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:642]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/findings-registry.json:1146:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/deep-research-strategy.md:90:- `key_files` still carry `847` unresolved entries in the active corpus, dominated by `749` path-like misses, `84` cross-track repo-relative paths, and `9` obsolete `memory/metadata.json` references.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/deep-research-strategy.md:96:- No historical memory-save analysis.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/deep-research-strategy.md:106:Wave 5 complete. Stop the research loop. The remaining work is now one residual-hygiene implementation phase focused on `key_files` path canonicalization, obsolete memory-path cleanup, and entity prioritization plus the `9` surviving cross-spec canonical-doc leaks. A smaller optional follow-on can address the two complete-checklist packets that still lack `implementation-summary.md`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:14:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:18:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:19:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:68:- The current reranker status surface only tracks in-memory latency `avg`, `p95`, and `count`; there is no persisted per-provider telemetry. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:458] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:499]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:108:- `applyLengthPenalty` is a public argument in schemas, tool metadata, runtime types, handler defaults, pipeline config, cache-key construction, and shadow replay config. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/schemas/tool-input-schemas.ts:160] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tool-schemas.ts:137] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tools/types.ts:69] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:643] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/search-utils.ts:50] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/feedback/shadow-evaluation-runtime.ts:235]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:173:- If continuity must become a public search intent accepted by `memory_search`, the blast radius expands into:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:340:- `handleMemorySearch()` now carries two intent values: `detectedIntent` remains the public classifier result, while `adaptiveFusionIntent` is rewritten to `continuity` when `profile === 'resume'`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:816] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:900]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:351:- `memory_context` treats `resume` as a dedicated ladder strategy and returns `handover.md -> _memory.continuity -> spec docs` directly. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:776] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:900] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:1097]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:352:- The resume-mode regression test makes that contract explicit by failing if `handleMemorySearch()` is called. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts:6]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/research.md:353:- `session_resume` documents its first sub-call as `memory_context(mode=resume, profile=resume)`, so the operator-facing recovery surface inherits the direct-doc ladder rather than the 4-stage retrieval path. [SOURCE: .opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/18-session-resume-tool.md:14]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/deep-research-dashboard.md:50:- Residual `key_files` misses are still dominated by path-quality issues, not parser junk: path-like references, cross-track repo-relative paths, and obsolete `memory/metadata.json` entries.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/research.md:14:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/research.md:18:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/research.md:19:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/001-advisor-hook-baseline-research/iterations/iteration-07.md:15:- Can existing memory-system adaptive-ranking patterns be reused here, or does advisor tuning need its own bounded store?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:11:{"type":"iteration","run":11,"status":"complete","focus":"Map length-penalty call graph, compatibility surface, and phase-001 blast radius","findingsCount":4,"newInfoRatio":0.74,"noveltyJustification":"This pass translated the earlier removal recommendation into a concrete schema-to-runtime blast-radius map and showed that the safe first step is behavior removal with a compatibility no-op rather than immediate contract deletion.","keyQuestions":["RQ-6"],"answeredQuestions":[],"ruledOut":["Treating phase 001 as a one-line constant deletion with no compatibility work"],"focusTrack":"length-penalty","toolsUsed":["Read","Grep"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:62",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:643",".opencode/skills/system-spec-kit/mcp_server/schemas/tool-input-schemas.ts:160",".opencode/skills/system-spec-kit/mcp_server/lib/feedback/shadow-evaluation-runtime.ts:235"],"timestamp":"2026-04-13T06:00:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:21:{"type":"iteration","run":21,"status":"complete","focus":"Cross-validate the phase recommendations against each other and the current repo state","findingsCount":4,"newInfoRatio":0.24,"noveltyJustification":"This pass did not uncover new tuning levers, but it converted the late-stage recommendations into a consistency check and exposed packet-local config/dashboard drift that needed to be corrected before final synthesis.","keyQuestions":["RQ-6","RQ-7","RQ-8","RQ-9","RQ-10"],"answeredQuestions":[],"ruledOut":["Reopening FSRS or search-weights.json as unresolved convergence topics"],"focusTrack":"convergence","toolsUsed":["Read","Grep"],"sourcesQueried":["research/deep-research-config.json:3","research/deep-research-dashboard.md:10",".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:212",".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:389",".opencode/skills/system-spec-kit/mcp_server/schemas/tool-input-schemas.ts:160",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:642",".opencode/skills/system-spec-kit/shared/algorithms/adaptive-fusion.ts:60",".opencode/skills/system-spec-kit/mcp_server/lib/eval/k-value-analysis.ts:402",".opencode/skills/system-spec-kit/mcp_server/lib/search/intent-classifier.ts:7"],"timestamp":"2026-04-13T07:00:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:26:{"type":"iteration","run":26,"status":"complete","focus":"Trace a continuity-oriented search call through the live search pipeline and isolate whether continuity reaches Stage 3 MMR","findingsCount":3,"newInfoRatio":0.42,"noveltyJustification":"This pass found the key post-implementation gap: the continuity profile reaches Stage 1/2 through adaptiveFusionIntent, but Stage 3 still keys MMR off detectedIntent.","keyQuestions":["RQ-11"],"answeredQuestions":[],"ruledOut":["Assuming INTENT_LAMBDA_MAP.continuity made the continuity lambda live end to end in Stage 3"],"focusTrack":"pipeline-trace","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:816",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage1-candidate-gen.ts:534",".opencode/skills/system-spec-kit/mcp_server/lib/search/hybrid-search.ts:1221",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/types.ts:153",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/orchestrator.ts:113",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:206"],"timestamp":"2026-04-13T09:42:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:27:{"type":"iteration","run":27,"status":"complete","focus":"Verify whether the canonical resume surface uses the search pipeline or bypasses it entirely","findingsCount":3,"newInfoRatio":0.36,"noveltyJustification":"The critical new insight is that /spec_kit:resume never touches handleMemorySearch, so the continuity profile and Stage 3 lambda gap do not currently affect the canonical resume ladder.","keyQuestions":["RQ-11"],"answeredQuestions":["RQ-11"],"ruledOut":["Treating /spec_kit:resume as evidence that continuity already reaches Stage 3 MMR"],"focusTrack":"resume-surface","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:776",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:900",".opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts:6",".opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/18-session-resume-tool.md:14"],"timestamp":"2026-04-13T09:48:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:30:{"type":"iteration","run":30,"status":"complete","focus":"Cross-check ARCHITECTURE.md and configs/README.md against the shipped continuity and reranker behavior","findingsCount":3,"newInfoRatio":0.21,"noveltyJustification":"This pass showed the docs are only partially aligned: constants and weights are right, but the continuity-lambda wording overstates the live Stage 3 and resume-path behavior.","keyQuestions":["RQ-13"],"answeredQuestions":[],"ruledOut":["Treating ARCHITECTURE.md and configs/README.md as fully aligned because the constant values match"],"focusTrack":"docs-architecture-configs","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/ARCHITECTURE.md:150",".opencode/skills/system-spec-kit/mcp_server/configs/README.md:49",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209",".opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts:6"],"timestamp":"2026-04-13T10:06:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:31:{"type":"iteration","run":31,"status":"complete","focus":"Verify SKILL.md alignment and compare the doc claims against the current regression surface","findingsCount":3,"newInfoRatio":0.18,"noveltyJustification":"The doc audit tightened here: SKILL.md stayed accurate, while the test surface revealed that the end-to-end continuity-to-Stage3 handoff is still unproven even though the individual pieces all pass.","keyQuestions":["RQ-13"],"answeredQuestions":["RQ-13"],"ruledOut":["Assuming the existing test surface already proves Stage 3 continuity-lambda behavior"],"focusTrack":"docs-skill-and-tests","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/SKILL.md:592",".opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts:6",".opencode/skills/system-spec-kit/mcp_server/tests/adaptive-ranking.vitest.ts:260",".opencode/skills/system-spec-kit/mcp_server/tests/intent-classifier.vitest.ts:677"],"timestamp":"2026-04-13T10:12:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:32:{"type":"iteration","run":32,"status":"complete","focus":"Check for second-order runtime and maintenance effects after retiring the length penalty","findingsCount":3,"newInfoRatio":0.14,"noveltyJustification":"This pass confirmed that the length penalty is truly inert at runtime and that the remaining cost is compatibility plumbing plus minor stale cache-key commentary rather than ranking quality drift.","keyQuestions":["RQ-14"],"answeredQuestions":[],"ruledOut":["Expecting the retired length penalty to still create meaningful ranking drift"],"focusTrack":"length-penalty-postflight","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:230",".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:431",".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:246",".opencode/skills/system-spec-kit/mcp_server/tests/search-limits-scoring.vitest.ts:176",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:923"],"timestamp":"2026-04-13T10:18:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:33:{"type":"iteration","run":33,"status":"complete","focus":"Check the small-result-set consequences of MIN_RESULTS_FOR_RERANK = 4, including the surviving MMR branch","findingsCount":3,"newInfoRatio":0.12,"noveltyJustification":"The key post-ship insight is that 2-3 result sets are no longer reranked but can still be diversified, which keeps a real behavioral change alive below the new rerank minimum.","keyQuestions":["RQ-14"],"answeredQuestions":["RQ-14"],"ruledOut":["Treating MIN_RESULTS_FOR_RERANK = 4 as only a reranker-cost optimization"],"focusTrack":"rerank-threshold-postflight","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:49",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:206",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:320",".opencode/skills/system-spec-kit/mcp_server/tests/stage3-rerank-regression.vitest.ts:136",".opencode/skills/system-spec-kit/mcp_server/tests/adaptive-ranking.vitest.ts:260",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830"],"timestamp":"2026-04-13T10:24:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:34:{"type":"iteration","run":34,"status":"complete","focus":"Synthesize the remaining post-implementation gaps across runtime behavior, telemetry semantics, and docs","findingsCount":4,"newInfoRatio":0.07,"noveltyJustification":"This was a low-novelty consolidation pass that grouped the residual issues into signal wiring, observability semantics, and wording precision rather than reopening tuning questions.","keyQuestions":["RQ-11","RQ-12","RQ-13","RQ-14","RQ-15"],"answeredQuestions":[],"ruledOut":["Reopening broad fusion-weight tuning as the next research target"],"focusTrack":"post-implementation-synthesis","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/shared/algorithms/adaptive-fusion.ts:60",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:914",".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:551",".opencode/skills/system-spec-kit/SKILL.md:592",".opencode/skills/system-spec-kit/ARCHITECTURE.md:150",".opencode/skills/system-spec-kit/mcp_server/configs/README.md:50"],"timestamp":"2026-04-13T10:30:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/001-search-fusion-routing-research/deep-research-state.jsonl:35:{"type":"iteration","run":35,"status":"complete","focus":"Define the next research phase now that the implementation, telemetry surface, and doc audit have all been checked","findingsCount":4,"newInfoRatio":0.05,"noveltyJustification":"This final pass converts the residual gaps into a concrete follow-on agenda instead of leaving them as loosely connected audit notes.","keyQuestions":["RQ-15"],"answeredQuestions":["RQ-15"],"ruledOut":["Repeating the old weight-tuning loop before the Stage 3 intent contract and telemetry semantics are resolved"],"focusTrack":"next-phase-definition","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/types.ts:153",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:900",".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts:140",".opencode/skills/system-spec-kit/ARCHITECTURE.md:150",".opencode/skills/system-spec-kit/mcp_server/configs/README.md:50",".opencode/skills/system-spec-kit/feature_catalog/01--retrieval/05-4-stage-pipeline-architecture.md:25"],"timestamp":"2026-04-13T10:36:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/deep-research-state.jsonl:38:{"type":"iteration","run":30,"status":"complete","focus":"Manual 50-entry key-file sample across 10 random folders","findingsCount":4,"newInfoRatio":0.18,"noveltyJustification":"The sample established that key-file quality is much cleaner than Wave 1 but not perfect: 47 of 50 sampled entries resolved, and the misses were concentrated in stale memory-era or cross-track references rather than the earlier junk-token flood.","keyQuestions":["PVQ-3"],"answeredQuestions":[],"ruledOut":["Assuming the improved global resolve rate meant the random sample would be 50 of 50 clean"],"focusTrack":"keyfiles-sample","toolsUsed":["Read","Bash","jq"],"sourcesQueried":["live filesystem scan over .opencode/specs on 2026-04-13"],"timestamp":"2026-04-13T12:56:00Z","durationMs":300000,"sessionId":"937db887-8922-4028-b13d-4eeca0e16d8f","generation":4,"lineageMode":"completed-continue"}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/deep-research-state.jsonl:39:{"type":"iteration","run":31,"status":"complete","focus":"Residual global key-file miss families after sanitization","findingsCount":5,"newInfoRatio":0.14,"noveltyJustification":"This pass showed that the remaining miss classes are now dominated by path-like references, phrase-like carryovers, and shell-command snippets that the current predicate still classifies too loosely.","keyQuestions":["PVQ-3"],"answeredQuestions":["PVQ-3"],"ruledOut":["Treating all remaining path-like misses as equivalent when obsolete memory paths and command snippets are now different cleanup targets"],"focusTrack":"keyfiles-residuals","toolsUsed":["Read","Bash","jq"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/graph/graph-metadata-parser.ts:562-568","live filesystem scan over .opencode/specs on 2026-04-13"],"timestamp":"2026-04-13T13:04:00Z","durationMs":300000,"sessionId":"937db887-8922-4028-b13d-4eeca0e16d8f","generation":4,"lineageMode":"completed-continue"}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-036.md:10:4. The remaining miss set is now dominated by path-quality issues, not junk tokens: `749` path-like misses, `84` cross-track repo-relative misses, `9` obsolete `memory/metadata.json` references, and `5` bare filenames. [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-036.md:11:5. The most repeated unresolved values are now concrete path residues such as `memory/metadata.json` (`9`), `hooks/memory-surface.ts` (`9`), `hooks/claude/session-prime.ts` (`7`), and `.opencode/agents/agent-improver.md` (`7`). [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-036.md:32:- What I would do differently: split the future residual-hygiene phase into repo-relative canonicalization versus obsolete memory-path cleanup so success metrics stay crisp.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/checklist.md:8:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/tasks.md:8:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/tasks.md:33:- [x] T002 Run generate-context.js on 020/ and 020/001/ (P0) [Evidence: child metadata and graph files present in 020/001.]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/tasks.md:56:- [x] T013b Run `generate-context.js` for each new child + 020 root (P0)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-prompts/deep-research-prompt.md:8:/spec_kit:deep-research:auto "Graph metadata relationship validation and entity quality analysis across 515+ spec folders" --max-iterations=15 --spec-folder=.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/003-continuity-refactor-gates/003-graph-metadata-validation
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:35:- [x] RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:36:- [x] RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:37:- [x] RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:49:- No historical memory-save corpus reconstruction.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:75:- RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:76:- RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:77:- RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:109:- Matching individual handover prototype sentences against the live drop regex separated the hard heuristic problem from the softer Tier 2 overlap. (iteration 22)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:134:- Looking only at overall accuracy hides the real hotspots, because the strong structured categories mask weaker delivery and handover performance. (iteration 5)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:135:- Category-level averages were too coarse to explain why handover and delivery underperform. (iteration 6)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:143:- Prototype labels such as "handover" or "drop" were not meaningful enough by themselves; the actual chunk text carried the overlap. (iteration 14)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:152:- Looking only at `memory-save.ts:1008` still underestimates the missing cache and env-contract work. (iteration 23)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:227:### Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated. -- BLOCKED (iteration 6, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:228:- What was tried: Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:230:- Do NOT retry: Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:267:### Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead. -- BLOCKED (iteration 1, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:268:- What was tried: Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:270:- Do NOT retry: Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:302:### Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes. -- BLOCKED (iteration 26, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:303:- What was tried: Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:305:- Do NOT retry: Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:337:### Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them. -- BLOCKED (iteration 22, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:338:- What was tried: Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:340:- Do NOT retry: Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:342:### Reopening the delivery/progress or handover/drop remediation plan as the primary next step. -- BLOCKED (iteration 34, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:343:- What was tried: Reopening the delivery/progress or handover/drop remediation plan as the primary next step.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:345:- Do NOT retry: Reopening the delivery/progress or handover/drop remediation plan as the primary next step.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:352:### Rewriting the drop corpus as the main fix for handover/drop confusion. -- BLOCKED (iteration 14, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:353:- What was tried: Rewriting the drop corpus as the main fix for handover/drop confusion.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:355:- Do NOT retry: Rewriting the drop corpus as the main fix for handover/drop confusion.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:402:### Treating command-first handover prose as harmless prototype decoration. -- BLOCKED (iteration 14, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:403:- What was tried: Treating command-first handover prose as harmless prototype decoration.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:405:- Do NOT retry: Treating command-first handover prose as harmless prototype decoration.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:417:### Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate. -- BLOCKED (iteration 13, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:418:- What was tried: Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:420:- Do NOT retry: Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:432:### Treating phase `003` as a one-line constructor tweak in `memory-save.ts`. -- BLOCKED (iteration 15, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:433:- What was tried: Treating phase `003` as a one-line constructor tweak in `memory-save.ts`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:435:- Do NOT retry: Treating phase `003` as a one-line constructor tweak in `memory-save.ts`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:437:### Treating phase-anchor inference as the main handover failure driver. -- BLOCKED (iteration 6, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:438:- What was tried: Treating phase-anchor inference as the main handover failure driver.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:440:- Do NOT retry: Treating phase-anchor inference as the main handover failure driver.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:527:### Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself. -- BLOCKED (iteration 20, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:528:- What was tried: Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:530:- Do NOT retry: Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:555:- Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead. (iteration 1)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:565:- Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated. (iteration 6)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:566:- Treating phase-anchor inference as the main handover failure driver. (iteration 6)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:580:- Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate. (iteration 13)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:581:- Rewriting the drop corpus as the main fix for handover/drop confusion. (iteration 14)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:582:- Treating command-first handover prose as harmless prototype decoration. (iteration 14)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:584:- Treating phase `003` as a one-line constructor tweak in `memory-save.ts`. (iteration 15)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:594:- Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself. (iteration 20)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:597:- Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them. (iteration 22)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:605:- Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes. (iteration 26)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:621:- Reopening the delivery/progress or handover/drop remediation plan as the primary next step. (iteration 34)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:641:- The runtime save path is `memory-save.ts` -> `createContentRouter()` -> `anchorMergeOperation()` or thin continuity frontmatter upsert, depending on the routed category.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:643:- The second research wave focused on remediation design for delivery/progress cues, handover/drop relaxation, Tier3 wiring, prototype quality, and test coverage.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-strategy.md:646:- The remaining residual errors have shifted into research/metadata overlap and ultra-short telemetry fragments rather than the original delivery or handover seams.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/description.json:19:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/description.json:20:  "memoryNameHistory": []
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/001-advisor-hook-baseline-research/findings-registry.json:119:      "summary": "Promotion docs promise restart-persistent telemetry-backed two-cycle state, but the core implementation is still an in-memory helper plus callback-shaped telemetry contracts.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-030.md:9:3. One sampled miss was a stale memory-era path: `memory/metadata.json` in `026/.../001-research-graph-context-systems/002-codesight`. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-graph-context-systems/002-codesight/graph-metadata.json]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/implementation-summary.md:9:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-034.md:7:1. The delivered phases resolved the packet's original live routing problem. On the preserved replay, the leading errors are no longer delivery/progress or handover/drop. [INFERENCE: synthesis across iterations 26-27]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-034.md:11:5. The remaining improvement path should therefore target short-fragment research/metadata/drop handling, not reopen the already-fixed delivery and handover seams. [INFERENCE: synthesis across iterations 26-33]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-034.md:14:- Reopening the delivery/progress or handover/drop remediation plan as the primary next step.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/001-advisor-hook-baseline-research/research.md:14:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/001-advisor-hook-baseline-research/research.md:18:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/001-advisor-hook-baseline-research/research.md:19:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/001-advisor-hook-baseline-research/research.md:41:- `F-007` Promotion telemetry/persistence claims are ahead of implementation: docs say the two-cycle state survives daemon restarts, but the core implementation is still an in-memory helper plus callback-shaped telemetry hooks. Evidence: [iteration-09.md](./iterations/iteration-09.md), `.opencode/skills/system-spec-kit/mcp_server/skill-advisor/feature_catalog/05--promotion-gates/04-two-cycle.md:31`, `.opencode/skills/system-spec-kit/mcp_server/skill-advisor/lib/promotion/two-cycle-requirement.ts:30`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/graph-metadata.json:225:      "handover.md"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-010.md:7:1. The current router is already strong on structured categories (`decision`, `task_update`, `metadata_only`) because those categories either have hard Tier1 rules or highly distinctive lexical floors. The weak spots are cue-rich narrative categories, especially delivery-versus-progress and handover-versus-drop. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:286] [INFERENCE: live corpus results summarized across iterations 5 and 6]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-010.md:8:2. The most valuable short-term improvement is not a global threshold change but cue/prototype tuning: delivery text needs stronger sequencing/gating cues relative to "what changed" verbs, and handover text needs protection from `drop` cues like `git diff` when resume-state language is also present. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:340] [INFERENCE: live corpus misclassification clusters summarized across iterations 5 and 6]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-010.md:10:4. `routeAs` is powerful enough to rescue natural misclassifications, but it also weakens the semantic guardrail because it can force a merge against a natural `drop` decision. Operationally, overrides should stay explicit, audited, and paired with target/merge-mode validation. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:428] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-010.md:11:5. The Tier3 prompt and tests are worth keeping, but threshold optimization should be revisited only after the canonical save path actually injects a real Tier3 classifier. Until then, the `0.50` floor is mostly a fallback/refusal parameter, not a live model-quality control. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:212]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-010.md:23:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-010.md:36:Open an implementation phase that tunes delivery and handover cue weighting, adds regression tests for the identified confusion pairs, and wires Tier3 only if the team wants LLM-backed disambiguation in the live save path.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-013.md:9:3. A narrow regex-only filter for command-shaped strings, version literals, MIME values, `_memory.continuity`, colon-delimited pseudo-fields, and `console.warn` removes 106 missing entries across 64 specs. [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-013.md:10:4. This filter is worth keeping, but it is not the main fix. Most misses are still structurally path-like bare filenames such as `workflow.ts`, `context-server.ts`, and `memory-save.ts`. [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-014.md:9:3. The dominant removable examples are `validate.sh`, `generate-context.js`, `workflow.ts`, `context-server.ts`, `_memory.continuity`, and similar unresolved bare references. [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-026.md:8:2. The old dominant confusion seams are no longer the leaders. In the preserved replay, `narrative_delivery -> narrative_progress` and `handover_state -> drop` disappear from the top confusion list entirely. [INFERENCE: packet-local preserved-subset replay over dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-026.md:11:5. The delivered fixes therefore solved the packet's original live-text hotspots. The residual errors now cluster around research/metadata overlap and very short telemetry fragments, not delivery or handover mechanics. [INFERENCE: packet-local preserved-subset replay over dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-026.md:17:- Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-024.md:7:1. No routing category has zero test coverage in `content-router.vitest.ts`. The tier-1 classification block already asserts natural routing for `narrative_progress`, `narrative_delivery`, `decision`, `handover_state`, `research_finding`, `task_update`, `metadata_only`, and `drop` between lines `48` and `191`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:48] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:182]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-024.md:8:2. The actual gap is adversarial coverage, not category presence. There is still no natural-routing regression test for delivery text that also contains build verbs, no natural-routing regression for handover text that also contains `git diff` or resume-command phrasing, and no metadata-versus-research or decision-versus-research boundary test. The existing non-happy-path tests concentrate on Tier 2 and Tier 3 contract behavior, cache behavior, and override semantics. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:195] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395] [INFERENCE: derived from the existing test list and the missing boundary cases]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-024.md:10:4. The handler path remains the bigger hole. The canonical atomic-save routing tests in `handler-memory-save.vitest.ts` all provide explicit `routeAs` values for progress and task updates, so there is still zero handler-level proof that ambiguous natural routing can reach Tier 3 in the real save flow. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1119] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1161]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-024.md:22:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/spec.md:10:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-037.md:7:1. The routed identity helper now maps `metadata_only` saves to the continuity anchor on the canonical implementation summary host: `targetDocPath = implementation-summary.md` and `targetAnchorId = _memory.continuity`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/save/create-record.ts:111] [INFERENCE: direct node probe against dist/handlers/save/create-record.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-037.md:8:2. The canonical save handler resolves `spec-frontmatter` to `implementation-summary.md` when that file exists and falls back to `spec.md` only when the implementation summary is missing. That matches the new regression tests covering both paths. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-037.md:9:3. Because the preserved replay stayed flat and the current tree shows no further diff in `content-router.ts` or `routing-prototypes.json`, the F7 change is a write-target correctness fix, not a classifier-tuning change. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1064] [INFERENCE: comparison against iteration 36 replay]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-037.md:19:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-037.md:20:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-037.md:21:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/tasks.md:8:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-004.md:9:3. Because Tier3 is unwired in the save handler, ambiguous content in the live path either routes via Tier2 or lands in the penalized Tier2 fallback band before refusal. A direct runtime check showed an ambiguous sample refusing at `0.4965` with `tier3: null`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [INFERENCE: live execution of dist/lib/routing/content-router.js against an ambiguous sample derived from the Tier3 refusal test]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-005.md:5:- Files reviewed: `002-content-routing-accuracy/review/review-report.md`, `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts`, `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-005.md:6:- Tool log (9 calls): read config, read state, read strategy, read 002 root review report, read live memory-save handler, read targeted regression test, grep metadata_only routing expectations, reread report finding block, update strategy
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-005.md:11:- The promoted `002` root review report still describes a live metadata-only routing bug, but the current handler now prefers `implementation-summary.md` and the targeted regression covers that path, so the promoted review artifact is stale evidence. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/review-report.md:12] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/plan.md:10:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/description.json:22:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/description.json:23:  "memoryNameHistory": []
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-003.md:9:3. The canonical save handler currently constructs `createContentRouter()` with no dependency injection, so `classifyWithTier3` defaults to `null` in the actual writer path. Tier3 exists in tests and the router contract, but not in the live save wiring studied here. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:386]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-003.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-005.md:11:- **F002**: Removed Tier-3 flag wording still ships across the primary save docs — `.opencode/commands/memory/save.md:93` — The primary docs still describe a “disabled or unavailable” Tier-3 path and an alternate non-live branch, while the config mirrors say Tier 3 is always on and the feature-flag reference marks `SPECKIT_TIER3_ROUTING` as removed. That means the doc-alignment story is still wrong on the main save surfaces operators are expected to read first.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-005.md:13:{"type":"claim-adjudication","findingId":"F002","claim":"The primary save docs still describe a removed Tier-3 opt-in/disabled-state story even though the live runtime and feature-flag reference say Tier 3 is always on.","evidenceRefs":[".opencode/commands/memory/save.md:93",".opencode/skills/system-spec-kit/references/memory/save_workflow.md:321",".opencode/skills/system-spec-kit/SKILL.md:549",".mcp.json:24",".opencode/skills/system-spec-kit/feature_catalog/19--feature-flag-reference/01-1-search-pipeline-features-speckit.md:130"],"counterevidenceSought":"I checked the config mirrors and feature-flag reference to see whether the removed-flag story had already been reintroduced there, but those surfaces are current and explicitly say always-on/removed.","alternativeExplanation":"Some wording could be read as describing endpoint unavailability rather than a feature flag, but the combination of packet-local references to `SPECKIT_TIER3_ROUTING` and the removed-flag reference makes the mismatch concrete.","finalSeverity":"P1","confidence":0.95,"downgradeTrigger":"Downgrade if the runtime reintroduces a real Tier-3 routing flag or the docs are updated to describe endpoint absence without implying an opt-in control."}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-031.md:10:4. Top repeated misses now look like stale or under-normalized repo-relative references, not generic prose: `hooks/memory-surface.ts`, `memory/metadata.json`, `.opencode/agents/agent-improver.md`, `handlers/memory-search.ts`, and `handlers/memory-context.ts`. [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-031.md:14:- Treating all residual misses as one generic “path-like” problem. The command-snippet subset and the stale memory-era subset clearly need different handling.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-013.md:4:Identify the exact regexes and score floors that cause legitimate handover content to be treated as `drop`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-013.md:10:4. Phase `002-fix-handover-drop-confusion` should therefore split the drop heuristic into two classes: hard wrapper evidence that still deserves the `0.92` floor, and soft operational commands that should either score much lower or defer to handover when strong stop-state cues (`current state`, `next session`, `resume`, `blocker`) are also present. That is the smallest change that matches the phase scope without touching downstream handover handling. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-013.md:13:- Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-013.md:22:- `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-013.md:35:Check whether the handover and drop prototype sets reinforce or soften this heuristic collision, and identify which examples should guide the implementation-phase regression tests.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/checklist.md:10:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-030.md:7:1. `save.md` and `SKILL.md` both describe the live eight-category router correctly: `narrative_progress`, `narrative_delivery`, `decision`, `handover_state`, `research_finding`, `task_update`, `metadata_only`, and `drop`. [SOURCE: .opencode/commands/memory/save.md:76] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:389]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-030.md:8:2. Their Tier flow description matches the code: Tier 1 uses strong heuristics, Tier 2 uses prototype similarity, and Tier 3 is wired into the save handler by default with a safe Tier 2 penalty fallback or refusal. [SOURCE: .opencode/commands/memory/save.md:89] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:569]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-030.md:9:3. The delivery and handover boundary language is aligned with the code. Delivery is documented as sequencing, gating, rollout, and verification oriented, while handover explicitly keeps state-first stop/resume notes even when soft operational commands appear. [SOURCE: .opencode/commands/memory/save.md:95] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:384] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:935]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-030.md:10:4. The override and context wording is also correct. Both docs say `routeAs` preserves the natural decision for audit, and that `packet_kind` comes from spec metadata first with a parent-phase fallback only when metadata is silent. [SOURCE: .opencode/commands/memory/save.md:101] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:479] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-030.md:20:- `.opencode/commands/memory/save.md:76`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-030.md:23:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/implementation-summary.md:10:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-001.md:11:- **F001**: Metadata-only routed saves can update a non-canonical frontmatter host — `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054` — `resolveMetadataHostDocPath()` prefers the current non-memory document over `implementation-summary.md`, but the continuity contract says the primary `_memory.continuity` block lives in `implementation-summary.md` and the resume ladder reads that file first. Because `handleMemorySave()` accepts spec docs directly, a `metadata_only` routed save on `spec.md` or `tasks.md` can write continuity into a document the recovery ladder does not treat as canonical.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-001.md:13:{"type":"claim-adjudication","findingId":"F001","claim":"Metadata-only routed saves can persist continuity onto a non-canonical host document that `/spec_kit:resume` does not read as authoritative.","evidenceRefs":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:2090",".opencode/skills/system-spec-kit/references/memory/save_workflow.md:167","AGENTS.md:52"],"counterevidenceSought":"I checked whether the current-doc shortcut only affects memory-file saves, but it explicitly triggers for any existing non-memory spec doc.","alternativeExplanation":"If operators only ever use memory files or direct manual continuity edits, impact is lower, but the tool surface still accepts spec-doc inputs and the routing helper can therefore violate the canonical host contract.","finalSeverity":"P1","confidence":0.93,"downgradeTrigger":"Downgrade if the continuity contract is updated to allow any spec doc frontmatter as a first-class `_memory.continuity` host."}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-001.md:18:- Ordinary memory-file routed saves still land on `implementation-summary.md`, because the current-document shortcut only fires when the source is already a non-memory spec doc.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-021.md:12:  /^(spec\.md|plan\.md|tasks\.md|checklist\.md|decision-record\.md|implementation-summary\.md|research\.md|research\/research\.md|handover\.md)$/;
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-021.md:14:  /^(node |npx |pnpm |npm |yarn |bun |python([0-9]+(\.[0-9]+)*)? |bash |sh |vitest |jest |mocha |tsx |ts-node )|^v[0-9]+\.[0-9]+(\.[0-9]+)?$|^[a-z]+\/[a-z0-9+-]+$|^_memory\.continuity$|^[A-Za-z][A-Za-z0-9_-]*:\s.+$|^console\.warn(\(|$)/;
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-021.md:29:- Broad slash-path rejection. It overreaches into unresolved but still file-shaped values such as `dist/index.js` and `memory/metadata.json`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-027.md:10:4. The reconstructed replay still supports the main post-implementation conclusion: the old delivery/progress and handover/drop seams are no longer the dominant source of error. The remaining fragility lives in ultra-short fragments that shed too much category-defining context. [INFERENCE: packet-local reconstructed 132-sample replay over dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-027.md:35:Trace the always-on Tier 3 path from `memory-save.ts` into the router and confirm that "wired by default" still fail-opens exactly the way the docs claim.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/003-advisor-gap-investigation/research.md:14:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/003-advisor-gap-investigation/research.md:18:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/003-advisor-gap-investigation/research.md:19:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/deep-research-strategy.md:9:- This packet will not redesign the broader hook engine, memory system, or code-graph system beyond the parts the skill-advisor surfaces consume directly.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/deep-research-strategy.md:37:- The hook metrics package defines a prompt-safe schema plus an in-memory collector, while the hooks themselves emit diagnostics via `process.stderr.write()` line-by-line [.opencode/skills/system-spec-kit/mcp_server/skill-advisor/lib/metrics.ts:41-72] [.opencode/skills/system-spec-kit/mcp_server/skill-advisor/lib/metrics.ts:263-309] [.opencode/skills/system-spec-kit/mcp_server/hooks/claude/user-prompt-submit.ts:88-101].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-006.md:15:{"type":"claim-adjudication","findingId":"F003","claim":"The phase-004 verification sweep was too weak to prove removed-flag/always-on Tier-3 doc parity.","evidenceRefs":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/004-doc-surface-alignment/implementation-summary.md:116",".opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md:34",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/004-doc-surface-alignment/checklist.md:93"],"counterevidenceSought":"I checked whether the verification sweep also captured removed-flag tokens indirectly, but the saved pattern list does not include the words needed to catch the stale playbook or opt-in claims.","alternativeExplanation":"If a broader unrecorded human review happened outside the packet, the sweep weakness matters less, but the recorded packet evidence still does not prove the claim it makes.","finalSeverity":"P2","confidence":0.9,"downgradeTrigger":"Dismiss if the packet adds a stronger recorded verification step that explicitly checks removed-flag/always-on wording and passes."}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-020.md:10:4. Tier3 wiring is worthwhile only as a targeted ambiguity resolver. The contract is already bounded and cache-aware, but the production classifier implementation is missing. Phase `003` should reuse the existing OpenAI-compatible fetch pattern, add audit visibility, and stay fail-open so canonical saves never depend on an LLM being available. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:185]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-020.md:11:5. The prototype library and tests are good enough to support a narrow remediation wave, but not good enough to verify it without new regression cases. The highest-value sequence is: phase `001` cue plus prototype tuning, phase `002` drop relaxation plus state-first handover examples, and phase `003` Tier3 wiring only after the heuristic fixes are benchmarked. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/001-fix-delivery-progress-confusion/spec.md:10] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/003-wire-tier3-llm-classifier/spec.md:10]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-020.md:17:- Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-020.md:22:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-007.md:7:1. Category-to-merge mapping is fixed: `narrative_progress` and `narrative_delivery` use `append-as-paragraph`, `handover_state` and `research_finding` use `append-section`, `decision` uses `insert-new-adr` on `L3/L3+` and `update-in-place` on lower packet levels, `task_update` uses `update-in-place`, and `metadata_only` updates frontmatter continuity rather than anchor-merging. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-007.md:8:2. The canonical writer derives merge payloads from routed content, not the original memory artifact type. That means the same text classification directly controls whether the writer looks for paragraphs, structured checklist IDs, or ADR fields. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1144]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-007.md:9:3. `metadata_only` is the least fragile category at write time because it bypasses `anchorMergeOperation()` and writes `_memory.continuity` through thin-continuity helpers. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:167]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-007.md:10:4. `task_update` is the most brittle category because `buildCanonicalMergePayload()` must discover a concrete `T###` or `CHK-###` ID, and the later merge requires exactly one matching checklist line. Classification accuracy alone is not enough to make task routing safe. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:952] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/merge/anchor-merge-operation.ts:440]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-007.md:20:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-007.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-009.md:8:2. The save handler accepts the routed override category, but it still rejects the write if the caller supplies a conflicting `mergeModeHint`. In other words, override bypasses natural classification, not the downstream merge contract. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1206]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-009.md:11:5. Because Tier3 is currently unwired in production, the practical role of the `0.50` Tier3 threshold today is mostly the penalized Tier2 fallback/refusal cutoff, not an LLM acceptance threshold. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:518]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-009.md:22:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-002.md:4:Re-checked the phase-003 areas that previously carried P1 findings: `packet_kind` derivation and `save_mode` labeling in the Tier-3 prompt path. Compared the current handler to the refreshed prompt-body assertions in `handler-memory-save.vitest.ts` to separate historical issues from still-open regressions.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:4:Determine whether the prototype library helps disambiguate handover from drop, or whether it embeds the same operational-command overlap seen in the heuristic layer.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:7:1. The handover prototypes themselves contain the phrases that trigger or resemble drop logic. `HS-01`, `HS-03`, and `HS-04` explicitly mention `verify`, `git diff`, `commit`, `run the resume command`, and file-review instructions. Those are realistic handovers, but they sit close to drop-style operational chatter. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:83]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:9:3. The drop prototypes are better anchored on truly non-canonical signals such as timestamps, `assistant:`/`tool:` wrappers, table-of-contents scaffolding, truncation notes, and raw telemetry. That suggests the best phase-002 prototype change is not to rewrite correctly categorized drop examples, but to add or strengthen handover examples around stop-state language (`active files`, `current blocker`, `estimated remaining effort`, `next safe action`) without leading with command strings. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:165]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:10:4. Phase `002` should treat `HS-02` and `HS-05` as the stronger handover templates and reduce reliance on `HS-04`-style command-first phrasing. The existing phase spec says not to reclassify correct drop prototypes, and that aligns with the evidence: the cleaner fix is to make handover prototypes more state-centric, not to weaken the drop prototypes that already capture wrappers and telemetry well. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:91]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:13:- Rewriting the drop corpus as the main fix for handover/drop confusion.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:16:- Treating command-first handover prose as harmless prototype decoration.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:22:- `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-014.md:31:- What did not work and why: Prototype labels such as "handover" or "drop" were not meaningful enough by themselves; the actual chunk text carried the overlap.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-035.md:10:4. The next substantive improvement phase should focus on residual `key_files` plus entity precision, not on another broad scan: raise `key_files` resolution above `90%`, remove command snippets and obsolete memory paths, suppress code-fence language tokens, and reduce entity-cap saturation. [SOURCE: live filesystem scan over `.opencode/specs` on 2026-04-13]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/findings-registry.json:112:      "summary": "Hook telemetry is currently shaped as stderr emission plus an in-memory collector, so the shipped recommendation-health surface is ephemeral rather than durable.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/findings-registry.json:119:      "recommended_fix": "Add a durable prompt-safe diagnostics sink and wire hook health summaries to a real operator-facing status surface instead of leaving them in-memory or stderr-only.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-033.md:7:1. The riskiest off-category pair is still `ND-03` versus `HS-04` (`cosine 0.8244`, `distance 0.1756`). That keeps the delivery-versus-handover seam visibly alive inside the prototype space even after the refresh. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:157] [INFERENCE: packet-local nearest-neighbor scan over routing-prototypes.json]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-005.md:11:5. Category performance is uneven: `decision`, `task_update`, and `metadata_only` were perfect on the corpus, while `handover_state` (`62.5%`) and `narrative_delivery` (`68.75%`) were the weakest categories. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76] [INFERENCE: live execution of dist/lib/routing/content-router.js on the synthetic corpus]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-005.md:32:- What did not work and why: Looking only at overall accuracy hides the real hotspots, because the strong structured categories mask weaker delivery and handover performance.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-005.md:36:Inspect the recurring confusion pairs and the concrete text patterns that trigger them, especially delivery-versus-progress and handover-versus-drop.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-002.md:10:- P1 `R010-F001`: The active operator prompt for `002-content-routing-accuracy` still invokes `--spec-folder=.opencode/specs/system-spec-kit/026-graph-and-context-optimization/002-continuity-memory-runtime/003-continuity-refactor-gates/002-content-routing-accuracy`, so launching the promoted prompt reopens the retired 006 lineage instead of the 010 packet. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/prompts/deep-research-prompt.md:8] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/spec.md:6]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-019.md:8:2. Phase `002-fix-handover-drop-confusion` should split hard and soft drop cues. In `content-router.ts`, keep transcript/table-of-contents/recovery-wrapper evidence in the hard drop branch, but move `git diff`, `list memories`, and similar operational commands into a softer path that cannot beat a strong handover state by default. Add a stronger handover floor for `current state`, `next session`, `active files`, `remaining effort`, `next safe action`, and `resume` near lines `868-869`, then preserve `extractHardNegativeFlags()` for true wrappers only. Prototype work should focus on making handover examples more state-first, not on weakening correct drop examples. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:353] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:83]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-019.md:9:3. Phase `003-wire-tier3-llm-classifier` should add a real classifier adapter and then inject it. The missing constructor seam is `memory-save.ts` line `1008`; the existing call graph is already ready to receive `classifyWithTier3` and `cache`. Reuse the fail-open, timeout-bounded `fetch()` pattern from `lib/search/llm-reformulation.ts`, but build the request from `buildTier3Prompt()` and return validated `Tier3RawResponse` objects. Then add handler coverage for natural routing without `routeAs`, plus router coverage for cache hits, timeouts, and unavailable-provider fallbacks in the live save path. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:203]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-019.md:10:4. Test work should follow the same phase boundaries. `content-router.vitest.ts` needs explicit regression samples for delivery-plus-implementation language, handover-plus-command language, and metadata-versus-research ambiguity. `handler-memory-save.vitest.ts` needs at least one naturally ambiguous atomic-save fixture that reaches Tier3 and proves safe fallback when the classifier returns `null` or times out. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-019.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-019.md:22:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-023.md:7:1. The production seam is still one unresolved constructor call. `createContentRouter()` already accepts `classifyWithTier3` and `cache`, and `resolveTier3Decision()` already consumes both, but `memory-save.ts` still creates the router with no dependencies at line `1008`. That leaves Tier 3 permanently stubbed to `null` in production. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:231] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:386] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-023.md:9:3. The smallest realistic production diff is about `90-130` LOC. A thin OpenAI-compatible call helper modeled on `callLlmForReformulation()` is roughly `45-60` LOC, a small session/spec-folder cache wrapper is another `20-30` LOC, env/response plumbing is about `10-20` LOC, and the actual injection at `memory-save.ts:1008` is only `8-15` LOC. If the phase also introduces routing-specific env names instead of reusing an existing OpenAI-compatible endpoint contract, the diff moves toward the high end of that range. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:200] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [INFERENCE: line-count estimate based on the existing helper shape and the missing seams]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-023.md:10:4. The test cost is separate and non-trivial: expect another `70-100` LOC across router and handler tests. `content-router.vitest.ts` already covers classifier injection, cache hits, below-floor refusals, and Tier 2 fallback, so phase `003` mostly needs adapter-path assertions. `handler-memory-save.vitest.ts` needs at least one natural-routing atomic-save case with no `routeAs`, one null/timeout fallback case, and one cache-reuse case that proves the real save path can reach Tier 3 without changing canonical outputs. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:212] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:338] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-023.md:22:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-023.md:23:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-023.md:32:- What did not work and why: Looking only at `memory-save.ts:1008` still underestimates the missing cache and env-contract work.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/description.json:22:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/description.json:23:  "memoryNameHistory": [],
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-008.md:11:- **F004**: Sub-phases `001` to `003` still fail strict validation despite verified-looking closeout state — `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/001-fix-delivery-progress-confusion/tasks.md:6` — Each child phase marks its tasks complete and records a complete-looking closeout state, but rerunning `validate.sh --strict` on 2026-04-13 fails all three phases with missing anchors, missing `_memory` frontmatter blocks, missing template-source headers, and missing Level-2 template headers. That means the packet family still has unresolved doc-verification work even though the child docs imply otherwise.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/iterations/iteration-008.md:13:{"type":"claim-adjudication","findingId":"F004","claim":"Child phases 001-003 are not actually strict-clean even though their packet docs imply verified completion.","evidenceRefs":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/001-fix-delivery-progress-confusion/tasks.md:6",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/tasks.md:6",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/003-wire-tier3-llm-classifier/tasks.md:6","validate.sh --strict failed for 001, 002, and 003 on 2026-04-13"],"counterevidenceSought":"I checked whether the failure was limited to optional warnings, but the validator returned `RESULT: FAILED` / exit code `2` for all three phases with hard structural/template errors.","alternativeExplanation":"If the packet family intentionally chose a non-template doc shape, the docs should not still claim strict verification or Level-2-closeout parity.","finalSeverity":"P1","confidence":0.97,"downgradeTrigger":"Downgrade if the validator contract is intentionally waived for these phases and the closeout docs are updated to say so explicitly."}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:7:1. A targeted routing-only Vitest run passed `7/7`, covering the new delivery/handover boundary assertions plus the natural Tier 3 and fail-open handler checks. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:133] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:503] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239] [INFERENCE: targeted `npx vitest run ... -t ...` execution]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:8:2. Natural canonical saves now reach Tier 3 with `PACKET_KIND: feature` and `SAVE_MODE: natural` in the prompt body, matching the handler's new `saveMode` labeling. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1206]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:9:3. Research-root packets derive `PACKET_KIND: research` from spec frontmatter rather than pure path shape, which confirms the metadata-first packet-kind logic is live. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1294] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:870]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:10:4. Explicit `routeAs` saves against a child phase emit `PACKET_KIND: phase` and `SAVE_MODE: route-as`, which proves the prompt body distinguishes operator-forced routes from natural classification. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1347] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1207]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:11:5. When Tier 3 transport throws, the handler still succeeds via natural Tier 2 routing and writes the note to the expected canonical target. That behavior matches the code-level fail-open contract from iteration 28. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:569] [INFERENCE: targeted `npx vitest run ... -t ...` execution]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:23:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-029.md:24:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:7:1. `save_workflow.md` matches the shipped category map, Tier flow, soft operational drop split, `routeAs` audit behavior, and metadata-first `packet_kind` derivation. [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:302] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:389] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:8:2. The same alignment also appears in `ARCHITECTURE.md`, so the deeper design doc, the operator command doc, and the skill entrypoint now tell the same routing story. [SOURCE: .opencode/skills/system-spec-kit/ARCHITECTURE.md:135] [SOURCE: .opencode/commands/memory/save.md:89] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:9:3. The one wording nuance is environmental. The docs phrase Tier 3 as if `LLM_REFORMULATION_ENDPOINT` is configured, while the code only checks whether the env var exists and otherwise returns `null` without hard failure. [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:321] [SOURCE: .opencode/commands/memory/save.md:93] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:953]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:10:4. That nuance is not a functional parity break because the same docs also state that unavailable Tier 3 falls back safely to Tier 2 with a penalty or refuses to route. The behavior description is correct even if the "configured" wording is slightly stronger than the code's guarantee. [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:321] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:569]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:20:- `.opencode/skills/system-spec-kit/references/memory/save_workflow.md:302`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:22:- `.opencode/commands/memory/save.md:93`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-031.md:23:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/research.md:13:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/research.md:17:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/research.md:18:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/research.md:26:Packet-02 confirmed that the remaining skill-advisor improvement work is no longer centered on the already-closed CF-019 scorer bug; it is centered on parity, threshold observability, MCP-surface consistency, and live-feedback blind spots [.opencode/specs/system-spec-kit/026-graph-and-context-optimization/007-deep-review-remediation/006-integrity-parity-closure/applied/CF-019.md:6-12] [iterations/iteration-01.md#findings]. The highest-signal recommendation-quality drift is now branch-specific: OpenCode still splits threshold handling between native and fallback bridge routes, while OpenCode and Codex both preserve bespoke prompt-time paths outside the fully shared build-and-render contract [iterations/iteration-02.md#findings] [iterations/iteration-03.md#findings]. The public MCP surface is also more asymmetric than the docs imply because workspace selection, validator control, and threshold semantics are not exposed consistently across `advisor_status`, `advisor_recommend`, and `advisor_validate` [iterations/iteration-05.md#findings] [iterations/iteration-06.md#findings]. Telemetry remains prompt-safe, but it is still mostly stderr-plus-memory and lacks the accepted/corrected/ignored outcome signals needed to tune recommendation quality from live use [iterations/iteration-07.md#findings]. Lower-severity but still actionable drift remains in weights/promotion observability claims and OpenCode bridge documentation [iterations/iteration-08.md#findings] [iterations/iteration-09.md#findings]. The packet converged enough for implementation planning, but it hit the 10-iteration cap before novelty dropped below the configured threshold twice in a row.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/research.md:42:- Redesigning the broader hook engine, memory system, or code graph beyond the skill-advisor surfaces directly under investigation.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/research.md:75:- `F-006` Hook telemetry is still effectively stderr plus an in-memory collector, so the durable health surface required for live recommendation tuning is missing [.opencode/skills/system-spec-kit/mcp_server/skill-advisor/lib/metrics.ts:263-309] [.opencode/skills/system-spec-kit/mcp_server/hooks/claude/user-prompt-submit.ts:88-101].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-017.md:8:2. The most fragile categories are also the ones whose prototypes borrow the most operational nouns from neighbors. Delivery overlaps with progress around repository and workflow language; handover overlaps with drop, task, and decision around session control, verification, and remaining work. The category-level negative-hint counts reinforce this: every delivery prototype warns against progress, and every task prototype warns against handover. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:3] [INFERENCE: packet-local negative-hint frequency scan over `routing-prototypes.json` run during iteration 17]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-017.md:10:4. The best near-term prototype work is surgical, not wholesale: refresh 2-3 delivery examples and 1-2 handover examples to emphasize category-specific nouns, then leave the rest of the library stable so the before/after benchmark stays attributable. This aligns with phases `001` and `002` and avoids turning the routing benchmark into a full corpus rewrite. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/001-fix-delivery-progress-confusion/spec.md:10] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/iterations/iteration-07.md:22:- The shipped health collector is purely in-memory, while the hook adapters emit serialized diagnostics to stderr, so the packet-local code shows ephemeral telemetry primitives rather than a durable recommendation-quality feedback loop [.opencode/skills/system-spec-kit/mcp_server/skill-advisor/lib/metrics.ts:263-309] [.opencode/skills/system-spec-kit/mcp_server/hooks/claude/user-prompt-submit.ts:88-101] [.opencode/skills/system-spec-kit/mcp_server/hooks/codex/user-prompt-submit.ts:156-169].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/iterations/iteration-07.md:51:- I did not find packet-scope evidence of a durable hook-diagnostic store or a public MCP surface that exposes the in-memory health collector.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/iterations/iteration-07.md:59:- Should the in-memory health collector become a real status surface or be removed from public expectations?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:14:_memory:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:18:    last_updated_by: "backfill-memory-block"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:19:    recent_action: "Backfilled _memory block (repo-wide frontmatter sweep)"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:27:This packet stayed read-only and only updated `research/` artifacts. Iterations 1-25 established the pre-implementation baseline and produced the three remediation phases plus the doc-alignment follow-on. Iterations 26-35 reran the benchmark against shipped behavior, traced the always-on Tier 3 path end to end, checked the canonical docs against code, and measured prototype separation after the refresh. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:384] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951] [SOURCE: .opencode/commands/memory/save.md:76]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:39:- The old dominant seams are gone from the preserved replay. `narrative_delivery -> narrative_progress` and `handover_state -> drop` no longer lead the confusion list. [INFERENCE: packet-local preserved-subset replay over dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:55:- Canonical routing is unconditional because `shouldUseCanonicalRouting()` now returns `true`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:56:- The handler constructs the router through `buildCanonicalRouter()`, injecting both `classifyWithTier3Llm` and the shared `tier3RoutingCache`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:57:- `classifyWithTier3Llm()` fail-opens on missing endpoint, non-OK response, invalid JSON, and thrown transport errors by returning `null`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:62:  - explicit route overrides on child phases: `PACKET_KIND: phase`, `SAVE_MODE: route-as` [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1294] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1347]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:63:- The fail-open test also passes: when Tier 3 transport throws, the handler still succeeds via natural Tier 2 routing and writes the expected canonical target. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401] [INFERENCE: targeted routing-only Vitest run]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:71:- `save.md`, `SKILL.md`, and `save_workflow.md` all describe the live eight-category router correctly. [SOURCE: .opencode/commands/memory/save.md:76] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:304]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:72:- Their Tier-flow description matches the code: Tier 1 heuristics, Tier 2 prototypes, Tier 3 wired by default with safe fallback or refusal. [SOURCE: .opencode/commands/memory/save.md:89] [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:317] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:73:- The new delivery and handover boundary language is accurate:
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:75:  - handover preserves state-first stop/resume notes even when soft operational commands such as `git diff`, `list memories`, or `force re-index` appear
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:76:  - hard transcript, telemetry, and wrapper scaffolding still route to `drop` [SOURCE: .opencode/commands/memory/save.md:95] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:384] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:943]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:77:- The override and context rules are also aligned: `routeAs` preserves the natural decision for audit, and `packet_kind` derives from spec metadata first (`type`, `title`, `description`) with parent-phase fallback only when metadata is silent. [SOURCE: .opencode/commands/memory/save.md:101] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:479] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:81:- The code only checks whether the env var exists and otherwise returns `null`, preserving fail-open behavior. [SOURCE: .opencode/commands/memory/save.md:93] [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:321] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:90:- The next closest is `narrative_delivery <-> handover_state` at `0.8918` (`distance 0.1082`). [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:1] [INFERENCE: packet-local lexical-vector centroid analysis over routing-prototypes.json]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:108:2. Distinguish `research_finding` from `metadata_only` more explicitly when `_memory.continuity`, `preflight`, or `postflight` vocabulary appears inside analytical prose rather than field-heavy payloads. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:409] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:417]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:117:- The `metadata_only` fix changes routed save-target identity, not classifier behavior. The create-record helper now resolves routed metadata saves onto `implementation-summary.md::_memory.continuity`, and the handler still falls back to `spec.md` only when `implementation-summary.md` is absent. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/save/create-record.ts:111] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/research.md:125:1. The delivered phases fixed the original delivery/progress and handover/drop seams.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-021.md:38:Map the exact handover patterns that are still getting dragged into `drop`, then split hard wrapper cues from softer operational commands.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/research/002-advisor-hook-followup-research/iterations/iteration-09.md:27:> printf '%s' '{"prompt":"save this conversation context to memory","workspaceRoot":"'"$PWD"'","runtime":"opencode","maxTokens":80,"thresholdConfidence":0.7}' | \
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-013.md:5:- Files reviewed: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts`, `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts`, `002-content-routing-accuracy/review/review-report.md`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-013.md:6:- Tool log (9 calls): read config, read state, read strategy, read live memory-save handler, read targeted regression test, read promoted 002 review report, grep metadata-only host resolver lines, reread exact evidence block, update correctness summary
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/iterations/iteration-013.md:11:- The current handler resolves metadata-only saves into `implementation-summary.md` when present and the targeted regression verifies that behavior, so the promoted 002 runtime defect remains disproved. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:1:{"type":"iteration","mode":"review","run":1,"status":"complete","focus":"Correctness on metadata-only continuity host selection","dimension":"correctness","dimensions":["correctness","traceability"],"findingsCount":1,"newFindingsRatio":1.0,"noveltyJustification":"The first correctness pass surfaced a previously unrecorded runtime/doc contract mismatch in metadata-only host selection.","findingsSummary":{"P0":0,"P1":1,"P2":0},"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/skills/system-spec-kit/references/memory/save_workflow.md","AGENTS.md","CODEX.md"],"dimensionScores":{"correctness":0.74,"security":0.0,"traceability":0.68,"maintainability":0.42},"findingsNew":{"P0":0,"P1":1,"P2":0},"findingsRefined":{"P0":0,"P1":0,"P2":0},"upgrades":[],"resolved":[],"findingRefs":["F001"],"traceabilityChecks":{"summary":{"required":2,"executed":2,"pass":1,"partial":1,"fail":0,"blocked":0,"notApplicable":0,"gatingFailures":0},"results":[{"protocolId":"spec_code","status":"partial","gateClass":"hard","applicable":true,"counts":{"pass":1,"partial":1,"fail":0},"evidence":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054",".opencode/skills/system-spec-kit/references/memory/save_workflow.md:167"],"findingRefs":["F001"],"summary":"`spec-frontmatter` host selection does not consistently honor the documented implementation-summary continuity host."},{"protocolId":"checklist_evidence","status":"pass","gateClass":"advisory","applicable":true,"counts":{"pass":1,"partial":0,"fail":0},"evidence":["AGENTS.md:52","CODEX.md:54"],"findingRefs":["F001"],"summary":"The continuity ladder consistently documents implementation-summary as the primary continuity host."}]},"coverage":{"filesReviewed":4,"filesTotal":22,"dimensionsComplete":["correctness"]},"ruledOut":["Ordinary memory-file routed saves still fall through to implementation-summary.md because memory documents do not trigger the current-document shortcut."],"focusTrack":"correctness","timestamp":"2026-04-13T12:52:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:2:{"type":"iteration","mode":"review","run":2,"status":"complete","focus":"Correctness sweep over prior phase-003 prompt-context regressions","dimension":"correctness","dimensions":["correctness","traceability"],"findingsCount":0,"newFindingsRatio":0.0,"noveltyJustification":"The second pass confirmed the older phase-003 packet_kind/save_mode prompt defects are fixed in the current code and tests.","findingsSummary":{"P0":0,"P1":0,"P2":0},"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/003-wire-tier3-llm-classifier/review/review-report.md"],"dimensionScores":{"correctness":0.71,"security":0.0,"traceability":0.63,"maintainability":0.38},"findingsNew":{"P0":0,"P1":0,"P2":0},"findingsRefined":{"P0":0,"P1":0,"P2":0},"upgrades":[],"resolved":[],"findingRefs":[],"traceabilityChecks":{"summary":{"required":2,"executed":2,"pass":2,"partial":0,"fail":0,"blocked":0,"notApplicable":0,"gatingFailures":0},"results":[{"protocolId":"spec_code","status":"pass","gateClass":"hard","applicable":true,"counts":{"pass":2,"partial":0,"fail":0},"evidence":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1206",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1288"],"findingRefs":[],"summary":"The current handler derives `packet_kind` and `save_mode` through the repaired phase-003 path, and the prompt-body assertions cover those fields."},{"protocolId":"checklist_evidence","status":"pass","gateClass":"advisory","applicable":true,"counts":{"pass":1,"partial":0,"fail":0},"evidence":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/003-wire-tier3-llm-classifier/review/review-report.md:12"],"findingRefs":[],"summary":"The previously reported phase-003 prompt-context issues are no longer current regressions."}]},"coverage":{"filesReviewed":3,"filesTotal":22,"dimensionsComplete":["correctness"]},"ruledOut":["The earlier phase-003 `packet_kind` and `save_mode` defects remain live in the current implementation."],"focusTrack":"correctness","timestamp":"2026-04-13T13:00:00Z","durationMs":300000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:5:{"type":"iteration","mode":"review","run":5,"status":"complete","focus":"Primary save docs versus always-on Tier-3 runtime","dimension":"traceability","dimensions":["traceability","maintainability"],"findingsCount":1,"newFindingsRatio":1.0,"noveltyJustification":"The primary doc audit found one new doc-alignment regression spanning the command, reference, and skill surfaces.","findingsSummary":{"P0":0,"P1":1,"P2":0},"filesReviewed":[".opencode/commands/memory/save.md",".opencode/skills/system-spec-kit/references/memory/save_workflow.md",".opencode/skills/system-spec-kit/SKILL.md",".opencode/skills/system-spec-kit/feature_catalog/19--feature-flag-reference/01-1-search-pipeline-features-speckit.md"],"dimensionScores":{"correctness":0.38,"security":0.0,"traceability":0.92,"maintainability":0.78},"findingsNew":{"P0":0,"P1":1,"P2":0},"findingsRefined":{"P0":0,"P1":0,"P2":0},"upgrades":[],"resolved":[],"findingRefs":["F002"],"traceabilityChecks":{"summary":{"required":3,"executed":3,"pass":1,"partial":1,"fail":1,"blocked":0,"notApplicable":0,"gatingFailures":1},"results":[{"protocolId":"spec_code","status":"fail","gateClass":"hard","applicable":true,"counts":{"pass":0,"partial":0,"fail":1},"evidence":[".opencode/commands/memory/save.md:93",".opencode/skills/system-spec-kit/references/memory/save_workflow.md:321",".opencode/skills/system-spec-kit/SKILL.md:549",".opencode/skills/system-spec-kit/feature_catalog/19--feature-flag-reference/01-1-search-pipeline-features-speckit.md:130"],"findingRefs":["F002"],"summary":"Primary docs still describe a disabled/unavailable or otherwise-not-live Tier-3 path even though the feature-flag reference says the flag was removed."},{"protocolId":"feature_catalog_code","status":"pass","gateClass":"advisory","applicable":true,"counts":{"pass":1,"partial":0,"fail":0},"evidence":[".opencode/skills/system-spec-kit/feature_catalog/19--feature-flag-reference/01-1-search-pipeline-features-speckit.md:130"],"findingRefs":["F002"],"summary":"The feature-flag reference itself is current and identifies the removed flag correctly."}]},"coverage":{"filesReviewed":4,"filesTotal":22,"dimensionsComplete":["traceability"]},"ruledOut":["The stale Tier-3 wording is confined only to packet-local phase docs."],"focusTrack":"docs","timestamp":"2026-04-13T13:25:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:6:{"type":"iteration","mode":"review","run":6,"status":"complete","focus":"Packet-local and playbook mirror parity for removed-flag wording","dimension":"maintainability","dimensions":["traceability","maintainability"],"findingsCount":1,"newFindingsRatio":1.0,"noveltyJustification":"The packet-local/playbook audit found a new advisory verification-gap finding after confirming the same removed-flag story persists there too.","findingsSummary":{"P0":0,"P1":0,"P2":1},"filesReviewed":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/spec.md",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/checklist.md",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/implementation-summary.md",".opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md"],"dimensionScores":{"correctness":0.34,"security":0.0,"traceability":0.88,"maintainability":0.83},"findingsNew":{"P0":0,"P1":0,"P2":1},"findingsRefined":{"P0":0,"P1":1,"P2":0},"upgrades":[],"resolved":[],"findingRefs":["F002","F003"],"traceabilityChecks":{"summary":{"required":3,"executed":3,"pass":0,"partial":1,"fail":2,"blocked":0,"notApplicable":0,"gatingFailures":2},"results":[{"protocolId":"playbook_capability","status":"fail","gateClass":"hard","applicable":true,"counts":{"pass":0,"partial":0,"fail":1},"evidence":[".opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md:34"],"findingRefs":["F002"],"summary":"The canonical save playbook still instructs operators to set the removed Tier-3 routing flag."},{"protocolId":"checklist_evidence","status":"fail","gateClass":"hard","applicable":true,"counts":{"pass":0,"partial":0,"fail":1},"evidence":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/checklist.md:93",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/implementation-summary.md:67"],"findingRefs":["F002","F003"],"summary":"The packet-local closeout docs still claim opt-in/default-off config notes and therefore overstate doc alignment."},{"protocolId":"spec_code","status":"partial","gateClass":"advisory","applicable":true,"counts":{"pass":0,"partial":1,"fail":0},"evidence":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/implementation-summary.md:116"],"findingRefs":["F003"],"summary":"The recorded verification grep was too weak to prove removed-flag/always-on parity."}]},"coverage":{"filesReviewed":4,"filesTotal":22,"dimensionsComplete":["traceability","maintainability"]},"ruledOut":["The `004` packet-local docs are fully aligned just because the packet passed strict validation."],"focusTrack":"docs","timestamp":"2026-04-13T13:34:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:7:{"type":"iteration","mode":"review","run":7,"status":"complete","focus":"Focused routing test coverage over live edge cases","dimension":"maintainability","dimensions":["correctness","maintainability"],"findingsCount":0,"newFindingsRatio":0.0,"noveltyJustification":"The focused test review found no additional failing edge case beyond the already-open metadata-host gap and the already-fixed phase-003 prompt fields.","findingsSummary":{"P0":0,"P1":0,"P2":0},"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts"],"dimensionScores":{"correctness":0.63,"security":0.0,"traceability":0.47,"maintainability":0.76},"findingsNew":{"P0":0,"P1":0,"P2":0},"findingsRefined":{"P0":0,"P1":0,"P2":0},"upgrades":[],"resolved":[],"findingRefs":[],"traceabilityChecks":{"summary":{"required":2,"executed":2,"pass":2,"partial":0,"fail":0,"blocked":0,"notApplicable":0,"gatingFailures":0},"results":[{"protocolId":"spec_code","status":"pass","gateClass":"hard","applicable":true,"counts":{"pass":2,"partial":0,"fail":0},"evidence":[".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:361",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239"],"findingRefs":[],"summary":"Tier-3 fallback, refusal, cache-hit, and prompt-body assertions are covered in the focused suites."},{"protocolId":"checklist_evidence","status":"pass","gateClass":"advisory","applicable":true,"counts":{"pass":1,"partial":0,"fail":0},"evidence":[".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:528"],"findingRefs":[],"summary":"The frozen Tier-3 prompt contract remains covered directly in the routing suite."}]},"coverage":{"filesReviewed":2,"filesTotal":22,"dimensionsComplete":["maintainability"]},"ruledOut":["The live suites completely ignore Tier-3 prompt payloads after the post-flag-removal changes."],"focusTrack":"tests","timestamp":"2026-04-13T13:42:00Z","durationMs":300000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:8:{"type":"iteration","mode":"review","run":8,"status":"complete","focus":"Child-phase strict-validation truth versus closeout state","dimension":"traceability","dimensions":["traceability"],"findingsCount":1,"newFindingsRatio":1.0,"noveltyJustification":"The child-phase validator reruns surfaced one new must-fix packet-traceability finding affecting 001 through 003.","findingsSummary":{"P0":0,"P1":1,"P2":0},"filesReviewed":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/001-fix-delivery-progress-confusion/tasks.md",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/002-fix-handover-drop-confusion/tasks.md",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/003-wire-tier3-llm-classifier/tasks.md"],"dimensionScores":{"correctness":0.29,"security":0.0,"traceability":0.96,"maintainability":0.61},"findingsNew":{"P0":0,"P1":1,"P2":0},"findingsRefined":{"P0":0,"P1":0,"P2":0},"upgrades":[],"resolved":[],"findingRefs":["F004"],"traceabilityChecks":{"summary":{"required":2,"executed":2,"pass":0,"partial":0,"fail":2,"blocked":0,"notApplicable":0,"gatingFailures":2},"results":[{"protocolId":"checklist_evidence","status":"fail","gateClass":"hard","applicable":true,"counts":{"pass":0,"partial":0,"fail":1},"evidence":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/001-fix-delivery-progress-confusion/tasks.md:6",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/002-fix-handover-drop-confusion/tasks.md:6",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/003-wire-tier3-llm-classifier/tasks.md:6"],"findingRefs":["F004"],"summary":"The child packets present all-complete task state while current validator output still reports structural failure."},{"protocolId":"spec_code","status":"fail","gateClass":"hard","applicable":true,"counts":{"pass":0,"partial":0,"fail":1},"evidence":["validate.sh --strict returned RESULT: FAILED for 001, 002, and 003 on 2026-04-13 due to missing anchors, missing template-source markers, and missing template headers."],"findingRefs":["F004"],"summary":"Current validator evidence contradicts the child packets' verified-complete posture."}]},"coverage":{"filesReviewed":3,"filesTotal":22,"dimensionsComplete":["traceability"]},"ruledOut":["Only phase 004 had packet-level doc validation expectations worth checking in this root review."],"focusTrack":"traceability","timestamp":"2026-04-13T13:51:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-state.jsonl:10:{"type":"iteration","mode":"review","run":10,"status":"complete","focus":"Final stability pass and release-readiness verdict","dimension":"traceability","dimensions":["correctness","security","traceability","maintainability"],"findingsCount":0,"newFindingsRatio":0.0,"noveltyJustification":"The final pass produced no new findings and confirmed the root packet can stop with a stable conditional verdict and four open findings.","findingsSummary":{"P0":0,"P1":0,"P2":0},"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/commands/memory/save.md",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/checklist.md",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/001-fix-delivery-progress-confusion/tasks.md"],"dimensionScores":{"correctness":0.71,"security":0.1,"traceability":0.91,"maintainability":0.79},"findingsNew":{"P0":0,"P1":0,"P2":0},"findingsRefined":{"P0":0,"P1":0,"P2":0},"upgrades":[],"resolved":[],"findingRefs":[],"traceabilityChecks":{"summary":{"required":4,"executed":4,"pass":1,"partial":1,"fail":2,"blocked":0,"notApplicable":0,"gatingFailures":2},"results":[{"protocolId":"spec_code","status":"partial","gateClass":"hard","applicable":true,"counts":{"pass":1,"partial":1,"fail":0},"evidence":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1206"],"findingRefs":["F001"],"summary":"The main runtime is largely aligned after phase 003, but metadata-only continuity host selection is still wrong."},{"protocolId":"checklist_evidence","status":"fail","gateClass":"hard","applicable":true,"counts":{"pass":0,"partial":0,"fail":2},"evidence":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/004-doc-surface-alignment/checklist.md:93","validate.sh --strict failed for 001-003 on 2026-04-13"],"findingRefs":["F002","F004"],"summary":"The current packet evidence still overstates completion and doc parity."}]},"coverage":{"filesReviewed":4,"filesTotal":22,"dimensionsComplete":["correctness","security","traceability","maintainability"]},"ruledOut":["A hidden P0 release blocker exists beyond the four already-open findings."],"focusTrack":"stability","timestamp":"2026-04-13T14:05:00Z","durationMs":240000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-015.md:4:Map the exact integration work required to connect the existing Tier3 contract to `memory-save.ts`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-015.md:8:2. The live save path never provides those Tier3 dependencies. `buildCanonicalAtomicPreparedSave()` simply calls `createContentRouter()` with no arguments, so the default dependency closes over `classifyWithTier3: async () => null`. That means the current runtime can only use Tier1, Tier2, and penalized Tier2 fallback. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:391]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-015.md:10:4. Phase `003-wire-tier3-llm-classifier` therefore needs two concrete code changes, not one. First, add a real classifier adapter that calls the Tier3 prompt contract and returns `Tier3RawResponse | null`. Second, inject that adapter into the router constructor in `memory-save.ts` and, ideally, pass a cache implementation so repeated ambiguous saves can hit the existing session/spec-folder cache layer. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/003-wire-tier3-llm-classifier/spec.md:10] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:630]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-015.md:13:- Treating phase `003` as a one-line constructor tweak in `memory-save.ts`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-015.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:59:      "id": "question-8-rq-8-which-handover-patterns-are-currently-pulled-into-drop-and-how-should-the-d",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:60:      "text": "RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:65:      "id": "question-9-rq-9-what-exact-code-is-missing-to-wire-tier3-into-memory-save-ts-and-what-laten",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:66:      "text": "RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:72:      "text": "RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:116:      "text": "The code currently contains eight hard Tier1 rules, not seven: four structured routes (`decision`, `handover`, `research`, `task_update`), one structured metadata route, and three hard drops (`toolCalls`, transcript wrapper, placeholder boilerplate). [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:286] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:171:      "text": "Target selection is deterministic by category: progress and delivery append paragraphs to `implementation-summary.md`, research and handover append sections, tasks update a phase anchor, metadata writes `_memory.continuity`, and `decision` switches between ADR insertion on `L3/L3+` and in-place summary updates on `L1/L2`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:92]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:193:      "text": "Tier1 heuristic scoring is cue-driven and asymmetric: each cue regex adds `0.18`, but some categories also receive floor boosts, such as `narrative_progress` at `0.72`, `narrative_delivery` at `0.74`, `decision` at `0.76`, `task_update` at `0.90`, `handover_state` at `0.84`, `research_finding` at `0.80`, `metadata_only` at `0.93`, and `drop` at `0.92`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:340] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:842]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:204:      "text": "The canonical save handler currently constructs `createContentRouter()` with no dependency injection, so `classifyWithTier3` defaults to `null` in the actual writer path. Tier3 exists in tests and the router contract, but not in the live save wiring studied here. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:386]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:209:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:220:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:231:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:242:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:248:      "text": "Because Tier3 is unwired in the save handler, ambiguous content in the live path either routes via Tier2 or lands in the penalized Tier2 fallback band before refusal. A direct runtime check showed an ambiguous sample refusing at `0.4965` with `tier3: null`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [INFERENCE: live execution of dist/lib/routing/content-router.js against an ambiguous sample derived from the Tier3 refusal test]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:292:      "text": "Category performance is uneven: `decision`, `task_update`, and `metadata_only` were perfect on the corpus, while `handover_state` (`62.5%`) and `narrative_delivery` (`68.75%`) were the weakest categories. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76] [INFERENCE: live execution of dist/lib/routing/content-router.js on the synthetic corpus]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:347:      "text": "One `research_finding` sample was classified as `metadata_only` because it discussed overlap in metadata and continuity terms, showing that `_memory.continuity` vocabulary can overpower research intent when the chunk is framed as findings about metadata. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:365] [INFERENCE: live corpus example `RF-03` from dist/lib/routing/content-router.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:357:      "id": "finding-6-5-short-handover-fragments-such-as-continuation-attempt-one-do-not-fail-because-of",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:358:      "text": "Short handover fragments such as \"Continuation attempt one\" do not fail because of phase-anchor logic; they fail because the abbreviated text loses resume-state detail and becomes semantically close to sparse task or generic wrapper language. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1011] [INFERENCE: live corpus examples `HS-01-s1` and `HS-01-compact` from dist/lib/routing/content-router.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:368:      "id": "finding-6-2-the-second-worst-confusion-is-handover-state-drop-also-with-four-cases-the-hando",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:369:      "text": "The second worst confusion is `handover_state -> drop`, also with four cases. The handover prototypes that mention `git diff`, verification commands, or command-style restart recipes are vulnerable because the `drop` cue table explicitly includes `git diff`, raw tool language, and recovery scaffolding. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [INFERENCE: live corpus examples `HS-01` and `HS-03` from dist/lib/routing/content-router.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:402:      "text": "`metadata_only` is the least fragile category at write time because it bypasses `anchorMergeOperation()` and writes `_memory.continuity` through thin-continuity helpers. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:167]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:406:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:407:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:413:      "text": "`task_update` is the most brittle category because `buildCanonicalMergePayload()` must discover a concrete `T###` or `CHK-###` ID, and the later merge requires exactly one matching checklist line. Classification accuracy alone is not enough to make task routing safe. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:952] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/merge/anchor-merge-operation.ts:440]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:417:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:418:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:424:      "text": "Category-to-merge mapping is fixed: `narrative_progress` and `narrative_delivery` use `append-as-paragraph`, `handover_state` and `research_finding` use `append-section`, `decision` uses `insert-new-adr` on `L3/L3+` and `update-in-place` on lower packet levels, `task_update` uses `update-in-place`, and `metadata_only` updates frontmatter continuity rather than anchor-merging. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:428:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:429:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:435:      "text": "The canonical writer derives merge payloads from routed content, not the original memory artifact type. That means the same text classification directly controls whether the writer looks for paragraphs, structured checklist IDs, or ADR fields. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1144]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:439:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:440:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1107`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:452:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:463:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:474:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:485:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:489:      "id": "finding-8-5-a-correct-classification-can-still-be-rejected-in-memory-save-ts-if-the-routed-m",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:490:      "text": "A correct classification can still be rejected in `memory-save.ts` if the routed merge mode conflicts with an explicit `mergeModeHint` or if the target document is missing. Those rejections are routing-surface failures, not merge-operation bugs. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1069]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:496:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:506:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:517:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:523:      "text": "Because Tier3 is currently unwired in production, the practical role of the `0.50` Tier3 threshold today is mostly the penalized Tier2 fallback/refusal cutoff, not an LLM acceptance threshold. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:518]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:528:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:539:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:545:      "text": "The save handler accepts the routed override category, but it still rejects the write if the caller supplies a conflicting `mergeModeHint`. In other words, override bypasses natural classification, not the downstream merge contract. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1206]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:550:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:556:      "text": "`routeAs` is powerful enough to rescue natural misclassifications, but it also weakens the semantic guardrail because it can force a merge against a natural `drop` decision. Operationally, overrides should stay explicit, audited, and paired with target/merge-mode validation. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:428] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:562:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:573:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:578:      "text": "The current router is already strong on structured categories (`decision`, `task_update`, `metadata_only`) because those categories either have hard Tier1 rules or highly distinctive lexical floors. The weak spots are cue-rich narrative categories, especially delivery-versus-progress and handover-versus-drop. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:286] [INFERENCE: live corpus results summarized across iterations 5 and 6]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:584:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:589:      "text": "The most valuable short-term improvement is not a global threshold change but cue/prototype tuning: delivery text needs stronger sequencing/gating cues relative to \"what changed\" verbs, and handover text needs protection from `drop` cues like `git diff` when resume-state language is also present. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:340] [INFERENCE: live corpus misclassification clusters summarized across iterations 5 and 6]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:595:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:600:      "text": "The Tier3 prompt and tests are worth keeping, but threshold optimization should be revisited only after the canonical save path actually injects a real Tier3 classifier. Until then, the `0.50` floor is mostly a fallback/refusal parameter, not a live model-quality control. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:212]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:606:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:698:      "id": "finding-13-4-phase-002-fix-handover-drop-confusion-should-therefore-split-the-drop-heuristic-",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:699:      "text": "Phase `002-fix-handover-drop-confusion` should therefore split the drop heuristic into two classes: hard wrapper evidence that still deserves the `0.92` floor, and soft operational commands that should either score much lower or defer to handover when strong stop-state cues (`current state`, `next session`, `resume`, `blocker`) are also present. That is the smallest change that matches the phase scope without touching downstream handover handling. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:705:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:716:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:727:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:738:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:749:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:753:      "id": "finding-14-4-phase-002-should-treat-hs-02-and-hs-05-as-the-stronger-handover-templates-and-re",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:754:      "text": "Phase `002` should treat `HS-02` and `HS-05` as the stronger handover templates and reduce reliance on `HS-04`-style command-first phrasing. The existing phase spec says not to reclassify correct drop prototypes, and that aligns with the evidence: the cleaner fix is to make handover prototypes more state-centric, not to weaken the drop prototypes that already capture wrappers and telemetry well. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:91]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:760:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:765:      "text": "The drop prototypes are better anchored on truly non-canonical signals such as timestamps, `assistant:`/`tool:` wrappers, table-of-contents scaffolding, truncation notes, and raw telemetry. That suggests the best phase-002 prototype change is not to rewrite correctly categorized drop examples, but to add or strengthen handover examples around stop-state language (`active files`, `current blocker`, `estimated remaining effort`, `next safe action`) without leading with command strings. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:165]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:771:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:775:      "id": "finding-14-1-the-handover-prototypes-themselves-contain-the-phrases-that-trigger-or-resemble-",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:776:      "text": "The handover prototypes themselves contain the phrases that trigger or resemble drop logic. `HS-01`, `HS-03`, and `HS-04` explicitly mention `verify`, `git diff`, `commit`, `run the resume command`, and file-review instructions. Those are realistic handovers, but they sit close to drop-style operational chatter. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:83]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:782:        "`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:787:      "text": "Phase `003-wire-tier3-llm-classifier` therefore needs two concrete code changes, not one. First, add a real classifier adapter that calls the Tier3 prompt contract and returns `Tier3RawResponse | null`. Second, inject that adapter into the router constructor in `memory-save.ts` and, ideally, pass a cache implementation so repeated ambiguous saves can hit the existing session/spec-folder cache layer. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/003-wire-tier3-llm-classifier/spec.md:10] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:630]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:792:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:798:      "text": "The live save path never provides those Tier3 dependencies. `buildCanonicalAtomicPreparedSave()` simply calls `createContentRouter()` with no arguments, so the default dependency closes over `classifyWithTier3: async () => null`. That means the current runtime can only use Tier1, Tier2, and penalized Tier2 fallback. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:391]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:803:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:814:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:825:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:836:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:841:      "id": "finding-16-3-the-biggest-operational-risk-is-latency-not-token-volume-memory-save-ts-feeds-ti",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:842:      "text": "The biggest operational risk is latency, not token volume. `memory-save.ts` feeds Tier3 the normalized routed chunk text after frontmatter/comment stripping, but it does not cap chunk length before routing. In typical prototype-sized content the prompt is modest, yet unusually long canonical save bodies could still push the request toward the 2-second deadline. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1009] [INFERENCE: prototype corpus averages roughly 45 words per chunk, but live save chunks are not hard-capped]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:847:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:858:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:869:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:886:      "text": "The best near-term prototype work is surgical, not wholesale: refresh 2-3 delivery examples and 1-2 handover examples to emphasize category-specific nouns, then leave the rest of the library stable so the before/after benchmark stays attributable. This aligns with phases `001` and `002` and avoids turning the routing benchmark into a full corpus rewrite. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/001-fix-delivery-progress-confusion/spec.md:10] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:908:      "text": "The most fragile categories are also the ones whose prototypes borrow the most operational nouns from neighbors. Delivery overlaps with progress around repository and workflow language; handover overlaps with drop, task, and decision around session control, verification, and remaining work. The category-level negative-hint counts reinforce this: every delivery prototype warns against progress, and every task prototype warns against handover. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:3] [INFERENCE: packet-local negative-hint frequency scan over `routing-prototypes.json` run during iteration 17]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:925:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:936:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:941:      "text": "The main measured failures are untested. There is no regression case where delivery text contains implementation verbs and sequencing language in the same chunk, and there is no natural-routing case where handover text coexists with `git diff`, resume commands, or recovery-style phrasing. The only drop-oriented regression today is a transcript wrapper sample and the explicit override-against-drop case. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:182] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:947:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:952:      "text": "The save-handler tests currently prove only explicit `routeAs` routing, not natural routing. `handler-memory-save.vitest.ts` routes canonical saves into the target summary and task docs by forcing `routeAs`, so phase `003` still needs handler-level coverage that a naturally ambiguous atomic save can reach Tier3 and fall back safely when the classifier is unavailable. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1119]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:958:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:968:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:969:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:973:      "id": "finding-19-2-phase-002-fix-handover-drop-confusion-should-split-hard-and-soft-drop-cues-in-co",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:974:      "text": "Phase `002-fix-handover-drop-confusion` should split hard and soft drop cues. In `content-router.ts`, keep transcript/table-of-contents/recovery-wrapper evidence in the hard drop branch, but move `git diff`, `list memories`, and similar operational commands into a softer path that cannot beat a strong handover state by default. Add a stronger handover floor for `current state`, `next session`, `active files`, `remaining effort`, `next safe action`, and `resume` near lines `868-869`, then preserve `extractHardNegativeFlags()` for true wrappers only. Prototype work should focus on making handover examples more state-first, not on weakening correct drop examples. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:353] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:83]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:979:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:980:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:985:      "text": "Phase `003-wire-tier3-llm-classifier` should add a real classifier adapter and then inject it. The missing constructor seam is `memory-save.ts` line `1008`; the existing call graph is already ready to receive `classifyWithTier3` and `cache`. Reuse the fail-open, timeout-bounded `fetch()` pattern from `lib/search/llm-reformulation.ts`, but build the request from `buildTier3Prompt()` and return validated `Tier3RawResponse` objects. Then add handler coverage for natural routing without `routeAs`, plus router coverage for cache hits, timeouts, and unavailable-provider fallbacks in the live save path. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:203]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:990:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:991:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:996:      "text": "Test work should follow the same phase boundaries. `content-router.vitest.ts` needs explicit regression samples for delivery-plus-implementation language, handover-plus-command language, and metadata-versus-research ambiguity. `handler-memory-save.vitest.ts` needs at least one naturally ambiguous atomic-save fixture that reaches Tier3 and proves safe fallback when the classifier returns `null` or times out. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1001:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1002:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1012:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1017:      "id": "finding-20-3-handover-drop-confusion-is-primarily-caused-by-over-aggressive-drop-dominance-th",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1023:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1034:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1040:      "text": "The prototype library and tests are good enough to support a narrow remediation wave, but not good enough to verify it without new regression cases. The highest-value sequence is: phase `001` cue plus prototype tuning, phase `002` drop relaxation plus state-first handover examples, and phase `003` Tier3 wiring only after the heuristic fixes are benchmarked. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/001-fix-delivery-progress-confusion/spec.md:10] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/003-wire-tier3-llm-classifier/spec.md:10]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1045:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1051:      "text": "Tier3 wiring is worthwhile only as a targeted ambiguity resolver. The contract is already bounded and cache-aware, but the production classifier implementation is missing. Phase `003` should reuse the existing OpenAI-compatible fetch pattern, add audit visibility, and stay fail-open so canonical saves never depend on an LLM being available. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:185]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1056:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1127:      "id": "finding-22-7-expand-the-handover-floor-with-b-active-files-current-blockers-remaining-effort-",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1128:      "text": "expand the handover floor with `/\\b(active files?|current blockers?|remaining effort|immediate next session work|fresh session|restart (?:the )?mcp server)\\b/`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1161:      "text": "The direct heuristic collision is narrow and explicit: `RULE_CUES.drop` and the hard drop floor both include `git diff`, while the handover prototypes `HS-01` and `HS-03` both use `git diff` as part of next-session instructions. That makes `git diff` the clearest phrase that is simultaneously valid handover language and a current hard drop signal. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:138] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:154]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1182:      "id": "finding-22-3-the-live-handover-floor-is-too-small-for-the-state-first-language-already-presen",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1183:      "text": "The live handover floor is too small for the state-first language already present in the prototypes. Today it only boosts `recent action`, `next safe action`, `current state`, and `resume`, but the strongest handover-specific phrases are `active files`, `current blockers`, `remaining effort`, `immediate next session work`, and `fresh session before closure`. Those phrases appear in `HS-02`, `HS-03`, and `HS-05` and should be part of the handover floor. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:868] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:146] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:170]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1210:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1211:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1216:      "text": "The production seam is still one unresolved constructor call. `createContentRouter()` already accepts `classifyWithTier3` and `cache`, and `resolveTier3Decision()` already consumes both, but `memory-save.ts` still creates the router with no dependencies at line `1008`. That leaves Tier 3 permanently stubbed to `null` in production. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:231] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:386] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1221:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1222:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1227:      "text": "The smallest realistic production diff is about `90-130` LOC. A thin OpenAI-compatible call helper modeled on `callLlmForReformulation()` is roughly `45-60` LOC, a small session/spec-folder cache wrapper is another `20-30` LOC, env/response plumbing is about `10-20` LOC, and the actual injection at `memory-save.ts:1008` is only `8-15` LOC. If the phase also introduces routing-specific env names instead of reusing an existing OpenAI-compatible endpoint contract, the diff moves toward the high end of that range. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:200] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [INFERENCE: line-count estimate based on the existing helper shape and the missing seams]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1232:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1233:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1238:      "text": "The test cost is separate and non-trivial: expect another `70-100` LOC across router and handler tests. `content-router.vitest.ts` already covers classifier injection, cache hits, below-floor refusals, and Tier 2 fallback, so phase `003` mostly needs adapter-path assertions. `handler-memory-save.vitest.ts` needs at least one natural-routing atomic-save case with no `routeAs`, one null/timeout fallback case, and one cache-reuse case that proves the real save path can reach Tier 3 without changing canonical outputs. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:212] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:338] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1243:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1244:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1254:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1255:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1266:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1271:      "text": "No routing category has zero test coverage in `content-router.vitest.ts`. The tier-1 classification block already asserts natural routing for `narrative_progress`, `narrative_delivery`, `decision`, `handover_state`, `research_finding`, `task_update`, `metadata_only`, and `drop` between lines `48` and `191`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:48] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:182]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1277:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1282:      "text": "The actual gap is adversarial coverage, not category presence. There is still no natural-routing regression test for delivery text that also contains build verbs, no natural-routing regression for handover text that also contains `git diff` or resume-command phrasing, and no metadata-versus-research or decision-versus-research boundary test. The existing non-happy-path tests concentrate on Tier 2 and Tier 3 contract behavior, cache behavior, and override semantics. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:195] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395] [INFERENCE: derived from the existing test list and the missing boundary cases]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1288:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1293:      "text": "The handler path remains the bigger hole. The canonical atomic-save routing tests in `handler-memory-save.vitest.ts` all provide explicit `routeAs` values for progress and task updates, so there is still zero handler-level proof that ambiguous natural routing can reach Tier 3 in the real save flow. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1119] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1161]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1299:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1310:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1314:      "id": "finding-25-2-phase-002-fix-handover-drop-confusion-also-has-a-concrete-patch-shape-keep-trans",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1315:      "text": "Phase `002-fix-handover-drop-confusion` also has a concrete patch shape: keep transcript wrappers and boilerplate hard-dropped, move `git diff`, `list memories`, and `force re-index` into a softer operational branch, expand the handover floor with `active files`, `current blockers`, `remaining effort`, `immediate next session work`, `fresh session`, and restart language, then refresh the handover prototypes so `HS-01`, `HS-03`, and `HS-04` lead with state before commands. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:138]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1321:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1326:      "text": "Phase `003-wire-tier3-llm-classifier` is best described as a small integration slice, not a large architecture change: add an OpenAI-compatible adapter around `buildTier3Prompt()`, add a `RouterCache` implementation, inject both at `memory-save.ts:1008`, and test the natural save path with success, cache-hit, null-response, and timeout cases. The realistic production diff is about `90-130` LOC plus `70-100` LOC of tests. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1332:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1343:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1358:      "text": "The delivered fixes therefore solved the packet's original live-text hotspots. The residual errors now cluster around research/metadata overlap and very short telemetry fragments, not delivery or handover mechanics. [INFERENCE: packet-local preserved-subset replay over dist/lib/routing/content-router.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1368:      "text": "The old dominant confusion seams are no longer the leaders. In the preserved replay, `narrative_delivery -> narrative_progress` and `handover_state -> drop` disappear from the top confusion list entirely. [INFERENCE: packet-local preserved-subset replay over dist/lib/routing/content-router.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1428:      "text": "The reconstructed replay still supports the main post-implementation conclusion: the old delivery/progress and handover/drop seams are no longer the dominant source of error. The remaining fragility lives in ultra-short fragments that shed too much category-defining context. [INFERENCE: packet-local reconstructed 132-sample replay over dist/lib/routing/content-router.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1448:      "text": "\"Always on\" therefore means \"always attempted on ambiguous routes,\" not \"always authoritative.\" The shipped runtime still prefers safe fallback or refusal over forcing an unreliable model answer into a merge. [INFERENCE: trace across memory-save.ts and content-router.ts]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1451:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1452:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1453:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1459:      "text": "`classifyWithTier3Llm()` fail-opens at every external boundary. Missing endpoint, non-OK HTTP response, invalid JSON payload, and thrown fetch or abort all return `null` rather than surfacing an error into the save path. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:986] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:999]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1462:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1463:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1464:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1470:      "text": "Canonical routing is now unconditional in the save handler. `shouldUseCanonicalRouting()` returns `true` for every atomic save, so the live path no longer depends on a feature flag or explicit opt-in. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:2440]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1473:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1474:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1475:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1484:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1485:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1486:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1492:      "text": "The handler now constructs the router through `buildCanonicalRouter()`, which injects both `classifyWithTier3Llm` and the shared `tier3RoutingCache`. That closes the exact runtime gap identified in iterations 15 and 23. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1208]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1495:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1496:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1497:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1502:      "id": "finding-29-1-a-targeted-routing-only-vitest-run-passed-7-7-covering-the-new-delivery-handover",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1503:      "text": "A targeted routing-only Vitest run passed `7/7`, covering the new delivery/handover boundary assertions plus the natural Tier 3 and fail-open handler checks. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:133] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:503] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239] [INFERENCE: targeted `npx vitest run ... -t ...` execution]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1509:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1510:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1515:      "text": "Explicit `routeAs` saves against a child phase emit `PACKET_KIND: phase` and `SAVE_MODE: route-as`, which proves the prompt body distinguishes operator-forced routes from natural classification. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1347] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1207]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1521:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1522:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1527:      "text": "Natural canonical saves now reach Tier 3 with `PACKET_KIND: feature` and `SAVE_MODE: natural` in the prompt body, matching the handler's new `saveMode` labeling. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1206]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1533:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1534:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1539:      "text": "Research-root packets derive `PACKET_KIND: research` from spec frontmatter rather than pure path shape, which confirms the metadata-first packet-kind logic is live. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1294] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:870]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1545:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1546:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1551:      "text": "When Tier 3 transport throws, the handler still succeeds via natural Tier 2 routing and writes the note to the expected canonical target. That behavior matches the code-level fail-open contract from iteration 28. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:569] [INFERENCE: targeted `npx vitest run ... -t ...` execution]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1557:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1558:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1401`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1563:      "text": "`save.md` and `SKILL.md` both describe the live eight-category router correctly: `narrative_progress`, `narrative_delivery`, `decision`, `handover_state`, `research_finding`, `task_update`, `metadata_only`, and `drop`. [SOURCE: .opencode/commands/memory/save.md:76] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:389]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1566:        "`.opencode/commands/memory/save.md:76`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1569:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1577:        "`.opencode/commands/memory/save.md:76`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1580:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1584:      "id": "finding-30-3-the-delivery-and-handover-boundary-language-is-aligned-with-the-code-delivery-is",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1585:      "text": "The delivery and handover boundary language is aligned with the code. Delivery is documented as sequencing, gating, rollout, and verification oriented, while handover explicitly keeps state-first stop/resume notes even when soft operational commands appear. [SOURCE: .opencode/commands/memory/save.md:95] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:384] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:935]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1588:        "`.opencode/commands/memory/save.md:76`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1591:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1596:      "text": "The override and context wording is also correct. Both docs say `routeAs` preserves the natural decision for audit, and that `packet_kind` comes from spec metadata first with a parent-phase fallback only when metadata is silent. [SOURCE: .opencode/commands/memory/save.md:101] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:479] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1599:        "`.opencode/commands/memory/save.md:76`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1602:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1607:      "text": "Their Tier flow description matches the code: Tier 1 uses strong heuristics, Tier 2 uses prototype similarity, and Tier 3 is wired into the save handler by default with a safe Tier 2 penalty fallback or refusal. [SOURCE: .opencode/commands/memory/save.md:89] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:569]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1610:        "`.opencode/commands/memory/save.md:76`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1613:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1618:      "text": "`save_workflow.md` matches the shipped category map, Tier flow, soft operational drop split, `routeAs` audit behavior, and metadata-first `packet_kind` derivation. [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:302] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:389] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1621:        "`.opencode/skills/system-spec-kit/references/memory/save_workflow.md:302`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1623:        "`.opencode/commands/memory/save.md:93`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1624:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1629:      "text": "That nuance is not a functional parity break because the same docs also state that unavailable Tier 3 falls back safely to Tier 2 with a penalty or refuses to route. The behavior description is correct even if the \"configured\" wording is slightly stronger than the code's guarantee. [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:321] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:569]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1632:        "`.opencode/skills/system-spec-kit/references/memory/save_workflow.md:302`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1634:        "`.opencode/commands/memory/save.md:93`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1635:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1643:        "`.opencode/skills/system-spec-kit/references/memory/save_workflow.md:302`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1645:        "`.opencode/commands/memory/save.md:93`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1646:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1651:      "text": "The one wording nuance is environmental. The docs phrase Tier 3 as if `LLM_REFORMULATION_ENDPOINT` is configured, while the code only checks whether the env var exists and otherwise returns `null` without hard failure. [SOURCE: .opencode/skills/system-spec-kit/references/memory/save_workflow.md:321] [SOURCE: .opencode/commands/memory/save.md:93] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:953]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1654:        "`.opencode/skills/system-spec-kit/references/memory/save_workflow.md:302`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1656:        "`.opencode/commands/memory/save.md:93`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1657:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1662:      "text": "The same alignment also appears in `ARCHITECTURE.md`, so the deeper design doc, the operator command doc, and the skill entrypoint now tell the same routing story. [SOURCE: .opencode/skills/system-spec-kit/ARCHITECTURE.md:135] [SOURCE: .opencode/commands/memory/save.md:89] [SOURCE: .opencode/skills/system-spec-kit/SKILL.md:549]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1665:        "`.opencode/skills/system-spec-kit/references/memory/save_workflow.md:302`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1667:        "`.opencode/commands/memory/save.md:93`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1668:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1696:      "id": "finding-32-2-the-next-closest-centroid-pair-is-narrative-delivery-and-handover-state-0-8918-d",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1697:      "text": "The next closest centroid pair is `narrative_delivery` and `handover_state` (`0.8918`, `distance 0.1082`), which means the old handover and delivery language is still clustered tightly even after the targeted prototype refresh. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:1] [INFERENCE: packet-local lexical-vector centroid analysis over routing-prototypes.json]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1753:      "text": "The riskiest off-category pair is still `ND-03` versus `HS-04` (`cosine 0.8244`, `distance 0.1756`). That keeps the delivery-versus-handover seam visibly alive inside the prototype space even after the refresh. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:157] [INFERENCE: packet-local nearest-neighbor scan over routing-prototypes.json]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1763:      "text": "The delivered phases resolved the packet's original live routing problem. On the preserved replay, the leading errors are no longer delivery/progress or handover/drop. [INFERENCE: synthesis across iterations 26-27]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1793:      "text": "The remaining improvement path should therefore target short-fragment research/metadata/drop handling, not reopen the already-fixed delivery and handover seams. [INFERENCE: synthesis across iterations 26-33]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1835:      "text": "The highest-leverage small changes are: stronger short-form drop wrappers for phrases like `captured file count`, `tool executions`, and `repository state`; a clearer research-versus-metadata distinction when `_memory.continuity` vocabulary appears inside analytical finding prose; and one additional guard so spec-doc nouns do not automatically push progress text into `research_finding`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:385] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:409] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:417] [INFERENCE: synthesis across preserved replay and residual error cases]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1857:      "text": "To keep a 95%+ story on abbreviated fragments, the next gains need to target short-form `research_finding` versus `metadata_only` and short telemetry `drop` cues, not the already-fixed delivery or handover mechanics. [INFERENCE: synthesis across iterations 26-34]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1898:      "text": "Because the preserved replay stayed flat and the current tree shows no further diff in `content-router.ts` or `routing-prototypes.json`, the F7 change is a write-target correctness fix, not a classifier-tuning change. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1064] [INFERENCE: comparison against iteration 36 replay]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1902:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1903:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1904:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1909:      "text": "The canonical save handler resolves `spec-frontmatter` to `implementation-summary.md` when that file exists and falls back to `spec.md` only when the implementation summary is missing. That matches the new regression tests covering both paths. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1913:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1914:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1915:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1920:      "text": "The routed identity helper now maps `metadata_only` saves to the continuity anchor on the canonical implementation summary host: `targetDocPath = implementation-summary.md` and `targetAnchorId = _memory.continuity`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/save/create-record.ts:111] [INFERENCE: direct node probe against dist/handlers/save/create-record.js]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1924:        "`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1925:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157`",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1926:        "`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200`"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1962:      "id": "ruled-out-1-2-historical-save-log-mining-the-packet-scope-and-current-memory-model-explicitly-",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:1963:      "text": "Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2012:      "id": "ruled-out-6-2-blaming-delivery-and-handover-failures-on-tier2-in-the-key-examples-tier2-prefer",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2013:      "text": "Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2017:      "id": "ruled-out-6-1-treating-phase-anchor-inference-as-the-main-handover-failure-driver",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2018:      "text": "Treating phase-anchor inference as the main handover failure driver.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2087:      "id": "ruled-out-13-2-treating-every-command-mention-inside-a-handover-chunk-as-proof-that-the-content",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2088:      "text": "Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2092:      "id": "ruled-out-14-2-rewriting-the-drop-corpus-as-the-main-fix-for-handover-drop-confusion",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2093:      "text": "Rewriting the drop corpus as the main fix for handover/drop confusion.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2097:      "id": "ruled-out-14-1-treating-command-first-handover-prose-as-harmless-prototype-decoration",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2098:      "text": "Treating command-first handover prose as harmless prototype decoration.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2107:      "id": "ruled-out-15-2-treating-phase-003-as-a-one-line-constructor-tweak-in-memory-save-ts",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2108:      "text": "Treating phase `003` as a one-line constructor tweak in `memory-save.ts`.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2157:      "id": "ruled-out-20-1-treating-tier3-wiring-as-the-fix-for-delivery-progress-and-handover-drop-by-itse",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2158:      "text": "Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2172:      "id": "ruled-out-22-2-removing-all-command-language-from-handover-guidance-real-handover-notes-legitim",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2173:      "text": "Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2212:      "id": "ruled-out-26-1-looking-for-the-old-delivery-and-handover-confusion-pairs-in-the-preserved-repla",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2213:      "text": "Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2292:      "id": "ruled-out-34-2-reopening-the-delivery-progress-or-handover-drop-remediation-plan-as-the-primary",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/findings-registry.json:2293:      "text": "Reopening the delivery/progress or handover/drop remediation plan as the primary next step.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-008.md:11:5. A correct classification can still be rejected in `memory-save.ts` if the routed merge mode conflicts with an explicit `mergeModeHint` or if the target document is missing. Those rejections are routing-surface failures, not merge-operation bugs. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1069]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-008.md:23:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:4:Trace the post-implementation always-on Tier 3 path through `memory-save.ts` and `content-router.ts`, with emphasis on where the handler attempts Tier 3 and how it falls back when the classifier is unavailable.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:7:1. Canonical routing is now unconditional in the save handler. `shouldUseCanonicalRouting()` returns `true` for every atomic save, so the live path no longer depends on a feature flag or explicit opt-in. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:2440]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:8:2. The handler now constructs the router through `buildCanonicalRouter()`, which injects both `classifyWithTier3Llm` and the shared `tier3RoutingCache`. That closes the exact runtime gap identified in iterations 15 and 23. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1208]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:9:3. `classifyWithTier3Llm()` fail-opens at every external boundary. Missing endpoint, non-OK HTTP response, invalid JSON payload, and thrown fetch or abort all return `null` rather than surfacing an error into the save path. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:986] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:999]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:11:5. "Always on" therefore means "always attempted on ambiguous routes," not "always authoritative." The shipped runtime still prefers safe fallback or refusal over forcing an unreliable model answer into a merge. [INFERENCE: trace across memory-save.ts and content-router.ts]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:20:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:951`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-028.md:22:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:47:| 13 | Handover versus drop heuristic collision | remediation-handover | 0.71 | 4 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:48:| 14 | Handover and drop prototype boundary | remediation-handover | 0.63 | 4 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:56:| 22 | Exact handover patterns that collide with drop | remediation-handover | 0.31 | 4 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:90:- [x] RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:91:- [x] RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:92:- [x] RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:112:- Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead. (iteration 1)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:122:- Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated. (iteration 6)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:123:- Treating phase-anchor inference as the main handover failure driver. (iteration 6)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:137:- Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate. (iteration 13)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:138:- Rewriting the drop corpus as the main fix for handover/drop confusion. (iteration 14)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:139:- Treating command-first handover prose as harmless prototype decoration. (iteration 14)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:141:- Treating phase `003` as a one-line constructor tweak in `memory-save.ts`. (iteration 15)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:151:- Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself. (iteration 20)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:154:- Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them. (iteration 22)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:162:- Looking for the old delivery and handover confusion pairs in the preserved replay after the implemented cue and prototype changes. (iteration 26)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-dashboard.md:178:- Reopening the delivery/progress or handover/drop remediation plan as the primary next step. (iteration 34)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/003-graph-metadata-validation-research/iterations/iteration-022.md:21:- Trying to solve canonical preference in the schema. The conflict happens before serialization, at the in-memory `Map` write sites.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-032.md:8:2. The next closest centroid pair is `narrative_delivery` and `handover_state` (`0.8918`, `distance 0.1082`), which means the old handover and delivery language is still clustered tightly even after the targeted prototype refresh. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:1] [INFERENCE: packet-local lexical-vector centroid analysis over routing-prototypes.json]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-035.md:8:2. To keep a 95%+ story on abbreviated fragments, the next gains need to target short-form `research_finding` versus `metadata_only` and short telemetry `drop` cues, not the already-fixed delivery or handover mechanics. [INFERENCE: synthesis across iterations 26-34]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-035.md:9:3. The highest-leverage small changes are: stronger short-form drop wrappers for phrases like `captured file count`, `tool executions`, and `repository state`; a clearer research-versus-metadata distinction when `_memory.continuity` vocabulary appears inside analytical finding prose; and one additional guard so spec-doc nouns do not automatically push progress text into `research_finding`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:385] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:409] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:417] [INFERENCE: synthesis across preserved replay and residual error cases]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-findings-registry.json:20:      "description": "The active operator prompt still invokes `--spec-folder=.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/003-continuity-refactor-gates/002-content-routing-accuracy`, so rerunning the prompt from `010-search-and-routing-tuning` opens the retired 006 lineage instead of the promoted 010 packet. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/prompts/deep-research-prompt.md:8] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/spec.md:6]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-findings-registry.json:40:      "description": "The promoted child-root review outputs were not regenerated after the move under `010-search-and-routing-tuning`: `001` still describes the old Stage 3 defect even though the live rerank path now prefers `adaptiveFusionIntent`, `002` still reports a metadata-only routing bug that the shipped handler and regression suite no longer reproduce, and `003` still points its dashboard at the retired `019` target. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/001-search-fusion-tuning/review/review-report.md:11] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/review-report.md:12] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/003-graph-metadata-validation/review/deep-review-dashboard.md:18]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:19:        ".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:20:        ".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:2090",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:21:        ".opencode/skills/system-spec-kit/references/memory/save_workflow.md:167"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:23:      "recommendation": "Route `spec-frontmatter` to `implementation-summary.md` whenever it exists, regardless of which non-memory doc initiated the save."
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:34:        ".opencode/commands/memory/save.md:93",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:35:        ".opencode/skills/system-spec-kit/references/memory/save_workflow.md:321",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:37:        ".opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md:34",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:52:        ".opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md:34"
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-findings-registry.json:66:        ".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/tasks.md:6",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-018.md:8:2. The main measured failures are untested. There is no regression case where delivery text contains implementation verbs and sequencing language in the same chunk, and there is no natural-routing case where handover text coexists with `git diff`, resume commands, or recovery-style phrasing. The only drop-oriented regression today is a transcript wrapper sample and the explicit override-against-drop case. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:65] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:182] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-018.md:10:4. The save-handler tests currently prove only explicit `routeAs` routing, not natural routing. `handler-memory-save.vitest.ts` routes canonical saves into the target summary and task docs by forcing `routeAs`, so phase `003` still needs handler-level coverage that a naturally ambiguous atomic save can reach Tier3 and fall back safely when the classifier is unavailable. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1119]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-018.md:22:- `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-001.md:8:2. The code currently contains eight hard Tier1 rules, not seven: four structured routes (`decision`, `handover`, `research`, `task_update`), one structured metadata route, and three hard drops (`toolCalls`, transcript wrapper, placeholder boilerplate). [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:286] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-001.md:13:- Historical save-log mining. The packet scope and current memory model explicitly require synthetic payloads instead.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:3:{"type":"iteration","run":3,"status":"complete","focus":"Tier3 prompt contract and runtime wiring reality","findingsCount":4,"newInfoRatio":0.82,"noveltyJustification":"Two findings were new and two refined the earlier router architecture map.","keyQuestions":["RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?","RQ-6: How does the `routeAs` override interact with natural classification? Does override produce better or worse outcomes?"],"answeredQuestions":[],"ruledOut":["Treating the Tier3 prompt contract as live runtime behavior without checking the save handler"],"focusTrack":"runtime-wiring","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:212"],"timestamp":"2026-04-13T05:07:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:5:{"type":"iteration","run":5,"status":"complete","focus":"Synthetic corpus baseline accuracy and hard-rule performance","findingsCount":5,"newInfoRatio":0.86,"noveltyJustification":"Four findings were newly measured from the live router corpus run and one refined earlier trigger analysis.","keyQuestions":["RQ-1: What is the classification accuracy of Tier1 hard rules? Which of the 7 rules fire most often, and do any produce false positives?","RQ-3: What are the confusion pairs between categories? (for example, does `narrative_progress` get confused with `task_update`?)","RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?"],"answeredQuestions":["RQ-1: What is the classification accuracy of Tier1 hard rules? Which of the 7 rules fire most often, and do any produce false positives?"],"ruledOut":["Relying on static rule reading alone for accuracy claims"],"focusTrack":"measurement","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:1",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:48","memory-save runtime corpus execution via dist/lib/routing/content-router.js"],"timestamp":"2026-04-13T05:23:00Z","durationMs":540000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:6:{"type":"iteration","run":6,"status":"complete","focus":"Confusion pairs and concrete edge-case failures","findingsCount":5,"newInfoRatio":0.74,"noveltyJustification":"Three findings were new and two deepened already-measured error clusters with concrete examples.","keyQuestions":["RQ-3: What are the confusion pairs between categories? (for example, does `narrative_progress` get confused with `task_update`?)","RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?"],"answeredQuestions":["RQ-3: What are the confusion pairs between categories? (for example, does `narrative_progress` get confused with `task_update`?)"],"ruledOut":["Assuming handover failures come from phase-anchor inference alone"],"focusTrack":"measurement","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:340",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:904","live router corpus misclassification sample set"],"timestamp":"2026-04-13T05:31:00Z","durationMs":480000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:7:{"type":"iteration","run":7,"status":"complete","focus":"Merge-mode mapping and payload construction by category","findingsCount":4,"newInfoRatio":0.7,"noveltyJustification":"Three findings were new and one connected earlier category analysis to the atomic save writer contract.","keyQuestions":["RQ-5: What merge modes succeed vs fail for each category? Are there categories where the default merge mode is wrong?","RQ-6: How does the `routeAs` override interact with natural classification? Does override produce better or worse outcomes?"],"answeredQuestions":[],"ruledOut":["Treating metadata-only saves as normal anchor merges"],"focusTrack":"merge","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:925",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76"],"timestamp":"2026-04-13T05:38:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:8:{"type":"iteration","run":8,"status":"complete","focus":"Merge legality and failure conditions","findingsCount":5,"newInfoRatio":0.66,"noveltyJustification":"Three findings were new and two consolidated the merge/validation safety model into one failure map.","keyQuestions":["RQ-5: What merge modes succeed vs fail for each category? Are there categories where the default merge mode is wrong?"],"answeredQuestions":["RQ-5: What merge modes succeed vs fail for each category? Are there categories where the default merge mode is wrong?"],"ruledOut":["Assuming a successful classification guarantees a legal merge"],"focusTrack":"merge","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/merge/anchor-merge-operation.ts:265",".opencode/skills/system-spec-kit/mcp_server/lib/validation/spec-doc-structure.ts:627",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1144"],"timestamp":"2026-04-13T05:46:00Z","durationMs":480000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:9:{"type":"iteration","run":9,"status":"complete","focus":"Override semantics and threshold sensitivity sweep","findingsCount":5,"newInfoRatio":0.62,"noveltyJustification":"Three findings were new and two quantified earlier wiring observations across the threshold grid.","keyQuestions":["RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?","RQ-6: How does the `routeAs` override interact with natural classification? Does override produce better or worse outcomes?"],"answeredQuestions":["RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?","RQ-6: How does the `routeAs` override interact with natural classification? Does override produce better or worse outcomes?"],"ruledOut":["Recommending a threshold change without comparing refusal cost"],"focusTrack":"thresholds","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:428",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1053",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395"],"timestamp":"2026-04-13T05:55:00Z","durationMs":540000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:10:{"type":"iteration","run":10,"status":"complete","focus":"Synthesis and implementation-ready recommendations","findingsCount":5,"newInfoRatio":0.58,"noveltyJustification":"Two findings were new and the rest resolved contradictions between raw accuracy gains, refusal costs, and runtime wiring reality.","keyQuestions":["RQ-1: What is the classification accuracy of Tier1 hard rules? Which of the 7 rules fire most often, and do any produce false positives?","RQ-2: What is the Tier1->Tier2 escalation rate? What types of content trigger escalation (top1 below threshold, narrow margin, mixed signals)?","RQ-3: What are the confusion pairs between categories? (for example, does `narrative_progress` get confused with `task_update`?)","RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?","RQ-5: What merge modes succeed vs fail for each category? Are there categories where the default merge mode is wrong?","RQ-6: How does the `routeAs` override interact with natural classification? Does override produce better or worse outcomes?"],"answeredQuestions":["RQ-1: What is the classification accuracy of Tier1 hard rules? Which of the 7 rules fire most often, and do any produce false positives?","RQ-2: What is the Tier1->Tier2 escalation rate? What types of content trigger escalation (top1 below threshold, narrow margin, mixed signals)?","RQ-3: What are the confusion pairs between categories? (for example, does `narrative_progress` get confused with `task_update`?)","RQ-4: Are the 0.70/0.70/0.50 thresholds optimal, or would different values reduce escalation without losing accuracy?","RQ-5: What merge modes succeed vs fail for each category? Are there categories where the default merge mode is wrong?","RQ-6: How does the `routeAs` override interact with natural classification? Does override produce better or worse outcomes?"],"ruledOut":["Single-knob threshold tuning as the primary remediation"],"focusTrack":"synthesis","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:470",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008",".opencode/skills/system-spec-kit/mcp_server/lib/validation/spec-doc-structure.ts:685"],"timestamp":"2026-04-13T06:03:00Z","durationMs":480000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:13:{"type":"iteration","run":11,"status":"complete","focus":"Delivery versus progress cue audit","findingsCount":4,"newInfoRatio":0.72,"noveltyJustification":"Three findings were new and one translated the phase spec into exact router seams for delivery remediation.","keyQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?"],"answeredQuestions":[],"ruledOut":["Treating delivery confusion as a prototype-only issue"],"focusTrack":"remediation-delivery","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:341",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:842",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:37",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/001-fix-delivery-progress-confusion/spec.md:10"],"timestamp":"2026-04-13T08:24:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:14:{"type":"iteration","run":12,"status":"complete","focus":"Delivery and progress prototype quality","findingsCount":4,"newInfoRatio":0.68,"noveltyJustification":"Two findings were new and two converted lexical-overlap measurements into concrete prototype guidance.","keyQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?"],"answeredQuestions":["RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?"],"ruledOut":["Assuming balanced prototype counts are enough to prevent confusion in Tier2"],"focusTrack":"remediation-delivery","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:151",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:1","packet-local lexical overlap and nearest-neighbor scripts over routing-prototypes.json"],"timestamp":"2026-04-13T08:33:00Z","durationMs":390000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:15:{"type":"iteration","run":13,"status":"complete","focus":"Handover versus drop heuristic collision","findingsCount":4,"newInfoRatio":0.71,"noveltyJustification":"Three findings were new and one translated the measured collision into a minimal phase-002 change shape.","keyQuestions":["RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?"],"answeredQuestions":[],"ruledOut":["Treating every command mention inside a handover chunk as proof that the content is generic operator boilerplate"],"focusTrack":"remediation-handover","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:353",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:904",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:10"],"timestamp":"2026-04-13T08:42:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:16:{"type":"iteration","run":14,"status":"complete","focus":"Handover and drop prototype boundary","findingsCount":4,"newInfoRatio":0.63,"noveltyJustification":"Two findings were new and two sharpened which prototypes should guide, rather than dominate, the phase-002 fix.","keyQuestions":["RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?","RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?"],"answeredQuestions":[],"ruledOut":["Rewriting the drop corpus as the main fix for handover/drop confusion"],"focusTrack":"remediation-handover","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:83",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:165","packet-local nearest-neighbor script over handover and drop prototypes",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/002-fix-handover-drop-confusion/spec.md:15"],"timestamp":"2026-04-13T08:51:00Z","durationMs":390000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:17:{"type":"iteration","run":15,"status":"complete","focus":"Tier3 wiring gap in the save path","findingsCount":4,"newInfoRatio":0.66,"noveltyJustification":"Three findings were new and one converted the callsite audit into a concrete missing-adapter requirement.","keyQuestions":["RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?"],"answeredQuestions":[],"ruledOut":["Treating phase `003` as a one-line constructor tweak in `memory-save.ts`"],"focusTrack":"runtime-wiring","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:386",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008",".opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:185"],"timestamp":"2026-04-13T09:00:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:18:{"type":"iteration","run":16,"status":"complete","focus":"Tier3 latency and cost envelope","findingsCount":4,"newInfoRatio":0.57,"noveltyJustification":"Two findings were new and two turned existing contract constants into an operational rollout estimate.","keyQuestions":["RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?"],"answeredQuestions":["RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?"],"ruledOut":["Treating Tier3 cost as the main blocker before measuring the ambiguous-call rate"],"focusTrack":"runtime-wiring","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:12",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:470",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806",".opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:203"],"timestamp":"2026-04-13T09:09:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:19:{"type":"iteration","run":17,"status":"complete","focus":"Prototype distribution beyond the hotspots","findingsCount":4,"newInfoRatio":0.52,"noveltyJustification":"Two findings were new and two reframed the prototype-library quality question around concentrated seams rather than global health.","keyQuestions":["RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?"],"answeredQuestions":["RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?"],"ruledOut":["Rebuilding the entire prototype library as the first remediation step"],"focusTrack":"prototypes","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:1","packet-local negative-hint and vocabulary-distribution scans over routing-prototypes.json",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-canonical-continuity-refactor/018-research-content-routing-accuracy/001-fix-delivery-progress-confusion/spec.md:10"],"timestamp":"2026-04-13T09:18:00Z","durationMs":330000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:20:{"type":"iteration","run":18,"status":"complete","focus":"Test coverage gaps and untested edges","findingsCount":4,"newInfoRatio":0.61,"noveltyJustification":"Three findings were new and one connected router-only coverage to the missing handler-level save-path assertions.","keyQuestions":["RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"answeredQuestions":["RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"ruledOut":["Treating the current test suite as sufficient because every category already has one positive-path assertion"],"focusTrack":"test-coverage","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:48",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076"],"timestamp":"2026-04-13T09:27:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:21:{"type":"iteration","run":19,"status":"complete","focus":"Phase-by-phase implementation guidance","findingsCount":4,"newInfoRatio":0.46,"noveltyJustification":"Most raw evidence was already known, but this pass converted it into exact code-location guidance for phases 001-003.","keyQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?","RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?","RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"answeredQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?"],"ruledOut":["Treating the implementation phases as independent"],"focusTrack":"phase-guidance","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:345",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076"],"timestamp":"2026-04-13T09:36:00Z","durationMs":390000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:22:{"type":"iteration","run":20,"status":"complete","focus":"Remediation synthesis and sequencing","findingsCount":5,"newInfoRatio":0.38,"noveltyJustification":"This iteration added limited new raw evidence but produced the final ordering and implementation guidance across the full research set.","keyQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?","RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?","RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?","RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"answeredQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?","RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?","RQ-10: Are the Tier2 prototype vectors well distributed across categories, especially at the delivery/progress and handover/drop boundaries?","RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"ruledOut":["Treating Tier3 wiring as the fix for delivery/progress and handover/drop by itself"],"focusTrack":"synthesis","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:341",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008",".opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:185"],"timestamp":"2026-04-13T09:45:00Z","durationMs":330000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:26:{"type":"iteration","run":22,"status":"complete","focus":"Exact handover patterns that collide with drop","findingsCount":4,"newInfoRatio":0.31,"noveltyJustification":"Two findings were new and two split the handover problem into hard heuristic conflicts versus softer prototype overlap.","keyQuestions":["RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?"],"answeredQuestions":["RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?"],"ruledOut":["Removing all command language from handover guidance"],"focusTrack":"remediation-handover","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:138",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:314"],"timestamp":"2026-04-13T10:16:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:27:{"type":"iteration","run":23,"status":"complete","focus":"Tier3 wiring effort estimate and test strategy","findingsCount":5,"newInfoRatio":0.28,"noveltyJustification":"Three findings were new and two translated the known runtime gap into concrete production and test line-count bands.","keyQuestions":["RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?"],"answeredQuestions":["RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?"],"ruledOut":["Assuming a reusable production `RouterCache` already exists and phase `003` only needs to pass it through"],"focusTrack":"runtime-wiring","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:231",".opencode/skills/system-spec-kit/mcp_server/lib/search/llm-reformulation.ts:200",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556"],"timestamp":"2026-04-13T10:25:00Z","durationMs":450000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:28:{"type":"iteration","run":24,"status":"complete","focus":"Routing-category coverage floor in content-router tests","findingsCount":4,"newInfoRatio":0.22,"noveltyJustification":"One finding was new and the rest clarified that the remaining gap is adversarial boundary coverage rather than category absence.","keyQuestions":["RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"answeredQuestions":["RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"ruledOut":["Looking for a routing category that is completely absent from `content-router.vitest.ts`"],"focusTrack":"test-coverage","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:48",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:195",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:395",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1076"],"timestamp":"2026-04-13T10:34:00Z","durationMs":330000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:29:{"type":"iteration","run":25,"status":"complete","focus":"Final convergence synthesis with exact phase change descriptions","findingsCount":4,"newInfoRatio":0.14,"noveltyJustification":"This iteration added little new raw evidence and instead converted the convergence wave into the final implementation-ready handoff.","keyQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?","RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?","RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"answeredQuestions":["RQ-7: Which exact delivery-versus-progress cues cause the current misclassifications, and what delivery lexicon should be added?","RQ-8: Which handover patterns are currently pulled into `drop`, and how should the drop heuristic be relaxed?","RQ-9: What exact code is missing to wire Tier3 into `memory-save.ts`, and what latency or cost envelope does that imply?","RQ-11: Which routing categories and edge cases lack meaningful regression coverage today?"],"ruledOut":["Continuing the research loop instead of handing the packet back to implementation"],"focusTrack":"synthesis","toolsUsed":["Read","Grep","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:345",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008"],"timestamp":"2026-04-13T10:43:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:34:{"type":"iteration","run":28,"status":"complete","focus":"Tier 3 always-on runtime trace","findingsCount":5,"newInfoRatio":0.35,"noveltyJustification":"The code trace added new runtime certainty about where Tier 3 is now injected and how the live path degrades to Tier 2 or refusal.","keyQuestions":["RQ-13: Does the always-on Tier3 save path now route end to end with correct fail-open behavior?"],"answeredQuestions":[],"ruledOut":["Assuming that always-on Tier3 makes every canonical save network-dependent"],"focusTrack":"tier3-runtime","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:711",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:553"],"timestamp":"2026-04-13T11:12:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:35:{"type":"iteration","run":29,"status":"complete","focus":"Tier 3 prompt-body and fail-open verification","findingsCount":5,"newInfoRatio":0.31,"noveltyJustification":"The targeted test run converted the runtime trace into verified prompt-body, packet-kind, save-mode, and fail-open behavior evidence.","keyQuestions":["RQ-13: Does the always-on Tier3 save path now route end to end with correct fail-open behavior?"],"answeredQuestions":["RQ-13: Does the always-on Tier3 save path now route end to end with correct fail-open behavior?"],"ruledOut":["Treating the routing-only Tier3 tests as redundant now that the handler wiring exists in code"],"focusTrack":"tier3-verification","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:76",".opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:503",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1239","targeted routing-only vitest run"],"timestamp":"2026-04-13T11:20:00Z","durationMs":420000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:36:{"type":"iteration","run":30,"status":"complete","focus":"save.md and SKILL.md parity audit","findingsCount":5,"newInfoRatio":0.29,"noveltyJustification":"This pass added new doc-to-code parity evidence across the two primary operator-facing routing surfaces.","keyQuestions":["RQ-14: Do `save.md`, `SKILL.md`, and `save_workflow.md` match the shipped router behavior line by line?"],"answeredQuestions":[],"ruledOut":["Treating the packet as still documentation-drifted just because the earlier research was written before implementation landed"],"focusTrack":"doc-parity","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/commands/memory/save.md:76",".opencode/skills/system-spec-kit/SKILL.md:549",".opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:384",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:858"],"timestamp":"2026-04-13T11:28:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:37:{"type":"iteration","run":31,"status":"complete","focus":"save_workflow.md parity and endpoint wording nuance","findingsCount":5,"newInfoRatio":0.24,"noveltyJustification":"The workflow-doc pass added one small wording nuance about endpoint availability while confirming functional parity across the full canonical doc surface.","keyQuestions":["RQ-14: Do `save.md`, `SKILL.md`, and `save_workflow.md` match the shipped router behavior line by line?"],"answeredQuestions":["RQ-14: Do `save.md`, `SKILL.md`, and `save_workflow.md` match the shipped router behavior line by line?"],"ruledOut":["Treating the endpoint-availability wording nuance as a substantive documentation mismatch"],"focusTrack":"doc-parity","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/references/memory/save_workflow.md:302",".opencode/skills/system-spec-kit/ARCHITECTURE.md:135",".opencode/commands/memory/save.md:93",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:899"],"timestamp":"2026-04-13T11:36:00Z","durationMs":330000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:40:{"type":"iteration","run":34,"status":"complete","focus":"Residual-gap synthesis after implementation","findingsCount":5,"newInfoRatio":0.19,"noveltyJustification":"This iteration added a new residual-gap map showing that the remaining scope shifted away from the original packet seams into short-form research, metadata, and telemetry overlap.","keyQuestions":["RQ-16: What is the smallest follow-on work that would make the abbreviated-fragment story credibly exceed 95%?"],"answeredQuestions":[],"ruledOut":["Reopening the delivery/progress or handover/drop remediation plan as the primary next step after the implemented fixes removed those seams from the preserved replay"],"focusTrack":"synthesis","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:15",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:191",".opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:333","packet-local preserved-subset replay over dist/lib/routing/content-router.js"],"timestamp":"2026-04-13T12:00:00Z","durationMs":330000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/deep-research-state.jsonl:45:{"type":"iteration","run":37,"status":"complete","focus":"Metadata-only identity verification","findingsCount":3,"newInfoRatio":0.04,"noveltyJustification":"Identity and handler checks confirmed the expected write-target fix shape without changing the research frontier or benchmark behavior.","keyQuestions":["RQ-17: Did the metadata_only target fix or doc cleanup change preserved-subset routing accuracy, and are any new router edge cases left after the post-fix verification sweep?"],"answeredQuestions":[],"ruledOut":["Treating F7 as a hidden fix for the research_finding versus metadata_only classification seam"],"focusTrack":"post-fix-identity","toolsUsed":["Read","Bash"],"sourcesQueried":[".opencode/skills/system-spec-kit/mcp_server/handlers/save/create-record.ts:111",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1055",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1200"],"timestamp":"2026-04-13T12:28:00Z","durationMs":210000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:4:Separate the exact handover language that should stay routable from the specific drop cues that are currently too strong.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:7:1. The direct heuristic collision is narrow and explicit: `RULE_CUES.drop` and the hard drop floor both include `git diff`, while the handover prototypes `HS-01` and `HS-03` both use `git diff` as part of next-session instructions. That makes `git diff` the clearest phrase that is simultaneously valid handover language and a current hard drop signal. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:138] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:154]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:9:3. The live handover floor is too small for the state-first language already present in the prototypes. Today it only boosts `recent action`, `next safe action`, `current state`, and `resume`, but the strongest handover-specific phrases are `active files`, `current blockers`, `remaining effort`, `immediate next session work`, and `fresh session before closure`. Those phrases appear in `HS-02`, `HS-03`, and `HS-05` and should be part of the handover floor. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:868] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:146] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:170]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:13:   - expand the handover floor with `/\b(active files?|current blockers?|remaining effort|immediate next session work|fresh session|restart (?:the )?mcp server)\b/`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:14:   This keeps transcript-like boilerplate hard-dropped while letting state-heavy handover notes survive ordinary operator commands. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [INFERENCE: derived from the current heuristic split and the prototype wording]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:17:- Removing all command language from handover guidance. Real handover notes legitimately contain commands; the fix is to demote the soft ones, not ban them.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-022.md:34:- What worked and why: Matching individual handover prototype sentences against the live drop regex separated the hard heuristic problem from the softer Tier 2 overlap.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-strategy.md:95:- A current metadata-only host-selection regression in the promoted runtime. Ruled out by the live host resolver and targeted regression. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-strategy.md:146:| `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts` | D1, D3 | 13 | 0 P0, 1 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-strategy.md:147:| `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts` | D1, D3 | 13 | 0 P0, 1 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-002.md:7:1. Tier1 heuristic scoring is cue-driven and asymmetric: each cue regex adds `0.18`, but some categories also receive floor boosts, such as `narrative_progress` at `0.72`, `narrative_delivery` at `0.74`, `decision` at `0.76`, `task_update` at `0.90`, `handover_state` at `0.84`, `research_finding` at `0.80`, `metadata_only` at `0.93`, and `drop` at `0.92`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:340] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:842]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-002.md:8:2. Target selection is deterministic by category: progress and delivery append paragraphs to `implementation-summary.md`, research and handover append sections, tasks update a phase anchor, metadata writes `_memory.continuity`, and `decision` switches between ADR insertion on `L3/L3+` and in-place summary updates on `L1/L2`. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:918] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/content-router.vitest.ts:92]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-002.md:35:Inspect the Tier3 prompt contract, Tier3 cache conditions, and the memory-save integration path to determine whether the LLM tier is actually active in the canonical save flow.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:48:- Reading the live router/save code beside the now-current `handler-memory-save.vitest.ts` prompt-body assertions separated already-fixed phase-003 issues from genuinely open regressions.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:59:- The earlier phase-003 `packet_kind` / `save_mode` prompt regressions are still live: ruled out by `memory-save.ts:1206-1230` plus `handler-memory-save.vitest.ts:1288-1290`, `1342-1344`, and `1396-1398`.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:69:- The parent packet is a research root (`type: research`) and the child phases split along delivery/progress, handover/drop, Tier-3 wiring, and doc-surface alignment.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:90:| `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts` | D1, D3, D4 | 10 | 1 P1 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:93:| `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts` | D1, D3, D4 | 7 | 0 P0, 0 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:94:| `.opencode/commands/memory/save.md` | D3, D4 | 5 | 1 P1 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:95:| `.opencode/skills/system-spec-kit/references/memory/save_workflow.md` | D1, D3, D4 | 5 | 1 P1 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:97:| `.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md` | D3, D4 | 6 | 1 P1, 1 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/deep-review-strategy.md:100:| `002/.../002-fix-handover-drop-confusion` | D3 | 8 | 1 P1 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-025.md:8:2. Phase `002-fix-handover-drop-confusion` also has a concrete patch shape: keep transcript wrappers and boilerplate hard-dropped, move `git diff`, `list memories`, and `force re-index` into a softer operational branch, expand the handover floor with `active files`, `current blockers`, `remaining effort`, `immediate next session work`, `fresh session`, and restart language, then refresh the handover prototypes so `HS-01`, `HS-03`, and `HS-04` lead with state before commands. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:877] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/routing-prototypes.json:138]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-025.md:9:3. Phase `003-wire-tier3-llm-classifier` is best described as a small integration slice, not a large architecture change: add an OpenAI-compatible adapter around `buildTier3Prompt()`, add a `RouterCache` implementation, inject both at `memory-save.ts:1008`, and test the natural save path with success, cache-hit, null-response, and timeout cases. The realistic production diff is about `90-130` LOC plus `70-100` LOC of tests. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1128] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:556]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-025.md:22:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1008`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-012.md:35:Trace the exact handover and drop patterns that collide in the heuristic layer, because the same kind of cue-level asymmetry may be driving the second confusion pair.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-006.md:8:2. The second worst confusion is `handover_state -> drop`, also with four cases. The handover prototypes that mention `git diff`, verification commands, or command-style restart recipes are vulnerable because the `drop` cue table explicitly includes `git diff`, raw tool language, and recovery scaffolding. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:369] [INFERENCE: live corpus examples `HS-01` and `HS-03` from dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-006.md:10:4. One `research_finding` sample was classified as `metadata_only` because it discussed overlap in metadata and continuity terms, showing that `_memory.continuity` vocabulary can overpower research intent when the chunk is framed as findings about metadata. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:365] [INFERENCE: live corpus example `RF-03` from dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-006.md:11:5. Short handover fragments such as "Continuation attempt one" do not fail because of phase-anchor logic; they fail because the abbreviated text loses resume-state detail and becomes semantically close to sparse task or generic wrapper language. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/routing/content-router.ts:1011] [INFERENCE: live corpus examples `HS-01-s1` and `HS-01-compact` from dist/lib/routing/content-router.js]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-006.md:14:- Blaming delivery and handover failures on Tier2. In the key examples, Tier2 preferred the expected class but never got a chance because Tier1 accepted early or `drop` cues dominated.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-006.md:17:- Treating phase-anchor inference as the main handover failure driver.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-006.md:32:- What did not work and why: Category-level averages were too coarse to explain why handover and delivery underperform.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-016.md:9:3. The biggest operational risk is latency, not token volume. `memory-save.ts` feeds Tier3 the normalized routed chunk text after frontmatter/comment stripping, but it does not cap chunk length before routing. In typical prototype-sized content the prompt is modest, yet unusually long canonical save bodies could still push the request toward the 2-second deadline. [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1009] [INFERENCE: prototype corpus averages roughly 45 words per chunk, but live save chunks are not hard-capped]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/iteration-016.md:21:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:806`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/description.json:22:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/research/002-content-routing-accuracy-research/iterations/description.json:23:  "memoryNameHistory": [],
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/deep-review-strategy.md:70:### Live metadata-only host-selection regression in the promoted 002 runtime: ruled out by the current handler and focused regression coverage. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157`] -- BLOCKED (iteration 11, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/deep-review-strategy.md:135:| `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts` | D1, D3 | 17 | 0 P0, 0 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/deep-review-strategy.md:136:| `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts` | D1 | 17 | 0 P0, 0 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/review-report.md:17:- File: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/review-report.md:18:- Evidence: `resolveMetadataHostDocPath()` prefers the current non-memory document when `spec-frontmatter` is targeted, but the canonical continuity contract says the primary `_memory.continuity` block lives in `implementation-summary.md` and the resume ladder reads that file first. Because `handleMemorySave()` accepts spec docs as direct inputs, a routed `metadata_only` save on `spec.md` or `tasks.md` can update continuity on a document the recovery ladder does not treat as canonical.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/review-report.md:19:- Recommendation: Always target `implementation-summary.md` for `spec-frontmatter` when that file exists, and add a focused regression that saves metadata-only content through a non-memory spec doc input.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/review-report.md:22:- File: `.opencode/commands/memory/save.md:93`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/011-search-routing-late-findings-review/review-report.md:28:- Evidence: `001`, `002`, and `003` mark their task lists complete and record `completion_pct: 100`, but rerunning `bash .opencode/skills/system-spec-kit/scripts/spec/validate.sh <phase> --strict` on 2026-04-13 fails all three phases with the same structural problems: missing required anchors, missing `_memory` frontmatter blocks, missing template-source headers, and missing Level-2 template headers. That means the packet docs are not actually verified to the standard their closeout artifacts imply.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/review-report.md:26:- **R010-F002 [P1 | traceability]** Promoted child root review artifacts still preserve pre-promotion 017 / 018 / 019 verdicts even though the live runtime no longer matches those old claims. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/001-search-fusion-tuning/review/review-report.md:11] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/review-report.md:12] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1054] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/003-graph-metadata-validation/review/deep-review-dashboard.md:18]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/review-report.md:99:- `nl -ba .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts | sed -n '1042,1065p'`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/review-report.md:100:- `nl -ba .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts | sed -n '1140,1185p'`
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/deep-review-findings-registry.json:20:      "description": "The promoted packet's live launch prompt still invokes `--spec-folder=.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/003-continuity-refactor-gates/002-content-routing-accuracy`, so rerunning the prompt from `010-search-and-routing-tuning` targets the retired 006 lineage instead of the promoted 010 tree. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/prompts/deep-research-prompt.md:8] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/spec.md:6]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/deep-review-findings-registry.json:40:      "description": "The promoted root review outputs were not regenerated after the packets moved under `010-search-and-routing-tuning`: `001` still claims Stage 3 ignores `adaptiveFusionIntent`, `002` still claims metadata-only host selection is broken, and `003` still surfaces the old `019` FAIL lineage even though current configs point at 010 paths and the live runtime/docs show those specific remediations landed. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/001-search-fusion-tuning/review/review-report.md:11] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/review-report.md:12] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/003-graph-metadata-validation/review/deep-review-dashboard.md:18] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/deep-review-config.json:22] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/003-graph-metadata-validation/implementation-summary.md:10]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/description.json:21:  "memorySequence": 0,
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/description.json:22:  "memoryNameHistory": []
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/review-report.md:25:- **F002 [P1 | traceability]** Promoted root deep-review artifacts were not regenerated after migration and still preserve pre-promotion 017/018/019 verdicts. Evidence: [`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/001-search-fusion-tuning/review/review-report.md:11`], [`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/review-report.md:12`], [`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/003-graph-metadata-validation/review/deep-review-dashboard.md:18`], [`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/deep-review-config.json:22`], [`.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`], [`.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1157`], [`.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/003-graph-metadata-validation/implementation-summary.md:10`].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-state.jsonl:6:{"type":"iteration","mode":"review","run":5,"status":"complete","focus":"Replay the promoted 002 root review report against the current metadata-only routing contract","dimensions":["traceability"],"filesReviewed":[".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/review/review-report.md",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts"],"sessionId":"2026-04-13T16:59:27Z-010-continuity-research-root-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":3,"findingsSummary":{"P0":0,"P1":3,"P2":0},"findingsNew":{"P0":0,"P1":0,"P2":0},"newFindingsRatio":0.0,"noveltyJustification":"The pass was used to test whether the carried-forward 018 finding still reflects the live handler and regression suite.","ruledOut":["The promoted 002 root review report as trustworthy evidence for a current metadata-only routing defect."],"timestamp":"2026-04-13T17:27:00Z","durationMs":360000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/deep-review-state.jsonl:14:{"type":"iteration","mode":"review","run":13,"status":"complete","focus":"Re-check the live metadata-only routing implementation and regression suite for promoted-packet contradictions","dimensions":["correctness"],"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/010-continuity-research/002-content-routing-accuracy/review/review-report.md"],"sessionId":"2026-04-13T16:59:27Z-010-continuity-research-root-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":5,"findingsSummary":{"P0":0,"P1":5,"P2":0},"findingsNew":{"P0":0,"P1":0,"P2":0},"newFindingsRatio":0.0,"noveltyJustification":"The live code and regression still rule out the old 002 runtime bug, so the promoted artifact drift remains the real issue.","ruledOut":["An unresolved metadata-only host-selection correctness bug in the shipped runtime."],"timestamp":"2026-04-13T18:13:00Z","durationMs":300000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/012-search-routing-final-review/deep-review-state.jsonl:6:{"type":"iteration","mode":"review","run":5,"status":"complete","focus":"doc accuracy - operator-facing graph metadata contract surfaces","dimensions":["traceability","maintainability"],"filesReviewed":["AGENTS.md","CLAUDE.md",".opencode/skills/system-spec-kit/SKILL.md",".opencode/commands/memory/save.md",".opencode/commands/memory/manage.md",".opencode/skills/system-spec-kit/templates/handover.md",".opencode/skills/system-spec-kit/templates/debug-delegation.md"],"sessionId":"2026-04-13T11:30:00Z-003-root-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":3,"findingsSummary":{"P0":0,"P1":1,"P2":2},"findingsNew":{"P0":0,"P1":0,"P2":0},"newFindingsRatio":0,"noveltyJustification":"The requested doc surfaces are aligned with the shipped parser and backfill contract, so this pass added only ruled-out evidence.","ruledOut":["repo-level doc drift in AGENTS, CLAUDE, SKILL, save, manage, and templates"],"timestamp":"2026-04-13T12:04:00Z","durationMs":43000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/iterations/iteration-011.md:15:- A live metadata-only host-selection regression still exists in the promoted runtime. `resolveMetadataHostDocPath()` now prefers `implementation-summary.md`, and the handler regression proves a `metadata_only` save starting from `tasks.md` lands on `_memory.continuity` in the implementation summary.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-prompts/deep-research-prompt.md:24:- `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts` - router integration with save handler
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-findings-registry.json:20:      "description": "`handleMemorySearch()` maps `profile === 'resume'` to `adaptiveFusionIntent = 'continuity'`, and Stage 1 forwards that internal intent into hybrid search, but Stage 3 still selects its lambda from `config.detectedIntent`. Because `SPECKIT_MMR` defaults to enabled, resume-oriented searches can lose the continuity profile in the final ordering step. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage1-candidate-gen.ts:538`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/intent-classifier.ts:641`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/search-flags.ts:69`]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-findings-registry.json:38:      "file": ".opencode/commands/memory/search.md",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-findings-registry.json:40:      "description": "the command contract, architecture doc, config README, repo README, and feature-catalog summaries now all say the final Stage 3 MMR pass uses continuity lambda `0.65`, but Stage 3 still selects lambda from `config.detectedIntent` rather than the internal continuity handoff used earlier in the pipeline. [SOURCE: `.opencode/commands/memory/search.md:102`] [SOURCE: `.opencode/skills/system-spec-kit/ARCHITECTURE.md:150`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/configs/README.md:49`] [SOURCE: `README.md:393`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-findings-registry.json:120:      "description": "the Codex mirror still tells the agent to do generic \"MEMORY FIRST\" retrieval plus glob/grep/read, while the canonical Claude/Gemini context agents now recover prior work via `handover.md -> _memory.continuity -> spec docs` and call `code_graph_status()` before structural exploration. [SOURCE: `.claude/agents/context.md:29`] [SOURCE: `.claude/agents/context.md:48`] [SOURCE: `.gemini/agents/context.md:29`] [SOURCE: `.gemini/agents/context.md:48`] [SOURCE: `.codex/agents/context.toml:30`] [SOURCE: `.codex/agents/context.toml:31`] [SOURCE: `.codex/agents/context.toml:36`]",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:102:### Looking for a catalog entry that limited continuity to Stage 1 or Stage 2 did not turn up any exception; the main catalog and retrieval entries repeat the same Stage 3 continuity-lambda language. [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/feature_catalog.md:147`] [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md:22`] -- BLOCKED (iteration 4, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:103:- What was tried: Looking for a catalog entry that limited continuity to Stage 1 or Stage 2 did not turn up any exception; the main catalog and retrieval entries repeat the same Stage 3 continuity-lambda language. [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/feature_catalog.md:147`] [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md:22`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:105:- Do NOT retry: Looking for a catalog entry that limited continuity to Stage 1 or Stage 2 did not turn up any exception; the main catalog and retrieval entries repeat the same Stage 3 continuity-lambda language. [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/feature_catalog.md:147`] [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md:22`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:107:### Looking for a compensating repo doc that explicitly corrected the Stage 3 continuity claim did not surface any such note; the same claim is repeated across the updated surfaces instead. [SOURCE: `.opencode/commands/memory/search.md:103`] -- BLOCKED (iteration 3, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:108:- What was tried: Looking for a compensating repo doc that explicitly corrected the Stage 3 continuity claim did not surface any such note; the same claim is repeated across the updated surfaces instead. [SOURCE: `.opencode/commands/memory/search.md:103`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:110:- Do NOT retry: Looking for a compensating repo doc that explicitly corrected the Stage 3 continuity claim did not surface any such note; the same claim is repeated across the updated surfaces instead. [SOURCE: `.opencode/commands/memory/search.md:103`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:122:### Looking for an additional runtime defect in the telemetry, save-routing, or config surfaces did not produce a seventh finding; the active risk cluster remains centered on continuity traceability and Codex mirror parity. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`] -- BLOCKED (iteration 9, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:123:- What was tried: Looking for an additional runtime defect in the telemetry, save-routing, or config surfaces did not produce a seventh finding; the active risk cluster remains centered on continuity traceability and Codex mirror parity. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:125:- Do NOT retry: Looking for an additional runtime defect in the telemetry, save-routing, or config surfaces did not produce a seventh finding; the active risk cluster remains centered on continuity traceability and Codex mirror parity. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:177:### Tier 3 feature-flag residue in the live stack: the save handler now wires Tier 3 routing unconditionally, and the active configs describe it as always on with fail-open Tier 2 fallback. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`] [SOURCE: `.mcp.json:24`] -- BLOCKED (iteration 2, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:178:- What was tried: Tier 3 feature-flag residue in the live stack: the save handler now wires Tier 3 routing unconditionally, and the active configs describe it as always on with fail-open Tier 2 fallback. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`] [SOURCE: `.mcp.json:24`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:180:- Do NOT retry: Tier 3 feature-flag residue in the live stack: the save handler now wires Tier 3 routing unconditionally, and the active configs describe it as always on with fail-open Tier 2 fallback. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`] [SOURCE: `.mcp.json:24`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:182:### Treating the Codex context mirror as "memory first but equivalent enough" does not hold up once the missing `handover.md` / `_memory.continuity` / graph-health ordering is compared directly to the canonical workflow. [SOURCE: `.codex/agents/context.toml:30`] [SOURCE: `.claude/agents/context.md:48`] -- BLOCKED (iteration 8, 1 attempts)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:183:- What was tried: Treating the Codex context mirror as "memory first but equivalent enough" does not hold up once the missing `handover.md` / `_memory.continuity` / graph-health ordering is compared directly to the canonical workflow. [SOURCE: `.codex/agents/context.toml:30`] [SOURCE: `.claude/agents/context.md:48`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:185:- Do NOT retry: Treating the Codex context mirror as "memory first but equivalent enough" does not hold up once the missing `handover.md` / `_memory.continuity` / graph-health ordering is compared directly to the canonical workflow. [SOURCE: `.codex/agents/context.toml:30`] [SOURCE: `.claude/agents/context.md:48`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:196:- Live Tier 3 save-routing flag drift: the active save handler and five live MCP configs no longer rely on `SPECKIT_TIER3_ROUTING`. (iteration 2, evidence: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:233:| `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts` | D1, D3 | 1 | 0 P0, 1 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:234:| `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts` | D1, D2 | 2 | 0 P0, 0 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:235:| `.opencode/commands/memory/search.md` | D3, D4 | 3 | 0 P0, 1 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-strategy.md:241:| `.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md` | D3, D4 | 4 | 0 P0, 1 P1, 0 P2 | complete |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/012-search-routing-final-review/iterations/iteration-005.md:4:Read `AGENTS.md`, `CLAUDE.md`, `SKILL.md`, `save.md`, `manage.md`, and the handover/debug templates against the shipped parser and backfill behavior.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-004.md:18:- Looking for a catalog entry that limited continuity to Stage 1 or Stage 2 did not turn up any exception; the main catalog and retrieval entries repeat the same Stage 3 continuity-lambda language. [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/feature_catalog.md:147`] [SOURCE: `.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md:22`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/002-content-routing-accuracy-research/archive-invalid-2026-04-13T16-59-27Z/iterations/iteration-002.md:11:- **F001**: The live deep-research prompt for `002-content-routing-accuracy` still dispatches against the retired 006 path — `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/prompts/deep-research-prompt.md:8` — The packet-local invocation still uses `--spec-folder=.opencode/specs/system-spec-kit/026-graph-and-context-optimization/002-continuity-memory-runtime/003-continuity-refactor-gates/002-content-routing-accuracy`, even though the promoted root packet now lives under `010-search-and-routing-tuning`. Re-running the prompt from the current tree would therefore open the wrong research folder. [SOURCE: `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/prompts/deep-research-prompt.md:8`] [SOURCE: `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/spec.md:6`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/review-report.md:23:- **F001 [P1 | correctness]** Stage 3 MMR ignores the internal continuity handoff. Evidence: [`.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830`], [`.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage1-candidate-gen.ts:538`], [`.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`], [`.opencode/skills/system-spec-kit/mcp_server/lib/search/intent-classifier.ts:641`], [`.opencode/skills/system-spec-kit/mcp_server/lib/search/search-flags.ts:69`].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/review-report.md:24:- **F002 [P1 | traceability]** Repo-level search docs now describe a continuity-aware Stage 3 lambda that the runtime does not execute. Evidence: [`.opencode/commands/memory/search.md:102`], [`.opencode/skills/system-spec-kit/ARCHITECTURE.md:150`], [`.opencode/skills/system-spec-kit/mcp_server/configs/README.md:49`], [`README.md:393`], [`.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`].
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/review-report.md:52:4. Normalize `.codex/agents/context.toml` to the canonical `handover.md -> _memory.continuity -> spec docs` recovery ladder plus `code_graph_status()` preflight.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/review-report.md:70:- No new security-sensitive regressions were found in `memory-save.ts`, the live MCP configs, or the reranker telemetry path during this review.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/iterations/iteration-004.md:8:- **F004**: Root packet docs drift from the active Level-3 template contract badly enough to break tooling - `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/validation-strict.txt:34` - The root `spec.md`, `plan.md`, `tasks.md`, and `checklist.md` all miss required anchors, `_memory` blocks, and template headers, so structured retrieval, validator guidance, and maintenance automation no longer have the packet shape they expect. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/validation-strict.txt:34-71] [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/review/validation-strict.txt:134-182] [SOURCE: AGENTS.md:260-269]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/iterations/iteration-006.md:8:- **F005**: Parent packet does not preserve a recoverable security-boundary decision record - `.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/plan.md:15` - Re-reading the shipped handler and targeted tests supports the packet-level conclusion: the reviewed implementation evidence is present, but the parent packet still fails to preserve a recoverable security decision surface for that boundary. [SOURCE: .opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-search-routing-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/plan.md:15-17] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1144-1150] [SOURCE: .opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts:1319-1402]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-002.md:17:- Tier 3 feature-flag residue in the live stack: the save handler now wires Tier 3 routing unconditionally, and the active configs describe it as always on with fail-open Tier 2 fallback. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`] [SOURCE: `.mcp.json:24`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-state.jsonl:2:{"type":"iteration","mode":"review","run":1,"status":"complete","focus":"correctness audit of the continuity handoff into the default Stage 3 MMR path","dimensions":["correctness"],"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage1-candidate-gen.ts",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts",".opencode/skills/system-spec-kit/mcp_server/lib/search/intent-classifier.ts",".opencode/skills/system-spec-kit/shared/algorithms/adaptive-fusion.ts",".opencode/skills/system-spec-kit/mcp_server/lib/search/search-flags.ts"],"sessionId":"2026-04-13T11:05:00Z-001-search-fusion-tuning-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":1,"findingsSummary":{"P0":0,"P1":1,"P2":0},"findingsNew":{"P0":0,"P1":1,"P2":0},"newFindingsRatio":0.55,"findingRefs":["F001"],"timestamp":"2026-04-13T11:18:00Z","durationMs":54000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-state.jsonl:4:{"type":"iteration","mode":"review","run":2,"status":"complete","focus":"correctness and security sweep of telemetry, rerank minimum, save routing, and live config flags","dimensions":["correctness","security"],"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/lib/search/cross-encoder.ts",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".mcp.json",".claude/mcp.json",".vscode/mcp.json",".gemini/settings.json","opencode.json"],"sessionId":"2026-04-13T11:05:00Z-001-search-fusion-tuning-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":1,"findingsSummary":{"P0":0,"P1":1,"P2":0},"findingsNew":{"P0":0,"P1":0,"P2":0},"newFindingsRatio":0.0,"findingRefs":["F001"],"timestamp":"2026-04-13T11:31:00Z","durationMs":46000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-state.jsonl:5:{"type":"iteration","mode":"review","run":3,"status":"complete","focus":"traceability audit of requested search docs versus the live Stage 3 continuity branch","dimensions":["traceability","maintainability"],"filesReviewed":[".opencode/commands/memory/search.md",".opencode/skills/system-spec-kit/ARCHITECTURE.md",".opencode/skills/system-spec-kit/mcp_server/configs/README.md","README.md",".opencode/skills/system-spec-kit/SKILL.md",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts"],"sessionId":"2026-04-13T11:05:00Z-001-search-fusion-tuning-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":2,"findingsSummary":{"P0":0,"P1":2,"P2":0},"findingsNew":{"P0":0,"P1":1,"P2":0},"newFindingsRatio":0.42,"findingRefs":["F001","F002"],"timestamp":"2026-04-13T11:46:00Z","durationMs":51000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/deep-review-state.jsonl:7:{"type":"iteration","mode":"review","run":4,"status":"complete","focus":"traceability follow-up across feature catalog retrieval docs and supporting summaries","dimensions":["traceability"],"filesReviewed":[".opencode/skills/system-spec-kit/feature_catalog/feature_catalog.md",".opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md",".opencode/skills/system-spec-kit/feature_catalog/01--retrieval/05-4-stage-pipeline-architecture.md",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts"],"sessionId":"2026-04-13T11:05:00Z-001-search-fusion-tuning-review","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":2,"findingsSummary":{"P0":0,"P1":2,"P2":0},"findingsNew":{"P0":0,"P1":0,"P2":0},"newFindingsRatio":0.0,"findingRefs":["F002"],"timestamp":"2026-04-13T11:58:00Z","durationMs":33000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-001.md:4:Trace the shipped continuity profile from `memory-search.ts` into the live ranking pipeline and verify whether the final Stage 3 ordering still honors it under the default MMR-enabled runtime.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-001.md:11:- **F001**: Stage 3 MMR ignores the internal continuity handoff — `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209` — `handleMemorySearch()` maps `profile === 'resume'` to `adaptiveFusionIntent = 'continuity'`, and Stage 1 forwards that internal intent into hybrid search, but Stage 3 still selects its lambda from `config.detectedIntent`. Because `SPECKIT_MMR` defaults to enabled, resume-oriented searches can lose the continuity profile in the final ordering step. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage1-candidate-gen.ts:538`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/intent-classifier.ts:641`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/search-flags.ts:69`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-001.md:14:{"type":"claim-adjudication","findingId":"F001","claim":"The shipped continuity profile is only partially wired because the default Stage 3 MMR pass still ignores adaptiveFusionIntent and falls back to detectedIntent/default lambda selection.","evidenceRefs":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:830",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage1-candidate-gen.ts:538",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209",".opencode/skills/system-spec-kit/mcp_server/lib/search/intent-classifier.ts:641",".opencode/skills/system-spec-kit/mcp_server/lib/search/search-flags.ts:69"],"counterevidenceSought":"Read the handler wiring, Stage 1 handoff, Stage 3 MMR branch, lambda map, and default MMR flag looking for a continuity-aware override or disabled default path; none exists.","alternativeExplanation":"Continuity could have been intended as a Stage 2-only profile, but the phase docs and implementation summary both claim the Stage 3 lambda landed, so the partial handoff is still a real runtime mismatch.","finalSeverity":"P1","confidence":0.93,"downgradeTrigger":"Downgrade if Stage 3 is updated to read adaptiveFusionIntent (or an equivalent continuity-aware override) and a regression test proves resume-profile ordering stays continuity-aware through MMR.","transitions":[{"iteration":1,"from":null,"to":"P1","reason":"Initial discovery"}]}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-009.md:20:- Looking for an additional runtime defect in the telemetry, save-routing, or config surfaces did not produce a seventh finding; the active risk cluster remains centered on continuity traceability and Codex mirror parity. [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1005`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/deep-review-state.jsonl:12:{"type":"iteration","mode":"review","run":6,"status":"insight","focus":"Security recheck for escalation risk versus documentation risk","dimensions":["security"],"filesReviewed":[".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts",".opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/plan.md"],"sessionId":"rvw-2026-04-21-content-routing-accuracy","parentSessionId":null,"lineageMode":"new","generation":1,"continuedFromRun":null,"findingsCount":5,"findingsSummary":{"P0":0,"P1":5,"P2":0},"findingsNew":{"P0":0,"P1":0,"P2":0},"findingsRefined":["F005"],"newFindingsRatio":0.08,"findingRefs":["F005"],"traceabilityChecks":["spec_code"],"coverage":{"reviewed":4,"total":4},"convergenceSignals":{"rollingAvg":0.18,"madScore":0.12,"dimensionCoverage":1.0,"compositeStop":0.45},"timestamp":"2026-04-21T17:34:00Z","durationMs":33000}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-008.md:11:- **F006**: `.codex/agents/context.toml` omits the canonical continuity recovery ladder and code-graph health probe — `.codex/agents/context.toml:30` — the Codex mirror still tells the agent to do generic "MEMORY FIRST" retrieval plus glob/grep/read, while the canonical Claude/Gemini context agents now recover prior work via `handover.md -> _memory.continuity -> spec docs` and call `code_graph_status()` before structural exploration. [SOURCE: `.claude/agents/context.md:29`] [SOURCE: `.claude/agents/context.md:48`] [SOURCE: `.gemini/agents/context.md:29`] [SOURCE: `.gemini/agents/context.md:48`] [SOURCE: `.codex/agents/context.toml:30`] [SOURCE: `.codex/agents/context.toml:31`] [SOURCE: `.codex/agents/context.toml:36`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-008.md:14:{"type":"claim-adjudication","findingId":"F006","claim":"The Codex context mirror is stale because it omits the current continuity-first recovery ladder and graph-health preflight required by the canonical context agent workflow.","evidenceRefs":[".claude/agents/context.md:29",".claude/agents/context.md:48",".gemini/agents/context.md:29",".gemini/agents/context.md:48",".codex/agents/context.toml:30",".codex/agents/context.toml:31",".codex/agents/context.toml:36"],"counterevidenceSought":"Compared the Codex context workflow against the canonical Claude/Gemini recovery steps looking for equivalent continuity-ladder or graph-health instructions; the Codex mirror still uses the older generic memory-first scan order.","alternativeExplanation":"The Codex mirror could have intended a condensed summary, but dropping the continuity ladder and graph-health step changes actual recovery behavior for the canonical resume path, so the drift is operational rather than stylistic.","finalSeverity":"P1","confidence":0.9,"downgradeTrigger":"Downgrade if the Codex context mirror is updated to include the canonical `handover.md -> _memory.continuity -> spec docs` ladder and `code_graph_status()` preflight, or if the canonical workflow is intentionally rolled back everywhere else.","transitions":[{"iteration":8,"from":null,"to":"P1","reason":"Initial discovery"}]}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-008.md:23:- Treating the Codex context mirror as "memory first but equivalent enough" does not hold up once the missing `handover.md` / `_memory.continuity` / graph-health ordering is compared directly to the canonical workflow. [SOURCE: `.codex/agents/context.toml:30`] [SOURCE: `.claude/agents/context.md:48`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/review-report.md:35:| `.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts` | Verified the cited `metadata_only` behavior |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/review-report.md:36:| `.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts` | Verified the cited handler regression coverage |
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/review-report.md:98:4. Normalize the root docs onto the current Level-3 templates with anchors, `_memory` blocks, and template headers so retrieval and validator tooling can trust the packet again.
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-003.md:11:- **F002**: Search docs claim a continuity-aware Stage 3 lambda that the runtime still does not execute — `.opencode/commands/memory/search.md:102` — the command contract, architecture doc, config README, repo README, and feature-catalog summaries now all say the final Stage 3 MMR pass uses continuity lambda `0.65`, but Stage 3 still selects lambda from `config.detectedIntent` rather than the internal continuity handoff used earlier in the pipeline. [SOURCE: `.opencode/commands/memory/search.md:102`] [SOURCE: `.opencode/skills/system-spec-kit/ARCHITECTURE.md:150`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/configs/README.md:49`] [SOURCE: `README.md:393`] [SOURCE: `.opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-003.md:14:{"type":"claim-adjudication","findingId":"F002","claim":"The updated search docs overstate current reality by documenting a continuity-aware Stage 3 MMR lambda that the live runtime still does not execute.","evidenceRefs":[".opencode/commands/memory/search.md:102",".opencode/skills/system-spec-kit/ARCHITECTURE.md:150",".opencode/skills/system-spec-kit/mcp_server/configs/README.md:49","README.md:393",".opencode/skills/system-spec-kit/mcp_server/lib/search/pipeline/stage3-rerank.ts:209"],"counterevidenceSought":"Read the named doc surfaces plus the live Stage 3 branch looking for wording that scoped continuity to Stage 2 only or a runtime override that made the docs true; neither exists.","alternativeExplanation":"The docs could have intended continuity lambda language as future-state guidance, but the packet is framed as doc alignment to shipped behavior, so presenting it as current reality is still inaccurate.","finalSeverity":"P1","confidence":0.91,"downgradeTrigger":"Downgrade if either the runtime Stage 3 handoff is fixed to match the docs or the docs are corrected to describe continuity as Stage 1/2-only until that fix lands.","transitions":[{"iteration":3,"from":null,"to":"P1","reason":"Initial discovery"}]}
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/003-graph-metadata-validation-research/iterations/iteration-003.md:23:- Looking for a compensating repo doc that explicitly corrected the Stage 3 continuity claim did not surface any such note; the same claim is repeated across the updated surfaces instead. [SOURCE: `.opencode/commands/memory/search.md:103`]
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/deep-review-findings-registry.json:81:      "description": "The root docs miss required anchors, `_memory` blocks, and template headers, which breaks structured retrieval and validator expectations.",
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:67:⚠ FRONTMATTER_MEMORY_BLOCK: 4 frontmatter_memory_block issue(s) found
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:68:    - SPECDOC_FRONTMATTER_002: spec.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:69:    - SPECDOC_FRONTMATTER_002: plan.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:70:    - SPECDOC_FRONTMATTER_002: tasks.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:71:    - SPECDOC_FRONTMATTER_002: checklist.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:80:    - 002-fix-handover-drop-confusion/spec.md missing predecessor reference (001-fix-delivery-progress-confusion)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:81:    - 003-wire-tier3-llm-classifier/spec.md missing predecessor reference (002-fix-handover-drop-confusion)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:85:    - 001-fix-delivery-progress-confusion/spec.md missing successor reference (002-fix-handover-drop-confusion)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:86:    - 002-fix-handover-drop-confusion/spec.md missing successor reference (003-wire-tier3-llm-classifier)
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:252:⚠ FRONTMATTER_MEMORY_BLOCK: 5 frontmatter_memory_block issue(s) found
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:253:    - SPECDOC_FRONTMATTER_002: spec.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:254:    - SPECDOC_FRONTMATTER_002: plan.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:255:    - SPECDOC_FRONTMATTER_002: tasks.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:256:    - SPECDOC_FRONTMATTER_002: checklist.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:257:    - SPECDOC_FRONTMATTER_002: decision-record.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:304:✓ SPEC_DOC_INTEGRITY: Spec doc references, metadata, and handover targets resolve cleanly
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:358:  Phase: 002-fix-handover-drop-confusion
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:374:    - P0:9: Router regression tests prove handover notes ar...
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:411:⚠ FRONTMATTER_MEMORY_BLOCK: 5 frontmatter_memory_block issue(s) found
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:412:    - SPECDOC_FRONTMATTER_002: spec.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:413:    - SPECDOC_FRONTMATTER_002: plan.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:414:    - SPECDOC_FRONTMATTER_002: tasks.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:415:    - SPECDOC_FRONTMATTER_002: checklist.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:416:    - SPECDOC_FRONTMATTER_002: decision-record.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:426:✓ FOLDER_NAMING: Folder name '002-fix-handover-drop-confusion' follows naming convention
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:463:✓ SPEC_DOC_INTEGRITY: Spec doc references, metadata, and handover targets resolve cleanly
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:515:    - ENOENT: no such file or directory, scandir '/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/002-content-routing-accuracy/002-fix-handover-drop-confusion/[0-9][0-9][0-9]-*'
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:570:⚠ FRONTMATTER_MEMORY_BLOCK: 5 frontmatter_memory_block issue(s) found
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:571:    - SPECDOC_FRONTMATTER_002: spec.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:572:    - SPECDOC_FRONTMATTER_002: plan.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:573:    - SPECDOC_FRONTMATTER_002: tasks.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:574:    - SPECDOC_FRONTMATTER_002: checklist.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:575:    - SPECDOC_FRONTMATTER_002: decision-record.md: missing _memory block
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:622:✓ SPEC_DOC_INTEGRITY: Spec doc references, metadata, and handover targets resolve cleanly
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:684:✓ FRONTMATTER_MEMORY_BLOCK: All spec-doc frontmatter memory blocks are structurally valid
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:726:✓ FRONTMATTER_MEMORY_BLOCK: All spec-doc frontmatter memory blocks are structurally valid
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:766:✓ SPEC_DOC_INTEGRITY: Spec doc references, metadata, and handover targets resolve cleanly
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:800:    - spec.md: Extra custom section header '## Scope <!-- ANCHOR:scope -->In scope: exact structured-line validation and loud user-facing rejections in `anchor-merge-operation.ts` and `memory-save.ts`. Out of scope: non-`task_update` merge modes and Tier 3 classifier redesign.<!-- /ANCHOR:scope -->' does not exist in the active template
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:811:    - plan.md: Extra custom section header '## Testing <!-- ANCHOR:testing -->Run `npx tsc --noEmit` plus `npx vitest run tests/handler-memory-save.vitest.ts tests/anchor-merge-operation.vitest.ts`.<!-- /ANCHOR:testing -->' does not exist in the active template
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:823:    - checklist.md: Extra custom section header '## Testing <!-- ANCHOR:testing -->- [x] `npx tsc --noEmit` plus `npx vitest run tests/anchor-merge-operation.vitest.ts` and `npx vitest run tests/handler-memory-save.vitest.ts -t "task updates"` pass.<!-- /ANCHOR:testing -->' does not exist in the active template
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:848:✓ FRONTMATTER_MEMORY_BLOCK: All spec-doc frontmatter memory blocks are structurally valid
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:888:✓ SPEC_DOC_INTEGRITY: Spec doc references, metadata, and handover targets resolve cleanly
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/validation-strict.txt:925:    - spec.md: Extra custom section header '## Risks <!-- ANCHOR:risks -->The new paragraph could accidentally contradict existing routing language or reintroduce older `_memory.continuity` targeting phrasing.<!-- /ANCHOR:risks -->' does not exist in the active template
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/review/006-content-routing-accuracy-review/deltas/iter-006.jsonl:1:{"type":"delta","iteration":6,"dimension":"security","newFindings":[],"refinedFindings":["F005"],"filesReviewed":["plan.md",".opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts",".opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts"],"findingsNew":{"P0":0,"P1":0,"P2":0},"findingsSummary":{"P0":0,"P1":5,"P2":0},"newFindingsRatio":0.08,"status":"insight","note":"Security concern remains packet-auditability debt rather than a live routing vulnerability."}

codex
The broad scan is extremely noisy because this repo has a lot of archived memory work. I’m narrowing to the canonical memory docs and live MCP/server files now, so the answer is about the current system rather than every historical packet that happens to mention “memory.”
exec
/bin/zsh -lc "sed -n '1,260p' .opencode/skills/system-spec-kit/references/memory/memory_system.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
title: Memory System Reference
description: Detailed documentation for Spec Kit Memory MCP tools, behavior notes, and configuration
---

# Memory System Reference - MCP Tools & Behavior

Spec Kit Memory MCP tools, behavior notes, and configuration options.

Current baseline: schema v23 (`document_type`, `spec_level`), 3 indexed content sources, 7 intent types, and `includeSpecDocs: true` by default.

---

<!-- ANCHOR:overview -->
## 1. OVERVIEW

The Spec Kit Memory system provides context preservation across sessions through vector-based semantic search and packet-first continuity. Phase 018 makes `handover.md -> _memory.continuity -> spec docs` the canonical recovery chain; retired `[spec]/memory/*.md` artifacts are no longer produced at save time and only matter when older packets still contain them. This reference covers MCP tool behavior, importance tiers, decay scoring, and configuration.

When a save mutates indexed state, the runtime also updates the `DB_UPDATED_FILE` marker from `mcp_server/core/config.ts`. Long-lived MCP processes poll that marker with `checkDatabaseUpdated()` so canonical-doc writes become visible without restarting the server.

### Architecture

| Component | Location | Purpose |
|-----------|----------|---------|
| MCP Server | `mcp_server/context-server.ts` | Spec Kit Memory MCP with vector search |
| Database | `mcp_server/dist/database/context-index.sqlite` | SQLite with FTS5 + vector embeddings (canonical runtime path; `mcp_server/database/context-index.sqlite` is a compatibility symlink) |
| Constitutional | `constitutional/` | Always-surface rules (Gate 3 enforcement) |
| Scripts | runtime `scripts/dist/memory/generate-context.js` (source: `scripts/memory/generate-context.ts`) | Canonical continuity save entrypoint for packet docs |

### Core Capabilities

- **Semantic search** - Find indexed spec-doc records by meaning, not just keywords
- **Importance tiers** - Six-level system for prioritizing context
- **Decay scoring** - Recent indexed spec-doc records rank higher than older ones
- **Checkpoints** - Save/restore indexed-continuity state snapshots
- **Constitutional tier** - Critical rules that always surface

### Indexable Content Sources

The indexed-continuity store indexes content from two active sources, plus a retired-compatibility row preserved for read-side retrieval against historical packets:

| Source | Location Pattern | Memory Type | Default Tier | Discovery |
|--------|-----------------|-------------|--------------|-----------|
| **Spec Documents** | `specs/**/*.md` and `.opencode/specs/**/*.md` | Per-type (spec, plan, tasks, etc.) | `normal` | `findSpecDocuments()` |
| **Constitutional Rules** | `.opencode/skills/*/constitutional/*.md` | `meta-cognitive` | `constitutional` | `findConstitutionalFiles()` |
| **Retired Compatibility Artifacts** | Older `specs/*/memory/*.{md,txt}` files already present in historical packets | Varies (episodic, procedural, etc.) | `normal` | Historical compatibility only |

**Content Source Behavior:**

- **Spec Documents** — Canonical packet continuity source. Recovery should read `handover.md`, then `_memory.continuity`, then the rest of the packet docs before widening into search.
- **Constitutional Rules** — Always-surface critical rules. Injected at top of every search result. No decay.
- **Retired Compatibility Artifacts** — Older session notes may still exist in historical packets, but save workflows no longer produce them and operators should not treat them as an active surface.

**Spec Document Indexing Pipeline:**
1. `findSpecDocuments()` walks both supported specs roots and discovers supported doc filenames
2. `isMemoryFile()` validates each document as an indexable file
3. `extractDocumentType()` infers `document_type` (spec/plan/tasks/etc.) for scoring
4. Documents are indexed alongside memory and constitutional files
5. `createSpecDocumentChain()` links lifecycle docs for causal traversal

---

<!-- /ANCHOR:overview -->
<!-- ANCHOR:importance-tiers -->
## 2. IMPORTANCE TIERS

Six-tier system for prioritizing memory relevance:

| Tier | Weight | searchBoost | Purpose | Auto-Surface |
|------|--------|-------------|---------|--------------|
| **Constitutional** | 1.0 | 3.0 | Critical rules that ALWAYS apply | Yes (top of every search) |
| **Critical** | 1.0 | 2.0 | High-importance context | Yes (high relevance) |
| **Important** | 0.8 | 1.5 | Significant decisions/context | Relevance-based |
| **Normal** | 0.5 | 1.0 | Standard session context | Relevance-based |
| **Temporary** | 0.3 | 0.5 | Short-term notes | Relevance-based |
| **Deprecated** | 0.1 | 0.0 | Outdated (kept for history) | Never (excluded from search) |

**searchBoost Multipliers:** Applied to search scores to prioritize higher tiers:
- Constitutional memories get 3x boost in search ranking
- Critical memories get 2x boost
- Important memories get 1.5x boost
- Normal memories have no boost (1.0x)
- Temporary and Deprecated get reduced visibility (0.5x and 0x respectively)

### Constitutional Tier Behavior

- Stored in `constitutional/` folder
- Auto-indexed on MCP server startup
- **ALWAYS** surface at top of search results, regardless of query
- Used for gate enforcement (e.g., "always ask spec folder question")
- EXEMPT from decay scoring (always max relevance)

---

<!-- /ANCHOR:importance-tiers -->
<!-- ANCHOR:mcp-tools -->
## 3. MCP TOOLS

> **Note:** MCP tool names use plain names such as `memory_search`, `memory_save`, and `checkpoint_create`.

### Tool Reference (43 tools)

| Layer | Tool | Purpose | Example Use |
|-------|------|---------|-------------|
| L1: Orchestration | `memory_context()` | Unified entry point with intent-aware routing (7 intents) | START HERE for most memory operations |
| L1: Orchestration | `session_resume()` | Resume memory, code graph, and CocoIndex state in one call | Detailed recovery payload after reconnect, or when you want direct merged resume state |
| L1: Orchestration | `session_bootstrap()` | Composite bootstrap combining resume and health checks | Canonical first tool call in a fresh OpenCode-style session or after `/clear` |
| L2: Core | `memory_search()` | Semantic search with vector similarity | Find prior decisions on auth |
| L2: Core | `memory_quick_search()` | Simplified search wrapper for fast lookups | Quick keyword-based retrieval |
| L2: Core | `memory_match_triggers()` | Fast keyword matching (<50ms) with cognitive features | Gate enforcement |
| L2: Core | `memory_save()` | Index a saved continuity artifact or spec doc. Re-generates embedding when **content hash** changes. Title-only changes do not trigger re-embedding. | After generate-context.js |
| L3: Discovery | `memory_list()` | Browse stored spec-doc records with pagination (parent rows by default) | Review session history |
| L3: Discovery | `memory_stats()` | Get memory system statistics with composite scoring | Check index health |
| L3: Discovery | `memory_health()` | Check health status of memory system | Diagnose issues |
| L3: Discovery | `session_health()` | Report session readiness, graph freshness, and priming status | Detect stale session context before continuing |
| L4: Mutation | `memory_delete()` | Delete memory by ID or bulk delete by spec folder | Remove outdated memories |
| L4: Mutation | `memory_update()` | Update memory metadata (title, tier, triggers) | Correct memory properties |
| L4: Mutation | `memory_validate()` | Mark memory as useful/not useful | Confidence scoring |
| L4: Mutation | `memory_bulk_delete()` | Bulk delete memories by spec folder with confirmation | Clean up entire spec folder memories |
| L5: Lifecycle | `checkpoint_create()` | Save named state snapshot | Before risky changes |
| L5: Lifecycle | `checkpoint_list()` | List available checkpoints | Find restore points |
| L5: Lifecycle | `checkpoint_restore()` | Restore from checkpoint | Rollback if needed |
| L5: Lifecycle | `checkpoint_delete()` | Delete a checkpoint | Clean up old snapshots |
| L6: Analysis | `task_preflight()` | Capture epistemic baseline before task execution | Start of implementation work |
| L6: Analysis | `task_postflight()` | Capture epistemic state after task, calculate Learning Index | After completing implementation |
| L6: Analysis | `memory_drift_why()` | Trace causal chain for a spec-doc record ("why was this decided?") | Understand decision lineage |
| L6: Analysis | `memory_causal_link()` | Create causal relationship between two memories | Link decision to its cause |
| L6: Analysis | `memory_causal_stats()` | Get statistics about the causal memory graph | Check causal coverage |
| L6: Analysis | `memory_causal_unlink()` | Remove a causal relationship by edge ID | Clean up incorrect links |
| L6: Analysis | `eval_run_ablation()` | Run ablation study on memory scoring components | Compare scoring strategies |
| L6: Analysis | `eval_reporting_dashboard()` | Generate evaluation and reporting dashboard data | Review system metrics |
| L6: Analysis | `code_graph_query()` | Query structural relationships such as callers, imports, and outlines | Find what calls a symbol or which files import a module |
| L6: Analysis | `code_graph_context()` | Expand CocoIndex or symbol seeds into compact graph neighborhoods | Pull structural context for an LLM prompt |
| L7: Maintenance | `memory_index_scan()` | Bulk scan and index packet docs, constitutional files, and graph metadata | After continuity or spec-doc updates |
| L7: Maintenance | `memory_ingest_start()` | Start async bulk memory ingestion | Import large memory sets |
| L7: Maintenance | `memory_ingest_status()` | Check status of running ingestion job | Monitor import progress |
| L7: Maintenance | `memory_ingest_cancel()` | Cancel a running ingestion job | Stop runaway imports |
| L7: Maintenance | `memory_get_learning_history()` | Get learning history (preflight/postflight records) | Analyze learning patterns |
| L7: Maintenance | `code_graph_scan()` | Build or refresh the structural code graph index | Re-index after branch switches or large code changes |
| L7: Maintenance | `code_graph_status()` | Report code graph freshness and node/edge counts | Check whether the structural index is usable |
| L7: Maintenance | `ccc_status()` | Report CocoIndex availability and index health | Confirm semantic code search is ready |
| L7: Maintenance | `ccc_reindex()` | Trigger incremental or full CocoIndex re-indexing | Refresh semantic search after a refactor |
| L7: Maintenance | `ccc_feedback()` | Submit search-quality feedback for CocoIndex results | Record whether semantic hits were helpful |

### memory_index_scan() Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `specFolder` | string | - | Limit scan to specific spec folder |
| `force` | boolean | false | Force re-index all files (ignore content hash) |
| `includeConstitutional` | boolean | true | Scan `.opencode/skills/*/constitutional/` directories |
| `includeSpecDocs` | boolean | true | Scan for spec folder documents in `.opencode/specs/`. When true, discovers and indexes specs, plans, tasks, decision records, etc. with document-type scoring multipliers (11 types). Also controllable via `SPECKIT_INDEX_SPEC_DOCS` env var. |
| `incremental` | boolean | true | Skip files whose mtime and content hash are unchanged since last index |

---

<!-- /ANCHOR:mcp-tools -->
<!-- ANCHOR:memory-search-behavior -->
## 4. MEMORY_SEARCH() BEHAVIOR

### Parameter Requirements

> **IMPORTANT:** You MUST provide either `query` OR `concepts` parameter. Calling `memory_search({ specFolder: "..." })` without a search parameter will cause an E040 error.

**Required Parameters (one of):**
- `query`: Natural language search query (string)
- `concepts`: Multiple concepts for AND search (array of 2-5 strings)

**Optional Parameters:**
- `specFolder`: Limit search to specific spec folder
- `tenantId` (string, optional): Tenant boundary for governed retrieval
- `userId` (string, optional): User boundary for governed retrieval
- `agentId` (string, optional): Agent boundary for governed retrieval
- `includeContent`: Include full file content in results
- `includeConstitutional`: Include constitutional tier memories
- `anchors`: Array of anchor IDs for targeted section retrieval (token-efficient)
- `tier`: Filter by importance tier
- `limit`: Maximum results to return
- `useDecay`: Apply temporal decay scoring

When operating in shared or multi-actor deployments, always provide scope parameters to prevent cross-scope data exposure.

### Parameter Reference

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| `query` | string | One of query/concepts | - | Natural language search query |
| `concepts` | string[] | One of query/concepts | - | 2-5 concepts for AND search (results must match ALL) |
| `specFolder` | string | No | - | Filter to specific spec folder |
| `tenantId` | string | No | - | Tenant boundary for governed retrieval |
| `userId` | string | No | - | User boundary for governed retrieval |
| `agentId` | string | No | - | Agent boundary for governed retrieval |
| `includeConstitutional` | boolean | No | true | Include constitutional memories |
| `includeContent` | boolean | No | false | Embed full file content in results |
| `includeContiguity` | boolean | No | false | Include adjacent memories |
| `anchors` | string[] | No | - | Anchor IDs to extract (e.g., `['summary', 'decisions']`) |
| `tier` | string | No | - | Filter by importance tier |
| `limit` | number | No | 10 | Maximum results to return |
| `useDecay` | boolean | No | true | Apply temporal decay scoring |

### Intent-Aware Retrieval (7 Intents)

The system detects query intent and applies task-specific search weights. Seven intent types are supported:

| Intent | Weight Adjustments |
|--------|-------------------|
| `add_feature` | +procedural, +architectural |
| `fix_bug` | +error logs, +debug, +recent |
| `refactor` | +patterns, +structure |
| `security_audit` | +security, +vulnerabilities |
| `understand` | +semantic, +explanatory |
| `find_spec` | +spec documents, +plans, +decision records |
| `find_decision` | +decision records, +architectural context |

### Constitutional Memory Behavior

> **Important:** Constitutional memories ALWAYS appear at the top of search results, even when a `specFolder` filter is applied. This is BY DESIGN to ensure critical context (e.g., Gate enforcement rules) is never accidentally filtered out.

| Parameter | Behavior |
|-----------|----------|
| `specFolder: "007-auth"` | Filters results to that folder, but constitutional memories still appear first |
| `includeConstitutional: false` | Explicitly excludes constitutional memories from results |
| `includeContent: true` | Embeds full indexed document content in results (eliminates separate load calls) |

### Usage Examples

```javascript
// Basic semantic search (query required)
memory_search({ query: "authentication decisions" })

// Folder-scoped with content (query still required)
memory_search({
  query: "OAuth implementation",
  specFolder: "007-auth",
  includeContent: true
})

// Multi-concept AND search (alternative to query)
memory_search({
  concepts: ["authentication", "session management"],
  specFolder: "007-auth"
})

// Exclude constitutional tier
memory_search({
  query: "login flow",
  includeConstitutional: false
})

// WRONG: specFolder alone is NOT sufficient
// memory_search({ specFolder: "007-auth" })  // ERROR: E040
```

### Anchor-Based Retrieval (Token-Efficient)

The `anchors` parameter enables **targeted section retrieval** from indexed documents, reducing token usage by ~90% when you only need specific sections.

**When to Use Anchors:**
- You need only specific sections (summary, decisions) not full content
- Token efficiency is important (large packet docs)

exec
/bin/zsh -lc "sed -n '1,260p' .opencode/skills/system-spec-kit/references/memory/save_workflow.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
title: Memory Save Workflow
description: Complete guide to saving conversation context including execution methods, output format, and retrieval.
---

# Memory Save Workflow - Context Preservation Methods

Complete guide to saving conversation context, execution methods, and retrieval.

---

<!-- ANCHOR:overview -->
## 1. OVERVIEW

### Core Principle

Execute save operations through whichever method fits your workflow - slash commands for convenience, direct scripts for control. All paths feed the same canonical save entrypoint, update the target packet's continuity surfaces, and reindex the resulting packet docs for retrieval.

When direct CLI mode includes an explicit spec-folder argument, that target is authoritative. Session-learning matches, JSON `SPEC_FOLDER` fields, and auto-detect may inform diagnostics, but they must not reroute the save to another folder.

Direct phase-folder targets are supported. If the explicit CLI target resolves to a policy-defined phase folder, `generate-context.js` preserves that target and updates the selected phase folder's canonical continuity surfaces instead of rerouting elsewhere.

### Governed Save Boundaries

The save workflow stays compatible with private and agent-scoped operation. When the surrounding runtime enables governance, save and follow-up retrieval flows may carry `tenantId`, `userId`, and `agentId` so memory capture stays inside the intended boundary.

### Execution Paths

The indexed-continuity store supports **2 independent execution paths**. Any method can be used standalone.

### Method Comparison

| Method            | AI Agent Required | Best For                           | Effort | Token Cost |
| ----------------- | ----------------- | ---------------------------------- | ------ | ---------- |
| **Slash Command** | Yes               | Interactive saves, manual triggers | Low    | ~200       |
| **Direct Script** | No                | Testing, debugging, CI/CD          | Medium | 0          |

### Execution Flow

```
┌────────────────────────────────────────────────────────────────┐
│                    MEMORY SAVE PATHWAYS                        │
├────────────────────────────────────────────────────────────────┤
│                                                                │
│   Slash Command                    Direct Script               │
│   ┌──────────┐                    ┌──────────┐                 │
│   │ /memory: │                    │  node    │                 │
│   │  save    │                    │ script.ts│                 │
│   └────┬─────┘                    └────┬─────┘                 │
│        │                               │                       │
│        ▼                               ▼                       │
│   ┌──────────┐                    ┌──────────┐                 │
│   │ AI Agent │                    │   JSON   │                 │
│   │ Analysis │                    │   Input  │                 │
│   └────┬─────┘                    └────┬─────┘                 │
│        │                               │                       │
│        └───────────────────────────────┘                       │
│                              │                                 │
│                              ▼                                 │
│                    ┌─────────────────┐                         │
│                    │ generate-context│                         │
│                    │      .ts        │                         │
│                    └────────┬────────┘                         │
│                             │                                  │
│                             ▼                                  │
│                    ┌─────────────────┐                         │
│                    │ canonical packet│                         │
│                    │ continuity docs │                         │
│                    └─────────────────┘                         │
│                                                                │
└────────────────────────────────────────────────────────────────┘
```

---

<!-- /ANCHOR:overview -->
<!-- ANCHOR:method-selection -->
## 2. METHOD SELECTION

### Decision Tree

```
┌─────────────────────────────────────────────────────────────────┐
│              WHICH METHOD SHOULD I USE?                         │
└─────────────────────────────────────────────────────────────────┘
                              │
                              ▼
              ┌───────────────────────────────┐
              │ Is an AI agent active in      │
              │ the current conversation?     │
              └───────────────┬───────────────┘
                              │
               ┌──────────────┴──────────────┐
               │                             │
              YES                           NO
               │                             │
               ▼                             ▼
┌─────────────────────────┐   ┌─────────────────────────┐
│ Need automatic          │   │ Prepare JSON, then use  │
│ conversation analysis?  │   │ Direct Script method    │
└────────────┬────────────┘   └─────────────────────────┘
             │
      ┌──────┴──────┐
      │             │
     YES           NO
      │             │
      ▼             ▼
┌───────────┐ ┌───────────┐
│   SLASH   │ │  DIRECT   │
│  COMMAND  │ │  SCRIPT   │
│           │ │ (custom   │
│ /memory:  │ │  JSON)    │
│   save    │ │           │
└───────────┘ └───────────┘
```

### Quick Selection Guide

| Scenario                                  | Recommended Method |
| ----------------------------------------- | ------------------ |
| End of work session, want AI to summarize | **Slash Command**  |
| CI/CD pipeline, automated saves           | **Direct Script**  |
| Quick manual save, no AI available        | **Direct Script**  |
| Testing memory system functionality       | **Direct Script**  |
| Batch processing multiple saves           | **Direct Script**  |
| Interactive session with full context     | **Slash Command**  |

---

<!-- /ANCHOR:method-selection -->
<!-- ANCHOR:slash-commands -->
## 3. SLASH COMMANDS

**When to Use:** Manual save with AI-powered conversation analysis
**Requirement:** Slash command files exist in `.opencode/commands/memory/`

### Available Commands

```
/memory:save       # Save current conversation context
/memory:search  # Unified retrieval + analysis: search, epistemic baselines, causal graph, evaluation
```

### Execution Flow

1. Slash command expands to full prompt
2. AI agent analyzes conversation history
3. AI agent creates structured JSON summary (the main agent or a delegated packet writer can invoke generate-context.js for memory under distributed governance)
4. AI agent calls `generate-context.js` with JSON data
5. Canonical continuity updated inside the active root-spec or phase packet

### Validation Checkpoints

| Checkpoint       | Verification                   | Action on Failure         |
| ---------------- | ------------------------------ | ------------------------- |
| Command exists   | `ls .opencode/commands/memory/` | Create command file       |
| AI agent active  | Check response capability      | Use Direct Script instead |
| Spec folder arg  | Passed via CLI argument        | Specify folder manually   |
| Write permission | `test -w specs/###/`           | Check packet permissions  |

### Example Output

```
✓ Context analyzed (12 exchanges detected)
✓ Spec folder: 049-anchor-context-retrieval
✓ Continuity surfaces updated for: 049-anchor-context-retrieval
✓ Primary continuity block: implementation-summary.md::_memory.continuity
✓ Packet docs reindexed
```

---

<!-- /ANCHOR:slash-commands -->
<!-- ANCHOR:direct-script -->
## 4. DIRECT SCRIPT

**When to Use:** Testing, debugging, custom workflows, CI/CD pipelines
**Requirement:** Node.js installed

### Usage Pattern

```bash
# Create minimal JSON data file
cat > /tmp/test-save-context.json << 'EOF'
{
  "SPEC_FOLDER": "049-anchor-context-retrieval",
  "recent_context": [{
    "request": "Test save-context execution",
    "completed": "Verified system works standalone",
    "learning": "Direct script execution requires minimal JSON",
    "duration": "5m",
    "date": "2025-11-28T18:30:00Z"
  }],
  "observations": [{
    "type": "discovery",
    "title": "Standalone execution test",
    "narrative": "Testing direct script invocation",
    "timestamp": "2025-11-28T18:30:00Z",
    "files": [],
    "facts": ["Standalone execution works", "Minimal data sufficient"]
  }],
  "user_prompts": [{
    "prompt": "Test save-context standalone",
    "timestamp": "2025-11-28T18:30:00Z"
  }]
}
EOF

# Execute script directly
node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js \
  /tmp/test-save-context.json \
  "049-anchor-context-retrieval"

# Inline JSON mode (preferred for routine saves)
node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js \
  --json '{"specFolder":"049-anchor-context-retrieval","sessionSummary":"Implemented anchor retrieval..."}' \
  "049-anchor-context-retrieval"

# Stdin mode (preferred for routine saves)
echo '{"specFolder":"049-anchor-context-retrieval","sessionSummary":"..."}' | \
  node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js --stdin

```

### Required JSON Fields

| Field            | Type   | Required | Description               |
| ---------------- | ------ | -------- | ------------------------- |
| `SPEC_FOLDER`    | string | Yes      | Target spec folder name   |
| `recent_context` | array  | Yes      | Array of context objects  |
| `observations`   | array  | No       | Discoveries and learnings |
| `user_prompts`   | array  | No       | Original user requests    |

If both the JSON payload and the CLI provide a spec folder, the explicit CLI argument wins.

If that explicit CLI argument resolves to a phase folder, the command keeps that explicit target and updates the selected phase folder's own canonical continuity surfaces.

### Validation Checkpoints

| Checkpoint         | Verification                                           | Action on Failure        |
| ------------------ | ------------------------------------------------------ | ------------------------ |
| Node.js installed  | `node --version`                                       | Install Node.js          |
| Script exists      | `test -f .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js` | Check skill installation |
| JSON valid         | `jq . < input.json`                                    | Fix JSON syntax          |
| Spec folder exists | `test -d specs/###/`                                   | Create spec folder       |
| Target exists under specs roots | Use the exact root-spec or phase-folder path you want to save into | Re-run with an explicit CLI target |

---

<!-- /ANCHOR:direct-script -->
<!-- ANCHOR:output-format -->
## 5. OUTPUT FORMAT

### Canonical Output Surfaces

The Phase 018 save path is packet-first. Retired `[spec]/memory/*.md` writes are no longer part of the workflow. `generate-context.js` updates continuity inside the selected packet and reindexes the affected docs.

After the save mutates indexed state, the MCP runtime touches `DB_UPDATED_FILE` so long-lived server processes can hot-rebind on the next `checkDatabaseUpdated()` pass instead of serving stale packet data.

| Surface | Role |

exec
/bin/zsh -lc "sed -n '1,220p' .opencode/skills/system-spec-kit/references/memory/trigger_config.md" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
---
title: Trigger Configuration
description: Complete configuration guide for memory trigger phrases and the fast trigger matching system.
---

# Trigger Configuration - Keywords and Manual Save Settings

Complete configuration guide for memory trigger phrases and the fast trigger matching system.

---

<!-- ANCHOR:overview -->
## 1. OVERVIEW

**Core Principle:** Trigger detection must be fast (<50ms) and reliable, using optimized phrase matching to surface relevant spec-doc records without impacting conversation flow.

The spec-doc record workflow supports manual activation mechanisms:
1. **Command Trigger** - `/memory:save` command for explicit saves
2. **Phrase Triggers** - User phrases that directly invoke memory operations

> **OpenCode Note:** Automatic interval-based saves (e.g., "every 20 messages") are NOT supported in OpenCode because OpenCode lacks the hooks system required to count messages and trigger saves automatically. All context preservation must be manually triggered.

This reference covers trigger phrase configuration, the MCP-based matching system, and best practices for custom trigger design.

### Key Components

| Component | Purpose | Performance Target |
|-----------|---------|-------------------|
| `/memory:save` Command | Primary save trigger | Immediate |
| Trigger Phrases | Explicit memory activation | <50ms detection |
| MCP Tool | Fast phrase matching | <50ms response |
| Custom Config | Project-specific triggers | Configurable |

---

<!-- /ANCHOR:overview -->
<!-- ANCHOR:trigger-phrases -->
## 2. TRIGGER PHRASES

The following phrases activate memory operations (case-insensitive matching):

### Primary Triggers

| Category | Primary Phrase | Alternatives |
|----------|----------------|--------------|
| **Save** | "save context" | "save conversation", "save session" |
| **Document** | "document this" | "preserve context", "save this discussion" |
| **Remember** | "remember this" | "store this", "keep this context" |
| **Checkpoint** | "checkpoint" | "save checkpoint", "create checkpoint" |

### Detection Logic

```typescript
const TRIGGER_PHRASES: readonly string[] = [
  // Save category
  'save context',
  'save conversation',
  'save session',
  'save this discussion',

  // Document category
  'document this',
  'preserve context',

  // Remember category
  'remember this',
  'store this',
  'keep this context',

  // Checkpoint category
  'checkpoint',
  'save checkpoint',
  'create checkpoint'
] as const;

function detectTrigger(userMessage: string): boolean {
  const normalized = userMessage.toLowerCase();
  return TRIGGER_PHRASES.some(phrase => normalized.includes(phrase));
}
```

### MCP Tool Integration

The `memory_match_triggers` MCP tool provides fast trigger phrase matching without requiring embeddings:

```typescript
// Fast trigger matching (<50ms) - no embeddings required
const result = await spec_kit_memory_memory_match_triggers({
  prompt: "I want to save context for this session",
  limit: 3  // Maximum matching spec-doc records to return
});

// Returns matching spec-doc records based on trigger phrases
// Ideal for proactive memory surfacing during conversation
```

**Usage Scenarios:**
- Quick keyword-based memory lookup before semantic search
- Proactive memory surfacing during conversation
- Fallback when semantic search is unavailable

### Gate 3 Enforcement Triggers

The constitutional memory for Gate 3 enforcement uses 33 trigger phrases to detect file modification intent:

| Category | Trigger Phrases |
|----------|-----------------|
| **Create** | `create`, `add`, `generate`, `build`, `implement`, `write` |
| **Modify** | `modify`, `edit`, `update`, `change`, `refactor`, `fix` |
| **Delete** | `delete`, `remove`, `cleanup` |
| **Move** | `rename`, `move`, `migrate` |
| **Scale Indicators** | `comprehensive`, `all bugs`, `multiple files`, `codebase`, `entire`, `full`, `everything` |
| **Agent Patterns** | `parallel agents`, `15 agents`, `10 agents`, `dispatch agents`, `opus agents` |
| **Compound Actions** | `analyze and fix`, `find and fix`, `fix all`, `update all`, `modify all`, `check and fix` |
| **Gate Keywords** | `spec folder`, `gate 3`, `file modification` |

**How Gate 3 Trigger Matching Works:**

1. AI calls `memory_match_triggers({ prompt: "user message" })`
2. If prompt matches any Gate 3 trigger, constitutional memory surfaces
3. AI sees reminder to ask spec folder question before file modifications

**Example:**

```typescript
// User says: "refactor the authentication module"
const matches = await memory_match_triggers({
  prompt: "refactor the authentication module"
});
// Returns: Gate 3 enforcement constitutional memory 
// matchedPhrases: ["refactor"]
// AI then asks: "Spec Folder (required): A) Existing | B) New | C) Update related | D) Skip"
```

**Trigger Design Guidelines for Constitutional Memories:**

| Guideline | Description |
|-----------|-------------|
| **Cover action verbs** | Include all verbs that indicate file modification intent |
| **Include scale words** | Words like "comprehensive", "all", "entire" suggest large changes |
| **Add domain terms** | Include project-specific terms for your enforcement use case |
| **Test coverage** | Verify triggers match common user phrases |
| **Limit count** | 20-40 triggers recommended for constitutional memories |

---

### Signal Vocabulary Expansion

Beyond the default trigger phrases, the system recognizes expanded signal types for contextual trigger matching:

| Signal | Purpose | Example Phrases |
|--------|---------|----------------|
| `CORRECTION` | Tracks when a spec-doc record is corrected or superseded | "actually", "correction", "that was wrong", "update previous" |
| `PREFERENCE` | Captures user preference signals | "I prefer", "use this instead", "default to", "always do" |
| `REINFORCEMENT` | Positive validation of existing spec-doc records | "that's right", "confirmed", "keep this" |
| `DEPRECATION` | Marks memories as outdated | "no longer valid", "deprecated", "removed", "obsolete" |

These signals are detected during `memory_match_triggers()` processing and influence save-time arbitration (prediction-error scoring) and correction tracking.

### Trigger Sanitization (026 Remediation)

Save-time trigger validation now applies sanitization rules to prevent low-quality triggers from degrading retrieval precision:

| Rule | Behavior |
|------|----------|
| **Single-word filter** | Overly generic single-word triggers (e.g., "code", "fix", "error") are stripped during save-time validation to reduce false-positive surfacing |
| **Duplicate detection** | Triggers that duplicate existing constitutional or high-importance memory triggers are flagged and removed |
| **Length minimum** | Trigger phrases shorter than 3 characters are rejected |
| **Stopword filter** | Common stopwords used alone as triggers are rejected |

**Post-save quality review** checks trigger_phrases in the saved memory and reports HIGH-severity issues when triggers are overly broad or likely to cause false matches. The AI must patch these manually via Edit tool when flagged.

**Filter behavior changes (026):**
- `memory_match_triggers()` now applies a relevance threshold before returning matches, reducing noise from weak partial matches
- Trigger matching respects importance tier: constitutional triggers always match, while normal-tier triggers require higher confidence scores
- When multiple memories match the same trigger, results are deduplicated by content similarity (>=0.88 threshold)

---

<!-- /ANCHOR:trigger-phrases -->
<!-- ANCHOR:manual-save-methods -->
## 3. MANUAL SAVE METHODS

### Primary Method: Command

```
/memory:save
```

This is the most reliable way to save context in OpenCode.

### Alternative: Trigger Phrases

Include any of these phrases in your message:
- "save context"
- "save conversation" 
- "please save this session"
- "checkpoint"

### When to Save Context

| Scenario | Recommendation |
|----------|----------------|
| Feature complete | Save after implementation milestones |
| Complex discussion | Save after major architectural decisions |
| Team sharing | Save before handoff to colleagues |
| Session ending | Save at end of work session |
| Research findings | Save valuable discoveries immediately |

### Save Location

- **Save path:** `/memory:save` targets the selected spec folder and routes continuity into canonical packet docs such as `implementation-summary.md`, `decision-record.md`, and `handover.md`.

**Continuity home:** packet-local canonical docs plus `_memory.continuity`, not a standalone `{spec_folder}/memory/*.md` note.

---

<!-- /ANCHOR:manual-save-methods -->
<!-- ANCHOR:customization -->
## 4. CUSTOMIZATION

exec
/bin/zsh -lc "rg --files .opencode/skills/system-spec-kit .opencode/command specs | rg 'memory|generate-context|resume|handover'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
.opencode/commands/spec_kit/assets/spec_kit_resume_auto.yaml
.opencode/commands/spec_kit/assets/spec_kit_resume_confirm.yaml
.opencode/commands/spec_kit/resume.md
.opencode/commands/memory/README.txt
.opencode/commands/memory/save.md
.opencode/commands/memory/manage.md
.opencode/commands/memory/learn.md
.opencode/commands/memory/search.md
.opencode/skills/system-spec-kit/templates/handover.md
.opencode/skills/system-spec-kit/mcp_server/tools/memory-tools.ts
.opencode/skills/system-spec-kit/mcp_server/hooks/memory-surface.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-integration.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-index.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-ux-regressions.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-context.resume-gate-d.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-extended.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory/trust-badges.test.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-fallback-fingerprint.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-governance.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-ingest-edge.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-types.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-ingest.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-bulk-delete.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-triggers.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud.ts
.opencode/skills/system-spec-kit/mcp_server/tests/workflow-memory-tracking.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-benchmark-memory-search.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/working-memory-event-decay.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-planner-first.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-crud.vitest.ts
.opencode/skills/system-spec-kit/references/memory/epistemic_vectors.md
.opencode/skills/system-spec-kit/references/memory/trigger_config.md
.opencode/skills/system-spec-kit/references/memory/embedding_resilience.md
.opencode/skills/system-spec-kit/references/memory/memory_system.md
.opencode/skills/system-spec-kit/references/memory/save_workflow.md
.opencode/skills/system-spec-kit/mcp_server/tests/checkpoint-working-memory.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-health-edge.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-list-edge.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/session-resume.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-regression-constitutional-memory.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-save.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/session-token-resume.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/working-memory.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/save/atomic-index-memory.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-delete.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-update.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/session-resume.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-list.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-health.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-index-discovery.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-context-eval-channels.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-eval-channels.vitest.ts
.opencode/skills/system-spec-kit/references/cli/memory_handback.md
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-index.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-stats.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-crud-utils.ts
.opencode/skills/system-spec-kit/mcp_server/handlers/memory-index-alias.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-ingest.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-crud-update-constitutional-guard.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/lib/parsing/memory-parser.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-search.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-benchmark-session-resume.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-triggers.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/lib/resume/resume-ladder.ts
.opencode/skills/system-spec-kit/mcp_server/lib/resume/README.md
.opencode/skills/system-spec-kit/mcp_server/tests/memory-types.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-crud-extended.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-lineage-backfill.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-dedup-order.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-delete-cascade.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/session-resume-auth.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-tools.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-state-baseline.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-index-cooldown.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-roadmap-flags.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-ux-hooks.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-parser.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-context-session-state.vitest.ts
.opencode/skills/system-spec-kit/scripts/utils/memory-frontmatter.ts
.opencode/skills/system-spec-kit/mcp_server/tests/atomic-index-memory.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-quality-filter.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-regression-memory-tiers.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-pipeline-enforcement.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-context.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-lineage-state.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-summaries.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-search-integration.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/resume-ladder.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/lib/cognitive/working-memory.ts
.opencode/skills/system-spec-kit/manual_testing_playbook/20--remediation-revalidation/226-memory-health-auto-repair.md
.opencode/skills/system-spec-kit/scripts/memory/backfill-research-metadata.ts
.opencode/skills/system-spec-kit/scripts/memory/migrate-trigger-phrase-residual.ts
.opencode/skills/system-spec-kit/scripts/memory/cleanup-orphaned-vectors.ts
.opencode/skills/system-spec-kit/scripts/memory/generate-context.ts
.opencode/skills/system-spec-kit/scripts/memory/ast-parser.ts
.opencode/skills/system-spec-kit/scripts/memory/validate-memory-quality.ts
.opencode/skills/system-spec-kit/scripts/memory/rebuild-auto-entities.ts
.opencode/skills/system-spec-kit/scripts/memory/reindex-embeddings.ts
.opencode/skills/system-spec-kit/scripts/memory/cleanup-index-scope-violations.ts
.opencode/skills/system-spec-kit/scripts/memory/README.md
.opencode/skills/system-spec-kit/scripts/memory/fix-memory-h1.mjs
.opencode/skills/system-spec-kit/scripts/memory/rank-memories.ts
.opencode/skills/system-spec-kit/scripts/memory/backfill-frontmatter.ts
.opencode/skills/system-spec-kit/mcp_server/lib/eval/memory-state-baseline.ts
.opencode/skills/system-spec-kit/scripts/core/memory-metadata.ts
.opencode/skills/system-spec-kit/scripts/core/find-predecessor-memory.ts
.opencode/skills/system-spec-kit/scripts/core/memory-indexer.ts
.opencode/skills/system-spec-kit/scripts/lib/validate-memory-quality.ts
.opencode/skills/system-spec-kit/scripts/lib/memory-frontmatter.ts
.opencode/skills/system-spec-kit/scripts/lib/memory-telemetry.ts
.opencode/skills/system-spec-kit/manual_testing_playbook/06--analysis/019-causal-edge-creation-memory-causal-link.md
.opencode/skills/system-spec-kit/manual_testing_playbook/06--analysis/025-learning-history-memory-get-learning-history.md
.opencode/skills/system-spec-kit/manual_testing_playbook/06--analysis/021-causal-edge-deletion-memory-causal-unlink.md
.opencode/skills/system-spec-kit/manual_testing_playbook/06--analysis/022-causal-chain-tracing-memory-drift-why.md
.opencode/skills/system-spec-kit/manual_testing_playbook/06--analysis/020-causal-graph-statistics-memory-causal-stats.md
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-context.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/gate-d-resume-perf.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/handler-memory-stats-edge.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-parser-extended.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/tests/memory-save-index-scope.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/lib/config/memory-types.ts
.opencode/skills/system-spec-kit/shared/parsing/memory-template-contract.ts
.opencode/skills/system-spec-kit/shared/parsing/memory-sufficiency.ts
.opencode/skills/system-spec-kit/manual_testing_playbook/19--feature-flag-reference/125-memory-roadmap-capability-flags.md
.opencode/skills/system-spec-kit/manual_testing_playbook/19--feature-flag-reference/031-4-memory-and-storage.md
.opencode/skills/system-spec-kit/manual_testing_playbook/14--pipeline-architecture/050-mpab-chunk-to-memory-aggregation-r1.md
.opencode/skills/system-spec-kit/manual_testing_playbook/04--maintenance/014-workspace-scanning-and-indexing-memory-index-scan.md
.opencode/skills/system-spec-kit/scripts/tests/generate-context-cli-authority.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/memory-sufficiency.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/test-memory-quality-lane.js
.opencode/skills/system-spec-kit/scripts/tests/validate-memory-quality-v12-normalization.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/runtime-memory-inputs.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/memory-quality-phase2-pr3.test.ts
.opencode/skills/system-spec-kit/scripts/tests/memory-learn-command-docs.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/memory-quality-phase3-pr6.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/deep-loop-wave-resume.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/memory-pipeline-regressions.vitest.ts
.opencode/skills/system-spec-kit/manual_testing_playbook/17--governance/273-session-resume-caller-binding-and-unicode-sanitization.md
.opencode/skills/system-spec-kit/scripts/tests/validate-memory-quality-v8-regex-narrow.vitest.ts
.opencode/skills/system-spec-kit/mcp_server/lib/search/memory-summaries.ts
.opencode/skills/system-spec-kit/manual_testing_playbook/10--graph-signal-activation/081-graph-and-cognitive-memory-fixes.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/073-quality-gate-timer-persistence.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/069-entity-normalization-consolidation.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/132-description-json-schema-field-validation.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/201-spec-doc-structure-validator-and-continuity-frontmatter.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/045-smarter-memory-content-generation-s1.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/039-verify-fix-verify-memory-quality-loop-pi-a5.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/047-encoding-intent-capture-at-index-time-r16.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/003-context-save-index-update.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/043-pre-storage-quality-gate-tm-04.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/203-memory-causal-trust-display.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/042-spec-folder-description-discovery-pi-b3.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/006-session-enrichment-and-alignment-guardrails.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/041-pre-flight-token-budget-validation-pi-a3.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/046-anchor-aware-chunk-thinning-r7.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/202-canonical-continuity-save-substrate.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/040-signal-vocabulary-expansion-tm-08.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/131-description-json-batch-backfill-validation-pi-b3.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/119-memory-filename-uniqueness-ensureuniquememoryfilename.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/005-outsourced-agent-memory-capture-round-trip.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/048-auto-entity-extraction-r10.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/111-deferred-lexical-only-indexing.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/199-content-aware-memory-filename-generation.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/044-reconsolidation-on-save-tm-06.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/177-hybrid-decay-policy-speckit-hybrid-decay-policy.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/178-save-quality-gate-exceptions-speckit-save-quality-gate-exceptions.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/155-post-save-quality-review.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/165-assistive-reconsolidation-speckit-assistive-reconsolidation.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/092-implemented-auto-entity-extraction-r10.md
.opencode/skills/system-spec-kit/manual_testing_playbook/13--memory-quality-and-indexing/133-dry-run-preflight-for-memory-save.md
.opencode/skills/system-spec-kit/manual_testing_playbook/03--discovery/011-memory-browser-memory-list.md
.opencode/skills/system-spec-kit/manual_testing_playbook/03--discovery/013-health-diagnostics-memory-health.md
.opencode/skills/system-spec-kit/manual_testing_playbook/03--discovery/012-system-statistics-memory-stats.md
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/055-dual-scope-memory-auto-surface-tm-05.md
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/059-memory-summary-search-channel-r8.md
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/056-constitutional-memory-as-expert-knowledge-injection-pi-a4.md
.opencode/skills/system-spec-kit/manual_testing_playbook/15--retrieval-enhancements/093-implemented-memory-summary-generation-r8.md
.opencode/skills/system-spec-kit/manual_testing_playbook/22--context-preservation-and-code-graph/263-session-resume.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/007-memory-metadata-update-memory-update.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/009-tier-based-bulk-deletion-memory-bulk-delete.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/006-memory-indexing-memory-save.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/101-memory-delete-confirm-schema-tightening.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/010-validation-feedback-memory-validate.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/008-single-and-folder-delete-memory-delete.md
.opencode/skills/system-spec-kit/manual_testing_playbook/02--mutation/008-feature-09-direct-manual-scenario-per-memory-history-log.md
.opencode/skills/system-spec-kit/feature_catalog/20--remediation-revalidation/02-memory-health-auto-repair.md
.opencode/skills/system-spec-kit/feature_catalog/16--tooling-and-scripts/33-memory-quality-kpi-reporting.md
.opencode/skills/system-spec-kit/feature_catalog/16--tooling-and-scripts/25-memory-maintenance-and-migration-clis.md
.opencode/skills/system-spec-kit/feature_catalog/16--tooling-and-scripts/13-constitutional-memory-manager-command.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/011-anchors-duplicate-ids/memory/context.md
.opencode/skills/system-spec-kit/manual_testing_playbook/09--evaluation-and-measurement/126-memory-roadmap-baseline-snapshot.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-semantic-and-lexical-search-memory-search.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/003-trigger-phrase-matching-memory-match-triggers.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/190-session-recovery-spec-kit-resume.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/189-tool-result-extraction-to-working-memory.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/185-memory-search-command-routing.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/187-quick-search-memory-quick-search.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/001-unified-context-retrieval-memory-context.md
.opencode/skills/system-spec-kit/manual_testing_playbook/01--retrieval/002-targeted-memory-lookup.md
.opencode/skills/system-spec-kit/feature_catalog/18--ux-hooks/02-memory-health-autorepair-metadata.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/16-dry-run-preflight-for-memory-save.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/17-outsourced-agent-memory-capture.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/26-spec-doc-structure-validator.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/21-assistive-reconsolidation.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/02-signal-vocabulary-expansion.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/01-verify-fix-verify-memory-quality-loop.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/10-auto-entity-extraction.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/14-quality-gate-timer-persistence.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/25-indexing-runtime-bootstrap-api.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/05-pre-storage-quality-gate.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/15-deferred-lexical-only-indexing.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/08-anchor-aware-chunk-thinning.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/23-hybrid-decay-policy.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/19-post-save-quality-review.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/07-smarter-memory-content-generation.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/11-content-aware-memory-filename-generation.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/06-reconsolidation-on-save.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/28-memory-causal-trust-display.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/09-encoding-intent-capture-at-index-time.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/04-spec-folder-description-discovery.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/27-canonical-continuity-save-substrate.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/18-session-enrichment-and-alignment-guards.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/03-pre-flight-token-budget-validation.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/24-save-quality-gate-exceptions.md
.opencode/skills/system-spec-kit/feature_catalog/13--memory-quality-and-indexing/13-entity-normalization-consolidation.md
.opencode/skills/system-spec-kit/feature_catalog/05--lifecycle/08-constitutional-memory-end-to-end-lifecycle.md
.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/09-tool-result-extraction-to-working-memory.md
.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/10-fast-delegated-search-memory-quick-search.md
.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/02-semantic-and-lexical-search-memorysearch.md
.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/03-trigger-phrase-matching-memorymatchtriggers.md
.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/11-session-recovery-spec-kit-resume.md
.opencode/skills/system-spec-kit/feature_catalog/01--retrieval/01-unified-context-retrieval-memorycontext.md
.opencode/skills/system-spec-kit/feature_catalog/17--governance/06-session-resume-caller-binding-and-unicode-sanitization.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/008-invalid-anchors/memory/context.md
.opencode/skills/system-spec-kit/feature_catalog/06--analysis/07-learning-history-memorygetlearninghistory.md
.opencode/skills/system-spec-kit/feature_catalog/06--analysis/02-causal-graph-statistics-memorycausalstats.md
.opencode/skills/system-spec-kit/feature_catalog/06--analysis/01-causal-edge-creation-memorycausallink.md
.opencode/skills/system-spec-kit/feature_catalog/06--analysis/04-causal-chain-tracing-memorydriftwhy.md
.opencode/skills/system-spec-kit/feature_catalog/06--analysis/03-causal-edge-deletion-memorycausalunlink.md
.opencode/skills/system-spec-kit/feature_catalog/08--bug-fixes-and-data-integrity/11-working-memory-timestamp-fix.md
.opencode/skills/system-spec-kit/manual_testing_playbook/16--tooling-and-scripts/147-constitutional-memory-manager-command.md
.opencode/skills/system-spec-kit/manual_testing_playbook/16--tooling-and-scripts/247-memory-quality-kpi-reporting.md
.opencode/skills/system-spec-kit/manual_testing_playbook/16--tooling-and-scripts/239-memory-maintenance-and-migration-clis.md
.opencode/skills/system-spec-kit/manual_testing_playbook/16--tooling-and-scripts/186-memory-manage-command-routing.md
.opencode/skills/system-spec-kit/manual_testing_playbook/16--tooling-and-scripts/149-rendered-memory-template-contract.md
.opencode/skills/system-spec-kit/feature_catalog/09--evaluation-and-measurement/17-memory-roadmap-baseline-snapshot.md
.opencode/skills/system-spec-kit/feature_catalog/22--context-preservation-and-code-graph/18-session-resume-tool.md
.opencode/skills/system-spec-kit/feature_catalog/19--feature-flag-reference/04-4-memory-and-storage.md
.opencode/skills/system-spec-kit/feature_catalog/19--feature-flag-reference/11-memory-roadmap-capability-flags.md
.opencode/skills/system-spec-kit/manual_testing_playbook/18--ux-hooks/210-memory-health-autorepair-metadata.md
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/03-single-and-folder-delete-memorydelete.md
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/01-memory-indexing-memorysave.md
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/10-per-memory-history-log.md
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/04-tier-based-bulk-deletion-memorybulkdelete.md
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/02-memory-metadata-update-memoryupdate.md
.opencode/skills/system-spec-kit/feature_catalog/02--mutation/05-validation-feedback-memoryvalidate.md
.opencode/skills/system-spec-kit/feature_catalog/14--pipeline-architecture/02-mpab-chunk-to-memory-aggregation.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/007-valid-anchors/memory/context.md
.opencode/skills/system-spec-kit/feature_catalog/04--maintenance/01-workspace-scanning-and-indexing-memoryindexscan.md
.opencode/skills/system-spec-kit/scripts/tests/memory-template-contract.vitest.ts
.opencode/skills/system-spec-kit/scripts/tests/memory-quality-phase6-migration.test.ts
.opencode/skills/system-spec-kit/scripts/test-fixtures/015-anchors-no-memory/spec.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/015-anchors-no-memory/plan.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/015-anchors-no-memory/tasks.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/015-anchors-no-memory/implementation-summary.md
.opencode/skills/system-spec-kit/feature_catalog/10--graph-signal-activation/08-graph-and-cognitive-memory-fixes.md
.opencode/skills/system-spec-kit/feature_catalog/03--discovery/02-system-statistics-memorystats.md
.opencode/skills/system-spec-kit/feature_catalog/03--discovery/03-health-diagnostics-memoryhealth.md
.opencode/skills/system-spec-kit/feature_catalog/03--discovery/01-memory-browser-memorylist.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/048-with-memory-placeholders/spec.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/048-with-memory-placeholders/plan.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/048-with-memory-placeholders/tasks.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/048-with-memory-placeholders/implementation-summary.md
.opencode/skills/system-spec-kit/feature_catalog/15--retrieval-enhancements/05-memory-summary-search-channel.md
.opencode/skills/system-spec-kit/feature_catalog/15--retrieval-enhancements/02-constitutional-memory-as-expert-knowledge-injection.md
.opencode/skills/system-spec-kit/feature_catalog/15--retrieval-enhancements/01-dual-scope-memory-auto-surface.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/048-with-memory-placeholders/memory/context.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP7-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC3-path-fragment.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP-clean.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC2-degraded-fallback.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-004a-in-progress.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP4-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC4-importance-tier.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-broken-D4.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-003-canonical-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP3-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC3-synthetic-bigrams.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-005b-clean.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-broken-D8.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-002b-proposition-overlap.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC3-standalone-stopwords.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP2-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP5-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-004a-completed-closure-triple.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC1-truncation.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-broken-D7.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-003-tree-thinning-files.json
.opencode/skills/system-spec-kit/scripts/test-fixtures/012-anchors-empty-memory/spec.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/012-anchors-empty-memory/plan.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/012-anchors-empty-memory/tasks.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/012-anchors-empty-memory/implementation-summary.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/migration/F-MIG-003-title-overlap.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/migration/F-MIG-002-clean.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/migration/F-MIG-001-junk-residual.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC3-happy-path.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC2-authored-decisions.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP1-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-005a-anchor-scaffolding.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-CHECK-DUP6-trigger.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-001-trigger-cluster.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC3-suspicious-prefix.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-004b-last-clipping.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-broken-D1.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-002a-blank-observation-titles.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC8-clean.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC6-provenance.json
.opencode/skills/system-spec-kit/scripts/test-fixtures/013-anchors-multiple-files/memory/invalid.md
.opencode/skills/system-spec-kit/scripts/test-fixtures/013-anchors-multiple-files/memory/valid.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-DUP-005b-frontmatter-mirror.json
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/hit/spec.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/miss/spec.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/ambiguity/spec.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/miss/memory/06-04-26_09-00__orphan-notes.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/hit/memory/06-04-26_12-30__project-notes.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/hit/memory/06-04-26_12-05__deep-research-run-8.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/ambiguity/memory/06-04-26_09-00__candidate-b.md
.opencode/skills/system-spec-kit/scripts/tests/fixtures/memory-quality/F-AC5-lineage/ambiguity/memory/06-04-26_09-00__candidate-a.md

mcp: spec_kit_memory/memory_match_triggers started
mcp: spec_kit_memory/memory_match_triggers (failed)
user cancelled MCP tool call
mcp: spec_kit_memory/memory_context started
mcp: spec_kit_memory/memory_context (failed)
user cancelled MCP tool call
codex
The MCP memory lookup was cancelled, so I’m staying with local repo evidence. Enough is already visible from the canonical docs; I’m adding a quick pass over the live handler/tool files to map docs to code.
exec
/bin/zsh -lc "sed -n '1,240p' .opencode/skills/system-spec-kit/mcp_server/tools/memory-tools.ts" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
// ───────────────────────────────────────────────────────────────
// MODULE: Memory Tools
// ───────────────────────────────────────────────────────────────
// Dispatch for L2-L4 memory tools: search, triggers, save,
// List, stats, health, delete, update, validate (T303).
import {
  handleMemorySearch,
  handleMemoryMatchTriggers,
  handleMemorySave,
  handleMemoryList,
  handleMemoryStats,
  handleMemoryHealth,
  handleMemoryDelete,
  handleMemoryUpdate,
  handleMemoryValidate,
  handleMemoryBulkDelete,
} from '../handlers/index.js';
import { validateToolArgs } from '../schemas/tool-input-schemas.js';

import { parseArgs } from './types.js';
import type {
  MCPResponse,
  SearchArgs,
  TriggerArgs,
  SaveArgs,
  ListArgs,
  StatsArgs,
  HealthArgs,
  DeleteArgs,
  UpdateArgs,
  MemoryValidateArgs,
  BulkDeleteArgs,
} from './types.js';

function relabelResponseTool(response: MCPResponse, toolName: string): MCPResponse {
  const firstEntry = response?.content?.[0];
  if (!firstEntry || firstEntry.type !== 'text' || typeof firstEntry.text !== 'string') {
    return response;
  }

  try {
    const envelope = JSON.parse(firstEntry.text) as Record<string, unknown>;
    const meta = envelope.meta && typeof envelope.meta === 'object'
      ? envelope.meta as Record<string, unknown>
      : {};
    envelope.meta = {
      ...meta,
      tool: toolName,
    };

    return {
      ...response,
      content: [{ ...firstEntry, text: JSON.stringify(envelope, null, 2) }],
    };
  } catch {
    return response;
  }
}

/** Tool names handled by this module */
export const TOOL_NAMES = new Set([
  'memory_search',
  'memory_quick_search',
  'memory_match_triggers',
  'memory_save',
  'memory_list',
  'memory_stats',
  'memory_health',
  'memory_delete',
  'memory_update',
  'memory_validate',
  'memory_bulk_delete',
]);

/** Dispatch a tool call. Returns null if tool name not handled. */
export async function handleTool(name: string, args: Record<string, unknown>): Promise<MCPResponse | null> {
  switch (name) {
    case 'memory_search':         return handleMemorySearch(parseArgs<SearchArgs>(validateToolArgs('memory_search', args)));
    case 'memory_quick_search': {
      // E3: Delegate to memory_search with sensible defaults
      const validated = validateToolArgs('memory_quick_search', args);
      const quickArgs: SearchArgs = {
        query: validated.query as string,
        limit: typeof validated.limit === 'number' ? validated.limit : 10,
        specFolder: validated.specFolder as string | undefined,
        tenantId: validated.tenantId as string | undefined,
        userId: validated.userId as string | undefined,
        agentId: validated.agentId as string | undefined,
        autoDetectIntent: true,
        enableDedup: true,
        includeContent: true,
        includeConstitutional: true,
        rerank: true,
      };
      const response = await handleMemorySearch(quickArgs);
      return relabelResponseTool(response, 'memory_quick_search');
    }
    case 'memory_match_triggers': return handleMemoryMatchTriggers(parseArgs<TriggerArgs>(validateToolArgs('memory_match_triggers', args)));
    case 'memory_save':           return handleMemorySave(parseArgs<SaveArgs>(validateToolArgs('memory_save', args)));
    case 'memory_list':           return handleMemoryList(parseArgs<ListArgs>(validateToolArgs('memory_list', args)));
    case 'memory_stats':          return handleMemoryStats(parseArgs<StatsArgs>(validateToolArgs('memory_stats', args)));
    case 'memory_health':         return handleMemoryHealth(parseArgs<HealthArgs>(validateToolArgs('memory_health', args)));
    case 'memory_delete':         return handleMemoryDelete(parseArgs<DeleteArgs>(validateToolArgs('memory_delete', args)));
    case 'memory_update':         return handleMemoryUpdate(parseArgs<UpdateArgs>(validateToolArgs('memory_update', args)));
    case 'memory_validate':       return handleMemoryValidate(parseArgs<MemoryValidateArgs>(validateToolArgs('memory_validate', args)));
    case 'memory_bulk_delete':    return handleMemoryBulkDelete(parseArgs<BulkDeleteArgs>(validateToolArgs('memory_bulk_delete', args)));
    default: return null;
  }
}

exec
/bin/zsh -lc "sed -n '1,220p' .opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
// ────────────────────────────────────────────────────────────────
// MODULE: Memory Context
// ────────────────────────────────────────────────────────────────

import { randomUUID } from 'crypto';
import { readFileSync } from 'node:fs';

// Layer definitions
import * as layerDefs from '../lib/architecture/layer-definitions.js';
import { checkDatabaseUpdated } from '../core/index.js';
import { toErrorMessage } from '../utils/index.js';

// Intent classifier
import * as intentClassifier from '../lib/search/intent-classifier.js';
import type { IntentTelemetry } from '../lib/search/intent-classifier.js';

// Query-intent routing (Phase 020: structural/semantic/hybrid classification)
import { classifyQueryIntent } from '../code_graph/lib/query-intent-classifier.js';
import { buildContext } from '../code_graph/lib/code-graph-context.js';

// Core handlers for routing
import { handleMemorySearch } from './memory-search.js';
import { handleMemoryMatchTriggers } from './memory-triggers.js';

// Response envelope
import { createMCPErrorResponse, createMCPResponse } from '../lib/response/envelope.js';

// Token estimation
import { estimateTokens } from '../formatters/token-metrics.js';
import {
  getPressureLevel,
  type RuntimeContextStats,
} from '../lib/cognitive/pressure-monitor.js';
import * as workingMemory from '../lib/cognitive/working-memory.js';
import * as sessionManager from '../lib/session/session-manager.js';

// Telemetry
import * as retrievalTelemetry from '../lib/telemetry/retrieval-telemetry.js';
import { initConsumptionLog, logConsumptionEvent } from '../lib/telemetry/consumption-logger.js';
import {
  attachSessionTransitionTrace,
  buildSessionTransitionTrace,
  type SessionTransitionTrace,
} from '../lib/search/session-transition.js';

// Eval logger — fail-safe, no-op when SPECKIT_EVAL_LOGGING !== "true"
import { logSearchQuery, logChannelResult, logFinalResult } from '../lib/eval/eval-logger.js';
import * as vectorIndex from '../lib/search/vector-index.js';

// Shared handler types
import type { MCPResponse } from './types.js';

// PI-B3: Folder discovery integration
import { discoverSpecFolder, getSpecsBasePaths } from '../lib/search/folder-discovery.js';
import {
  isAutoResumeEnabled,
  isFolderDiscoveryEnabled,
  isPressurePolicyEnabled,
  isIntentAutoProfileEnabled,
} from '../lib/search/search-flags.js';
import { buildResumeLadder, type ResumeLadderResult } from '../lib/resume/resume-ladder.js';

// Feature catalog: Unified context retrieval (memory_context)
// Feature catalog: Dual-scope memory auto-surface
// Feature catalog: Provenance-rich response envelopes


/* ───────────────────────────────────────────────────────────────
   1. TYPES
──────────────────────────────────────────────────────────────── */

interface ContextMode {
  readonly name: string;
  readonly description: string;
  readonly strategy: string;
  readonly tokenBudget?: number;
}

interface ContextOptions {
  specFolder?: string;
  folderBoost?: { folder: string; factor: number };
  tenantId?: string;
  userId?: string;
  agentId?: string;
  limit?: number;
  sessionId?: string;
  enableDedup?: boolean;
  includeContent?: boolean;
  includeTrace?: boolean; // CHK-040: Forward to internal memory_search calls
  anchors?: string[];
  profile?: string;
  sessionTransition?: SessionTransitionTrace;
}

interface SessionLifecycleMetadata {
  sessionScope: 'caller' | 'ephemeral';
  requestedSessionId: string | null;
  effectiveSessionId: string;
  resumed: boolean;
  eventCounterStart: number;
  resumedContextCount: number;
}

interface ContextResult extends Record<string, unknown> {
  strategy: string;
  mode: string;
}

interface LayerInfo {
  tokenBudget?: number;
}

interface ContextArgs {
  input: string;
  mode?: string;
  intent?: string;
  specFolder?: string;
  tenantId?: string;
  userId?: string;
  agentId?: string;
  limit?: number;
  sessionId?: string;
  enableDedup?: boolean;
  includeContent?: boolean;
  includeTrace?: boolean; // CHK-040: Forward to internal memory_search calls
  tokenUsage?: number;
  anchors?: string[];
  /** REQ-D5-003: Presentation profile ('quick'|'research'|'resume'|'debug'). Default: full response. */
  profile?: string;
}

/** T205: Token budget enforcement metadata */
type DroppedAllResultsReason = 'impossible_budget' | 'parse_failed' | 'no_survivor_fits';

interface TokenBudgetEnforcement {
  budgetTokens: number;
  preEnforcementTokens: number;
  returnedTokens: number;
  /** Backward-compatible alias of returnedTokens. */
  actualTokens: number;
  enforced: boolean;
  truncated: boolean;
  originalResultCount?: number;
  returnedResultCount?: number;
  droppedAllResultsReason?: DroppedAllResultsReason;
}

type PressureOverrideTargetMode = 'quick' | 'focused' | null;

interface SessionLifecycleResolution {
  requestedSessionId: string | null;
  effectiveSessionId: string;
  resumed: boolean;
  priorMode: string | null;
  counter: number;
  error?: string;
}

interface EffectiveModeIntentClassification {
  detectedIntent?: string;
  intentConfidence: number;
  intentEvidence: string[];
  resumeHeuristicApplied: boolean;
  source: 'explicit' | 'auto-detected';
}

interface EffectiveModeResolution {
  effectiveMode: string;
  pressureOverrideApplied: boolean;
  pressureOverrideTargetMode: PressureOverrideTargetMode;
  pressureWarning: string | null;
  intentClassification: EffectiveModeIntentClassification;
}

interface BuildResponseMetaParams {
  effectiveMode: string;
  requestedMode: string;
  tracedResult: ContextResult;
  pressurePolicy: {
    level: string;
    ratio: number | null;
    source: string;
    warning: string | null;
  };
  pressureOverrideApplied: boolean;
  pressureOverrideTargetMode: PressureOverrideTargetMode;
  pressureWarning: string | null;
  sessionLifecycle: SessionLifecycleMetadata;
  effectiveBudget: number;
  enforcement: TokenBudgetEnforcement;
  intentClassification: EffectiveModeIntentClassification;
  discoveredFolder?: string;
  includeTrace: boolean;
  sessionTransition: SessionTransitionTrace;
  structuralRoutingNudge: StructuralRoutingNudgeMeta | null;
  intentTelemetry: IntentTelemetry | null;
}

interface QueryIntentMetadata {
  queryIntent: string;
  routedBackend: string;
  confidence: number;
  matchedKeywords?: string[];
}

interface StrategyErrorPayload {
  error: string;
  code: string;
  details: Record<string, unknown>;
  hints: string[];
  severity: string | null;
}

interface StructuralRoutingNudgeMeta {
  advisory: true;
  advisoryPreset: 'ready';
  preferredTool: 'code_graph_query';
  message: string;
  preservesAuthority: 'session_bootstrap';
}

exec
/bin/zsh -lc "sed -n '1,220p' .opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
// ───────────────────────────────────────────────────────────────
// MODULE: Memory Search
// ───────────────────────────────────────────────────────────────
/* ───────────────────────────────────────────────────────────────
   1. DEPENDENCIES
──────────────────────────────────────────────────────────────── */

import * as toolCache from '../lib/cache/tool-cache.js';
import * as causalEdges from '../lib/storage/causal-edges.js';
import * as sessionManager from '../lib/session/session-manager.js';
import * as intentClassifier from '../lib/search/intent-classifier.js';
// TierClassifier, crossEncoder imports removed — only used by legacy V1 pipeline.
import { isSessionBoostEnabled, isCausalBoostEnabled, isCommunitySearchFallbackEnabled, isDualRetrievalEnabled, isIntentAutoProfileEnabled } from '../lib/search/search-flags.js';
import { searchCommunities } from '../lib/search/community-search.js';
// 4-stage pipeline architecture
import { executePipeline } from '../lib/search/pipeline/index.js';
import type { PipelineConfig, PipelineResult } from '../lib/search/pipeline/index.js';
import type { IntentWeightsConfig } from '../lib/search/pipeline/types.js';
import { initConsumptionLog, logConsumptionEvent } from '../lib/telemetry/consumption-logger.js';
import * as retrievalTelemetry from '../lib/telemetry/retrieval-telemetry.js';
// Artifact-class routing (spec/plan/tasks/checklist/memory)
import { getStrategyForQuery } from '../lib/search/artifact-routing.js';
// Chunk reassembly (extracted from this file)
import { collapseAndReassembleChunkResults } from '../lib/search/chunk-reassembly.js';
// Search utilities (extracted from this file)
import {
  filterByMinQualityScore,
  resolveQualityThreshold,
  buildCacheArgs,
  resolveRowContextType,
  resolveArtifactRoutingQuery,
  applyArtifactRouting,
} from '../lib/search/search-utils.js';
// CacheArgsInput used internally by buildCacheArgs (lib/search/search-utils.ts)
// Eval channel tracking (extracted from this file)
import {
  collectEvalChannelsFromRow,
  buildEvalChannelPayloads,
  summarizeGraphWalkDiagnostics,
} from '../lib/telemetry/eval-channel-tracking.js';
import type { EvalChannelPayload } from '../lib/telemetry/eval-channel-tracking.js';

// Eval logger — fail-safe, no-op when SPECKIT_EVAL_LOGGING !== "true"
import { logSearchQuery, logChannelResult, logFinalResult } from '../lib/eval/eval-logger.js';
import {
  logFeedbackEvents,
  isImplicitFeedbackLogEnabled,
} from '../lib/feedback/feedback-ledger.js';
import type { FeedbackEvent } from '../lib/feedback/feedback-ledger.js';
import { trackQueryAndDetect, logResultCited } from '../lib/feedback/query-flow-tracker.js';

// Core utilities
import { checkDatabaseUpdated, isEmbeddingModelReady, waitForEmbeddingModel } from '../core/index.js';
import { validateQuery, requireDb, toErrorMessage } from '../utils/index.js';

// Response envelope + formatters
import { createMCPErrorResponse, createMCPSuccessResponse } from '../lib/response/envelope.js';
import { formatSearchResults } from '../formatters/index.js';

// Shared handler types
import type { MCPResponse, IntentClassification } from './types.js';

// Retrieval trace contracts (C136-08)
import { createTrace } from '@spec-kit/shared/contracts/retrieval-trace';
import { buildAdaptiveShadowProposal } from '../lib/cognitive/adaptive-ranking.js';
import { normalizeScopeContext } from '../lib/governance/scope-governance.js';
import {
  attachSessionTransitionTrace,
  type SessionTransitionTrace,
} from '../lib/search/session-transition.js';

// REQ-D5-003: Mode-Aware Response Shape
import {
  applyProfileToEnvelope,
  isResponseProfileEnabled,
} from '../lib/response/profile-formatters.js';
import {
  buildProgressiveResponse,
  extractSnippets,
  isProgressiveDisclosureEnabled,
  resolveCursor,
} from '../lib/search/progressive-disclosure.js';
import {
  SPEC_DOCUMENT_FILENAMES,
  canClassifyAsSpecDocument,
  normalizeSpecPath,
} from '../lib/config/spec-doc-paths.js';
import {
  getLastLexicalCapabilitySnapshot,
  resetLastLexicalCapabilitySnapshot,
} from '../lib/search/sqlite-fts.js';
import type { LexicalCapabilitySnapshot } from '../lib/search/sqlite-fts.js';
import { evaluatePublicationGate } from '../lib/context/publication-gate.js';
import {
  deduplicateResults as deduplicateWithSessionState,
  isSessionRetrievalStateEnabled,
  manager as retrievalSessionStateManager,
  refineForGoal,
} from '../lib/search/session-state.js';

// Type imports for casting
import type { IntentType, IntentWeights as IntentClassifierWeights } from '../lib/search/intent-classifier.js';
import type { RawSearchResult } from '../formatters/index.js';
// RoutingResult, WeightedResult — now used internally by lib/search/search-utils.ts

// Feature catalog: Semantic and lexical search (memory_search)
// Feature catalog: Hybrid search pipeline
// Feature catalog: 4-stage pipeline architecture
// Feature catalog: Quality-aware 3-tier search fallback


/* ───────────────────────────────────────────────────────────────
   2. TYPES
──────────────────────────────────────────────────────────────── */

/**
 * Internal search result row — enriched DB row used within this handler.
 * NOT the same as the canonical SearchResult in shared/types.ts.
 * Self-contained: uses local types instead of the deprecated MemoryRow/MemoryRecord shapes.
 * This can migrate to MemoryDbRow & Record<string, unknown> later without changing the handler contract.
 */
interface MemorySearchRow extends Record<string, unknown> {
  id: number;
  similarity?: number;
  importance_tier?: string;
  contextType?: string;
  context_type?: string;
  attentionScore?: number;
  retrievability?: number;
  stability?: number;
  last_review?: string | null;
  created_at?: string;
  last_accessed?: number;
  content?: string;
  memoryState?: string;
  file_path?: string;
  parent_id?: number | null;
  chunk_index?: number | null;
  chunk_label?: string | null;
  isChunk?: boolean;
  parentId?: number | null;
  chunkIndex?: number | null;
  chunkLabel?: string | null;
  chunkCount?: number | null;
  contentSource?: 'reassembled_chunks' | 'file_read_fallback';
  precomputedContent?: string;
}

interface DedupResult {
  results: MemorySearchRow[];
  dedupStats: Record<string, unknown>;
}

interface SearchCachePayload {
  summary: string;
  data: Record<string, unknown>;
  hints: string[];
}

type SessionAwareResult = Record<string, unknown> & {
  id: number | string;
  score?: number;
  content?: string;
};

type CanonicalSourceKind = 'spec_doc' | 'continuity' | 'constitutional';

interface CanonicalSourceStats {
  retained: number;
  dropped: number;
  bySourceKind: Record<CanonicalSourceKind, number>;
}

const CONTINUITY_ANCHOR_ID = '_memory.continuity';
const CANONICAL_READER_CACHE_VERSION = 'gate-d-reader-ready-v1';
const CANONICAL_SPEC_DOC_DOCUMENT_TYPES = new Set([
  'spec',
  'plan',
  'tasks',
  'checklist',
  'decision_record',
  'implementation_summary',
  'research',
  'handover',
  'graph_metadata',
  'spec_doc',
]);
const NON_CANONICAL_DOCUMENT_TYPES = new Set([
  'memory',
  'scratch',
]);

function normalizeDocumentType(value: unknown): string | null {
  if (typeof value !== 'string') {
    return null;
  }
  const normalized = value.trim().toLowerCase();
  return normalized.length > 0 ? normalized : null;
}

function resolveAnchorId(row: Record<string, unknown>): string | null {
  const value = row.anchor_id ?? row.anchorId;
  return typeof value === 'string' && value.trim().length > 0
    ? value.trim()
    : null;
}

function resolveFilePath(row: Record<string, unknown>): string | null {
  const value = row.file_path ?? row.filePath;
  return typeof value === 'string' && value.trim().length > 0
    ? value
    : null;
}

function resolveCanonicalSourceKind(row: Record<string, unknown>): CanonicalSourceKind | null {
  const documentType = normalizeDocumentType(row.document_type ?? row.documentType);
  const importanceTier = normalizeDocumentType(row.importance_tier ?? row.importanceTier);
  const anchorId = resolveAnchorId(row);

  if (importanceTier === 'constitutional' || documentType === 'constitutional') {

exec
/bin/zsh -lc "sed -n '1,220p' .opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
// ───────────────────────────────────────────────────────────────
// MODULE: Memory Save Handler
// ───────────────────────────────────────────────────────────────
/* --- 1. DEPENDENCIES --- */

// Node built-ins
import { createHash, randomUUID } from 'node:crypto';
import * as fs from 'node:fs';
import path from 'path';

// Shared packages
import { validateFilePath } from '@spec-kit/shared/utils/path-security';
import {
  evaluateMemorySufficiency,
  MEMORY_SUFFICIENCY_REJECTION_CODE,
  type MemorySufficiencyResult,
} from '@spec-kit/shared/parsing/memory-sufficiency';
import {
  validateMemoryTemplateContract,
  type MemoryTemplateContractResult,
} from '@spec-kit/shared/parsing/memory-template-contract';
import {
  evaluateSpecDocHealth,
  type SpecDocHealthResult,
} from '@spec-kit/shared/parsing/spec-doc-health';

// Internal modules
import { ALLOWED_BASE_PATHS, checkDatabaseUpdated } from '../core/index.js';
import { createFilePathValidator } from '../utils/validators.js';
import * as memoryParser from '../lib/parsing/memory-parser.js';
import * as transactionManager from '../lib/storage/transaction-manager.js';
import * as checkpoints from '../lib/storage/checkpoints.js';
import * as preflight from '../lib/validation/preflight.js';
import { requireDb } from '../utils/index.js';
import type { MCPResponse } from './types.js';
import { createAppendOnlyMemoryRecord, recordLineageVersion } from '../lib/storage/lineage-state.js';
import { determineAction } from '../lib/storage/reconsolidation.js';
import * as causalEdges from '../lib/storage/causal-edges.js';

import { runQualityGate, isQualityGateEnabled } from '../lib/validation/save-quality-gate.js';
import {
  isPostInsertEnrichmentEnabled,
  isSaveQualityGateEnabled,
  isSaveReconsolidationEnabled,
  resolveSavePlannerMode,
} from '../lib/search/search-flags.js';

import { getCanonicalPathKey, resolveCanonicalPath } from '../lib/utils/canonical-path.js';
import { isConstitutionalPath, shouldIndexForMemory } from '../lib/utils/index-scope.js';
import { findSimilarMemories } from './pe-gating.js';
import { runPostMutationHooks } from './mutation-hooks.js';
import { buildMutationHookFeedback } from '../hooks/mutation-feedback.js';
import { indexChunkedMemoryFile, shouldUseChunkedIndexing } from './chunking-orchestrator.js';
import { applyPostInsertMetadata } from './save/db-helpers.js';
import {
  createMemoryRecord,
  findSamePathExistingMemory,
  type CreateRecordIdentityHints,
  type MemoryScopeMatch,
} from './save/create-record.js';
import {
  buildGovernanceLogicalKey,
  buildGovernancePostInsertFields,
  ensureGovernanceRuntime,
  recordGovernanceAudit,
  recordTierDowngradeAudit,
  validateGovernedIngest,
} from '../lib/governance/scope-governance.js';
import { delete_memory_from_database } from '../lib/search/vector-index-mutations.js';
import {
  runQualityLoop,
} from './quality-loop.js';
import type {
  QualityLoopResult,
} from './quality-loop.js';

// O2-5/O2-12: V-rule validation (previously only in workflow path)
import {
  validateMemoryQualityContent,
  determineValidationDisposition,
} from './v-rule-bridge.js';

// Save pipeline modules (CR-P2-4 decomposition)
import type {
  IndexResult,
  RouteCategory,
  MergeModeHint,
  SaveArgs,
  AtomicSaveParams,
  AtomicSaveOptions,
  AtomicSaveResult,
  PlannerAdvisory,
  PlannerBlocker,
  PlannerFollowUpAction,
  PlannerRouteTarget,
} from './save/index.js';
import { checkExistingRow, checkContentHashDedup } from './save/dedup.js';
import { generateOrCacheEmbedding, persistPendingEmbeddingCacheWrite } from './save/embedding-pipeline.js';
import { evaluateAndApplyPeDecision } from './save/pe-orchestration.js';
import {
  findScopeFilteredCandidates,
  getRequestedScope,
  runReconsolidationIfEnabled,
} from './save/reconsolidation-bridge.js';
import { runPostInsertEnrichmentIfEnabled } from './save/post-insert.js';
import {
  buildIndexResult,
  buildPlannerResponse,
  buildSaveResponse,
  serializePlannerAdvisory,
  serializePlannerBlocker,
  serializePlannerFollowUpAction,
  serializePlannerProposedEdit,
  serializePlannerRouteTarget,
} from './save/response-builder.js';
import type {
  IndexingOrigin,
  ReconsolidationFailureReason,
  ReconsolidationOperationState,
} from './save/types.js';
import { atomicIndexMemory } from './save/atomic-index-memory.js';
import { createMCPErrorResponse } from '../lib/response/envelope.js';
import {
  buildTier3Prompt,
  createContentRouter,
  getTier3Contract,
  isTier3RoutingEnabled,
  InMemoryRouterCache,
  TIER2_FALLBACK_PENALTY,
  TIER3_THRESHOLD,
  type RoutingDecision,
  type Tier3ClassifierInput,
  type Tier3RawResponse,
} from '../lib/routing/content-router.js';
import { anchorMergeOperation } from '../lib/merge/anchor-merge-operation.js';
import {
  readThinContinuityRecord,
  upsertThinContinuityInMarkdown,
  type ThinContinuityRecord,
} from '../lib/continuity/thin-continuity-record.js';
import {
  runSpecDocStructureRule,
  type ContaminationPlan,
  type MergePlan,
  type PostSavePlan,
} from '../lib/validation/spec-doc-structure.js';
import { detectSpecLevelFromParsed } from './handler-utils.js';

// Extracted sub-modules
import { withSpecFolderLock } from './save/spec-folder-mutex.js';
import { buildParsedMemoryEvidenceSnapshot } from './save/markdown-evidence-builder.js';
import {
  applyInsufficiencyMetadata,
  buildInsufficiencyRejectionResult,
  buildTemplateContractRejectionResult,
  buildDryRunSummary,
  buildPlannerAdvisory,
  buildPlannerBlocker,
} from './save/validation-responses.js';

import { markMemorySuperseded } from './pe-gating.js';
import { resolveMemoryReference } from './causal-links-processor.js';
import { refreshAutoEntitiesForMemory } from '../lib/extraction/entity-extractor.js';

// Feature catalog: Memory indexing (memory_save)
// Feature catalog: Verify-fix-verify memory quality loop
// Feature catalog: Dry-run preflight for memory_save
// Feature catalog: Prediction-error save arbitration


// Create local path validator
const validateFilePathLocal = createFilePathValidator(ALLOWED_BASE_PATHS, validateFilePath);
const MANUAL_FALLBACK_SOURCE_CLASSIFICATION = 'manual-fallback' as const;
const ROUTED_CONTINUITY_ANCHOR_ID = '_memory.continuity';
const tier3RoutingCache = new InMemoryRouterCache();

interface PreparedParsedMemory {
  parsed: ReturnType<typeof memoryParser.parseMemoryFile>;
  validation: ReturnType<typeof memoryParser.validateParsedMemory>;
  qualityLoopResult: QualityLoopResult;
  sufficiencyResult: MemorySufficiencyResult;
  templateContract: MemoryTemplateContractResult;
  specDocHealth: SpecDocHealthResult | null;
  finalizedFileContent: string | null;
  sourceClassification: 'template-generated' | typeof MANUAL_FALLBACK_SOURCE_CLASSIFICATION;
}

type ParsedMemoryWithIndexHints = ReturnType<typeof memoryParser.parseMemoryFile> & {
  _skipIndex?: boolean;
  _vRuleIndexBlockIds?: string[];
};

interface RoutedSaveOptions extends CreateRecordIdentityHints {
  routeAs?: RouteCategory;
  mergeModeHint?: MergeModeHint;
}

interface RoutedRecordIdentity {
  targetDocPath: string;
  canonicalFilePath: string;
  targetAnchorId: string | null;
  routeAs: RouteCategory | null;
  continuitySourceKey: string | null;
}

type CanonicalPacketLevel = 'L1' | 'L2' | 'L3' | 'L3+';
type CanonicalPacketKind = 'feature' | 'phase' | 'remediation' | 'research' | 'unknown';

interface CanonicalAtomicValidatorPlan {
  folder: string;
  level: string;
  mergePlan: MergePlan | null;
  contaminationPlan: ContaminationPlan | null;
  postSavePlan: PostSavePlan | null;
}

interface CanonicalAtomicPrepared {
  preparedMemory: PreparedParsedMemory;
  routing: RoutedSaveOptions;
  validatorPlan: CanonicalAtomicValidatorPlan | null;

exec
/bin/zsh -lc "nl -ba .opencode/skills/system-spec-kit/references/memory/memory_system.md | sed -n '8,140p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
exec
/bin/zsh -lc "nl -ba .opencode/skills/system-spec-kit/references/memory/save_workflow.md | sed -n '8,210p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
     8	Spec Kit Memory MCP tools, behavior notes, and configuration options.
     9	
    10	Current baseline: schema v23 (`document_type`, `spec_level`), 3 indexed content sources, 7 intent types, and `includeSpecDocs: true` by default.
    11	
    12	---
    13	
    14	<!-- ANCHOR:overview -->
    15	## 1. OVERVIEW
    16	
    17	The Spec Kit Memory system provides context preservation across sessions through vector-based semantic search and packet-first continuity. Phase 018 makes `handover.md -> _memory.continuity -> spec docs` the canonical recovery chain; retired `[spec]/memory/*.md` artifacts are no longer produced at save time and only matter when older packets still contain them. This reference covers MCP tool behavior, importance tiers, decay scoring, and configuration.
    18	
    19	When a save mutates indexed state, the runtime also updates the `DB_UPDATED_FILE` marker from `mcp_server/core/config.ts`. Long-lived MCP processes poll that marker with `checkDatabaseUpdated()` so canonical-doc writes become visible without restarting the server.
    20	
    21	### Architecture
    22	
    23	| Component | Location | Purpose |
    24	|-----------|----------|---------|
    25	| MCP Server | `mcp_server/context-server.ts` | Spec Kit Memory MCP with vector search |
    26	| Database | `mcp_server/dist/database/context-index.sqlite` | SQLite with FTS5 + vector embeddings (canonical runtime path; `mcp_server/database/context-index.sqlite` is a compatibility symlink) |
    27	| Constitutional | `constitutional/` | Always-surface rules (Gate 3 enforcement) |
    28	| Scripts | runtime `scripts/dist/memory/generate-context.js` (source: `scripts/memory/generate-context.ts`) | Canonical continuity save entrypoint for packet docs |
    29	
    30	### Core Capabilities
    31	
    32	- **Semantic search** - Find indexed spec-doc records by meaning, not just keywords
    33	- **Importance tiers** - Six-level system for prioritizing context
    34	- **Decay scoring** - Recent indexed spec-doc records rank higher than older ones
    35	- **Checkpoints** - Save/restore indexed-continuity state snapshots
    36	- **Constitutional tier** - Critical rules that always surface
    37	
    38	### Indexable Content Sources
    39	
    40	The indexed-continuity store indexes content from two active sources, plus a retired-compatibility row preserved for read-side retrieval against historical packets:
    41	
    42	| Source | Location Pattern | Memory Type | Default Tier | Discovery |
    43	|--------|-----------------|-------------|--------------|-----------|
    44	| **Spec Documents** | `specs/**/*.md` and `.opencode/specs/**/*.md` | Per-type (spec, plan, tasks, etc.) | `normal` | `findSpecDocuments()` |
    45	| **Constitutional Rules** | `.opencode/skills/*/constitutional/*.md` | `meta-cognitive` | `constitutional` | `findConstitutionalFiles()` |
    46	| **Retired Compatibility Artifacts** | Older `specs/*/memory/*.{md,txt}` files already present in historical packets | Varies (episodic, procedural, etc.) | `normal` | Historical compatibility only |
    47	
    48	**Content Source Behavior:**
    49	
    50	- **Spec Documents** — Canonical packet continuity source. Recovery should read `handover.md`, then `_memory.continuity`, then the rest of the packet docs before widening into search.
    51	- **Constitutional Rules** — Always-surface critical rules. Injected at top of every search result. No decay.
    52	- **Retired Compatibility Artifacts** — Older session notes may still exist in historical packets, but save workflows no longer produce them and operators should not treat them as an active surface.
    53	
    54	**Spec Document Indexing Pipeline:**
    55	1. `findSpecDocuments()` walks both supported specs roots and discovers supported doc filenames
    56	2. `isMemoryFile()` validates each document as an indexable file
    57	3. `extractDocumentType()` infers `document_type` (spec/plan/tasks/etc.) for scoring
    58	4. Documents are indexed alongside memory and constitutional files
    59	5. `createSpecDocumentChain()` links lifecycle docs for causal traversal
    60	
    61	---
    62	
    63	<!-- /ANCHOR:overview -->
    64	<!-- ANCHOR:importance-tiers -->
    65	## 2. IMPORTANCE TIERS
    66	
    67	Six-tier system for prioritizing memory relevance:
    68	
    69	| Tier | Weight | searchBoost | Purpose | Auto-Surface |
    70	|------|--------|-------------|---------|--------------|
    71	| **Constitutional** | 1.0 | 3.0 | Critical rules that ALWAYS apply | Yes (top of every search) |
    72	| **Critical** | 1.0 | 2.0 | High-importance context | Yes (high relevance) |
    73	| **Important** | 0.8 | 1.5 | Significant decisions/context | Relevance-based |
    74	| **Normal** | 0.5 | 1.0 | Standard session context | Relevance-based |
    75	| **Temporary** | 0.3 | 0.5 | Short-term notes | Relevance-based |
    76	| **Deprecated** | 0.1 | 0.0 | Outdated (kept for history) | Never (excluded from search) |
    77	
    78	**searchBoost Multipliers:** Applied to search scores to prioritize higher tiers:
    79	- Constitutional memories get 3x boost in search ranking
    80	- Critical memories get 2x boost
    81	- Important memories get 1.5x boost
    82	- Normal memories have no boost (1.0x)
    83	- Temporary and Deprecated get reduced visibility (0.5x and 0x respectively)
    84	
    85	### Constitutional Tier Behavior
    86	
    87	- Stored in `constitutional/` folder
    88	- Auto-indexed on MCP server startup
    89	- **ALWAYS** surface at top of search results, regardless of query
    90	- Used for gate enforcement (e.g., "always ask spec folder question")
    91	- EXEMPT from decay scoring (always max relevance)
    92	
    93	---
    94	
    95	<!-- /ANCHOR:importance-tiers -->
    96	<!-- ANCHOR:mcp-tools -->
    97	## 3. MCP TOOLS
    98	
    99	> **Note:** MCP tool names use plain names such as `memory_search`, `memory_save`, and `checkpoint_create`.
   100	
   101	### Tool Reference (43 tools)
   102	
   103	| Layer | Tool | Purpose | Example Use |
   104	|-------|------|---------|-------------|
   105	| L1: Orchestration | `memory_context()` | Unified entry point with intent-aware routing (7 intents) | START HERE for most memory operations |
   106	| L1: Orchestration | `session_resume()` | Resume memory, code graph, and CocoIndex state in one call | Detailed recovery payload after reconnect, or when you want direct merged resume state |
   107	| L1: Orchestration | `session_bootstrap()` | Composite bootstrap combining resume and health checks | Canonical first tool call in a fresh OpenCode-style session or after `/clear` |
   108	| L2: Core | `memory_search()` | Semantic search with vector similarity | Find prior decisions on auth |
   109	| L2: Core | `memory_quick_search()` | Simplified search wrapper for fast lookups | Quick keyword-based retrieval |
   110	| L2: Core | `memory_match_triggers()` | Fast keyword matching (<50ms) with cognitive features | Gate enforcement |
   111	| L2: Core | `memory_save()` | Index a saved continuity artifact or spec doc. Re-generates embedding when **content hash** changes. Title-only changes do not trigger re-embedding. | After generate-context.js |
   112	| L3: Discovery | `memory_list()` | Browse stored spec-doc records with pagination (parent rows by default) | Review session history |
   113	| L3: Discovery | `memory_stats()` | Get memory system statistics with composite scoring | Check index health |
   114	| L3: Discovery | `memory_health()` | Check health status of memory system | Diagnose issues |
   115	| L3: Discovery | `session_health()` | Report session readiness, graph freshness, and priming status | Detect stale session context before continuing |
   116	| L4: Mutation | `memory_delete()` | Delete memory by ID or bulk delete by spec folder | Remove outdated memories |
   117	| L4: Mutation | `memory_update()` | Update memory metadata (title, tier, triggers) | Correct memory properties |
   118	| L4: Mutation | `memory_validate()` | Mark memory as useful/not useful | Confidence scoring |
   119	| L4: Mutation | `memory_bulk_delete()` | Bulk delete memories by spec folder with confirmation | Clean up entire spec folder memories |
   120	| L5: Lifecycle | `checkpoint_create()` | Save named state snapshot | Before risky changes |
   121	| L5: Lifecycle | `checkpoint_list()` | List available checkpoints | Find restore points |
   122	| L5: Lifecycle | `checkpoint_restore()` | Restore from checkpoint | Rollback if needed |
   123	| L5: Lifecycle | `checkpoint_delete()` | Delete a checkpoint | Clean up old snapshots |
   124	| L6: Analysis | `task_preflight()` | Capture epistemic baseline before task execution | Start of implementation work |
   125	| L6: Analysis | `task_postflight()` | Capture epistemic state after task, calculate Learning Index | After completing implementation |
   126	| L6: Analysis | `memory_drift_why()` | Trace causal chain for a spec-doc record ("why was this decided?") | Understand decision lineage |
   127	| L6: Analysis | `memory_causal_link()` | Create causal relationship between two memories | Link decision to its cause |
   128	| L6: Analysis | `memory_causal_stats()` | Get statistics about the causal memory graph | Check causal coverage |
   129	| L6: Analysis | `memory_causal_unlink()` | Remove a causal relationship by edge ID | Clean up incorrect links |
   130	| L6: Analysis | `eval_run_ablation()` | Run ablation study on memory scoring components | Compare scoring strategies |
   131	| L6: Analysis | `eval_reporting_dashboard()` | Generate evaluation and reporting dashboard data | Review system metrics |
   132	| L6: Analysis | `code_graph_query()` | Query structural relationships such as callers, imports, and outlines | Find what calls a symbol or which files import a module |
   133	| L6: Analysis | `code_graph_context()` | Expand CocoIndex or symbol seeds into compact graph neighborhoods | Pull structural context for an LLM prompt |
   134	| L7: Maintenance | `memory_index_scan()` | Bulk scan and index packet docs, constitutional files, and graph metadata | After continuity or spec-doc updates |
   135	| L7: Maintenance | `memory_ingest_start()` | Start async bulk memory ingestion | Import large memory sets |
   136	| L7: Maintenance | `memory_ingest_status()` | Check status of running ingestion job | Monitor import progress |
   137	| L7: Maintenance | `memory_ingest_cancel()` | Cancel a running ingestion job | Stop runaway imports |
   138	| L7: Maintenance | `memory_get_learning_history()` | Get learning history (preflight/postflight records) | Analyze learning patterns |
   139	| L7: Maintenance | `code_graph_scan()` | Build or refresh the structural code graph index | Re-index after branch switches or large code changes |
   140	| L7: Maintenance | `code_graph_status()` | Report code graph freshness and node/edge counts | Check whether the structural index is usable |

 succeeded in 0ms:
     8	Complete guide to saving conversation context, execution methods, and retrieval.
     9	
    10	---
    11	
    12	<!-- ANCHOR:overview -->
    13	## 1. OVERVIEW
    14	
    15	### Core Principle
    16	
    17	Execute save operations through whichever method fits your workflow - slash commands for convenience, direct scripts for control. All paths feed the same canonical save entrypoint, update the target packet's continuity surfaces, and reindex the resulting packet docs for retrieval.
    18	
    19	When direct CLI mode includes an explicit spec-folder argument, that target is authoritative. Session-learning matches, JSON `SPEC_FOLDER` fields, and auto-detect may inform diagnostics, but they must not reroute the save to another folder.
    20	
    21	Direct phase-folder targets are supported. If the explicit CLI target resolves to a policy-defined phase folder, `generate-context.js` preserves that target and updates the selected phase folder's canonical continuity surfaces instead of rerouting elsewhere.
    22	
    23	### Governed Save Boundaries
    24	
    25	The save workflow stays compatible with private and agent-scoped operation. When the surrounding runtime enables governance, save and follow-up retrieval flows may carry `tenantId`, `userId`, and `agentId` so memory capture stays inside the intended boundary.
    26	
    27	### Execution Paths
    28	
    29	The indexed-continuity store supports **2 independent execution paths**. Any method can be used standalone.
    30	
    31	### Method Comparison
    32	
    33	| Method            | AI Agent Required | Best For                           | Effort | Token Cost |
    34	| ----------------- | ----------------- | ---------------------------------- | ------ | ---------- |
    35	| **Slash Command** | Yes               | Interactive saves, manual triggers | Low    | ~200       |
    36	| **Direct Script** | No                | Testing, debugging, CI/CD          | Medium | 0          |
    37	
    38	### Execution Flow
    39	
    40	```
    41	┌────────────────────────────────────────────────────────────────┐
    42	│                    MEMORY SAVE PATHWAYS                        │
    43	├────────────────────────────────────────────────────────────────┤
    44	│                                                                │
    45	│   Slash Command                    Direct Script               │
    46	│   ┌──────────┐                    ┌──────────┐                 │
    47	│   │ /memory: │                    │  node    │                 │
    48	│   │  save    │                    │ script.ts│                 │
    49	│   └────┬─────┘                    └────┬─────┘                 │
    50	│        │                               │                       │
    51	│        ▼                               ▼                       │
    52	│   ┌──────────┐                    ┌──────────┐                 │
    53	│   │ AI Agent │                    │   JSON   │                 │
    54	│   │ Analysis │                    │   Input  │                 │
    55	│   └────┬─────┘                    └────┬─────┘                 │
    56	│        │                               │                       │
    57	│        └───────────────────────────────┘                       │
    58	│                              │                                 │
    59	│                              ▼                                 │
    60	│                    ┌─────────────────┐                         │
    61	│                    │ generate-context│                         │
    62	│                    │      .ts        │                         │
    63	│                    └────────┬────────┘                         │
    64	│                             │                                  │
    65	│                             ▼                                  │
    66	│                    ┌─────────────────┐                         │
    67	│                    │ canonical packet│                         │
    68	│                    │ continuity docs │                         │
    69	│                    └─────────────────┘                         │
    70	│                                                                │
    71	└────────────────────────────────────────────────────────────────┘
    72	```
    73	
    74	---
    75	
    76	<!-- /ANCHOR:overview -->
    77	<!-- ANCHOR:method-selection -->
    78	## 2. METHOD SELECTION
    79	
    80	### Decision Tree
    81	
    82	```
    83	┌─────────────────────────────────────────────────────────────────┐
    84	│              WHICH METHOD SHOULD I USE?                         │
    85	└─────────────────────────────────────────────────────────────────┘
    86	                              │
    87	                              ▼
    88	              ┌───────────────────────────────┐
    89	              │ Is an AI agent active in      │
    90	              │ the current conversation?     │
    91	              └───────────────┬───────────────┘
    92	                              │
    93	               ┌──────────────┴──────────────┐
    94	               │                             │
    95	              YES                           NO
    96	               │                             │
    97	               ▼                             ▼
    98	┌─────────────────────────┐   ┌─────────────────────────┐
    99	│ Need automatic          │   │ Prepare JSON, then use  │
   100	│ conversation analysis?  │   │ Direct Script method    │
   101	└────────────┬────────────┘   └─────────────────────────┘
   102	             │
   103	      ┌──────┴──────┐
   104	      │             │
   105	     YES           NO
   106	      │             │
   107	      ▼             ▼
   108	┌───────────┐ ┌───────────┐
   109	│   SLASH   │ │  DIRECT   │
   110	│  COMMAND  │ │  SCRIPT   │
   111	│           │ │ (custom   │
   112	│ /memory:  │ │  JSON)    │
   113	│   save    │ │           │
   114	└───────────┘ └───────────┘
   115	```
   116	
   117	### Quick Selection Guide
   118	
   119	| Scenario                                  | Recommended Method |
   120	| ----------------------------------------- | ------------------ |
   121	| End of work session, want AI to summarize | **Slash Command**  |
   122	| CI/CD pipeline, automated saves           | **Direct Script**  |
   123	| Quick manual save, no AI available        | **Direct Script**  |
   124	| Testing memory system functionality       | **Direct Script**  |
   125	| Batch processing multiple saves           | **Direct Script**  |
   126	| Interactive session with full context     | **Slash Command**  |
   127	
   128	---
   129	
   130	<!-- /ANCHOR:method-selection -->
   131	<!-- ANCHOR:slash-commands -->
   132	## 3. SLASH COMMANDS
   133	
   134	**When to Use:** Manual save with AI-powered conversation analysis
   135	**Requirement:** Slash command files exist in `.opencode/commands/memory/`
   136	
   137	### Available Commands
   138	
   139	```
   140	/memory:save       # Save current conversation context
   141	/memory:search  # Unified retrieval + analysis: search, epistemic baselines, causal graph, evaluation
   142	```
   143	
   144	### Execution Flow
   145	
   146	1. Slash command expands to full prompt
   147	2. AI agent analyzes conversation history
   148	3. AI agent creates structured JSON summary (the main agent or a delegated packet writer can invoke generate-context.js for memory under distributed governance)
   149	4. AI agent calls `generate-context.js` with JSON data
   150	5. Canonical continuity updated inside the active root-spec or phase packet
   151	
   152	### Validation Checkpoints
   153	
   154	| Checkpoint       | Verification                   | Action on Failure         |
   155	| ---------------- | ------------------------------ | ------------------------- |
   156	| Command exists   | `ls .opencode/commands/memory/` | Create command file       |
   157	| AI agent active  | Check response capability      | Use Direct Script instead |
   158	| Spec folder arg  | Passed via CLI argument        | Specify folder manually   |
   159	| Write permission | `test -w specs/###/`           | Check packet permissions  |
   160	
   161	### Example Output
   162	
   163	```
   164	✓ Context analyzed (12 exchanges detected)
   165	✓ Spec folder: 049-anchor-context-retrieval
   166	✓ Continuity surfaces updated for: 049-anchor-context-retrieval
   167	✓ Primary continuity block: implementation-summary.md::_memory.continuity
   168	✓ Packet docs reindexed
   169	```
   170	
   171	---
   172	
   173	<!-- /ANCHOR:slash-commands -->
   174	<!-- ANCHOR:direct-script -->
   175	## 4. DIRECT SCRIPT
   176	
   177	**When to Use:** Testing, debugging, custom workflows, CI/CD pipelines
   178	**Requirement:** Node.js installed
   179	
   180	### Usage Pattern
   181	
   182	```bash
   183	# Create minimal JSON data file
   184	cat > /tmp/test-save-context.json << 'EOF'
   185	{
   186	  "SPEC_FOLDER": "049-anchor-context-retrieval",
   187	  "recent_context": [{
   188	    "request": "Test save-context execution",
   189	    "completed": "Verified system works standalone",
   190	    "learning": "Direct script execution requires minimal JSON",
   191	    "duration": "5m",
   192	    "date": "2025-11-28T18:30:00Z"
   193	  }],
   194	  "observations": [{
   195	    "type": "discovery",
   196	    "title": "Standalone execution test",
   197	    "narrative": "Testing direct script invocation",
   198	    "timestamp": "2025-11-28T18:30:00Z",
   199	    "files": [],
   200	    "facts": ["Standalone execution works", "Minimal data sufficient"]
   201	  }],
   202	  "user_prompts": [{
   203	    "prompt": "Test save-context standalone",
   204	    "timestamp": "2025-11-28T18:30:00Z"
   205	  }]
   206	}
   207	EOF
   208	
   209	# Execute script directly
   210	node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js \

exec
/bin/zsh -lc "nl -ba .opencode/skills/system-spec-kit/references/memory/trigger_config.md | sed -n '8,170p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
     8	Complete configuration guide for memory trigger phrases and the fast trigger matching system.
     9	
    10	---
    11	
    12	<!-- ANCHOR:overview -->
    13	## 1. OVERVIEW
    14	
    15	**Core Principle:** Trigger detection must be fast (<50ms) and reliable, using optimized phrase matching to surface relevant spec-doc records without impacting conversation flow.
    16	
    17	The spec-doc record workflow supports manual activation mechanisms:
    18	1. **Command Trigger** - `/memory:save` command for explicit saves
    19	2. **Phrase Triggers** - User phrases that directly invoke memory operations
    20	
    21	> **OpenCode Note:** Automatic interval-based saves (e.g., "every 20 messages") are NOT supported in OpenCode because OpenCode lacks the hooks system required to count messages and trigger saves automatically. All context preservation must be manually triggered.
    22	
    23	This reference covers trigger phrase configuration, the MCP-based matching system, and best practices for custom trigger design.
    24	
    25	### Key Components
    26	
    27	| Component | Purpose | Performance Target |
    28	|-----------|---------|-------------------|
    29	| `/memory:save` Command | Primary save trigger | Immediate |
    30	| Trigger Phrases | Explicit memory activation | <50ms detection |
    31	| MCP Tool | Fast phrase matching | <50ms response |
    32	| Custom Config | Project-specific triggers | Configurable |
    33	
    34	---
    35	
    36	<!-- /ANCHOR:overview -->
    37	<!-- ANCHOR:trigger-phrases -->
    38	## 2. TRIGGER PHRASES
    39	
    40	The following phrases activate memory operations (case-insensitive matching):
    41	
    42	### Primary Triggers
    43	
    44	| Category | Primary Phrase | Alternatives |
    45	|----------|----------------|--------------|
    46	| **Save** | "save context" | "save conversation", "save session" |
    47	| **Document** | "document this" | "preserve context", "save this discussion" |
    48	| **Remember** | "remember this" | "store this", "keep this context" |
    49	| **Checkpoint** | "checkpoint" | "save checkpoint", "create checkpoint" |
    50	
    51	### Detection Logic
    52	
    53	```typescript
    54	const TRIGGER_PHRASES: readonly string[] = [
    55	  // Save category
    56	  'save context',
    57	  'save conversation',
    58	  'save session',
    59	  'save this discussion',
    60	
    61	  // Document category
    62	  'document this',
    63	  'preserve context',
    64	
    65	  // Remember category
    66	  'remember this',
    67	  'store this',
    68	  'keep this context',
    69	
    70	  // Checkpoint category
    71	  'checkpoint',
    72	  'save checkpoint',
    73	  'create checkpoint'
    74	] as const;
    75	
    76	function detectTrigger(userMessage: string): boolean {
    77	  const normalized = userMessage.toLowerCase();
    78	  return TRIGGER_PHRASES.some(phrase => normalized.includes(phrase));
    79	}
    80	```
    81	
    82	### MCP Tool Integration
    83	
    84	The `memory_match_triggers` MCP tool provides fast trigger phrase matching without requiring embeddings:
    85	
    86	```typescript
    87	// Fast trigger matching (<50ms) - no embeddings required
    88	const result = await spec_kit_memory_memory_match_triggers({
    89	  prompt: "I want to save context for this session",
    90	  limit: 3  // Maximum matching spec-doc records to return
    91	});
    92	
    93	// Returns matching spec-doc records based on trigger phrases
    94	// Ideal for proactive memory surfacing during conversation
    95	```
    96	
    97	**Usage Scenarios:**
    98	- Quick keyword-based memory lookup before semantic search
    99	- Proactive memory surfacing during conversation
   100	- Fallback when semantic search is unavailable
   101	
   102	### Gate 3 Enforcement Triggers
   103	
   104	The constitutional memory for Gate 3 enforcement uses 33 trigger phrases to detect file modification intent:
   105	
   106	| Category | Trigger Phrases |
   107	|----------|-----------------|
   108	| **Create** | `create`, `add`, `generate`, `build`, `implement`, `write` |
   109	| **Modify** | `modify`, `edit`, `update`, `change`, `refactor`, `fix` |
   110	| **Delete** | `delete`, `remove`, `cleanup` |
   111	| **Move** | `rename`, `move`, `migrate` |
   112	| **Scale Indicators** | `comprehensive`, `all bugs`, `multiple files`, `codebase`, `entire`, `full`, `everything` |
   113	| **Agent Patterns** | `parallel agents`, `15 agents`, `10 agents`, `dispatch agents`, `opus agents` |
   114	| **Compound Actions** | `analyze and fix`, `find and fix`, `fix all`, `update all`, `modify all`, `check and fix` |
   115	| **Gate Keywords** | `spec folder`, `gate 3`, `file modification` |
   116	
   117	**How Gate 3 Trigger Matching Works:**
   118	
   119	1. AI calls `memory_match_triggers({ prompt: "user message" })`
   120	2. If prompt matches any Gate 3 trigger, constitutional memory surfaces
   121	3. AI sees reminder to ask spec folder question before file modifications
   122	
   123	**Example:**
   124	
   125	```typescript
   126	// User says: "refactor the authentication module"
   127	const matches = await memory_match_triggers({
   128	  prompt: "refactor the authentication module"
   129	});
   130	// Returns: Gate 3 enforcement constitutional memory 
   131	// matchedPhrases: ["refactor"]
   132	// AI then asks: "Spec Folder (required): A) Existing | B) New | C) Update related | D) Skip"
   133	```
   134	
   135	**Trigger Design Guidelines for Constitutional Memories:**
   136	
   137	| Guideline | Description |
   138	|-----------|-------------|
   139	| **Cover action verbs** | Include all verbs that indicate file modification intent |
   140	| **Include scale words** | Words like "comprehensive", "all", "entire" suggest large changes |
   141	| **Add domain terms** | Include project-specific terms for your enforcement use case |
   142	| **Test coverage** | Verify triggers match common user phrases |
   143	| **Limit count** | 20-40 triggers recommended for constitutional memories |
   144	
   145	---
   146	
   147	### Signal Vocabulary Expansion
   148	
   149	Beyond the default trigger phrases, the system recognizes expanded signal types for contextual trigger matching:
   150	
   151	| Signal | Purpose | Example Phrases |
   152	|--------|---------|----------------|
   153	| `CORRECTION` | Tracks when a spec-doc record is corrected or superseded | "actually", "correction", "that was wrong", "update previous" |
   154	| `PREFERENCE` | Captures user preference signals | "I prefer", "use this instead", "default to", "always do" |
   155	| `REINFORCEMENT` | Positive validation of existing spec-doc records | "that's right", "confirmed", "keep this" |
   156	| `DEPRECATION` | Marks memories as outdated | "no longer valid", "deprecated", "removed", "obsolete" |
   157	
   158	These signals are detected during `memory_match_triggers()` processing and influence save-time arbitration (prediction-error scoring) and correction tracking.
   159	
   160	### Trigger Sanitization (026 Remediation)
   161	
   162	Save-time trigger validation now applies sanitization rules to prevent low-quality triggers from degrading retrieval precision:
   163	
   164	| Rule | Behavior |
   165	|------|----------|
   166	| **Single-word filter** | Overly generic single-word triggers (e.g., "code", "fix", "error") are stripped during save-time validation to reduce false-positive surfacing |
   167	| **Duplicate detection** | Triggers that duplicate existing constitutional or high-importance memory triggers are flagged and removed |
   168	| **Length minimum** | Trigger phrases shorter than 3 characters are rejected |
   169	| **Stopword filter** | Common stopwords used alone as triggers are rejected |
   170	

exec
/bin/zsh -lc "nl -ba .opencode/skills/system-spec-kit/mcp_server/tools/memory-tools.ts | sed -n '1,95p'" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
     1	// ───────────────────────────────────────────────────────────────
     2	// MODULE: Memory Tools
     3	// ───────────────────────────────────────────────────────────────
     4	// Dispatch for L2-L4 memory tools: search, triggers, save,
     5	// List, stats, health, delete, update, validate (T303).
     6	import {
     7	  handleMemorySearch,
     8	  handleMemoryMatchTriggers,
     9	  handleMemorySave,
    10	  handleMemoryList,
    11	  handleMemoryStats,
    12	  handleMemoryHealth,
    13	  handleMemoryDelete,
    14	  handleMemoryUpdate,
    15	  handleMemoryValidate,
    16	  handleMemoryBulkDelete,
    17	} from '../handlers/index.js';
    18	import { validateToolArgs } from '../schemas/tool-input-schemas.js';
    19	
    20	import { parseArgs } from './types.js';
    21	import type {
    22	  MCPResponse,
    23	  SearchArgs,
    24	  TriggerArgs,
    25	  SaveArgs,
    26	  ListArgs,
    27	  StatsArgs,
    28	  HealthArgs,
    29	  DeleteArgs,
    30	  UpdateArgs,
    31	  MemoryValidateArgs,
    32	  BulkDeleteArgs,
    33	} from './types.js';
    34	
    35	function relabelResponseTool(response: MCPResponse, toolName: string): MCPResponse {
    36	  const firstEntry = response?.content?.[0];
    37	  if (!firstEntry || firstEntry.type !== 'text' || typeof firstEntry.text !== 'string') {
    38	    return response;
    39	  }
    40	
    41	  try {
    42	    const envelope = JSON.parse(firstEntry.text) as Record<string, unknown>;
    43	    const meta = envelope.meta && typeof envelope.meta === 'object'
    44	      ? envelope.meta as Record<string, unknown>
    45	      : {};
    46	    envelope.meta = {
    47	      ...meta,
    48	      tool: toolName,
    49	    };
    50	
    51	    return {
    52	      ...response,
    53	      content: [{ ...firstEntry, text: JSON.stringify(envelope, null, 2) }],
    54	    };
    55	  } catch {
    56	    return response;
    57	  }
    58	}
    59	
    60	/** Tool names handled by this module */
    61	export const TOOL_NAMES = new Set([
    62	  'memory_search',
    63	  'memory_quick_search',
    64	  'memory_match_triggers',
    65	  'memory_save',
    66	  'memory_list',
    67	  'memory_stats',
    68	  'memory_health',
    69	  'memory_delete',
    70	  'memory_update',
    71	  'memory_validate',
    72	  'memory_bulk_delete',
    73	]);
    74	
    75	/** Dispatch a tool call. Returns null if tool name not handled. */
    76	export async function handleTool(name: string, args: Record<string, unknown>): Promise<MCPResponse | null> {
    77	  switch (name) {
    78	    case 'memory_search':         return handleMemorySearch(parseArgs<SearchArgs>(validateToolArgs('memory_search', args)));
    79	    case 'memory_quick_search': {
    80	      // E3: Delegate to memory_search with sensible defaults
    81	      const validated = validateToolArgs('memory_quick_search', args);
    82	      const quickArgs: SearchArgs = {
    83	        query: validated.query as string,
    84	        limit: typeof validated.limit === 'number' ? validated.limit : 10,
    85	        specFolder: validated.specFolder as string | undefined,
    86	        tenantId: validated.tenantId as string | undefined,
    87	        userId: validated.userId as string | undefined,
    88	        agentId: validated.agentId as string | undefined,
    89	        autoDetectIntent: true,
    90	        enableDedup: true,
    91	        includeContent: true,
    92	        includeConstitutional: true,
    93	        rerank: true,
    94	      };
    95	      const response = await handleMemorySearch(quickArgs);

exec
/bin/zsh -lc "jq -r '.[]? | select((.specFolder // \"\") | test(\"memory|context|retrieval|resume\"; \"i\")) | [.specFolder, (.description // \"\")] | @tsv' specs/descriptions.json 2>/dev/null | head -n 40" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 0ms:
exec
/bin/zsh -lc "find specs .opencode/specs -path '*memory*' -name spec.md -o -path '*context*' -name spec.md -o -path '*resume*' -name spec.md 2>/dev/null | head -n 60" in /Users/michelkerkmeester/MEGA/Development/Code_Environment/Public
 succeeded in 684ms:
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/008-spec-memory-compliance-audit/spec.md
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/011-indexing-and-adaptive-fusion/007-external-graph-memory-research/spec.md
.opencode/specs/system-spec-kit/023-hybrid-rag-fusion-refinement/012-memory-save-quality-pipeline/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/003-advisor-standards-alignment/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-skill-graph-metadata-routing-boosts/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-memory-search-routing-tuning/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/005-advisor-setup-command/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-documentation-code-alignment/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/004-advisor-hook-surface-integration/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/003-smart-remediation-opencode-plugin/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/002-advisor-phrase-booster-tuning/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-deferred-remediation-telemetry-run/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/002-advisor-plugin-hardening/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/001-advisor-hook-brief-improvements/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/002-skill-graph-daemon-native-advisor-tools/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/006-skill-advisor/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/002-sk-deep-cli-runtime-execution/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/001-foundational-runtime/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/004-runtime-executor-hardening/003-system-hardening/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/003-code-graph-hook-improvements/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/006-code-graph-resilience-research/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/005-code-graph-backend-resilience/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/004-code-graph-advisor-refinement/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/001-code-graph-upgrades/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/005-code-graph-doctor-command/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/002-code-graph-self-contained-package/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/005-code-graph/002-code-graph-context-and-scan-scope/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/005-code-graph-fail-fast-routing/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/009-memory-search-citation-response-policy/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/006-causal-graph-relation-window-metrics/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/003-memory-context-truncation-telemetry-contract/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/002-mcp-runtime-improvement-research/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/007-intent-classifier-stability-telemetry/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/004-cocoindex-overfetch-dedup-rerank/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/001-search-intelligence-stress-playbook/002-search-scenario-execution/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/001-search-intelligence-stress-playbook/001-search-scenario-design/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/001-search-intelligence-stress-playbook/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/010-stress-test-close-loop-measurement-rerun/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/011-mcp-runtime-stress-remediation/008-mcp-daemon-rebuild-protocol/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/002-codesight/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/004-graphify/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/005-claudest/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/006-research-memory-redundancy/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/003-contextador/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/001-research-and-baseline/001-claude-optimization-settings/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/000-release-cleanup/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/000-release-cleanup/001-memory-terminology/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/005-memory-search-runtime-bugs/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/004-memory-save-rewrite/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/002-memory-quality-remediation/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/001-cache-warning-hooks/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/003-continuity-memory-runtime/003-continuity-refactor-gates/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/002-resource-map-deep-loop-fix/001-reverse-parent-research-review-folders/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/002-resource-map-deep-loop-fix/002-resource-map-deep-loop-fix-creation/spec.md
.opencode/specs/system-spec-kit/026-graph-and-context-optimization/002-resource-map-deep-loop-fix/spec.md

codex
I found the current memory system surfaces. The short version: **Spec Kit Memory is packet-first now**. Saves no longer write active `specs/.../memory/*.md` notes; recovery goes through `handover.md -> _memory.continuity -> spec docs`, with indexed retrieval layered on top.

**Best Entry Points**
- [memory_system.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/references/memory/memory_system.md:17)  
  Main reference. Covers architecture, indexed sources, tiers, tools, search behavior.
- [save_workflow.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/references/memory/save_workflow.md:17)  
  Save path. `/memory:save` and direct script both route through `generate-context.js`.
- [trigger_config.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/references/memory/trigger_config.md:15)  
  Trigger phrases, Gate 3 trigger behavior, sanitization rules.
- [memory-tools.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/tools/memory-tools.ts:60)  
  Live tool dispatcher for `memory_search`, `memory_quick_search`, `memory_match_triggers`, `memory_save`, CRUD, stats, health.

**Current Model**
- Canonical recovery chain: `handover.md -> _memory.continuity -> spec docs`.
- Indexed sources: `specs/**/*.md`, `.opencode/specs/**/*.md`, constitutional files, plus historical compatibility for old memory artifacts.
- Search is vector/FTS-backed with importance tiers; constitutional records always surface unless explicitly excluded.
- `memory_context()` is the preferred high-level retrieval entry point.
- `memory_search()` requires `query`, `concepts`, or cursor; `specFolder` alone is invalid.
- `memory_quick_search()` delegates to `memory_search` with defaults: content included, constitutional included, rerank enabled.
- Saves should use `/memory:save` or `node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js ...`.

**Relevant Implementation Files**
- [memory-context.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:1)
- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1)
- [memory-save.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1)
- [resume-ladder.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/lib/resume/resume-ladder.ts)

One caveat: I attempted the live Spec Kit Memory MCP lookup, but that tool call was cancelled, so this pass is based on local repo evidence rather than the current memory DB contents.
hook: Stop
hook: Stop Completed
2026-04-27T14:30:17.336112Z ERROR codex_core::session: failed to record rollout items: thread 019dcf58-36c7-79e0-af5b-f110954b4c42 not found
tokens used
173,332
I found the current memory system surfaces. The short version: **Spec Kit Memory is packet-first now**. Saves no longer write active `specs/.../memory/*.md` notes; recovery goes through `handover.md -> _memory.continuity -> spec docs`, with indexed retrieval layered on top.

**Best Entry Points**
- [memory_system.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/references/memory/memory_system.md:17)  
  Main reference. Covers architecture, indexed sources, tiers, tools, search behavior.
- [save_workflow.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/references/memory/save_workflow.md:17)  
  Save path. `/memory:save` and direct script both route through `generate-context.js`.
- [trigger_config.md](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/references/memory/trigger_config.md:15)  
  Trigger phrases, Gate 3 trigger behavior, sanitization rules.
- [memory-tools.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/tools/memory-tools.ts:60)  
  Live tool dispatcher for `memory_search`, `memory_quick_search`, `memory_match_triggers`, `memory_save`, CRUD, stats, health.

**Current Model**
- Canonical recovery chain: `handover.md -> _memory.continuity -> spec docs`.
- Indexed sources: `specs/**/*.md`, `.opencode/specs/**/*.md`, constitutional files, plus historical compatibility for old memory artifacts.
- Search is vector/FTS-backed with importance tiers; constitutional records always surface unless explicitly excluded.
- `memory_context()` is the preferred high-level retrieval entry point.
- `memory_search()` requires `query`, `concepts`, or cursor; `specFolder` alone is invalid.
- `memory_quick_search()` delegates to `memory_search` with defaults: content included, constitutional included, rerank enabled.
- Saves should use `/memory:save` or `node .opencode/skills/system-spec-kit/scripts/dist/memory/generate-context.js ...`.

**Relevant Implementation Files**
- [memory-context.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-context.ts:1)
- [memory-search.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-search.ts:1)
- [memory-save.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/handlers/memory-save.ts:1)
- [resume-ladder.ts](/Users/michelkerkmeester/MEGA/Development/Code_Environment/Public/.opencode/skills/system-spec-kit/mcp_server/lib/resume/resume-ladder.ts)

One caveat: I attempted the live Spec Kit Memory MCP lookup, but that tool call was cancelled, so this pass is based on local repo evidence rather than the current memory DB contents.
