Skip to content

test: add 20 tests for preflight_check triage integration#42

Closed
TerminalGravity wants to merge 5 commits intomainfrom
test/preflight-check-coverage
Closed

test: add 20 tests for preflight_check triage integration#42
TerminalGravity wants to merge 5 commits intomainfrom
test/preflight-check-coverage

Conversation

@TerminalGravity
Copy link
Copy Markdown
Collaborator

Adds comprehensive test coverage for the preflight_check tool's triage integration — the main entry point had zero tests.

Coverage:

  • Trivial/clear/ambiguous/cross-service/multi-step classification
  • skip & always_check keyword overrides
  • Strictness mode confidence adjustment
  • Edge cases: empty prompt, bullet lists, pronoun detection, vague verbs
  • Recommended tools per triage level

All 70 tests pass (20 new + 50 existing).

… and contracts

The README references .preflight/ config extensively but there were no
concrete example files to copy. This adds a ready-to-use examples/.preflight/
directory with annotated config.yml, triage.yml, and contracts/api.yml,
plus a README explaining how to use them.
Created examples/USAGE_EXAMPLES.md with 8 real-world scenarios showing
what each tool looks like in practice: preflight_check catching vague
prompts, scope_work creating execution plans, enrich_agent_task for
sub-agents, sharpen_followup resolving ambiguity, session health checks,
semantic history search, weekly scorecards, and prompt grading.

Added link to usage examples in README nav bar.
- Fixed extractText to filter by b.type === 'text' (was counting tool_use
  blocks as text tokens, inflating estimates)
- Exported analyzeSessionFile and SessionAnalysis for testability
- Added 7 tests covering: token counting, correction detection, tool call
  counting, preflight tool tracking, content block filtering, tool_result
  handling, malformed input, and epoch timestamps
- Test count: 43 → 50
Covers trivial/clear/ambiguous/cross-service/multi-step classification,
skip/always_check keywords, strictness modes, edge cases (empty prompt,
bullet lists, pronoun detection, vague verbs).
@TerminalGravity
Copy link
Copy Markdown
Collaborator Author

Superseded by newer PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant