Repository navigation
reference: record F-NoOwnExecution instead of sampling it (#178) - #206
Merged
Merged
Conversation
The property is closure: for a file whose verdict is `fold`, what executes is a closed set the rule names. A CPU profile is the wrong instrument for that. It has a sampling floor, so chant's "0 MB of definition-library code on the path" means everything the profiler could see rather than nothing ran (#177), and something does run — revival constructs entities through real host classes. So this counts, and it counts twice. packages/reference/src/trace.ts is a ledger: every site in the package that invokes code it did not write records the invocation and the rule admitting it. The harness also wraps every callable the host publishes in a counting Proxy, which knows nothing about rules and only sees that it was called. An invocation one observer sees and the other does not is an unmapped frame and fails the build. Three panels, from the committed fixtures: A data-host, 19 fixtures, zero invocations on both observers. F-Profile-DataHost made visible rather than measured. B full, 29 fully folding estates, 24 invocations, both counts agreeing. C full, 32 estates that do not fold completely, 21 invocations. chant's harness fails unless every file folds, so it has never recorded one of these. F-Succ/forward-into-imports is the exemplar and its verdicts and taint edges are held to the fixture's own expectation. Arm coverage is asserted too, so a rule F-NoOwnExecution lists that nothing exercises fails. F-Eval-CallMethod is reached only by an expression fixture, which is why the sweep folds those as well. Mutation-tested rather than assumed: removing F-Val-Fate from the allowlist produces 23 failures, and deleting one record() call from revive.ts produces the unmapped-frame failure the two-observer design exists to catch. The artifact is JSON and not a markdown report. #190 is the bug that habit produced on corpus-report.md, so sync-spec.mjs reads this one with JSON.parse and it has no table to drift from. Also here: spec/rationale.md's claim that 2.1 made the 0 MB row "a property the specification requires" conflated the property with the instrument. 2.1 requires the thinness the row reflects; the row is still a profiler sample. packages/reference/src/no-own-execution.test.ts is untouched and complementary: it asserts a folded file's own statements never run, where this asserts closure over what does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AzfJnYw9p6rAxhJqXK3CPv
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #178. Delivers #177's counters requirement on this side.
Why not a profile
The claim is closure — exactly this set executed and every member is admitted by a named rule — and a
node --cpu-proffigure cannot establish it. It has a sampling floor, so chant's "0 MB of definition-library code on the path" means everything the profiler could see, not nothing ran. Something does run: revival constructs entities through real host classes (F-Val-Fate).Two observers
packages/reference/src/trace.ts): every site in the reference that invokes code it did not write callsrecord(rule, what, name)first. Seven sites, one per arm.Proxyaround every callable the host publishes. It knows nothing about rules and only sees that it was entered.An invocation one sees and the other does not is an unmapped frame and fails the build. That is the failure this exists to catch: a new invocation site added without a
recordbeside it.Three panels, from committed fixtures
data-hostfull, folds completelyfull, does not fold completelyPanel A is
F-Profile-DataHostmade visible: "No constructor and no function is invoked", asserted on both observers rather than observed.Panel C is the one nothing in either repository had.
test/leftnessfails unless every file reports[fold:fold], so it is necessarily a best case.F-Succ/forward-into-importsis the exemplar —config.tsfolds tentatively and is taken by the forward edge — and every fixture's verdicts and taint edges are held to its ownexpect.json, so the demonstration and the conformance suite cannot drift.B and C partition the
fullwhole-build fixtures: nothing sits in both, nothing outside both.Arm coverage
F-Val-Fate38,F-Eval-CallEager1,F-Eval-CallMethod1,F-Callstep 6 → 6. A listed arm nothing exercises fails, so the allowlist has no dead entry.F-Eval-CallMethodis unreachable from any whole-build fixture, which is why the sweep folds the expression fixtures too — a real coverage fact rather than a silent gap.Mutation-tested
Not assumed to work:
F-Val-Fatefrom the allowlist → 23 failuresrecord()call fromrevive.ts→ "the witness counted 1 invocation(s) and the ledger recorded 0. A witnessed invocation with no ledger entry is an unmapped frame"Plus 9 tests, four of them non-vacuity.
What it does not see
The witness wraps what the host publishes, so host code calling a function it closed over privately is invisible to both observers. That is
F-Host-Interfaceitem 1's to forbid rather than this instrument's to detect, and since spec 2.1 it does. The limit is stated in the harness doc comment rather than left implicit.Also here
spec/rationale.md: my claim in spec 2.1: an entity constructor holds its props and does no more (#173) #205 that 2.1 made the 0 MB row "a property the specification requires" conflated the property with the instrument. 2.1 requires the thinness the row reflects; the row is still a profiler sample.spec/fixtures/UNCOVERED.md:F-NoOwnExecution's reason now names this harness. Still no fixture — an adapter reports verdicts and cannot observe execution — so the coverage counts are unchanged.JSON.parse. Gate: narrow the corpus-report.md slurp to the report's table cells #190 is the bug that regex-slurpingcorpus-report.mdproduced, and this does not repeat it.packages/reference/src/no-own-execution.test.tsis untouched. It asserts a folded file's own top-level statements never run; this asserts closure over what does. I overwrote it by accident partway through and restored it frommain— worth knowing it already existed.Verification
69 tests in 16 files, typecheck clean, prose lint 58 with no regressions,
npm run docs:buildclean (57 pages).🤖 Generated with Claude Code
https://claude.ai/code/session_01AzfJnYw9p6rAxhJqXK3CPv