Repository navigation
Capture core: failed-then-fixed commands, and the count fixes (#134, #136) - #137
Merged
Merged
Conversation
…ipts (#134, #136) Builds specs/memkernel-0-12-capture-core (D1-D8, R1-R15). With MEMKERNEL_CAPTURE on, normal startup reads ended sessions' Claude Code transcripts through a new TranscriptReaderPort and stores each failed-then-fixed command as a redacted, short-term observation keyed by (session, tool_use_id, extractor). The spool keeps ended sessions until their records are stored; one capture runs at a time within 3 seconds and 20 records; captured records are never promotion candidates. The repeated-mistake count moves onto the same reader: it reads subagent transcripts and reports their repeats apart, counts only Bash runs that failed with their own exit code, names the command, drops single-word stored errors, and reports captured errors apart. DIADE reported these on #112.
Only recalls before a failure decide its outcome, on both threads; captured errors repeated by a subagent are counted apart; the key lookup is store-filtered and metadata-only (MemoryService.list_metadata); sessions a budget stop leaves add to the misses already counted; a sidechain entry with no agent identity is skipped rather than joining any thread. The spec is marked approved and its tasks ticked.
The owner's amendment from the review of #137 at 6c0072e: the slash-inclusive long-string rule redacted paths with a digit, in file paths and inside error lines, so a captured error naming such a path could never match later output. A token is now redacted when a /-separated piece is 32+ characters mixing letters and digits (not all hexadecimal) or 16+ mixing uppercase, lowercase and digits.
…is a test From the owner's review of #137 at cb362cf: splitting every token on / let AWS's documented sample secret key through (pieces of 13, 7 and 18 characters). A token is split only when it starts with / or a file extension follows it; any other token is judged whole by the 32-character rule, as before R16.
This was referenced Nov 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds the S2 spec,
specs/memkernel-0-12-capture-core(#135): D1–D8 and amendments R1–R15.Fixes #136. Refs #134.
Capture (opt-in,
MEMKERNEL_CAPTURE, off by default)TranscriptReaderPort(core/ports.py), with a Claude Code reader (transcripts/claude_code.py). It handles batched results under one entryuuid, sidechain lines,agent_id, recursive subagent files (journal.jsonlskipped) and the 50 MB limit.transcript_path. With capture on, ended sessions stay untilcommit(), and unsaved ones are still reported once (via areportedline). Misses are counted withcapture_missedlines. Ended sessions older than 7 days are dropped and counted.capture.py:(session, tool_use_id, extractor), with the version as a tag;capture.lock(R3), the 3 s budget, the 20-record and 5-per-session caps, 3 misses, and the oversize rule;retain(content_dedup=False)(R1), andconsolidate()never returns them as candidates (D5).The count (#136, DIADE's report on #112)
(subagent)line.Bashrun that failed with its own exit code, and its evidence names the command (R8).shownonly when that subagent recalled the memory; otherwisenot shown, nevermissed. "Other store" and "unknown" still apply there (R14, plus the owner's build note).Checks
For review
/as part of a string, so it redacts paths such as…/tests/test_zz_us1_scratch.py. The real fixture shows it. Treating/as a separator would fix it, at the cost of missing base64 secrets that contain/.eval/repeat-mistakes/transcripts.pyis kept as a re-export, becauseci.yml's mypy step names it. Deleting it needs a one-line CI change.is_errorand anExit codeprefix), as R8 requires. Its expected outcomes are unchanged.list_memories(session_id=…): filtered by the store, but it reads content, not only metadata.