Skip to content

fix(iris_production_diff): a side that could not be read is not a side with no items (re-land of #366) - #415

Merged
PYDuquesnoy merged 1 commit into
masterfrom
recover/366-production-diff-unavailable
Sep 28, 2026
Merged

PYDuquesnoy merged 1 commit into
masterfrom
recover/366-production-diff-unavailable

Conversation

@PYDuquesnoy

Copy link
Copy Markdown
Contributor

Recovery PR — no new work. This re-applies the content of a PR that GitHub marked MERGED but whose
changes never reached master.

What happened

#366 and #367 were opened with base set to fix/remedy-gate-reads-wrapped-calls (#364's head
branch) rather than master. When I squash-merged them, GitHub merged them into that stale feature
branch
, which had itself already been squashed into master a moment earlier. Both PRs are now
closed as merged and neither one's changes are on master.

The cause is narrow and worth recording: GitHub only auto-retargets an open PR to the default branch
when its base branch is deleted. I merged with --squash and no --delete-branch, so the stale
base survived and the retarget never happened. The same defect was present on three still-open PRs
(#376 → #375's branch, #377 → #376's branch, #381 → #372's branch); those have been retargeted to
master before merging, and merges from here on delete the branch.

Nothing was lost — both head branches survived intact, each with exactly one commit of its own.

What this PR contains

The original commit, re-applied onto current master. CI ran green on the original PR; it is
re-running here because master has moved (#363, #364, #365 landed in between).

🤖 Generated with Claude Code

https://claude.ai/code/session_01N7fLbq3ftb82ub45QCpsPB

…e with no items

#153 hardened the committed side's error arms and left two ways to reach an empty set through
SUCCESS. Neither produces a quiet wrong answer — `in_sync` is `changes.is_empty()`, so each
renders a maximally ALARMING one, indistinguishable from real catastrophic drift, which is
precisely the property that makes someone act on it.

Hole 1, the guard on the wrong side of the parse. The success arm read the body with
`resp.json().await.unwrap_or_default()`, so a 200 whose body does not parse became `Value::Null`
-> `doc_content_to_string(&Null)` -> "" -> zero items. The `BASELINE_UNAVAILABLE` arms directly
below exist to refuse exactly that outcome, and this path never consulted them. Two
`unwrap_or_default()` calls in series, each individually defensible.

Hole 2, the sibling that was never hardened. The current side ended in `.unwrap_or_default()`,
so an unrecognised 200 yielded an empty running set and the diff reported every COMMITTED item
as `removed` — the mirror image of what #153 fixed. Narrower than the issue states, and worth
recording: `query()` already turns a transport fault, a non-2xx and a non-JSON body into `Err`,
so the one way in is a 200 whose JSON parsed but carries no `result.content` array.

The committed side also refuses a 200 carrying no source LINES. That is safe because
`%ExistsId` proved the class exists two calls earlier, and it does not refuse a legitimately
empty production: a production with no <Item> entries still has a class definition, so the
document is non-empty even when the item list is.

Both item counts are now in the payload. "Every item added" and "every item removed" read
exactly like real drift unless the caller can see the denominators they were computed from.

## The new code needs #361

`CURRENT_UNAVAILABLE` is new, so it needs a REMEDIES row — and adding one on master makes
`no_remedy_entry_is_stale` go RED, because master's scanner cannot see a rustfmt-wrapped
`err_json(` and therefore reads a correct row for a genuinely emitted code as naming one the
server "can no longer emit". That is #361 demonstrated from the other direction: the gate does
not merely miss unreviewed codes, it rejects reviewing one. Hence this is based on the #361
branch rather than spelled to suit the scanner bug it is filed against.

Refs #360

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@PYDuquesnoy
PYDuquesnoy merged commit 98c3849 into master Sep 28, 2026
5 checks passed
@PYDuquesnoy
PYDuquesnoy deleted the recover/366-production-diff-unavailable branch September 28, 2026 09:51
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.

1 participant