Skip to content

fix(prompt-score): remove false scope credit for long prompts#105

Open
TerminalGravity wants to merge 2 commits intomainfrom
fix/prompt-score-scope-bug
Open

fix(prompt-score): remove false scope credit for long prompts#105
TerminalGravity wants to merge 2 commits intomainfrom
fix/prompt-score-scope-bug

Conversation

@TerminalGravity
Copy link
Collaborator

What

The scope dimension in prompt_score was giving full marks (25/25) to any prompt longer than 100 characters, regardless of whether the scope was actually clear. A rambling vague prompt got the same scope score as a tightly bounded one.

Fix

  • Removed the text.length > 100 shortcut from scope scoring
  • Scope now only rewards explicit bounding words (only, just, single, specific, this)
  • Added handling for mixed signals (e.g. "only update all tests" → partial credit + feedback)
  • Exported scorePrompt for direct testing

Tests

Added 10 tests covering all scoring dimensions, the regression case, and edge cases like mixed scope signals and questions.

Implements #5. Adds a new export_report MCP tool that generates:
- Weekly summaries with commit lists, correction rates, and daily breakdowns
- Activity reports with event breakdowns, tool usage stats, and heatmaps

Supports saving reports to ~/.preflight/reports/ and all existing
search scopes (current/related/all).

Includes test suite with 4 tests covering registration, empty state,
weekly report generation, and activity report heatmap output.
Previously, any prompt over 100 chars got full scope score (25/25)
regardless of actual scope clarity. Now scope scoring only rewards
explicit bounding words (only, just, single, specific, this) and
penalizes broad words (all, every, entire, whole).

Also exports scorePrompt for testability and adds 10 tests covering
all scoring dimensions, edge cases, and the regression.
Copy link
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.

Clean fix — scope credit was inflating scores for long prompts regardless of actual scope quality. Good separation of concerns.

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