Skip to content

test: add 10 unit tests for preflight_check tool - #58

Closed
TerminalGravity wants to merge 6 commits into
mainfrom
test/preflight-check-tests
Closed

test: add 10 unit tests for preflight_check tool#58
TerminalGravity wants to merge 6 commits into
mainfrom
test/preflight-check-tests

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

What

Adds first test coverage for preflight_check — the unified entry point tool. 10 tests covering:

  • Tool registration correctness
  • force_level overrides (skip/light/full)
  • Trivial prompt pass-through
  • Ambiguous prompt clarification + git state
  • Vague pronoun detection
  • Short prompt warnings
  • Multi-step splitting into numbered subtasks
  • Risk level assignment (database=HIGH, api=MEDIUM, UI=LOW)

Also updates CI matrix from Node [18, 20] → [20, 22] since Node 18 is EOL and breaks ESLint 10 (see #57).

53 tests total, all passing.

Closes: n/a (new coverage)
Related: #57 (CI blocker)

… 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.
- Reorder options: npx (zero install) → npm global → clone
- Add -y flag to npx for non-interactive use
- Explain what CLAUDE_PROJECT_DIR enables
- Note that .mcp.json paths must be absolute
- Use 'absolute' in path placeholders to prevent confusion
Tests cover:
- Tool registration
- force_level skip/light/full overrides
- Trivial prompt pass-through
- Ambiguous prompt clarification
- Vague pronoun detection
- Short prompt detection
- Multi-step task splitting into subtasks
- Risk level assignment (HIGH/MEDIUM/LOW)

Also updates CI matrix: Node 18→22 (18 is EOL, see #57)

@TerminalGravity TerminalGravity left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid first test coverage for the main entry point. The force_level override tests and multi-step splitting coverage are particularly good — those are the paths most likely to regress. Note this PR also includes the CI matrix fix from #51, so we should merge #51 first to avoid conflicts.

@TerminalGravity

Copy link
Copy Markdown
Collaborator Author

Closing — 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