feat: catch additive corrections + semantic one-off gate + SHA versioning - #2
Merged
Merged
Conversation
…tch to SHA versioning
Two coupled changes.
1. Catch additively-phrased corrections (the "use UI testing as well" miss).
The v1.3.3 fix made the assistant-ack channel require user doubt to corroborate.
That suppressed the dominant self-ack false positive, but also dropped genuine
corrections phrased as calm additive instructions ("use UI testing as well") that
carry no doubt words — Claude acknowledged them and did real rework, yet they
scored as a procedure, not a rule.
Channel 2 is now corroborated by EITHER user doubt OR substantial corrective
rework (an edit, or a turn clearing the procedure bar):
ack_is_correction = correction_ack and (user_doubt or strong_rework)
The no-rework self-ack ("I was wrong about my own claim" in a neutral chat) stays
suppressed, because it has no rework to corroborate it.
2. Semantic one-off gate. Detection is deterministic and cannot tell a generalizable
rule from a one-off (the UI-testing and ScopeCall corrections are structurally
identical — same ack, same rework, opposite desired outcome). That call is
delegated to the compounded-author RULE MODE gate. build_rule_reason now instructs
Claude to judge generalizability FIRST and drop one-offs SILENTLY (no AskUserQuestion),
surfacing the approval gate only when the lesson genuinely generalizes. So widening
the trigger does not bring back one-off nagging — the LLM absorbs it.
3. Switch to commit-SHA versioning. Removed the "version" field from plugin.json so
every push auto-propagates to installs (no manual version bump, no stale-cache
problem where same-version installs keep old code).
- score_turn: compute score before the correction decision; add strong_rework arm
- build_rule_reason: generalize-or-drop-silently instruction
- docstring updated; 2 new regression tests (ack+rework+no-doubt -> rule), 61/61 green
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Background
v1.3.3 made the assistant-ack channel (channel 2) require user doubt to corroborate, killing the self-ack false positive (Claude saying "I was wrong" about its own claim). But that over-corrected: it dropped genuine corrections phrased as calm additive instructions — e.g. "use UI testing as well" — which carry no doubt words. Claude acknowledged them and did real rework, yet they scored as a
procedure, not arule.Changes
1. Ack corroborated by doubt OR rework.
2. Semantic one-off gate.
The UI-testing correction and the earlier ScopeCall correction are structurally identical (same ack, same rework) but want opposite outcomes — the only difference is generalizable vs one-off, which is irreducibly semantic. Detection can't make that call, so
build_rule_reasonnow instructs Claude to judge generalizability first and drop one-offs silently (noAskUserQuestion), surfacing the approval gate only when the lesson genuinely generalizes. Widening the trigger therefore does not bring back one-off nagging — the LLM absorbs it.3. SHA-based versioning.
Removed
versionfromplugin.json. Per the Claude Code docs, same-version pushes don't reach existing installs; omitting the field resolves the version to the commit SHA so every push auto-propagates with no manual bump and no stale-cache problem.Verification
End-to-end via
main():2 new regression tests; 61/61 green, no existing true-positive assertions weakened.
🤖 Generated with Claude Code