Repository navigation
feat(assistant): record withheld topics and reopen closed topics on material change - #6368
Conversation
…aterial change Discovery kept "investigated" (notes), "told" (delivery receipts) and the user's open/deferred/closed policy, but had no record of a topic the judgement looked into and chose not to tell the user, and a closed topic stayed closed until the user said otherwise. Judgement drafts may now carry two optional arrays: - withheld: a topic investigated but not told, with a reason. Stored apart from notes and receipts; it does not mark the topic as sent and is not a ban. - reopened: a closed or deferred topic whose information materially changed. The change must be in the notebook, as a note on that topic recorded after the governing user feedback, so the model cannot reopen on assertion alone. A newer user rule overrides a reopening. The prompt contract, the notebook view the model reads, and the README describe both. Exploration still only appends notes. Fixes #6359 Refs #6247 Generated-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
me2seeks
left a comment
There was a problem hiding this comment.
Found one reproducible policy-precedence bug when a topic acquires a tag after it was reopened. The 7 added disposition tests pass, but an additional real Notebook regression reproduces the issue below.
… against A reopening was applied whenever it was recorded after the governing user feedback. Topics gain tags over time, so the rule that governs a topic can change with no new feedback event: a newer rule on a tag starts to match once the topic acquires that tag. The earlier reopening then overrode a user rule the model had never judged a change against. Store the governing feedback id and rule index in the reopening and apply it only while that same rule still governs. The topic can be reopened again, but only by a judgement against the rule that governs now. Refs #6359 Generated-by: Claude Opus 5.5 Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Thanks @me2seeks, reproduced and fixed. The reopening was applied whenever it was recorded after the governing feedback, but Your scenario is a regression test: close tea (f1), close tag sport (f2), reopen tea against f1, then add a sport-tagged tea note. Tea is closed by f2, and a fresh reopening reopens it. It fails without the fix. |
me2seeks
left a comment
There was a problem hiding this comment.
Re-reviewed the updated head. Reopenings are now bound to the feedback rule they were judged against, and the added tag-change regression covers the previous finding. Local assistant suites pass (93 + 97 + 88); hosted CI is green and the review thread is resolved.
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)
Summary
Implements the remaining gap in #6359 (decision 5 of #6247). Investigated (notes), told (delivery receipts) and the user's open/deferred/closed policy already existed. Two things were missing, and the maintainer chose how to settle them: a model judges whether information materially changed, and "withheld" is stored separately.
Judgement drafts may now carry two optional arrays:
withheld: a topic investigated but not told, with a reason. Stored apart from notes and receipts. It does not mark the topic as sent and is not a ban on discussing it later.reopened: a closed or deferred topic whose information materially changed. The change must be in the notebook: a note on that topic recorded after the user feedback that governs it. The model cannot reopen on assertion alone. A newer user rule overrides a reopening. Only a topic the user closed or deferred can be reopened.The prompt contract, the notebook view the model reads, and the README describe both. Exploration still only appends notes. The README sentence "only genuine user feedback may close, defer or reopen a topic" now says reopen is also possible on changed information.
Fixes #6359
Refs #6247, #6309
Verification
Node 24.21.0,
origin/main@0993b381a:npm run test:assistantnotebook.tstsc -b packages/runtime-host,biome check,npm run check:asf-headersNew tests: withheld is stored apart from told and is visible to the model; withheld needs a known topic and a reason and only judgement can write it; a rejected topic with no change is not reopened; a material change reopens a closed topic and the view says why; a newer user rule beats an earlier reopening; only user-closed or deferred topics can be reopened; a deferred topic can be reopened early.
Not run: a real model against the new prompt wording, Node 22, Windows, the rest of the workspace suite.
Review focus
withheldandreopenedhas only been checked structurally, not against live model output. test(assistant): evaluate discovery for missed discoveries as well as repeats #6360 adds the evaluation that can measure it.Behaviour change
Yes: judgement can now reopen a closed or deferred topic. Existing drafts without the new arrays behave as before.
AI use
Select exactly one:
Tool(s) and scope: Claude Code (Claude Opus 5.5) wrote the change and tests. I reviewed the diff and ran the checks above. The commit carries a
Generated-bytrailer.Checklist
Does this PR entail a change in behavior?
🤖 Generated with Claude Code