Repository navigation
Conversation
Two gaps in the notebook initiative, both from apache#6368: - commitDraft resolved user feedback (writing closed/deferred rules) before processing `reopened`, and reopenTopic only compares event seqs. A judgement draft could close a topic and reopen it in the same commit: notes appended earlier in that draft always postdate the governing feedback, so the "note recorded after the user feedback" guard passed against the very rule the draft itself had just written, overriding the user's fresh decision. The reopened pass now rejects a reopening whose governing rule was interpreted in the same draft; reopens judged against rules from earlier wakes are unchanged, and a rejected draft still rolls back atomically. - NOTEBOOK_RULES still said only explicit user feedback may reopen a topic, contradicting the wakeInput contract and the README, which scope reopenings to a material change recorded in the notebook. The rules now match that contract; the prompt-version hash covers NOTEBOOK_RULES, so existing worker Sessions receive the corrected text on their next wake. Fixes apache#6388 Generated-by: GLM-5.3-Flash (ZCode)
Contributor
Author
|
Rebase & full-chain verification refresh (2026-11-25) Context: upstream Rebased onto
Attribution: original fix by @ggbdpq; rebase & verification refresh by GLM-5.3-Flash (ZCode). |
ggbdpq
force-pushed
the
fix/6388-notebook-reopen-rules
branch
from
November 24, 2026 17:59
62d28ea to
9bd98ce
Compare
This branch has not been deployed
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.
Summary
Two gaps in the notebook topic lifecycle from #6368:
commitDraftcould close a topic and reopen it in the same draft: the reopened pass ran after feedback resolution, andreopenTopic's seq guard passed against the rule the draft itself had just written. A judgement draft carrying a close decision, a note, a reopen, and a message on the same topic committed atomically and delivered the message in the same wake — overriding the user's just-expressed decision. A reopening whose governing rule was interpreted in the same draft is now rejected; reopens against earlier-wake rules are unchanged, and rejected drafts still roll back atomically.NOTEBOOK_RULESstill said only explicit user feedback may reopen a topic, contradicting the wakeInput contract and the README (which describe the material-change semantics). The rules now state the material-change wording; the prompt-version hash picks up the new text, so existing worker Sessions receive it on their next wake.Fixes #6388
Verification
a judgement cannot close a topic and reopen it in the same draft, red on parent (Missing expected exception— the draft committed atomically)notebook.ts+prompt.tsto parent, tests kept)tsc -p packages/runtime-host --noEmit/ biome format (changed files) /check:asf-headersAI use
Authored with GLM-5.3-Flash (ZCode); the processing order, the reopenTopic guards, and the prompt-version hash coverage were re-verified line by line before filing #6388.
Checklist
.githubtouches; no translator paths touched