Skip to content

feat(triage): implement patternMatchCount boost#30

Closed
TerminalGravity wants to merge 4 commits intomainfrom
feat/pattern-match-triage-boost
Closed

feat(triage): implement patternMatchCount boost#30
TerminalGravity wants to merge 4 commits intomainfrom
feat/pattern-match-triage-boost

Conversation

@TerminalGravity
Copy link
Copy Markdown
Collaborator

Implements the config field that was declared but never used in triagePrompt(). When >= 2 correction patterns match a prompt, it gets bumped from clearambiguous with clarify-intent/scope-work recommended.

Connects correction pattern learning (#13) to smart triage (#8) — if we've seen this kind of prompt cause corrections before, we flag it proactively.

  • Added boost logic in triagePrompt() (threshold: 2 pattern matches)
  • Updated test from type-only check to actual behavior test
  • Added below-threshold test case
  • All 81 tests pass

… 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.
- Add 17 tests covering config loading from .preflight/, env var
  overrides, caching, malformed YAML handling, and helper functions
- Export resetConfig() to clear cached config (needed for tests and
  potential config hot-reload)
- All 60 tests passing
…tests + fix dotfile bug

- Extract extractFilePaths, detectAmbiguity, estimateComplexity, splitSubtasks into src/lib/preflight.ts
- Add comprehensive test suite (tests/lib/preflight.test.ts) — 20 new tests
- Fix bug: extractFilePaths now correctly detects dotfiles (.env, .gitignore)
- preflight-check.ts imports from lib instead of inline definitions
- All 80 tests pass
The TriageConfig.patternMatchCount field was declared in the interface
and documented as 'boosts level to at least ambiguous' but never actually
consumed by triagePrompt(). Now when patternMatchCount >= 2, prompts that
would otherwise classify as 'clear' get bumped to 'ambiguous' with
clarify-intent and scope-work recommended.

This closes the loop between correction pattern learning (#13) and
smart triage (#8) — if a prompt matches multiple known correction
patterns, we proactively flag it before the agent wastes tokens.

Added tests for both the boost case and the below-threshold case.
@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