Skip to content

test: add config module test suite (9 tests) - #39

Closed
TerminalGravity wants to merge 4 commits into
mainfrom
test/config-module-v2
Closed

test: add config module test suite (9 tests)#39
TerminalGravity wants to merge 4 commits into
mainfrom
test/config-module-v2

Conversation

@TerminalGravity

Copy link
Copy Markdown
Collaborator

Adds comprehensive tests for src/lib/config.ts — the config loading system that powers issue #9 (.preflight/ config directory).

What's tested:

  • Default config when no .preflight/ dir exists
  • config.yml merging (profile, related_projects, thresholds)
  • triage.yml rule loading and strictness override
  • Graceful fallback on malformed YAML (no crash)
  • Env var fallback when .preflight/ dir is absent
  • Env vars correctly ignored when .preflight/ dir is present
  • hasPreflightConfig() and getRelatedProjects() helpers

9 new tests, 52 total passing. All green.

… 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.
- Tests default config values when no .preflight/ dir exists
- Tests config.yml merging with defaults
- Tests triage.yml rule loading
- Tests graceful fallback on malformed YAML
- Tests env var fallback (PROMPT_DISCIPLINE_PROFILE)
- Tests env vars ignored when .preflight/ dir present
- Tests hasPreflightConfig() and getRelatedProjects()

9 new tests, 52 total passing
@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