Skip to content

reference: record F-NoOwnExecution instead of sampling it (#178) - #206

Merged
lex00 merged 1 commit into
mainfrom
spec/178-noownexecution-recording
Sep 15, 2026
Merged

lex00 merged 1 commit into
mainfrom
spec/178-noownexecution-recording

Conversation

@lex00

@lex00 lex00 commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

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-prof figure 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

  • The ledger (packages/reference/src/trace.ts): every site in the reference that invokes code it did not write calls record(rule, what, name) first. Seven sites, one per arm.
  • The witness: a counting Proxy around 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 record beside it.

Three panels, from committed fixtures

estate fixtures invocations witness
A data-host 19 0 0
B full, folds completely 29 24 24
C full, does not fold completely 32 21 21

Panel A is F-Profile-DataHost made 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/leftness fails unless every file reports [fold:fold], so it is necessarily a best case. F-Succ/forward-into-imports is the exemplar — config.ts folds tentatively and is taken by the forward edge — and every fixture's verdicts and taint edges are held to its own expect.json, so the demonstration and the conformance suite cannot drift.

B and C partition the full whole-build fixtures: nothing sits in both, nothing outside both.

Arm coverage

F-Val-Fate 38, F-Eval-CallEager 1, F-Eval-CallMethod 1, F-Call step 6 → 6. A listed arm nothing exercises fails, so the allowlist has no dead entry. F-Eval-CallMethod is 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:

  • removing F-Val-Fate from the allowlist → 23 failures
  • deleting one record() call from revive.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-Interface item 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.
  • The artifact is JSON, read with JSON.parse. Gate: narrow the corpus-report.md slurp to the report's table cells #190 is the bug that regex-slurping corpus-report.md produced, and this does not repeat it.
  • packages/reference/src/no-own-execution.test.ts is 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 from main — worth knowing it already existed.

Verification

69 tests in 16 files, typecheck clean, prose lint 58 with no regressions, npm run docs:build clean (57 pages).

🤖 Generated with Claude Code

https://claude.ai/code/session_01AzfJnYw9p6rAxhJqXK3CPv

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
@lex00
lex00 merged commit 4a25f57 into main Sep 15, 2026
3 checks passed
@lex00
lex00 deleted the spec/178-noownexecution-recording branch September 15, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Record F-NoOwnExecution against the reference and tsad-eval, including a mixed estate

1 participant