Skip to content

reflect: catch an evidence-order correction from the ledger transition, not from wording - #782

Merged
mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/reflect/subagent-decisions-slot-20260922/catch-evidence-order-correction-ledger-transition--99190104
Sep 24, 2026
Merged

mergify[bot] merged 1 commit into
mainfrom
stack/EdbertChan/reflect/subagent-decisions-slot-20260922/catch-evidence-order-correction-ledger-transition--99190104

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

A correction can be about order, not error. Saying "I was right, but I said it before I checked" admits nothing was wrong, so no wording-based detector sees it.

Both detectors here require a wrongness word, so that shape was invisible.

The exact signal already exists: a claim going from open to resolved is the event "this was asserted before its check ran, and the check has now run."

That transition now triggers the review nudge.

Review Claim

A claim closing in the ledger triggers the review nudge, with no wording match involved.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

The trigger is a state change the ledger already records, so it cannot fire on a claim that was never opened, and it fires at most once per claim. No phrase list gates it.

Slice Rationale

Rebased onto main; the wrong-check-reflect commit this once sat on already landed as #796. Kept separate because it changes what fires the nudge, not how claims are tracked.

Non-goals

Does not widen the regex retraction scan; three tests pin its gap on purpose. Does not change the nudge's wording. The wrong-check-reflect judge dictionary does gain the two real sentences as match cases, and its meaning now names "right, but said before it was checked" as a match.

Test Plan

Test Plan

Run at this commit:

python3 -m unittest discover -s engine/hooks/unverified-tag-ledger/tests
Ran 37 tests in 6.534s
OK

python3 -m unittest discover -s engine/hooks/wrong-check-reflect/tests
Ran 36 tests in 84.462s
OK

Added cases pin the two real sentences from the session that motivated this, both of which the wording detectors stay silent on.

Revert Plan

Revert Plan

Revert this commit. Corrections about order go undetected again, as they do on main.

@EdbertChan

EdbertChan commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner Author

This pull request is part of a Mergify stack:

# Pull Request Link
1 wrong-check-reflect: one shot per reply, and scope the reflect scan to the turn #796
2 reflect: catch an evidence-order correction from the ledger transition, not from wording #782 👈
3 unverified-tag-ledger: gate the next-prompt reminder, default to stale only #783
4 diu-stop: a file citation buys silence only when it is backed #784
5 diu-stop: the marker gate reads prose, so a mention is not a use #785
6 cat-mode: show the escape-hatch tag in the form the gate accepts #786
7 principle-subagent-inherits-scope: a brief carries decisions, not just facts and a question #788
8 llm-judge: claude is the only default runner #793

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 97efd7e. Configure here.

Comment thread engine/hooks/unverified-tag-ledger/detect.py
@EdbertChan
EdbertChan changed the base branch from stack/EdbertChan/reflect/subagent-decisions-slot-20260922/wrong-check-reflect-one-shot-per-reply-scope--db90d55f to main September 22, 2026 18:38
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/reflect/subagent-decisions-slot-20260922/catch-evidence-order-correction-ledger-transition--99190104 branch from 97efd7e to 65902c9 Compare September 22, 2026 18:38
@EdbertChan
EdbertChan changed the base branch from main to stack/EdbertChan/reflect/subagent-decisions-slot-20260922/wrong-check-reflect-one-shot-per-reply-scope--60c5103d September 22, 2026 18:38
@EdbertChan

EdbertChan commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner Author

Revision history

# Type Changes Reason Date
1 initial 97efd7e 2026-09-22 18:38 UTC
2 rebase 97efd7e → 65902c9 (rebase only) 2026-09-22 18:38 UTC
3 rebase 65902c9 → 21fb367 (rebase only) 2026-09-23 14:06 UTC

@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/reflect/subagent-decisions-slot-20260922/wrong-check-reflect-one-shot-per-reply-scope--60c5103d branch from 9473d50 to ed08f60 Compare September 23, 2026 14:06
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/reflect/subagent-decisions-slot-20260922/catch-evidence-order-correction-ledger-transition--99190104 branch from 65902c9 to 21fb367 Compare September 23, 2026 14:06
@EdbertChan
EdbertChan changed the base branch from stack/EdbertChan/reflect/subagent-decisions-slot-20260922/wrong-check-reflect-one-shot-per-reply-scope--60c5103d to main September 23, 2026 18:27
@mergify

mergify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Queued — the merge queue status continues in this comment ↓.

@EdbertChan

Copy link
Copy Markdown
Owner Author

Mergify repair stopped: GitHub reports merge conflict. The retry cap was reached for current head 21fb367.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

🛑 Queue command has been cancelled

…n, not from wording

Both retraction detectors need a wrongness word. Two real corrections carry
none, because the claim was true and only its order was wrong:

  "Correcting one claim and arming the check I implied:"
  "I was right - but I said it a turn before I checked it"

Primary fix, no regex and no model: a ledger row going outstanding ->
discharged IS the event "a claim was asserted before its check ran, and the
check has now run". The Stop that discharges a row now reports it as a reflect
trigger. It reads state, so the reply's wording is not consulted at all.

Secondary fix: the judge dictionary's meaning now covers "right, but said
before it was checked", and both real strings are eval cases. Run against the
real judge, all six cases land where the dictionary says they should.

The regex scan keeps its hole on purpose, pinned by three tests so the next
author widens it knowingly rather than by accident.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Change-Id: I99190104b68d88f78aa9c8a706c9a6d23055aecc
@EdbertChan
EdbertChan force-pushed the stack/EdbertChan/reflect/subagent-decisions-slot-20260922/catch-evidence-order-correction-ledger-transition--99190104 branch from 21fb367 to 13ab621 Compare September 24, 2026 03:33
@cursor

cursor Bot commented Sep 24, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_649337ee-0879-45f7-861b-676c5a614429)

@mergify

mergify Bot commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

queue

🛑 The pull request has been removed from the queue admin-bypass

Details

The pull request #782 has been manually updated.

You can take a look at Mergify Merge Queue check runs for more details about the failure.

@EdbertChan

Copy link
Copy Markdown
Owner Author

@Mergifyio queue

@mergify

mergify Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Merge Queue Status

This pull request spent 27 minutes 41 seconds in the queue, including 27 minutes 3 seconds running CI.

Required conditions to merge
  • check-success = lint
  • check-success = test
  • check-success = validate

@mergify mergify Bot added the queued label Sep 24, 2026
@mergify
mergify Bot merged commit ca2d6d6 into main Sep 24, 2026
8 checks passed
@mergify mergify Bot removed the queued label Sep 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant