Skip to content

[finding] check:durability-log-level's readInventionKey falls back to one shared "anonymous" placeholder, so every anonymous-callback read seam in a file collapses onto a single baseline key #12576

Description

@os-litant

Filed unassigned and ungraded by the domain:cli seat while implementing #12545 (PR #12577, on scripts/check-cli-test-child-env.mjs). ⛔ Not claimed, not routed, ⛔ deliberately not fixed there — #12545's whole headline is that its unwrap stays targeted, and a drive-by in a second gate is how a review loses track of what was measured.

Measured on origin/main @ aa4591971.

⚠️Spelling note, learned the hard way on this very issue. The key placeholder in the source is the word anonymouswrapped in angle brackets. GitHub's body sanitizer silently eats short angle-bracket fragments — inside backticks and inside fenced code blocks — so the first version of this issue had them removed from its title and three places in its body, leaving the text asserting the fallback was an empty string. Everything below therefore spells it in prose. ⛔ Do not "restore" the literal spelling; it will be eaten again.

Why this was looked at

#12545's claim comment recorded that scripts/check-durability-degradation-log-level.mjs:1695 holds an independent copy of the same enclosingFunctionName walk, and asked whoever took the card to measure whether it carries the same (top-level) defect rather than assume it. This is that measurement, and the answer is no — but there is a different, related latency at one of its two call sites.

It does NOT have #12545's defect

enclosingFunctionName(node) (:1695) recognises four shapes: function declaration, method declaration, variable-bound arrow / function expression, and named function expression.

It has no call-argument-callback branch at all. It never names it('x', fn)either, not merely it.skip('x', fn) — so there is no identifier branch for a modifier unwrap to extend. (The guess recorded on #12545, that a copy taking no sourceFile argument may not have the same branches, is correct.)

Its fallback is undefined, not '(top-level)', and the two call sites diverge sharply:

:2493declaredPropagationFor — no defect, structurally

constfnName=enclosingFunctionName(tryNode);if(!fnName)returnglobalPropagation;constkey=`${relPath}::${fnName}`;

An unnamed site short-circuits and no key is ever constructed. That is a closed door, not a shared one: no site declaration can be written for that catch, which the function's own docblock states as intended.

:2451readInventionKey (:2827) — the same collision class, latent

enclosingFunctionName(node) flows into seam.fn, and readInventionKey keys the rule's shrink-only baseline on f.file and f.fn joined by a double colon — substituting the fixed angle-bracketed anonymous placeholder whenever f.fn is undefined.

⇒ two read seams in one file that both sit inside anonymous callbacks produce the identical key, so one baseline entry would classify both — leaving the second unreviewed by the PR that needed the first. That is structurally the same carve-out-by-accident shape #12531 closed for check-cli-test-child-env's (top-level), and that #12545 is closing one modifier over.

It is LATENT, and here is the measurement that says so

scripts/durability-read-invention.baseline.json:

measurevalue
baseline entries1
entries whose fn is anonymous0
files carrying more than one entry0

⇒ nothing is mis-keyed today, and no verdict on main is wrong. Exactly the latency profile #12545 itself had when it was filed: it is the next entry's problem, if that entry lands in an anonymous callback.

Re-check

git grep -n "readInventionKey\|function enclosingFunctionName" origin/main -- scripts/check-durability-degradation-log-level.mjs
node -e "const b=require('./scripts/durability-read-invention.baseline.json');console.log(b.entries.length, b.entries.filter(e=>!e.fn).length)"

⛔ Reverse-check any zero against a term known present in the same file, never a substring of the term under test.

Severity not judged

Recording so the residue is a stated fact rather than something rediscovered in three months. Whether it is worth closing at all is a real judgement call: the fix direction that worked for check-cli-test-child-env (name a callback after its call) would import a naming vocabulary into a gate that currently has none, and the honest alternative — leaving undefined to mean "undeclarable", as :2493 already does — may be better than minting shared placeholder keys at all. ⇒ ⛔ Not obviously a "make it match the other gate" card.

Dedupe performed

MCP search_issues (the dev seat's raw REST is 403, including reads), plus local grep. Three neighbours in the same file, none covering key granularity:

⚠️ Not deduped against domain:devx's own backlog beyond the searches above.


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