Skip to content

diu waits for the word-list answer and says it in the same turn - #454

Merged
EdbertChan merged 2 commits into
mainfrom
plan/diu-asks-the-judge
Sep 12, 2026
Merged

diu waits for the word-list answer and says it in the same turn#454
EdbertChan merged 2 commits into
mainfrom
plan/diu-asks-the-judge

Conversation

@EdbertChan

@EdbertChan EdbertChan commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Summary

When a reply uses wording the user has had to ask about, diu now says so before the turn ends, and the agent rewrites it.

The five word lists become one question for a background model. The Stop hook waits for the answer, sixteen seconds in a live run.

If no answer arrives in time, the turn ends as it does today.

Review Claim

diu-stop builds one judge question from every phrases/plain-words-*.json, waits for the answer, and blocks the turn with a message that names the list and quotes the reply.

Review Lane

behavior

Review Unit

engine-runtime

Safety Invariant

No question is asked unless the payload names a transcript file that exists, so a harness payload without one, and every test, calls no model: the full diu-stop suite leaves zero job files behind. A verdict whose quote is not in the reply is dropped. No answer within the wait ends the turn unblocked.

Slice Rationale

This PR reads the word lists added by the PR below it, so it stacks on #446.

Delivering the answer on the user's next message was the first shape, and it was wrong: Claude Code has no way to push a message into an idle session, so a verdict nobody reads is a verdict the user never sees. Waiting is the only way to show it in the same turn.

Claude Code only for now. Cursor and Codex keep the behavior they have.

Non-goals

  • No change to llm-judge, its inbox, or the word lists themselves.
  • No Cursor or Codex wiring.
  • The word count and unproven-claim checks are untouched.

Architecture

Before

graph TD
    S["Stop hook"] --> W["word count"]
    S --> C["unproven claim"]
    W --> B["block the turn, or let it end"]
    C --> B
Loading

After

graph TD
    S["Stop hook"] --> W["word count"]
    S --> C["unproven claim"]
    S --> P["one question from every plain-words list"]
    P --> J["background judge: one model call"]
    J --> V["answer, or nothing in time"]
    V --> Q["drop an answer that does not quote the reply"]
    W --> B["block the turn, or let it end"]
    C --> B
    Q --> B
Loading

Test Plan

Test Plan
  • python3 -m unittest discover -s engine/hooks/diu-stop/tests, on the branch rebuilt onto current main: Ran 97 tests ... OK, and the job folder held zero files before and after, with no model calls running
  • Live end-to-end, one fake turn through claude_stop_check.py with its own state folder: reply "No hook decides differently. Preflight passes and the review unit is engine-runtime." gave hook exit=2 after 16s and the message diu: the last reply used wording the user has had to ask about (plain-words-internal-names): "Preflight passes and the review unit is engine-runtime."
  • Same reply under the first, five-question shape: two of five answers quoted the lists instead of the reply. The one question now says the quote must come from the reply, and the code drops a quote that is not in it.
  • uvx ruff check . --select E9,F: All checks passed!
  • check_no_new_comments.py, check_no_dated_provenance.py (both --base the diu word lists: five kinds of wording to avoid in replies #446 branch), check_hook_test_coverage.py engine/hooks/diu-stop: all exit 0
  • python3 engine/skills/make-pr/scripts/preflight.py --base <the #446 branch>: exit 0, declare Review Unit: engine-runtime
  • Stop hook timeout raised from 10 to 60 seconds to cover the wait. Claude Code's hooks guide gives command hooks a ten-minute default and states no cap; no test pins this hook's value.

Revert Plan

Revert Plan
  • Safe to revert? Yes.
  • Revert command: git revert <merge-sha>
  • Post-revert steps: None. diu goes back to the word count and unproven-claim checks, and the word lists sit unread.
  • Data migration? No

🤖 Generated with Claude Code

https://claude.ai/code/session_01Gnua5cuAAF1ey1b7zRqJCC

@cursor

cursor Bot commented Sep 12, 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_1d565321-990e-4a74-bc65-55e9b7c11f3a)

EdbertChan and others added 2 commits September 11, 2026 18:07
Five phrase lists under engine/hooks/diu-stop/phrases/ name the kinds of wording that left the user asking what a reply meant: words the assistant made up, raw code or setting names, internal tool names, tech jargon and abbreviations, and status words. Data and one test only; nothing reads them yet.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnua5cuAAF1ey1b7zRqJCC
Change-Id: I4860c82b5b8a8a6b84a9397e289c7023fd5d7730
diu-stop turns every phrases/ word list into one question for the background
judge, waits for the answer, and blocks the turn with a message that names the
list and quotes the reply. A verdict delivered on the next prompt is one the
user may never see, and Claude Code cannot push a message into an idle session.

No question is asked without a transcript file, a quote that is not in the
reply is dropped, and no answer in time ends the turn unblocked.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Gnua5cuAAF1ey1b7zRqJCC
Change-Id: I825590c10c14ec3d968c99dd78067b5deb05a22c
@EdbertChan
EdbertChan force-pushed the plan/plain-words-phrase-lists branch from 0c3ab81 to eea6f19 Compare September 12, 2026 01:09
@EdbertChan
EdbertChan force-pushed the plan/diu-asks-the-judge branch from 8f15d77 to 2e4cd20 Compare September 12, 2026 01:09
@cursor

cursor Bot commented Sep 12, 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_31dd4040-8250-4334-b58e-0c92f06e9c1b)

@EdbertChan
EdbertChan changed the base branch from plan/plain-words-phrase-lists to main September 12, 2026 01:24
@mergify

mergify Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@EdbertChan
EdbertChan merged commit aa7f7d7 into main Sep 12, 2026
6 checks passed
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