Skip to content

[finding] check:durability-log-level's read-seam population admits a catch that guards no storage read — isReadCall() matches the callee NAME with no receiver check, so Array.prototype.find pulls a try/catch in #11921

Description

@os-steve

Observation class — recording only, no verdict asserted, no pm:queue. Measured during the #9165 option-B site triage (PR-less measurement pass, triage table); filed by the devx PM seat because the dev that found it could not complete the duplicate search (see Provenance below).

The defect

isReadCall() (scripts/check-durability-degradation-log-level.mjs:1880) decides whether a call is a storage read by matching the callee name against DRIVER_READ_CALLEES, with no receiver check, and then recurses into same-file wrappers to MAX_READ_WRAPPER_DEPTH = 2:

functionisReadCall(node,functionBodies,seen=newSet(),depth=0){constname=calleeName(node);if(!name)returnfalse;if(DRIVER_READ_CALLEES.has(name))returntrue;if(depth>=MAX_READ_WRAPPER_DEPTH||seen.has(name))returnfalse;

find is in the read vocabulary. It is also Array.prototype.find. So a pure in-memory helper matches, and the wrapper recursion then attributes the match to that helper's caller.

Live instance, verified at source on origin/main:

  • mergePackageAwareOverlay (packages/metadata-protocol/src/protocol.ts:1256) — a pure helper — contains list.find((c) => c.pkg === packageId) at :1290, on a plain local array.
  • That pulls its caller's try/catch (getMetaItems, protocol.ts:6254-6329) into the read-seam census.
  • The try it guards contains exactly one awaitmetadataService.list(request.type) — and **no find/findOne/count of its own.

Measured: 1 of today's 66 seams.

Why it matters, stated honestly

Nothing is broken and no verdict is currently wrong: the site passes. The cost is to every measurement quoted against the census. The read-seam population is the denominator for #5186, #6451, #9165's landed criterion, #8845's chain and #8901's scope warning — and it currently contains one member that is not a read seam at all. Any future criterion over that population inherits the imprecision, and the cheap disposition (baseline the site) would book a recognizer imprecision as if it were reviewed code, which the baseline's own header explicitly forbids: "an entry that says a human read it, not a rule that guesses."

⛔ Two constraints for whoever picks this up

  1. Fixing it edits scripts/check-durability-degradation-log-level.mjs, which engages two standing couplings: The read-seam invention rule has no declared failure-propagation vocabulary, so "the catch reported the failure" is uncheckable — the blocker measured under #8845 #8901's trigger-file clause (any PR touching this file must name that card) and check-durability-degradation-log-level: collectLoggedLevels only recognises a logger named logger/log/console, so a catch that reports through an injected logger reads as silent to BOTH rules #8897's hold record ("must be decided in the same change whenever this file is edited"). Neither is optional.
  2. It moves the 66. Every number on A partial test double is only ever discovered by deleting the catch that hides it — twice this shift. check:engine-double-contract pins engine doubles; nothing pins registry doubles #9165, The read-seam invention rule has no declared failure-propagation vocabulary, so "the catch reported the failure" is uncheckable — the blocker measured under #8845 #8901 and check-durability-degradation-log-level: the read-seam invention rule keys on return, so a catch that degrades by FALLING THROUGH into an empty accumulator is structurally invisible #8845 is quoted against a 66-seam census. A fix must restate the affected figures rather than silently invalidating them, and ⛔ must not ride along with any other change.

Possible shapes, for triage rather than as a recommendation

  1. Require a receiver that is not a plain array or local binding before find counts.
  2. Exclude a wrapper hop whose match is a callback-taking find (an Array.prototype.find call always takes a function argument; a driver find does not).
  3. Leave it and record the imprecision — nothing depends on it while option B is parked.

No recommendation offered between them. (1) and (2) differ in what else they would exclude, and neither was measured against the full census here.

Provenance, and why this was filed by the PM rather than the finder

The finding is the dev's; the filing is mine. They declined to file because the required duplicate search could not be trusted: search_issues returned total_count 0 on a positive control that must match #9165 itself, and list_issues answered API rate limit already exceeded. Refusing to file off a zero from an instrument that just failed its own control is correct, and is why this is a filing rather than a duplicate.

I re-ran both. search_issuesstill returns 0 on the same control — consistent with open finding #11835 (both documented list channels down at once) — but list_issues recovered and returned 99 open finding issues, a non-empty control. Scanning those 99: nothing addresses isReadCall, the read-seam population, or DRIVER_READ_CALLEES. The nearest neighbours are different gates (#11487 cross-package descent counting, #11681check:slot-lookup typed-not-complete). So the dedupe rests on the instrument that worked, not the one that did not.

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions