Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions tests/fixtures/transcripts/sc8-claude-code/expected.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"about": "SC-8 on transcripts in Claude Code's on-disk shape (2.1.x): batched results, attachment, system, api-request and api-request-blob lines, a hook block, a piped run. Fixture times start at `base`; the test moves them after the store is written.",
"base": "2026-11-17T10:00:00Z",
"memories": {
"left_pad": "npm test fails with `Error: Cannot find module 'left-pad'`",
"bare": "a bare `ValueError` is not a stored error",
"plain": "Use Postgres for the user store."
},
"recalls": [
{"origin": "hook", "session": "sess-d", "memories": ["left_pad"], "at": "2026-11-17T10:10:00Z"},
{"origin": "hook", "session": "sess-e", "memories": ["plain"], "at": "2026-11-17T10:20:00Z"},
{"origin": "tool", "query": "left-pad module", "memories": ["left_pad"], "at": "2026-11-17T10:21:00.300Z"},
{"origin": "tool", "query": "npm test failure", "memories": ["left_pad"], "at": "2026-11-17T10:31:00.300Z"}
],
"repeats": [
{"session": "sess-d", "agent": "a3f9c2e81b7d4056e", "outcome": "not shown", "command": "npm test 2>&1",
"why": "the parent was shown the memory, the subagent was not (R10, R14)"},
{"session": "sess-e", "agent": "", "outcome": "missed", "command": "npm test",
"why": "the subagent's recall is not the main thread's; the failing result is the second of a batched entry (R12)"},
{"session": "sess-f", "agent": "a0c58e3f1d9b27c44", "outcome": "shown", "command": "npm test",
"why": "the subagent recalled the memory before its own failure (R14)"},
{"session": "sess-g", "agent": "a5d2e9b04c61f73a8", "outcome": "not shown", "command": "npm ci && npm test",
"why": "a workflow agent counts as a subagent; journal.jsonl beside it is not read (R15)"},
{"session": "sess-h", "agent": "review-abc", "outcome": "not shown", "command": "npm test",
"why": "no agentId in the lines: the id is the whole file name after `agent-` (R15)"}
],
"no_repeat": {
"sess-b": "`cat NOTES.md` quotes the error but did not fail (R8); the hook-blocked `npm test` never ran (FR-005); `npm test 2>&1 | tail -5` exits with tail's status, so it is not a failed run (D7, a limit the README names)"
},
"stored_errors": 1,
"repeats_main": 1,
"subagent_repeats": 4
}
13 changes: 13 additions & 0 deletions tests/fixtures/transcripts/sc8-claude-code/sess-b.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{"type": "queue-operation", "operation": "enqueue", "timestamp": "2026-11-17T10:00:00.000Z", "sessionId": "sess-b", "content": "check why the build is red"}
{"type": "file-history-snapshot", "messageId": "1d9d7a23-d88c-7f15-7eff-6ffb592a92b5", "snapshot": {"messageId": "1d9d7a23-d88c-7f15-7eff-6ffb592a92b5", "trackedFileBackups": {}, "timestamp": "2026-11-17T10:00:00.000Z"}, "isSnapshotUpdate": false}
{"parentUuid": null, "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "0da32254-e667-d8a3-4835-9192ab96e605", "timestamp": "2026-11-17T10:00:00.000Z", "message": {"role": "user", "content": "check why the build is red"}, "promptId": "512d1f0f-dbb1-9370-44fc-64f95c5b2f1c"}
{"parentUuid": "0da32254-e667-d8a3-4835-9192ab96e605", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "assistant", "uuid": "88b2c13b-d708-c7ac-6eef-9722b1eab8bb", "timestamp": "2026-11-17T10:01:00.000Z", "message": {"id": "msg_01fb6991d1eee2ed36844d12", "type": "message", "role": "assistant", "model": "claude-sonnet-4-5", "content": [{"type": "tool_use", "id": "toolu_016479bd6b3e22c416c46c0f", "name": "Bash", "input": {"command": "cat NOTES.md"}}], "stop_reason": "tool_use", "usage": {"input_tokens": 3, "output_tokens": 41}}, "requestId": "req_011fb6991d1eee2ed"}
{"parentUuid": "88b2c13b-d708-c7ac-6eef-9722b1eab8bb", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "d819ac82-1aae-7a28-26c5-80ebf4e6a155", "timestamp": "2026-11-17T10:01:00.600Z", "message": {"role": "user", "content": [{"tool_use_id": "toolu_016479bd6b3e22c416c46c0f", "type": "tool_result", "content": "- npm test fails with `Error: Cannot find module 'left-pad'`", "is_error": false}]}, "sourceToolAssistantUUID": "88b2c13b-d708-c7ac-6eef-9722b1eab8bb", "permissionDecision": {"decision": "accept", "source": "config", "reasonType": "mode"}, "toolUseResult": {"stdout": "- npm test fails with `Error: Cannot find module 'left-pad'`", "stderr": "", "interrupted": false, "isImage": false}}
{"parentUuid": "d819ac82-1aae-7a28-26c5-80ebf4e6a155", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "attachment", "uuid": "0a2e8c19-e814-30ed-42fe-58b64be0fdb5", "timestamp": "2026-11-17T10:01:30.000Z", "attachment": {"type": "todo_reminder", "content": [], "itemCount": 0}}
{"parentUuid": "0a2e8c19-e814-30ed-42fe-58b64be0fdb5", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "system", "uuid": "fef8d847-f3fa-4799-4683-621a471eb975", "timestamp": "2026-11-17T10:01:30.000Z", "subtype": "informational", "content": "Context left until auto-compact: 61%", "level": "info", "isMeta": false}
{"type": "api-request", "id": "026ade24-7436-02fe-5379-628b05feae7c", "timestamp": "2026-11-17T10:01:30.000Z", "sessionId": "sess-b", "version": "2.1.325", "shapeHash": "9f2c1e", "querySource": "repl_main_thread"}
{"parentUuid": "fef8d847-f3fa-4799-4683-621a471eb975", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "assistant", "uuid": "f12199bf-25ae-c32f-5254-8cb140fc251c", "timestamp": "2026-11-17T10:02:00.000Z", "message": {"id": "msg_01blockedeead5c4678", "type": "message", "role": "assistant", "model": "claude-sonnet-4-5", "content": [{"type": "tool_use", "id": "toolu_019f0040566d18eead5c4678", "name": "Bash", "input": {"command": "npm test"}}]}}
{"parentUuid": "f12199bf-25ae-c32f-5254-8cb140fc251c", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "668d1275-9054-d003-b0c8-57da85b27ace", "timestamp": "2026-11-17T10:02:00.600Z", "message": {"role": "user", "content": [{"type": "tool_result", "content": "PreToolUse:Bash hook error: [guard]: tests are run by CI only", "is_error": true, "tool_use_id": "toolu_019f0040566d18eead5c4678"}]}, "toolUseResult": "Error: PreToolUse:Bash hook error: [guard]: tests are run by CI only", "toolDenialKind": "permission-rule", "permissionDecision": {"decision": "reject", "source": "hook", "reasonType": "hook"}, "sourceToolAssistantUUID": "f12199bf-25ae-c32f-5254-8cb140fc251c"}
{"parentUuid": "668d1275-9054-d003-b0c8-57da85b27ace", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "assistant", "uuid": "da93cb2d-b0d7-6af1-6a52-3f04ea8c8022", "timestamp": "2026-11-17T10:03:00.000Z", "message": {"id": "msg_01709374d79086dd21235046", "type": "message", "role": "assistant", "model": "claude-sonnet-4-5", "content": [{"type": "tool_use", "id": "toolu_01f9cd91992c9ee8114c7c4e", "name": "Bash", "input": {"command": "npm test 2>&1 | tail -5"}}], "stop_reason": "tool_use", "usage": {"input_tokens": 3, "output_tokens": 41}}, "requestId": "req_011709374d79086dd"}
{"parentUuid": "da93cb2d-b0d7-6af1-6a52-3f04ea8c8022", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-b", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "04fb56a5-3911-4b2c-21db-5bcee0fb10a8", "timestamp": "2026-11-17T10:03:00.600Z", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01f9cd91992c9ee8114c7c4e", "type": "tool_result", "content": "Error: Cannot find module 'left-pad'\nRequire stack:\n- /home/dev/shop-api/index.js", "is_error": false}]}, "sourceToolAssistantUUID": "da93cb2d-b0d7-6af1-6a52-3f04ea8c8022", "permissionDecision": {"decision": "accept", "source": "config", "reasonType": "mode"}, "toolUseResult": {"stdout": "Error: Cannot find module 'left-pad'\nRequire stack:\n- /home/dev/shop-api/index.js", "stderr": "", "interrupted": false, "isImage": false}}
{"type": "last-prompt", "lastPrompt": "check why the build is red", "sessionId": "sess-b"}
8 changes: 8 additions & 0 deletions tests/fixtures/transcripts/sc8-claude-code/sess-d.jsonl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"type": "queue-operation", "operation": "enqueue", "timestamp": "2026-11-17T10:10:00.000Z", "sessionId": "sess-d", "content": "run the test suite in a subagent"}
{"type": "file-history-snapshot", "messageId": "b8538adf-eb0d-672f-9740-183237b9bb51", "snapshot": {"messageId": "b8538adf-eb0d-672f-9740-183237b9bb51", "trackedFileBackups": {}, "timestamp": "2026-11-17T10:10:00.000Z"}, "isSnapshotUpdate": false}
{"parentUuid": null, "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "d03cbf7d-e665-1662-2a47-836c1ad3d390", "timestamp": "2026-11-17T10:10:00.000Z", "message": {"role": "user", "content": "run the test suite in a subagent"}, "promptId": "f2f1e922-a1b0-73c2-64df-8f55d2becb0d"}
{"parentUuid": "d03cbf7d-e665-1662-2a47-836c1ad3d390", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "assistant", "uuid": "d80c8bca-b0f3-796a-f6ca-20e226a085d5", "timestamp": "2026-11-17T10:10:00.000Z", "message": {"id": "msg_0112de7dc781685a731040dc", "type": "message", "role": "assistant", "model": "claude-sonnet-4-5", "content": [{"type": "tool_use", "id": "toolu_01115dd75dd27a2036f4a98e", "name": "Bash", "input": {"command": "ls"}}], "stop_reason": "tool_use", "usage": {"input_tokens": 3, "output_tokens": 41}}, "requestId": "req_01112de7dc781685a"}
{"parentUuid": "d80c8bca-b0f3-796a-f6ca-20e226a085d5", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "b7cc7bc1-4a5b-38a2-8d80-7e6abb31ec8d", "timestamp": "2026-11-17T10:10:00.600Z", "message": {"role": "user", "content": [{"tool_use_id": "toolu_01115dd75dd27a2036f4a98e", "type": "tool_result", "content": "index.js\npackage.json", "is_error": false}]}, "sourceToolAssistantUUID": "d80c8bca-b0f3-796a-f6ca-20e226a085d5", "permissionDecision": {"decision": "accept", "source": "config", "reasonType": "mode"}, "toolUseResult": {"stdout": "index.js\npackage.json", "stderr": "", "interrupted": false, "isImage": false}}
{"parentUuid": "b7cc7bc1-4a5b-38a2-8d80-7e6abb31ec8d", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "assistant", "uuid": "a4af7aa0-74f1-3f61-d618-69d2c4caa7cb", "timestamp": "2026-11-17T10:10:30.000Z", "message": {"id": "msg_01eac61d4792580bd8de3a23", "type": "message", "role": "assistant", "model": "claude-sonnet-4-5", "content": [{"type": "tool_use", "id": "toolu_019c595be5c526ed1ab77e7c", "name": "Agent", "input": {"description": "run tests", "prompt": "run npm test"}}], "stop_reason": "tool_use", "usage": {"input_tokens": 3, "output_tokens": 41}}, "requestId": "req_011eac61d4792580b"}
{"parentUuid": "a4af7aa0-74f1-3f61-d618-69d2c4caa7cb", "isSidechain": false, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "type": "user", "uuid": "780cb78b-6631-cda1-6c02-c28293f43ac9", "timestamp": "2026-11-17T10:10:30.600Z", "message": {"role": "user", "content": [{"tool_use_id": "toolu_019c595be5c526ed1ab77e7c", "type": "tool_result", "content": "Tests fail: missing module.", "is_error": false}]}, "sourceToolAssistantUUID": "a4af7aa0-74f1-3f61-d618-69d2c4caa7cb", "permissionDecision": {"decision": "accept", "source": "config", "reasonType": "mode"}, "toolUseResult": "Tests fail: missing module."}
{"type": "last-prompt", "lastPrompt": "run the test suite in a subagent", "sessionId": "sess-d"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"parentUuid": null, "isSidechain": true, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "agentId": "a3f9c2e81b7d4056e", "type": "user", "uuid": "52c8771d-be45-f1e6-f8d7-52dd5fe07d1d", "timestamp": "2026-11-17T10:10:36.000Z", "message": {"role": "user", "content": "run npm test"}, "promptId": "899b0b64-6152-9a08-cd87-ebf402e730a5"}
{"parentUuid": "52c8771d-be45-f1e6-f8d7-52dd5fe07d1d", "isSidechain": true, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "agentId": "a3f9c2e81b7d4056e", "type": "attachment", "uuid": "8a02e882-0fed-5a1f-3aa2-1be57544440a", "timestamp": "2026-11-17T10:10:42.000Z", "attachment": {"type": "todo_reminder", "content": [], "itemCount": 0}}
{"parentUuid": "8a02e882-0fed-5a1f-3aa2-1be57544440a", "isSidechain": true, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "agentId": "a3f9c2e81b7d4056e", "type": "system", "uuid": "59a25dce-1e73-98e8-b06f-832630643505", "timestamp": "2026-11-17T10:10:42.000Z", "subtype": "informational", "content": "Context left until auto-compact: 61%", "level": "info", "isMeta": false}
{"type": "api-request", "id": "a0c50e75-0015-2a9a-e2ad-b83af5d9b5bd", "timestamp": "2026-11-17T10:10:42.000Z", "sessionId": "sess-d", "version": "2.1.325", "shapeHash": "9f2c1e", "querySource": "repl_main_thread", "agentId": "a3f9c2e81b7d4056e"}
{"parentUuid": "59a25dce-1e73-98e8-b06f-832630643505", "isSidechain": true, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "agentId": "a3f9c2e81b7d4056e", "type": "assistant", "uuid": "7bc6f6ec-ef0b-2ca2-fb9a-9c2d4f736634", "timestamp": "2026-11-17T10:11:00.000Z", "message": {"id": "msg_01d736ab6af3ff8e039eff73", "type": "message", "role": "assistant", "model": "claude-sonnet-4-5", "content": [{"type": "tool_use", "id": "toolu_018c30519ec66acdb9c328e1", "name": "Bash", "input": {"command": "npm test 2>&1"}}], "stop_reason": "tool_use", "usage": {"input_tokens": 3, "output_tokens": 41}}, "requestId": "req_011d736ab6af3ff8e"}
{"parentUuid": "7bc6f6ec-ef0b-2ca2-fb9a-9c2d4f736634", "isSidechain": true, "userType": "external", "cwd": "/home/dev/shop-api", "sessionId": "sess-d", "version": "2.1.325", "gitBranch": "main", "entrypoint": "cli", "agentId": "a3f9c2e81b7d4056e", "type": "user", "uuid": "013fa1eb-66e7-dd31-2d28-a8fa0f3497d2", "timestamp": "2026-11-17T10:11:00.600Z", "message": {"role": "user", "content": [{"tool_use_id": "toolu_018c30519ec66acdb9c328e1", "type": "tool_result", "content": "Exit code 1\nError: Cannot find module 'left-pad'\nRequire stack:\n- /home/dev/shop-api/index.js", "is_error": true}]}, "sourceToolAssistantUUID": "7bc6f6ec-ef0b-2ca2-fb9a-9c2d4f736634", "permissionDecision": {"decision": "accept", "source": "config", "reasonType": "mode"}, "toolUseResult": "Error: Exit code 1\nError: Cannot find module 'left-pad'\nRequire stack:\n- /home/dev/shop-api/index.js"}
{"type": "api-request-blob", "hash": "b2d9d0585a95f4b6", "sessionId": "sess-d", "message": {"role": "assistant", "content": [{"type": "tool_use", "id": "toolu_018c30519ec66acdb9c328e1", "name": "Bash", "input": {"command": "npm test 2>&1"}}]}, "agentId": "a3f9c2e81b7d4056e"}
{"type": "api-request-blob", "hash": "274a365e8cae432b", "sessionId": "sess-d", "message": {"role": "user", "content": [{"tool_use_id": "toolu_018c30519ec66acdb9c328e1", "type": "tool_result", "content": "Exit code 1\nError: Cannot find module 'left-pad'\nRequire stack:\n- /home/dev/shop-api/index.js", "is_error": true}]}, "agentId": "a3f9c2e81b7d4056e"}
Loading