fix(prompt-score): remove false scope credit for long prompts#105
Open
TerminalGravity wants to merge 2 commits intomainfrom
Open
fix(prompt-score): remove false scope credit for long prompts#105TerminalGravity wants to merge 2 commits intomainfrom
TerminalGravity wants to merge 2 commits intomainfrom
Conversation
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.
TerminalGravity
commented
Mar 5, 2026
Collaborator
Author
TerminalGravity
left a comment
There was a problem hiding this comment.
Clean fix — scope credit was inflating scores for long prompts regardless of actual scope quality. Good separation of concerns.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The scope dimension in
prompt_scorewas 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
text.length > 100shortcut from scope scoringonly,just,single,specific,this)scorePromptfor direct testingTests
Added 10 tests covering all scoring dimensions, the regression case, and edge cases like mixed scope signals and questions.