Skip to content

feat: catch additive corrections + semantic one-off gate + SHA versioning - #2

Merged
ankitkr3 merged 1 commit into
mainfrom
feat/semantic-correction-gate
Jun 22, 2026
Merged

feat: catch additive corrections + semantic one-off gate + SHA versioning#2
ankitkr3 merged 1 commit into
mainfrom
feat/semantic-correction-gate

Conversation

@ankitkr3

Copy link
Copy Markdown
Owner

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 a rule.

Changes

1. Ack corroborated by doubt OR rework.

strong_rework = len(edit_files) >= 1 or score >= SCORE_TO_FIRE
ack_is_correction = correction_ack and (user_doubt or strong_rework)
  • Doubt catches questioned facts (web-search version checks).
  • Rework catches additive corrections with no doubt words (the UI-testing case).
  • The no-rework self-ack stays suppressed — nothing corroborates it.

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_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. Widening the trigger therefore does not bring back one-off nagging — the LLM absorbs it.

3. SHA-based versioning.
Removed version from plugin.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():

case result
UI correction (ack + rework, no doubt) ✅ fires (rule)
self-ack meta (ack, no rework, no doubt) ✅ silent
web-search (ack + doubt) ✅ fires (rule)

2 new regression tests; 61/61 green, no existing true-positive assertions weakened.

🤖 Generated with Claude Code

…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>
@ankitkr3
ankitkr3 merged commit 9feb758 into main Jun 22, 2026
8 checks passed
@ankitkr3
ankitkr3 deleted the feat/semantic-correction-gate branch June 22, 2026 07:47
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.

2 participants