Skip to content

feat(memory): bootstrap memory architecture interfaces and shadow-write wiring#78

Merged
dgarson merged 2 commits intofeat/memory-architecture-2from
nate/bs-tim-3-eval-guardrails
Feb 23, 2026
Merged

feat(memory): bootstrap memory architecture interfaces and shadow-write wiring#78
dgarson merged 2 commits intofeat/memory-architecture-2from
nate/bs-tim-3-eval-guardrails

Conversation

@dgarson
Copy link
Owner

@dgarson dgarson commented Feb 22, 2026

Summary

  • Add memory.architecture config schema + labels/help and config typing for architecture settings.
  • Add additive IMemoryService interfaces with domain, governance matching and in-memory bootstrap implementation.
  • Add scope isolation + governance deny-by-default unit tests.
  • Add initial transcript-based shadow-write wiring from session persistence into architecture service (opt-in).

This PR delivers the bootstrap slice requested by bs-tim-3 for phase 1 scaffolding.

@dgarson dgarson changed the title feat(memory): add retrieval relevance/latency/cost telemetry feat(memory): bootstrap memory architecture interfaces and shadow-write wiring Feb 22, 2026
@dgarson dgarson merged commit cc67cb8 into feat/memory-architecture-2 Feb 23, 2026
2 of 9 checks passed
@dgarson
Copy link
Owner Author

dgarson commented Feb 23, 2026

Run Codex sweep first, then request final architecture review.

@dgarson
Copy link
Owner Author

dgarson commented Feb 23, 2026

Phase-2 hybrid read-path hook stubs are now in on this branch (no cutover):

Implemented

  • Added additive hybrid read contracts in src/memory/architecture.ts:
    • retrieveHybrid() returns { nodes, usedPath, fallbackReason }.
    • Hook surfaces: vectorRead, lexicalRead, onFallback.
    • Fallback reasons: vector-empty, vector-error, forced.
  • Added retrieval guardrails in config surface:
    • memory.architecture.retrieval.readPath.enabled (default false)
    • memory.architecture.retrieval.readPath.lexicalFallback (on-empty|on-error|always)
    • wired through types.memory.ts, zod-schema.ts, schema.help.ts, schema.labels.ts.
  • retrieve() remains legacy by default; it only routes through hybrid path when readPath.enabled is explicitly true.
  • Added focused tests in src/memory/architecture.test.ts for:
    • legacy path unchanged when read hooks disabled
    • lexical fallback on vector error
    • lexical fallback on empty vector result
  • Added docs guardrail note in docs/concepts/memory.md under “Memory Architecture 2.0 guardrails (additive rollout)”.

Explicit non-goals

  • No runtime cutover of memory_search / manager read-paths to architecture service.
  • No production vector backend integration (Qdrant/Pinecone/PgVector adapters still pending).
  • No ranking/relevance tuning beyond stub contracts.
  • No migration/replay of existing memory corpus.

Validation

  • pnpm test:fast src/memory/architecture.test.ts
  • pnpm check ❌ currently blocked by pre-existing repo formatting failures outside this change set (e.g. agent-runtime/review/*, extensions/workq/*, src/sessions/session-auto-label.ts).

@dgarson
Copy link
Owner Author

dgarson commented Feb 24, 2026

Memory Architecture 2.0 execution update (branch: feat/memory-architecture-2)

What I checked

Current blockers observed

  • Existing failed checks on PR feat(memory): bootstrap memory architecture interfaces and shadow-write wiring #78 are from cancelled/skipped workflow runs (older run set), not fresh code execution:
    • actionlint, docs-scope, label, label-issues, no-tabs, secrets
  • Local code blocker identified on memory branch:
    • Cannot find package 'openai' imported from src/memory/architecture.ts
    • This caused src/memory/architecture.test.ts and dependent suites to fail to load.

Fix applied

  • ✅ Added missing runtime dependency openai at workspace root.
  • Commit: 629ea362c (fix(memory): add missing openai runtime dependency)
  • Pushed to origin/feat/memory-architecture-2

Focused validation run

  • pnpm exec vitest run src/memory/architecture.test.ts
    • 11/11 passing
  • pnpm exec vitest run --config vitest.e2e.config.ts src/agents/tools/memory-tool.e2e.test.ts
    • 10/10 passing
  • pnpm exec vitest run src/memory/*.test.ts
    • 25 files, 195 tests passing

Merge-readiness checklist

  • Memory architecture runtime import issue fixed
  • Memory unit tests passing locally
  • Memory tool e2e tests passing locally
  • Branch updated and pushed
  • Fresh CI run on current HEAD completed green
  • PR-level non-memory required checks re-run/green

Recommendation

GO (conditional) for the memory architecture codepath itself.
Proceed once CI is re-run on latest HEAD and required PR checks are green.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant