test(work-ledger): name the refusing validator in the bind race failure - #9353
Conversation
Design Review (Fable 5) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The PR title claims a fail-closed behavior fix the diff no longer contains; what ships is a test diagnostic plus a one-caller refactor. Watch
Suggestions
[DESIGN-REVIEWED] 6da76e9 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — 🟡 CONCERNSPremise-level review of Both files read and verified against the repository: First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsIntent: make an intermittent Windows-shard binding-race failure name which validator refused and on what value (#9343) — titled a FIX, but the description itself says "Does not fix or diagnose it", so what ships is diagnostics plus a refactor.
Watch
Subtractions
[FIRST-PRINCIPLES-REVIEWED] 6da76e9 |
Opus 4.8 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
38ec1f3 to
ae139b7
Compare
|
Verification of the fix (fail-before / pass-after). Confirmed with the prepare-pr Full file run on the fixed tree: What this closes, precisely. The two failure signatures on the Windows shard share one seam -- the bind guard reads the worker's binding file and hands the stored
Hence The one red lane ( Kiro Crew Auto-Pipeline [operator: chenmingwei23] |
ae139b7 to
b4f6f01
Compare
b4f6f01 to
4715d9b
Compare
The binding-race test recorded only exc.code, so a Windows-shard invalid_value failure did not say which validator refused or on what value. Record exc.field and the message alongside the code and fold them into both assertion messages; the ==1 and ==3 assertions are unchanged (diagnosis, not tolerance). Also extract conductor_dir's inline slot-key shape check into a shared _slot_key_is_shaped predicate (no behaviour change). Refs #9343
4715d9b to
6da76e9
Compare
Problem / Motivation
test_two_conductors_binding_one_worker_at_once_yield_exactly_one_bindingfailsintermittently on the Windows shard, sometimes reporting
invalid_value(issue #9343). The test recorded only
exc.codefor a failing thread, so thatinvalid_valuedid not say which validator refused or on what value -- the onefact needed to attribute the failure from a shard you cannot reproduce on.
Why it matters
A failure message that names only
invalid_value, with no field and no value, sendsthe next person to trace the whole bind path by hand. Naming the refusing validator's
field and the offending value turns a blind shard failure into a diagnosable one.
What changed (motivation -> approach -> change)
Two behaviour-preserving changes.
The race test now records
exc.fieldand the message alongside the countedexc.code, and folds them into both assertion messages. The== 1and== 3assertions are unchanged: this adds diagnosis, not tolerance.
conductor_dir's inline slot-key shape check (not key or "\0"/"/"/"\\" in key) isextracted into a shared
_slot_key_is_shapedpredicate.conductor_dircalls it andraises exactly as before; behaviour is identical, the check just has a name.
Scope -- what this does and does not do
This PR does NOT change any binding-read behaviour and does NOT diagnose the shard
failure. An earlier revision made
read_bindingtreat a malformed stored conductorkey as unbound; GPT review showed that would let
_bootstrappersist a depth-0 ledgerand bypass the nesting-depth ceiling, so that hunk was removed. A bind against a
binding with a malformed conductor key therefore raises today exactly as it does on
main -- unchanged. #9343's symptom is unchanged and only better reported.
Tests
exercised by the existing test; the counted assertions are untouched.
Commands run (Linux, one file at a time):
No
prove.pymutation check applies: this change is a diagnostic plus abehaviour-preserving refactor, so there is no production behaviour to revert.
Manual verification
N/A -- the change is test-diagnostic and a refactor with identical behaviour. The
Windows-shard failure is not addressed here.
Related Issues
Refs #9343 -- widens that test's diagnostic so a future Windows
invalid_valuenamesits validator. Does not fix or diagnose it; the issue stays open.
Refs #9388 -- open question of whether the worker
binding_lockserializes on Windows.Refs #9389 -- open question of whether a malformed stored conductor key is reachable
and whether
_bootstrapshould refuse it regardless (the depth-ceiling question thatscoped this PR down).
no linked issue is closed by this PR.
Pattern harvest
A single two-valued reader result was asked to answer two independent questions and
was wrong for opposite reasons on each.
read_bindingreturningNonemeans both"not a usable report channel" (right for the worker / Phase 2) and "no parent for
depth" (a fail-open for
_bootstrap's nesting ceiling). Making an unreadable bindingREFUSE drew an objection that it removed self-healing; making it READ AS UNBOUND drew
an objection that it bypassed the depth ceiling. Both directions of the one boolean
were rejected, for unrelated reasons -- the signature of one value carrying two
questions that need not share an answer for a malformed file.
Rule candidate: review-prompt -- when a fix changes what a shared reader returns for a
malformed or unreadable input, enumerate every consumer of that return value and check
each for the OPPOSITE failure mode before shipping; when two consumers reject both
values of the result for unrelated reasons, split the result so each consumer asks its
own question rather than overloading one sentinel.