Skip to content

test: add 13 unit tests for preflight_check helpers#33

Closed
TerminalGravity wants to merge 4 commits intomainfrom
test/preflight-check-unit-tests
Closed

test: add 13 unit tests for preflight_check helpers#33
TerminalGravity wants to merge 4 commits intomainfrom
test/preflight-check-unit-tests

Conversation

@TerminalGravity
Copy link
Copy Markdown
Collaborator

Exports and tests the core helper functions in preflight-check.ts:

  • extractFilePaths — file path extraction from prompt text (dedup, dotfiles, various extensions)
  • buildScopeSection — scope estimation (SMALL/MEDIUM/LARGE based on file count + directory spread)
  • buildSequenceSection — multi-step parsing, risk classification (HIGH/MEDIUM/LOW), checkpoint reminders

Takes test count from 43 → 56. All passing.

… 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.
Export extractFilePaths, buildScopeSection, buildSequenceSection from
preflight-check.ts and add comprehensive tests covering:
- File path extraction (dedup, dotfiles, various extensions)
- Scope estimation (SMALL/MEDIUM/LARGE based on file count + dir spread)
- Sequence splitting (multi-step parsing, risk classification, checkpoints)

Takes test count from 43 → 56.
Copy link
Copy Markdown
Collaborator Author

@TerminalGravity TerminalGravity left a comment

Choose a reason for hiding this comment

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

Tests look good. Noticed this PR also bundles the example configs and README changes from #34 — if #34 lands first you'll want to rebase.

The unused import cleanup overlaps with #32 too. These PRs have a lot of cross-contamination — might be worth doing a quick rebase pass to isolate each PR's scope. Otherwise reviewers can't tell what's unique to each branch.

The actual test additions are solid though. 👍

@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