Liking cljdoc? Tell your friends :D

Remember Capture Test Matrix

Scope: Step 10 /remember manual memory capture contract.

Coverage Map (Checklist → Tests)

  • Exactly-once manual capture per invocation → U1, I1, E1
  • Surface parity (REPL/RPC/Emacs) → E1, E2, E3
  • Minimal context snapshot fields → U2, I2
  • Persist via active provider + recover later session → I3, E4
  • No mirrored git-history summaries in memory ranking corpus → U3, I4
  • Blocked prerequisites emit memory_capture_prerequisites_not_ready → U4, I5, E5
  • Stable EQL telemetry attrs → U5, I6
  • /resume persistence distinct from remember/recover semantics → I7, E6
  • Negative provider/unavailable behavior → U6, I8, E7

Unit Tests

IDScenarioArrangeAssert
U1Single invocation writes one captureready memory + valid reasoncapture count increments by 1 only
U2Snapshot shape is minimal and stableprovide session/cwd/branch contextcapture contains sessionId/cwd/gitBranch/summary/evidence (nullable where appropriate)
U3Recovery corpus excludes git-mirrored entriesseed memory + git dataranking input comes from memory artifacts only
U4Prereq gatingtoggle query/memory readiness falsestatus error, lastError="memory_capture_prerequisites_not_ready"
U5EQL remember attrs resolvequery remember store attrsstatus/captures/lastCaptureAt/lastError present and typed
U6Provider failure pathmock provider write failurefailure surfaced with explicit fallback metadata; no silent success

Integration Tests

IDScenarioArrangeAssert
I1/remember command pipelinerunning session + ready memoryone memory write-through call + success response
I2Context extraction from live sessionrun in repo with branch/cwdstored capture reflects current session metadata
I3Cross-session recoverywrite capture in session A, new session B recovercapture is retrievable/used in recovery
I4Git history remains query-onlyrun remember after git activityno git-log/diff payload persisted as memory artifact
I5Not-ready memory layermemory status != readycommand fails with canonical blocked error
I6EQL telemetry stabilityperform remember + query attrsattrs available before/after capture; counts/timestamps evolve
I7/resume separationpersist session journal, resume, inspect memoryresumed transcript != implicit remember artifact creation
I8Fallback/unavailable provider behaviorpersistent provider unavailable with fallback modesexplicit selection/failure telemetry and user-facing fallback warning (⚠ Remembered with store fallback …)

End-to-End Tests

IDSurfaceScenarioAssert
E1REPL/remember "reason" onceone capture created, user-visible confirmation
E2RPC-EDNremember command op/flowsame semantics and result shape as REPL
E3Emacsinteractive remember commandsame semantics and visibility as REPL/RPC
E4Cross-sessioncapture then restart/new session recoverrecovered artifact is visible/usable
E5Failure UXinvoke remember when memory not readyclear blocked message with canonical error key
E6Resume boundary/resume old session then query memory capturesno synthetic remember captures from resume alone
E7Provider outageactive provider fails mid-rundeterministic fallback warning + telemetry, no duplicate writes

Suggested Test Placement

  • Unit: components/memory/test/..., components/agent-session/test/...remember*
  • Integration: components/agent-session/test/.../commands_*, memory-store integration namespaces
  • E2E: existing REPL/RPC/Emacs acceptance suites (add remember-focused scenarios)

Runtime Warning Contract (store fallback)

When /remember succeeds in-memory but active provider write fails, surfaces should emit a warning (not silent success):

  • Prefix: ⚠ Remembered with store fallback
  • Include provider when available
  • Include store-error when available
  • Include detail message when available

This warning must be consistent across REPL, RPC, and Emacs-visible transcript output.

Pass Criteria

  • All matrix IDs implemented and green.
  • No regression in existing memory/session persistence tests.
  • Telemetry attrs remain queryable and documented.
  • Store fallback warning contract is documented and tested across surfaces.

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close