fix(iris_production_diff): a side that could not be read is not a side with no items (re-land of #366) - #415
Merged
Conversation
…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>
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.
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
baseset tofix/remedy-gate-reads-wrapped-calls(#364's headbranch) rather than
master. When I squash-merged them, GitHub merged them into that stale featurebranch, 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
--squashand no--delete-branch, so the stalebase 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
masterbefore 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 isre-running here because master has moved (#363, #364, #365 landed in between).
🤖 Generated with Claude Code
https://claude.ai/code/session_01N7fLbq3ftb82ub45QCpsPB