Repository navigation
doxBench: no outline verdict row for a buffer the state does not hold (#291) - #326
Conversation
… gets none (#291) `saveBufferOrder` prepended OUTLINE_BUFFER_KEY unconditionally, so the legitimate absent-outline state -- the T100 P1-3 real-corpus shape this module documents and skips everywhere else -- still carried the reserved key into `runSave`'s row loop, where the not-planned branch reported it `unchanged`. That is a verdict about a buffer the state does not hold, which is exactly what the module's own reporting discipline forbids, and `savePlanState` is an EXPORTED seam: a caller reading `outcome.buffers` directly read the phantom row. Two guards, one rule, each independently pinned: * `saveBufferOrder` names the outline only when the key set contains it -- membership read the way doxbench-state.js reads it. The ordering contract is untouched: an outline in the set still leads, documents still follow in SAVE_DOCUMENT_ORDER_RULE order. * `runSave`'s row loop skips a key the state does not actually hold (`state.buffers[key] == null`), the same not-held rule `validatedState` and `saveOrder` already read, so the second spelling of the absence -- a present key holding nothing -- cannot produce a verdict either. BLAST RADIUS, larger than the issue estimated. The issue called the phantom inert in the editor because `!holdsBufferKey` skips it; that is true for a key the canvas does not hold, but the canvas DOES hold the outline. The editor hands the seam only the buffers that CHANGED, so a tile Save's clean outline was never in the reshaped state and its `unchanged` row was the phantom -- applied, and leading the row list. It now gets no row, and its own region states the fact that is true of it (`Outline: no unsaved changes`) instead of a Save verdict about an act it was not part of. Nothing is sent, refused or committed differently; the transport call sequence is byte-identical. RED (before the fix, three of five new pins failing): FAILED test_doxbench_save.py::test_the_save_order_prepends_the_outline_only_when_the_state_holds_one AssertionError: saveBufferOrder named a buffer the key set does not contain assert ['outline', ...] == ['ideation/.../alpha.md', 'ideation/.../zulu.md'] FAILED test_doxbench_save.py::test_an_absent_outline_produces_no_outline_verdict_row AssertionError: runSave stated a verdict about an outline buffer the state does not hold: [{'key': 'outline', 'status': 'unchanged'}, ...] FAILED test_doxbench_save.py::test_an_outline_key_holding_nothing_is_not_a_buffer_to_report_on AssertionError: a null-valued outline key was reported on: [{'key': 'outline', 'status': 'unchanged'}, ...] 3 failed, 2 passed, 50 deselected The two that passed RED are the companions, and they are the point: they fail if the fix over-reaches and drops or demotes a real outline row. MUTATION ROUND (doxbench-save.js; suite = test_doxbench_save.py + test_doxbench_view.py + test_doxbench_mutation_boundary.py, 266 tests): | # | mutation | caught | by | |---|-------------------------------------------------|--------|-----------------------------------------------------------| | 1 | restore the unconditional prepend | YES 1F | test_the_save_order_prepends_the_outline_only_when_... | | 2 | never prepend (drop the outline even when held) | YES 21F| test_the_outline_still_leads_the_order_whenever_..., | | | | | test_a_held_outline_is_still_reported_first_dirty_or_clean,| | | | | + 19 ordering/ancestry pins incl. two in the view suite | | 3 | drop the row loop's not-held guard | YES 1F | test_an_outline_key_holding_nothing_is_not_a_buffer_to_... | Mutation 1 is caught by one test and not by the runSave-facing one, because the row-loop guard masks it -- which is what defence in depth looks like from the inside, and why each guard carries its own pin. Test counts, before -> after: test_doxbench_save.py 50 -> 55, test_doxbench_view.py 130 -> 131, test_doxbench_mutation_boundary.py 80 -> 80. Whole tests/ideation-dashboard suite green: 4143 passed, 13 skipped. The #81 companion rule -- an `unchanged` row must never take the one visible Save line -- lost its scenario when the phantom row went away, so it is re-pinned next door on scripted rows (test_a_vacuous_unchanged_row_never_takes_the_visible_line): `unchanged` remains a status a seam may state, and the canvas must still lead from the withheld set. Without it, narrowing the lead back to "everything not committed" would have gone undetected. Co-Authored-By: Claude Fable 5 <[email protected]>
…tline-verdict-row
The comment amended in b4f5e9f stated the withheld-set rule one sentence before the paragraph that states it properly, so it read as two answers to one question. It now says only the part that is its own: #291 removed the row, and the guard stands anyway because the rows this loop reads are the SEAM's. Comment only -- no behaviour, no test expectation. Co-Authored-By: Claude Fable 5 <[email protected]>
…e the pins this branch moved Adversarial review of the #291 fix found a real coverage regression and asked for the changed pins to be stated rather than left to a diff reader. THE REGRESSION. Brett's #81 ruling of 2026-08-24 is a CONJUNCTION -- a vacuous row AND nothing withheld -- and the mutation that violates it is offering the one visible line to every row that is not `committed`. On main that mutation was caught by four tests, the ruled pin `test_a_save_with_nothing_withheld_leaves_the_visible_line_alone` among them. On this branch it was caught by two, and the ruled pin was no longer one of them: `nothingToSay` drives the REAL orchestrator, which since #291 hands it no vacuous row to offer, and `vacuousRowNeverLeads` scripts a refusal beside the vacuous row, so it catches the lead being WRONG rather than the line appearing at all. Neither covers the ruled case any more. `test_a_vacuous_row_beside_a_success_still_takes_no_line` restores it: a scripted seam answers `status: 'committed'` with rows [outline `unchanged`, DOC_A `committed`] over a real edit + `saveDocument(DOC_A)`, and the assertions are the ruling itself -- `eventNoteText == ""` and `eventNoteHidden is True`. Nothing failed, so the only wrong answer available is the line appearing, which is exactly what the ruling forbids. Measured, with the lead mutation applied: caught by 2 before this commit; caught by 3 with it -- test_a_vacuous_unchanged_row_never_takes_the_visible_line test_a_vacuous_row_beside_a_success_still_takes_no_line <- new test_a_commit_the_canvas_cannot_adopt_never_reads_as_a_tile_success (#290) The ruled pin itself still does not catch it, and cannot while the real orchestrator is the thing driving it; the scripted scenario is where that shape now lives, and it says so in its own docstring. DISCLOSURE -- the three existing pins whose assertions this branch changed: 1. test_doxbench_view.py::test_an_unchanged_row_never_takes_the_one_visible_save_line RENAMED to test_a_clean_outline_gets_no_row_and_the_refusal_leads, because the #81 name belongs to the scripted vacuous-row tests and this scenario now pins the row's ABSENCE. before: assert statuses[0][1] == "unchanged" assert len(refused) == 1 after: assert statuses == [("ideation/staging/topic-x/detail.md", "refused")] assert result["statusOutline"] == "Outline: no unsaved changes" 2. test_doxbench_view.py::test_a_save_with_nothing_withheld_leaves_the_visible_line_alone Shape assertion inverted; every assertion carrying the RULING is untouched. before: assert ("outline", "unchanged") in statuses after: assert not [row for row in rows if row["status"] == "unchanged"] assert result["statuses"]["outline"] == "Outline: no unsaved changes" 3. test_doxbench_save.py::test_an_absent_outline_buffer_no_longer_blocks_the_document_save before: assert outcome == {"outline": "unchanged", "document": "committed"} after: assert outcome == {"document": "committed"} CORRECTION to b4f5e9f's body. It quoted the outline region's post-fix text but not the full pre-fix string, which was `Outline: nothing to save in this buffer -- no unsaved changes` -- the Save verdict AND the dirty fact, per `bufferStatusText`. It now reads `Outline: no unsaved changes`: the dirty fact alone, which is all that is true of a buffer the act neither sent nor was asked about. Also pinned: `saveBufferOrder([]) == []`, the issue's own literal case, spelled the way #291 reported it. Counts. Before this commit, save 56 / view 135 / boundary 80 (271); after, save 56 / view 136 / boundary 80 (272) -- item 4 adds an assertion to an existing test, item 1 adds a test. test_renderer.py 50, unchanged. Co-Authored-By: Claude Fable 5 <[email protected]>
…tline-verdict-row
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
This PR fixes a user-visible doxBench Save/UI inconsistency where the Save pipeline could emit an outline=unchanged verdict row even when the client state did not hold an outline buffer (phantom row). The change ensures verdict rows are only produced for buffers that actually exist in the validated state, preventing the editor from rendering misleading outline-related Save messaging.
Changes:
- Update
saveBufferOrderto include the outline key only when it is actually present in the key set (no unconditional prepend). - Update
runSaveto skip emitting anunchangedverdict row when the corresponding buffer is not held (state.buffers[key] == null). - Add/reshape tests to pin both the real orchestrator behavior (no phantom outline row) and the still-supported seam behavior (a scripted vacuous
unchangedrow never takes the visible Save line).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| scripts/ideation_dashboard/web/views/doxbench-save.js | Prevents phantom outline rows by conditioning outline ordering on key presence and skipping verdict emission for not-held buffers. |
| scripts/ideation_dashboard/web/views/doxbench-editor.js | Updates inline rationale/comments to reflect the post-#291 shape while preserving the seam-level rule about unchanged rows not taking the visible line. |
| tests/ideation-dashboard/test_doxbench_save.py | Adds targeted Node-harness pins for issue #291 across absent/null/held outline cases, including ordering and row emission behavior. |
| tests/ideation-dashboard/test_doxbench_view.py | Reshapes view-level pins: real-orchestrator scenario now asserts “no outline row”, and scripted scenarios keep the #81 “vacuous row never leads / takes no line” rules enforced. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Fixes #291 — filed as a nit; turned out user-visible.
What was wrong
saveBufferOrder([])unconditionally prependedOUTLINE_BUFFER_KEY, sorunSaveemittedoutline=unchangedfor a buffer the state did not hold. The issue called this inert in the editor. It was not: the editor sends the seam only the buffers that changed (changed.map(bufferRequestRow)), so on every tile Save with a clean outline the phantom row was the first row back, andholdsBufferKey(which asks the canvas, which does hold the outline) applied it into the outline's aria-live sr-only region —Outline: nothing to save in this buffer -- no unsaved changes, a Save verdict about an act the outline wasn't part of. Independently reproduced on pristine main by the reviewer (Node probe + DOM scenario). Transport calls, refusals and commits are byte-identical before/after.The fix
saveBufferOrderemits the outline only when the key set contains it;runSave's row loop skips a key whose buffer is== null(the second spelling of absencevalidatedState/saveOrderalready tolerated). A clean outline now reads its own standing text,Outline: no unsaved changes— the same string two untouchedtest_outline_tab.pypins already assert for a never-saved clean outline.#81 pins — disclosed in full (commit
76562efabody has before/after asserts)Three existing pins were built on the phantom and moved to the new truth:
test_an_unchanged_row_never_takes_the_one_visible_save_line(→ renamedtest_a_clean_outline_gets_no_row_and_the_refusal_leads, asserts the row's absence),test_a_save_with_nothing_withheld_leaves_the_visible_line_alone(shape assert inverted),test_an_absent_outline_buffer_no_longer_blocks_the_document_save. Two scripted-seam tests carry the #81 rule "anunchangedrow never takes the visible line" now that the real orchestrator can't produce one:test_a_vacuous_unchanged_row_never_takes_the_visible_lineand — added at review —test_a_vacuous_row_beside_a_success_still_takes_no_line, which restores the exact conjunction ruled in #81 (a wholly successful Save carrying a vacuous row shows NO line); the widen-the-lead mutation is caught by 3 tests again (main: 4, pre-review: 2).Evidence
RED-first (3 of 5 new save pins red on main;
saveBufferOrder([]) == []pinned literally). Mutations on the final merged tree: unconditional prepend → 1F; never prepend → 23F; drop the not-held guard → 1F; widen the #81 lead → 3F. Adversarial review: 14 findings, 0 blockers, 2 SHOULD-FIX fixed. Merges of main are git's own auto-resolution (verified byte-identical viamerge-tree); all #313 pins and mutations still hold. Full ideation-dashboard suite on the reviewed tree: 4148 passed / 13 skipped.For Brett's ruling (from the reviewer, verbatim in substance)
The reshaping does not overturn #81 — all three limbs (lead with the first refused/not_attempted row; clean success shows no line; an
unchangedrow never takes the line) are still enforced and mutation-caught. What changed is where limbs two and three live: the ruled pintest_a_save_with_nothing_withheld_leaves_the_visible_line_alonecan no longer catch the widen-the-lead regression because the real orchestrator no longer produces the vacuous row — a genuine improvement, not a weakening — and the scripted-seam tests now carry that duty.Follow-ups (not widened here)
doxbench-save.jstolerates a present-but-nulloutline key thatdoxbench-state.jsrefuses (validatedBufferthrows on null) — two differently strict judges of one value, the pattern doxBench: tileSaveVerdict reports ok:true over a commit the canvas could not adopt #290 called a gap. A strictervalidatedStatewould delete the row-loop guard.!row→unchangedbranch inrunSaveis now unreachable from every shipped caller (editor and staging-workbench send only dirty buffers); kept as seam contract, docstring should say so.🤖 Generated with Claude Code