Skip to content

#81: the Save's one visible line leads with the first failing cause - #295

Merged
brettheap merged 4 commits into
mainfrom
fix/081-save-lead-cause
Aug 24, 2026
Merged

brettheap merged 4 commits into
mainfrom
fix/081-save-lead-cause

Conversation

@brettheap

Copy link
Copy Markdown
Contributor

Closes #81.

On a partial or refused ordered Save there is exactly ONE transient visible line, and the operator was reading the wrong row off it — a downstream consequence instead of the cause that produced it.

The defect is not where the issue points

#81 names doxbench-save.js first. It is not there. runSave already reports rows in save order, and tileSaveVerdict already led with withheld[0]. The defect is in doxbench-editor.js: save() called stateEvent once per reported row, and stateEvent overwrites the single visible line and resets its timer — so the last row reported won.

On the shape the issue is about — the ancestry step refused, every document behind it not_attempted because of it — that meant the human read the last consequence while the cause never appeared anywhere they were looking.

RED, through the real orchestrator

refusedAncestryLeadsTheSummary composes the real runSave over a transport that refuses the outline. The not_attempted rows are the orchestrator's own answer, not scripted. Against the unfixed editor:

visible line:  second.md: Save not attempted -- the outline did not land, so there is
               no session ancestry for this document to be saved against -- nothing was sent
lead row's own region:
               Outline: Save refused -- the outline base moved under this buffer

The pin is semantic, not a sentence match: the visible line must equal the opening of the FIRST failing row's own durable status region (both derive from bufferLabel + saveOutcomeSentence), must not be any later row's, and every downstream row must keep its own message in its own region (FR-035).

The fix, in three commits

2377022 — RED.

5c8ffce — the line is chosen ONCE, from the first row with something to report, after every row has been read. leadWith takes the first offer; one stateEvent at the end. No new vocabulary: the same sentences, one of them chosen instead of the last one surviving.

d87226e — a regression found in review, and its fix. The first cut offered the line from row.status !== "committed", which includes unchanged — a row with nothing to say. A tile Save scopes to one document and the outline always rides along, so a clean outline reports unchanged first, ahead of the document that actually failed:

visible line
before #81 detail.md: Save refused -- the document base moved under this buffer
5c8ffce Outline: nothing to save in this buffer
d87226e detail.md: Save refused -- the document base moved under this buffer

That was #81 arriving from the other end, and it falsified the claim that the two surfaces agreed. The offer now comes from the same withheld set tileSaveVerdict already uses (refused / not_attempted), so they agree in fact rather than in the common case. Verified by applying the halves separately: the test half alone reproduces the exact regression shape; the fix half turns it green.

005d798e — Brett's ruling of 2026-08-24, pinned. Narrowing the lead realized the ruling that a Save with nothing withheld says nothing on the transient line — a fully successful tile save no longer flashes Outline: nothing to save in this buffer. It was measured but unpinned, and realized-but-unpinned is how a ruling quietly stops being true. Both halves are asserted, because the weaker one is where it would rot: the line must be empty and hidden, and the committed buffer's own region must still state the action and ref it landed under.

Verification

Mutation-tested at each layer. The #81 pin refuses last-wins, a hardcoded sentence, emitting nothing, conflating the lead with report order, and choosing by any rule other than save order. The regression pin refuses widening back to "not committed" and refuses granting /run-style breadth. The suppress pin refuses widening back, adding unchanged to the withheld set, emitting a fallback sentence, and blanking the per-row stated outcomes.

Suite, measured at each step from a sibling-placed checkout: 3986 at 5c8ffce, 3987 at d87226e, 3988 passed / 13 skipped at 005d798e. Three commits add a test each (5c8ffce is fix-only), so the count goes up by exactly three and never down.

Note for anyone reproducing: python3 -m pytest tests/ does not work in this repo on any branch — test_header_value_readers.py exists in both tests/doc-health/ and tests/ideation-dashboard/ with no packaging, so collection dies. Use python3 -m pytest tests/ideation-dashboard. Also run it from a checkout placed beside the aggregation tree: test_find_validator_locates_pinned_checkout walks up for a sibling openxFactory checkout and fails from an unrelated path.

Found alongside, tracked separately

Neither is touched here.

🤖 Generated with Claude Code

brettheap and others added 4 commits August 24, 2026 04:26
The ordered Save reports one row per buffer in save order. When the ANCESTRY
step is what failed, every document behind it is `not_attempted` because of
it -- a root and its consequences. There is exactly one transient visible
line, and `save()` calls `stateEvent` once per reported row, so each later row
overwrites the one before it and the LAST consequence is what stands.

Measured through the REAL orchestrator (`runSave` over a transport that
refuses the outline), the line reads

  second.md: Save not attempted -- the outline did not land, so there is no
  session ancestry for this document to be saved against -- nothing was sent

while the cause -- "Outline: Save refused -- the outline base moved under this
buffer" -- never reaches the human at all.

The pin is the semantic, not a sentence: the visible line must be the FIRST
failing row's own stated outcome, which is exactly what that buffer's durable
status region opens with, and must not be any later row's.

Co-Authored-By: Claude Fable 5 <[email protected]>
`save()` called `stateEvent` once per reported row, and the transient line
holds one sentence, so every later row overwrote the one before it. On the
shape the defect is about -- the ancestry step refused, every document behind
it `not_attempted` BECAUSE OF IT -- the human was left reading the LAST
consequence ("the outline did not land, so there is no session ancestry...")
while the cause it names never appeared anywhere they were looking.

The line is now chosen ONCE, from the FIRST row with something to report, and
rows arrive in save order, so it is the first failing cause. Nothing is
hidden by choosing: every row still writes its own durable sr-only sentence,
which is where the per-buffer report lives (FR-035), and the tile verdict
already led with the first withheld row (`tileSaveVerdict`), so the two
surfaces now agree.

No new vocabulary: the same sentences, one of them chosen instead of the last
one surviving.

Co-Authored-By: Claude Fable 5 <[email protected]>
The reviewer proved my selection rule regressed #81 from the other end.
`row.status !== "committed"` admits `unchanged`, and a tile Save scopes to one
document with the outline riding along -- so a CLEAN outline reports
`unchanged` FIRST, ahead of the document that actually failed, and took the
line with "Outline: nothing to save in this buffer". Pre-fix the human at
least saw the refusal; my branch showed them the vacuous row instead.
Reproduced here before the change (RED) and after (GREEN).

The offer now comes from the WITHHELD set -- `refused` or `not_attempted` --
which is the same set `tileSaveVerdict` already leads with, so the two
surfaces agree in fact rather than only in the common case.

BRETT'S RULING (2026-08-24) on the product question this raises: on a fully
successful tile save with a clean outline the transient line is SUPPRESSED --
no line at all. The line exists to surface failure causes; the per-row sr-only
sentences and the tile verdict still tell the whole story. That is what the
narrowed condition produces, measured: eventNote empty and hidden, while the
outline's own region still reads "nothing to save in this buffer" and the
document's reads "saved as edit-document on draft/topic-x".

Fix and companion test authored by the reviewer of record; applied verbatim.

Co-Authored-By: Claude Fable 5 <[email protected]>
Brett ruled on 2026-08-24 that a Save with nothing withheld leaves the one
transient line alone. Narrowing the lead to the withheld set REALIZED that --
before it, a fully successful tile save flashed `Outline: nothing to save in
this buffer`, because the clean outline rides along `unchanged`, `unchanged`
was "not committed", and so the vacuous row took the line ahead of the buffer
the human actually acted on.

Realized is not pinned. A ruled behaviour that nothing asserts is one refactor
away from silently ceasing to hold, which is the failure this repository keeps
digging out, so the measurement becomes a test rather than a transcript.

Both halves are asserted, because the weaker half is where this would rot: the
line must be empty AND hidden, and the committed buffer's own region must still
state the action and ref it landed under (FR-035). Verified by mutation: widening
the lead back to "not committed", adding `unchanged` to the withheld set, emitting
a fallback sentence, and blanking the per-row stated outcomes each fail it.

Co-Authored-By: Claude Fable 5 <[email protected]>
Copilot AI lite review requested due to automatic review settings August 24, 2026 13:29

Copilot AI 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.

Pull request overview

This PR fixes doxBench Save’s single transient visible status line so it consistently reflects the first failing cause (in save order) rather than being overwritten by downstream consequence rows, addressing issue #81. It also adds regression tests to pin the intended behavior across multi-buffer Save, tile Save, and fully-successful Save cases.

Changes:

  • Update doxbench-editor.js to select the transient Save event line once (first withheld/adopt-failure row) after processing all outcome rows, instead of emitting per-row events.
  • Align transient-line eligibility to the withheld set (refused / not_attempted) so unchanged never steals the lead line.
  • Add three new integration-style view tests to pin the ordering/eligibility semantics and the “nothing withheld => no transient line” ruling.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
tests/ideation-dashboard/test_doxbench_view.py Adds three regression tests that pin the transient-line semantics for first-failure leading, unchanged not leading, and “nothing withheld => hidden/empty line.”
scripts/ideation_dashboard/web/views/doxbench-editor.js Changes Save reporting to choose the transient event line once from the first withheld/adopt-failure row, preventing last-row overwrite and excluding unchanged from transient reporting.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +2067 to 2069
if (row.status === "refused" || row.status === "not_attempted") {
leadWith(bufferLabel(row.key) + ": " + saveOutcomeSentence(row));
}
@brettheap
brettheap merged commit 783e3da into main Aug 24, 2026
2 checks passed

@sourcery-ai sourcery-ai 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.

Hi @brettheap! 👋

Your private repo does not have access to Sourcery.

Please upgrade to continue using Sourcery ✨

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

doxBench R-5: the Save summary leads with a downstream row's message, not the first failing cause

2 participants