Repository navigation
010 stream session parsing - #17
Merged
Merged
Conversation
Add Spec Kit artifacts for 010-stream-session-parsing to define the CCH-only OOM fix scope and implementation path. - specify one-pass summary/detail parsing requirements, additive SessionSummary.preview, and 512 MiB listSessions() regression budget - document parser/session research decisions, data model, library and CLI contracts, and implementation quickstart - generate executable story-first tasks for US1-US3 with test-first checkpoints, dependency graph, and parallelization notes - update AGENTS.md with the active JSONL session storage context for this feature
Apply the five post-analysis decisions across the 010-stream-session-parsing artifacts. - document the branch-name governance exception for this Spec Kit-generated branch - clarify that listSessions()/cch list must return both main-session and agent-session top-level rows - pin summary preview behavior to a 200-character cap with '(No summary)' as the exact fallback label - add explicit baseline-vs-new regression coverage for >=90% fewer fallback detail fetches - align plan.md with tests/unit/cli/formatters/table.test.ts and refresh related contracts, data model, quickstart, and task counts
Refactor summary and detail parsing around one-pass JSONL scanners so list and view paths retain only derived state, emit bounded preview text, return top-level agent rows, and avoid duplicate target-file parses. Add large-fixture, one-pass, and CLI fallback regression coverage, then update stale contract/export expectations to the new listing shape. Validation: - npm run typecheck - npm run lint - npm test Per-file summary: eslint.config.js - Ignore minified JS artifacts. specs/010-stream-session-parsing/tasks.md - Mark all implementation tasks complete. src/cli/formatters/table.ts - Render summary, then preview, then the no-summary placeholder. src/lib/parser.ts - Add streaming scan helpers, preview extraction, and one-pass detail and summary parsers. src/lib/session.ts - Use one-pass parser outputs for listing and detail retrieval and include top-level agent rows. src/lib/types.ts - Add SessionSummary.preview. tests/helpers/large-session-fixtures.ts - Add synthetic large/untitled JSONL fixture builders. tests/helpers/parser-performance.ts - Add heap sampling and parser scan-count helpers. tests/integration/cli/list.test.ts - Cover CLI preview fallback, top-level agent rows, and reduced fallback reads. tests/integration/contract/claude-session-contract.test.ts - Expect both main and agent rows in contract fixture listing. tests/integration/export-sessions.test.ts - Expect top-level agent rows in export-all JSON. tests/integration/get-session.test.ts - Assert preview and metadata on large main and agent detail responses. tests/integration/list-sessions.test.ts - Cover agent rows, preview fallback, malformed-line recovery, and summary precedence. tests/integration/performance/session-lookup.test.ts - Add 1,000-session heap regression and update agent-inclusive list counts. tests/unit/cli/formatters/table.test.ts - Cover preview fallback and display-only truncation. tests/unit/parser.test.ts - Cover streaming scans, preview normalization, and malformed-line recovery. tests/unit/session.test.ts - Cover preview propagation and one-pass main and agent detail parsing.
Apply the feature-branch version bump and run Prettier over the touched TypeScript files. Validation: - npm run format - npm run typecheck - npm test Per-file summary: package.json - Bump package version to 0.9.0. package-lock.json - Sync lockfile package version metadata to 0.9.0. src/lib/session.ts - Apply Prettier formatting to wrapped parser/link-context calls. tests/integration/cli/list.test.ts - Apply Prettier formatting to long CLI fixture calls. tests/integration/performance/session-lookup.test.ts - Apply Prettier formatting to long performance fixture helpers.
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.
Node OOM when running Claude session list/sync because CCH and vibe-history load many large transcripts and duplicate full-file parses just to derive fallback preview text. #16