From d5b46ffc45c43500832c7c9edef04b3fb45a0a0e Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Sun, 20 Sep 2026 21:53:53 -0400 Subject: [PATCH] fix(ledger): the in-play tuple widened and one consumer kept reading four (#4204) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [s_id for rank, _at, s_id, _why in bucket if rank == 2] ValueError: too many values to unpack (expected 4, got 5) `in_play` gained the canon's form as a fifth element so the stamp could be decided per shape rather than per file. The `record_uses` call eighty lines below still destructured four, and every stamp that reached it raised. Both integration failures on runs 7090 and 7091 are this one line — `test_write_path_stamp_is_evidence_that_yields_to_judgment` and `test_a_brand_new_shape_gets_a_provisional_row_the_sync_settles`. Now indexed rather than destructured, matching the candidate scan above it, so the next widening cannot break it positionally. WHY THE UNIT LANE STAYED GREEN THROUGH TWO PUSHES. `record_uses` is only reached once a stamp is actually written, which needs a real snippet, a real ledger row and the write ACL — so no unit test crosses that line. 139 local assertions and the whole unit suite passed on code that raised on every successful stamp. The integration lane was the only thing that could say so, which is the case for it. Co-Authored-By: Claude Opus 5 Claude-Session: https://claude.ai/code/session_01821k5B3Ysecp9fNYs92Kuy --- src/scribe/services/shape_ledger.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scribe/services/shape_ledger.py b/src/scribe/services/shape_ledger.py index 701cf7b..61d7e79 100644 --- a/src/scribe/services/shape_ledger.py +++ b/src/scribe/services/shape_ledger.py @@ -1290,7 +1290,12 @@ async def stamp_write_path_instances( # call-site fact, independent of which one the row is judged to be. await record_uses( session, row, - [s_id for rank, _at, s_id, _why in bucket if rank == 2], + # Indexed, not destructured: this list widened from 4 to 5 when + # the canon's form joined it (#4204) and a positional unpack + # here went on reading four. The unit lane never touches + # `record_uses`, so it stayed green and the integration lane + # was the only thing that said so. + [t[2] for t in bucket if t[0] == 2], basis="hook", evidence="write path: pulled the snippet, payload names its symbol", ) if stamped: