Repository navigation
Drift Near-Miss Hints (Cycle 0023) #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
67a4d0a
cycles: pull 0023-drift-near-miss-hints
flyingrobots dff96d0
test: RED — failing tests for drift near-miss hints
flyingrobots d33c4c0
feat: add near-miss hints to drift detector
flyingrobots b27295e
cycles: close 0023-drift-near-miss-hints
flyingrobots File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
docs/design/0023-drift-near-miss-hints/drift-near-miss-hints.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| --- | ||
| title: "Drift Near-Miss Hints" | ||
| legend: PROCESS | ||
| --- | ||
|
|
||
| # Drift Near-Miss Hints | ||
|
|
||
| Source backlog item: `docs/method/backlog/cool-ideas/PROCESS_drift-near-miss-hints.md` | ||
| Legend: PROCESS | ||
|
|
||
| ## Sponsors | ||
|
|
||
| - Human: Process Steward | ||
| - Agent: Drift Analyst | ||
|
|
||
| ## Hill | ||
|
|
||
| When `method drift` reports an unmatched playback question, show the | ||
| closest test description as a near-miss hint so the operator can see | ||
| whether the mismatch is trivial (wording) or structural (missing test). | ||
|
|
||
| ## Playback Questions | ||
|
|
||
| ### Human | ||
|
|
||
| - [ ] When a playback question has no exact match but a test description | ||
| is close, the drift output shows the near-miss candidate. | ||
| - [ ] Near-miss hints never change the pass/fail exit code. Drift with | ||
| hints still exits 2. | ||
| - [ ] When no test description is remotely close, no hint is shown. | ||
|
|
||
| ### Agent | ||
|
|
||
| - [ ] `detectWorkspaceDrift` includes near-miss hints in the output for | ||
| unmatched questions. | ||
| - [ ] The similarity function is deterministic, requires no external | ||
| dependencies, and uses normalized token overlap. | ||
| - [ ] A dedicated `tests/drift.test.ts` proves exact match, near-miss | ||
| hint, no-hint, and exit code behavior. | ||
|
|
||
| ## Accessibility and Assistive Reading | ||
|
|
||
| Hints are plain text indented under the unmatched question, readable | ||
| in any terminal or screen reader. | ||
|
|
||
| ## Localization and Directionality | ||
|
|
||
| Not in scope. English-only CLI output. | ||
|
|
||
| ## Agent Inspectability and Explainability | ||
|
|
||
| Hints are deterministic and reproducible. The similarity metric is | ||
| transparent (token overlap ratio). | ||
|
|
||
| ## Non-goals | ||
|
|
||
| - [ ] LLM-based or embedding-based semantic matching. | ||
| - [ ] Changing the pass/fail contract. Exact match remains authority. | ||
| - [ ] Configurable similarity thresholds (hardcoded is fine for now). |
27 changes: 0 additions & 27 deletions
27
docs/method/backlog/cool-ideas/PROCESS_drift-near-miss-hints.md
This file was deleted.
Oops, something went wrong.
47 changes: 47 additions & 0 deletions
47
docs/method/retro/0023-drift-near-miss-hints/drift-near-miss-hints.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| --- | ||
| title: "Drift Near-Miss Hints" | ||
| outcome: hill-met | ||
| drift_check: yes | ||
| --- | ||
|
|
||
| # Drift Near-Miss Hints Retro | ||
|
|
||
| Design: `docs/design/0023-drift-near-miss-hints/drift-near-miss-hints.md` | ||
| Outcome: hill-met | ||
| Drift check: yes | ||
|
|
||
| ## Summary | ||
|
|
||
| Added near-miss hints to `method drift`. When a playback question has | ||
| no exact normalized match but a test description shares enough tokens | ||
| (Jaccard similarity >= 0.7), the drift output now shows the closest | ||
| candidate as a "Near miss" hint. Exit codes are unchanged — drift with | ||
| hints still exits 2. | ||
|
|
||
| The feature uses deterministic punctuation-stripped token overlap with | ||
| no external dependencies. This solves the immediate pain where | ||
| playback questions with minor wording differences (backticks, extra | ||
| words) appeared as complete misses. | ||
|
|
||
| ## Playback Witness | ||
|
|
||
| - [Verification Witness](./witness/verification.md) | ||
|
|
||
| ## Drift | ||
|
|
||
| - None recorded. | ||
|
|
||
| ## New Debt | ||
|
|
||
| - None recorded. | ||
|
|
||
| ## Cool Ideas | ||
|
|
||
| - Make the similarity threshold configurable via `.method.json`. | ||
| - Show the similarity score alongside the hint for transparency. | ||
|
|
||
| ## Backlog Maintenance | ||
|
|
||
| - [x] Inbox processed | ||
| - [x] Priorities reviewed | ||
| - [x] Dead work buried or merged |
49 changes: 49 additions & 0 deletions
49
docs/method/retro/0023-drift-near-miss-hints/witness/verification.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| --- | ||
| title: "Verification Witness for Cycle 23" | ||
| --- | ||
|
|
||
| # Verification Witness for Cycle 23 | ||
|
|
||
| This witness proves that `Drift Near-Miss Hints` now carries the | ||
| required behavior and adheres to the repo invariants. | ||
|
|
||
| ## Test Results | ||
|
|
||
| ```text | ||
| > method@0.2.0 test | ||
| > vitest run --config vitest.config.ts | ||
|
|
||
|
|
||
| RUN v4.1.2 ./method | ||
|
|
||
|
|
||
| Test Files 10 passed (10) | ||
| Tests 110 passed (110) | ||
| Start at 18:37:33 | ||
| Duration 1.45s | ||
| ``` | ||
|
|
||
| ## Drift Results | ||
|
|
||
| ```text | ||
| Playback-question drift found. | ||
| Scanned 1 active cycle, 6 playback questions, 123 test descriptions. | ||
| Search basis: exact normalized match in tests/**/*.test.* and tests/**/*.spec.* descriptions. | ||
|
|
||
| docs/design/0023-drift-near-miss-hints/drift-near-miss-hints.md | ||
| - Agent: `detectWorkspaceDrift` includes near-miss hints in the output for unmatched questions. | ||
| Near miss: "detectWorkspaceDrift includes near-miss hints in the output for unmatched questions." | ||
| - Agent: A dedicated `tests/drift.test.ts` proves exact match, near-miss hint, no-hint, and exit code behavior. | ||
| No exact normalized test description match found. | ||
| ``` | ||
|
|
||
| The drift output itself demonstrates the near-miss feature working: | ||
| line 1 shows a near-miss hint (backticks removed = close match), and | ||
| line 2 shows no hint (the test description is the `describe` block | ||
| title, not a direct match for the meta-question). | ||
|
|
||
| ## Manual Verification | ||
|
|
||
| - [x] Automated capture completed successfully. | ||
| - [x] All 110 tests pass (102 prior + 8 new drift tests). | ||
| - [x] No personal paths in witness output. |
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The near-miss scorer currently removes punctuation before splitting on spaces, which merges adjacent words into one token (for example,
near-missbecomesnearmiss). That makes punctuation-only wording differences look much less similar than intended and can suppress hints for otherwise close questions (especially shorter ones), reducing the accuracy of the feature this commit adds. Treating punctuation as a delimiter (e.g., replacing with spaces or splitting on non-alphanumerics) avoids these false negatives.Useful? React with 👍 / 👎.