Repository navigation
[AI-1460] Claude SessionStart memory-index behavioral baseline + live-cert scaffold - #359
Conversation
…t scaffold The ClaudeHookCommand migration onto the shared SessionStart memory provider already landed with the AI-1458 foundation (#350); this adds the behavioral baseline that pins no regression, plus a gated live model-receipt cert. - 9 characterization tests: lessons+nudge+memory fragment ordering; only-ready-memory; empty-array / 204 / 5xx memory-index responses emit nothing (hook never fails); no re-fetch on a second session-start for the same session; memory-GET timeout does not suppress lessons/nudge; exhausted budget never touches the provider; a ready memory index is discarded when the session-start POST fails. - ClaudeMemoryIndexLiveCertTests: env-gated (KCAP_CURSOR/CLAUDE live) nonce-via- additionalContext model-receipt cert + disabled negative control, plus ungated ExtractAssistantAnswer parser coverage. No production change. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
PR Summary by QodoAdd Claude SessionStart memory-index baseline tests + gated live certification
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo
Context used 1.
|
The ~30-line XML <summary> on ClaudeMemoryIndexLiveCertTests and the multi-paragraph banner comment above the SessionStart memory-index baseline tests in ClaudeHookCommandTests read like runbook prose. Trim both to a short intent summary — what the file/block covers, that the live tests are env-gated manual release gates, and the --print-parser-unverified caveat — without touching any parser or gating logic.
…odo finding 2) disabled_memory_index_does_not_construct_the_lease_store mutated the process-global AppConfig resolved state directly and restored a fresh default Profile instead of whatever was resolved before it ran, and had no parallel guard against interleaving with the file's other AppConfig/Console.Out-mutating tests. Route it through the existing WithProfileAsync helper (which captures + restores the original ResolvedServerUrl/ResolvedProfile regardless of run order or a mid-test exception) and add [NotInParallel], matching this file's precedent for every other test that touches the same shared state.
…Qodo finding 4) ReadDisableMemoryIndexAsync split stdout on "\n\n" to isolate the leading JSON block from kcap config show's "JSON, blank line, Path:" output shape. On Windows the blank line is "\r\n\r\n", so the split never matched, JsonNode.Parse threw on the whole CRLF blob, and ReadDisableMemoryIndexAsync silently returned null — which would make the negative-control test's restore step wrongly write "false" even when disable_memory_index was originally true. Extract the split into ExtractLeadingJsonBlock, normalizing \r\n to \n first, and add CI-safe coverage for both the LF and CRLF shapes.
…ding 3) RunProcessAsync's timeout path let WaitForExitAsync/ReadToEndAsync throw OperationCanceledException without ever signaling the spawned child, leaving a hung `claude`/`kcap` process running past the test. Wrap the read/wait in a finally that kills the whole process tree whenever the process hasn't already exited, and add a CI-safe test (spawning a long-lived cross-platform process the same way Daemon.DummyProcess does) that confirms the child is actually gone after a timeout, not just that the await unblocked.
Implements AI-1460 — the behavioral baseline + certification for Claude Code's SessionStart memory-index injection.
What
The
ClaudeHookCommandmigration onto the sharedSessionStartMemoryprovider already landed with the AI-1458 foundation (#350) — so this PR is test-only, no production change. It pins the no-regression baseline the design requires and adds the live model-receipt gate.Tests
ClaudeHookCommandTests: lessons+nudge+memory fragment ordering; only-ready-memory; empty-array / 204 / 5xx memory-index responses emit nothing (hook never fails); no re-fetch on a second session-start for the same session (lease dedup); memory-GET timeout does not suppress lessons/nudge; exhausted budget never touches the provider; a ready memory index is discarded when the session-start POST fails.ClaudeMemoryIndexLiveCertTests(new): env-gated (KCAP_CURSOR_MEMORY_LIVE=1 + reachableKCAP_URL) nonce-via-additionalContextmodel-receipt cert + disabled negative control (manual release gate, mirrors the Cursor AI-1461 precedent), plus ungatedExtractAssistantAnswerparser coverage.ClaudeHookCommandTests35/35, parser 4/4 green;check-linear-idsclean.Notes
--printparser is defensive and to be confirmed on first live run (same posture as AI-1461).🤖 Generated with Claude Code