Skip to content

[finding] MAX_READ_WRAPPER_DEPTH = 2 costs the read-seam census 6 real seams — the bound is documented, the number never was, and it is 5 of the 8 deltas #12138 attributed to the callback refusal #12360

Description

@yinlianghui

Observation class — recording only, no verdict asserted, no pm:queue. Unassigned. Found while performing the per-seam census #12138 asked for (PR #12356); deliberately not fixed there — #12138's declared scope is the wrapper recursion's walk, not its depth bound.

Measured on origin/main @ 3ddad51b5c, reproduced after merging c312a562e3.

What I found

scripts/check-durability-degradation-log-level.mjs states the bound as a limitation:

It cannot DISCOVER a seam whose read runs outside the try block, or more than MAX_READ_WRAPPER_DEPTH hops away. A ratchet, not a proof — the same honest bound the log-level rule states about its vocabulary.

The bound is honest and the sentence is correct. What has never been recorded is how much it costs, and the answer is not small relative to the census it bounds.

Raising MAX_READ_WRAPPER_DEPTH from 2 to 6, with walkSameTickInclusive left exactly as it is (no change to the callback refusal):

recognizerread seams
today — same-tick walk, depth 264
same-tick walk, depth 670
same-tick walk, depth 5070 (saturated)

+8 / −2, where the 2 "removals" are the same two try lines (objectql/src/engine.ts:9407 and :10572) re-attributed to a different first-matching callee, not seams leaving the population. Net 6 real seams the census does not count. Saturation checked at depth 50, so 6 is the number, not a floor that keeps climbing.

The six, each an unbroken chain of awaits on the caller's own tick:

seamchain
metadata-protocol/src/protocol.ts:10243getMetaItemCachedgetMetaItemfindDraft/findOverlaylookupengine.findOne
metadata-protocol/src/protocol.ts:13559saveMetaItemsame tail
metadata-protocol/src/protocol.ts:14535migrateStoredMetadatasaveMetaItem → same tail
metadata-protocol/src/protocol.ts:16170publishPackageDraftspromoteDraftForPublish → …
metadata-protocol/src/protocol.ts:17213duplicatePackagesaveMetaItem → same tail
objectql/src/lifecycle/lifecycle-service.ts:625sweepreapObjectarchiveObjectarchivePasshot.find

Nothing exotic is going on: protocol.ts reaches sys_metadata through a three-deep helper ladder (getMetaItemfindOverlaylookup), which is one hop past the bound, and the extraction that produced that ladder is ordinary refactoring.

Why this is filed separately, and why it matters now

#12138 attributed a delta of 8 seams to the wrapper recursion's callback refusal. Five of those 8 are these — they are admitted by raising the depth bound alone, with the callback refusal untouched. The walkAll probe appeared to fix them only because walking into nested declarations reaches the read at depth 1 regardless of how many call hops are really between, i.e. it masks the depth bound rather than addressing it. Full enumeration and the discriminating run are in PR #12356.

So anyone reading #12138's table as "8 callbacks are being missed" will be wrong about 5 of them, and a fix aimed at callbacks will move a number for a reason that is not the stated one.

Direction of the error

Under-count, the safe direction: real read seams are missing from the population rather than fake ones added. But it is the denominator #5186, #6451, #9165, #8845 and #8901 are quoted against, and #8901's restart conjunct (b) is a census re-run — so anyone re-running that census should know 64 is 64 because of a tunable, and that the tunable is worth 6.

⛔ This filing does not propose raising the bound. Depth 6 was a probe; whether the extra seams are ones the rule should judge, and what a wider population does to the #8845 / #9165 ladders, is a decision with its own measurement attached. Recording the cost is all that is claimed here.

Dedupe performed

⚠️The prescribed REST channel was unavailable and this is declared rather than papered over: curl to api.github.com from this seat returns "GitHub access is not enabled for this session" and gh is absent — the condition already filed as #12123. Dedupe therefore ran through one bounded MCP list_issues call: 18 open finding issues, a non-empty control. None addresses MAX_READ_WRAPPER_DEPTH, the wrapper recursion, or the read-seam population. A local grep over the gate file confirms the bound is mentioned in four places and quantified in none of them.

Related


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions