test: add session-parser test suite (20 tests) - #261
Open
TerminalGravity wants to merge 4 commits into
Open
Conversation
Shows 4 concrete scenarios: vague prompt clarification, multi-step scoping, correction pattern matching, and cross-service awareness. Each example includes the prompt, triage classification, and the actual output users can expect.
The README and examples/README.md referenced examples/.preflight/ but the actual config files didn't exist. Added: - config.yml — profile, related projects, thresholds, embeddings - triage.yml — keyword rules and strictness settings - contracts/api.yml — manual contract definition examples All files are heavily commented so users can copy them into their project root and customize without needing to reference the docs.
The init wizard resolved the templates directory relative to dist/cli/, which pointed to dist/templates/ — a path that doesn't exist. Templates live in src/templates/ and ship in the npm tarball via the 'files' field. Fixed by going up three levels (dist/cli/init.js → package root) instead of two, then into src/templates/.
Covers prompt parsing, correction detection, tool call extraction, sub-agent spawns, error/compaction events, malformed JSON handling, array content blocks, epoch timestamps, and findSessionFiles.
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.
Adds comprehensive test coverage for
src/lib/session-parser.ts— a core module that had zero tests.20 tests covering:
it.each)Task/dispatch_agent)tool_resultwithis_errorfindSessionFilesincluding subagent directoriesAll 63 tests pass (43 existing + 20 new).