Skip to content

Repair main red: interpreter primitive surface census - #7614

Merged
briansrls merged 2 commits into
mainfrom
session/keen-swift-704
Aug 1, 2026
Merged

briansrls merged 2 commits into
mainfrom
session/keen-swift-704

Conversation

@briansrls

@briansrls briansrls commented Aug 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Repairs the red main build in dag/test/claim/v1_interpreter_primitive_surface_witness_test.dag. Two witnesses were failing: the_surface_is_almost_entirely_derived and the_three_denominators_are_derived_and_distinct.

Root cause (measured by execution, not transcribed)

Two same-day commits each landed a genuine new derived arm in the v1 interpreter's v1_builtin_arms! macro (the single authority whose expansions generate both the dispatch match and the machine-readable roster from one token list), but only one of them touched the census pin, and it touched it incorrectly:

Both arms are genuinely derived, not native/hand-added — exactly the kind of change this census exists to auto-track, not a weaker-surface regression. So the fix is to re-pin at the true measured values, not to weaken the equalities.

Measurement method

Built claim_batch locally (sccache off, bypassing the ctrl-build shim to avoid a known rustc ICE and to avoid CTRL_BUILD_MODE=remote's no-local-binary default). Wrote a scratch probe .dag module with equality witnesses bracketing each of the five candidate counts (e.g. v1_interpreter_derived_arm_count() == 183), ran it directly against the current worktree with claim_batch --source-root dag --source-root src/v2 --entry <probe> --functions <csv>, read which candidates PASSed, and deleted the probe before committing. This is the same mechanism every_dispatch_site_is_enumerated etc. use — no value here was transcribed from a peer session's claim or a CI failure message.

Measured: derived_arm_count=183, declared_arm_count=2, dispatch_site_count=7, distinct_arm_identity_count=174, authored_spelling_count=161, row_count=185 (183+2, cross-checked directly against v1_interpreter_row_count()).

Changes

  • dag/test/claim/v1_interpreter_primitive_surface_witness_test.dag: the three pinned literals (182→183, 173→174, 160→161), and exact_count_witness_note's illustrative numbers updated to match (181/172/159/183 rows → 185/174/161/185 rows) — fixing only the code literals while leaving the note's prose stale would repeat exactly the defect that made this repair necessary.

Verification

All 24 witness fns in the file PASS by execution against the current worktree (local build, not CI-transcribed).

Blast radius

Grepped dag/ and src/v2/ for other transcriptions of these five counts — none found. The only other numeric mention near this carrier is an unrelated net-line-count note in dag/gunbc/v1_interpreter_primitive_surface.dag (added_hand_rust_accounting_note, about v1_interpreter.rs's +178 line delta), untouched here.

🤖 Generated with Claude Code

Brian Searls and others added 2 commits August 1, 2026 18:32
Two commits landed genuine new derived arms on the same day without the
pin catching up. #7562 added free_call.parse_stage0_cargo_manifest_bins
inside v1_builtin_arms! (the single-authority macro whose expansions
generate both the dispatch match and the roster from one token list) but
never touched this file's pinned literals. #7575 added
free_call.compile_dag_diagnostic_census, also inside v1_builtin_arms!,
and did update the pin -- but by incrementing the value already in the
file (181->182) rather than re-measuring, so it silently carried forward
#7562's un-pinned addition instead of catching it.

Both arms are confirmed DERIVED, not native: both sit inside the
v1_builtin_arms! macro body (verified by locating the macro's open/close
brace and grepping both arm names between them), so both are exactly the
kind of change this census is designed to auto-pick-up, not a weaker-
surface regression.

True values measured by execution (local sccache-off build of
claim_batch, run directly against this file with a scratch probe module
binary-searching each of the five counts via equality witnesses, deleted
before this commit): derived_arm_count=183, declared_arm_count=2,
dispatch_site_count=7, distinct_arm_identity_count=174,
authored_spelling_count=161, row_count=185 (183+2, checked against
v1_interpreter_row_count() directly). All 24 witnesses in this file now
PASS by execution.

exact_count_witness_note updated in the same commit so its illustrative
numbers (rows/identities/spellings) match the code again -- fixing only
the code literals while leaving the note stale would repeat exactly the
defect that made this repair necessary.

No other file in the corpus transcribes these five counts (checked by
grep across dag/ and src/v2/); the only other reference is an unrelated
net-line-count note in v1_interpreter_primitive_surface.dag.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review August 1, 2026 18:35
@briansrls
briansrls merged commit 8ffde0f into main Aug 1, 2026
1 of 6 checks passed
@briansrls
briansrls deleted the session/keen-swift-704 branch August 1, 2026 18:36
gunbai-bot Bot pushed a commit that referenced this pull request Aug 1, 2026
gunbai-bot Bot pushed a commit that referenced this pull request Aug 1, 2026
gunbai-bot Bot pushed a commit that referenced this pull request Aug 1, 2026
The heal-generated-artifacts commit regressed v1_interpreter_primitive_surface_witness_test to stale 182/173/160 expectations; CI merge ref carries main's 183/174/161 interpreter surface.

Co-authored-by: Cursor <cursoragent@cursor.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 1, 2026
…ves onto the single authority

Main's #7614 dodged the two-duplicate ambiguity by qualifying calls as
std.primitive_identity.decl_ref; this branch deletes that duplicate, so
the six qualified calls repoint to the bare constructor imported from
std.decl_ref — the qualification workaround dissolves with the fork.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
gunbai-bot Bot pushed a commit that referenced this pull request Aug 2, 2026
…-Unknown collapse (review 47124)

Two findings from review 47124 on PR #7620:

1. vacuity_consumer_witness_classified_sites appended every site for
   every VacuityEvidence outcome including Unknown, making the derived/
   classified set-equality check invariant to classifier output (a
   DESIGN.md §5 vacuous-evidence violation). Fixed: Unknown-classified
   sites are now dropped instead of kept.

2. The bound witness only ever drove classify_unified_test_claim_vacuity
   through its Absent-fn arm, whose honest answer is Unknown — so a
   wholesale collapse of the dispatcher to `_ => Unknown` would still
   pass. Fixed: added a second, independent assertion that drives the
   SAME public dispatcher through its NodeCorpus{EqualsClaim} arm with
   LiveSurfaceSnapshot/LiteralOracle provenance (the PR #7614 shape),
   asserting ProvenDuplicate. Proven by mutation: temporarily collapsing
   classify_unified_test_claim_vacuity to `Unknown` reds the witness by
   execution; restoring it greens all 5 witnesses again.

Also fixes an unrelated namespace collision surfaced while writing the
new assertion: TestgenLayer.Unit is one of three same-named `Unit`
symbols in the corpus (dag/std/types.dag, src/v2/std/cardinality.dag),
so the bare reference is ambiguous — used the fully qualified
v2.std.verification.Unit rather than an explicit import, since adding
an import line to this previously-import-free file switched it out of
whole-corpus namespace-only visibility and broke unrelated bare
references (filesystem_read's hermetic capability grant,
classify_vacuity_same_eval_record, vacuity_self_application_probe).

Verified by real claim_batch execution: 5/5 PASS.
briansrls added a commit that referenced this pull request Aug 2, 2026
…consumer witness, typed falsification roster (4/4/4 correction), self-application (#7620)

* WIP: Make the vacuity lens honest and live

* Implement item 2: real-corpus BoolWitnessClaim body classification; fix CI naming-hygiene break

- classify_unified_test_claim_vacuity's BoolWitnessClaim arm now reads the
  real parsed corpus (filesystem_read + tokenize/parse_module/normalize,
  reusing cost_coverage.dag's proven ingest pattern) to locate the named
  test fn and classify its body only when it reduces to exactly one
  top-level `==` statement; everything else stays Unknown.
- Fixed a call-shape bug (exact_structural_equality_zip_fold takes
  source_facts/candidate, not a/b) caught by local compile verification.
- Deleted the scratch src/v2/test/claim/manual/vacuity_probe.dag file that
  an autosave had committed — it broke CI's witness-naming-hygiene gate
  (test fn outside *_test.dag). Its finding (real corpus `test fn`
  declarations do not parse under dag_language_model() today — `test` has
  no lexer keyword or grammar production at all) is preserved as a
  documented, empirically-confirmed ceiling in vacuity_bool_witness_real_corpus_note.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* WIP: Make the vacuity lens honest and live

* WIP: Make the vacuity lens honest and live

* WIP: Make the vacuity lens honest and live

* WIP: Make the vacuity lens honest and live

* Item 6: replace vacuity falsification suite's hardcoded distribution pin with a typed roster; fix the newly-reached fixture's construction-justification gate

- vacuity_test.dag: refactor the 12 inline falsification rows into named
  VacuityCensusRow bindings, add a typed VacuityFalsificationCaseId /
  VacuityFalsificationCase roster with a per-case `expected` VacuityEvidence
  derived by hand-tracing classify_test_claim_vacuity and confirmed by direct
  execution. The old hardcoded census assertion (proven_duplicate==4,
  proven_independent==6, unknown==2) was stale: three cases whose labels say
  "_behavioral" actually pass OperandProvenanceUnknown, so the classifier
  correctly returns Unknown for them, not ProvenIndependent. The census test
  now derives its expected counts from the roster's own `expected` column
  instead of hardcoding a second, driftable copy of the same fact.
- vacuity.dag: document the broader fn-decl-collection ceiling found while
  wiring the item-5 consumer witness (same "general body producer" DESIGN.md
  open thread as the existing body-lowering ceiling note, not a new one).
- vacuity_self_application_fixture.dag: add the construction_justification
  decl the CI naming-hygiene gate now requires now that this module is
  genuinely reached by a discovered floor witness (previously inert).

* WIP: Make the vacuity lens honest and live

* Fix tautological vacuity consumer-witness binding (review 46910)

classified_sites was a pure alias of live_derived_sites, making
derived_equals_classified_sites literally x == x — a check that
cannot RED regardless of what the ingest pipeline does. Restructure
classified_sites to fold every derived site through real
classification, and rebind the contract's consumer_witness to
fixture_ingest_is_accepted_by_execution, the witness that genuinely
executes filesystem_read + ingest and can RED on a real regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Bind vacuity consumer witness to a real classifier-exercising test (review 46930)

fixture_ingest_is_accepted_by_execution only proved the fixture file
ingests; it never called classify_unified_test_claim_vacuity or
checked its output, so a classifier regression could stay green.
Rebind consumer_witness to
vacuity_consumer_witness_real_test_fn_gap_stays_unknown_by_execution,
which performs real filesystem_read + ingest + fn lookup internally
(via vacuity_bool_witness_evidence) and asserts the classifier's
returned VacuityEvidence equals the honest ceiling value (Unknown).

Also add a bounded Owner/Lane/Dissolve-trigger disposition to the
live-snapshot-duplicate-partner predicate note, in the shape
precedented by docs/plans/e0599-implementation-proposal.md §3.0,
rather than leaving only a dissolve-on trigger with no named owner.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* WIP: Make the vacuity lens honest and live

* Strengthen vacuity consumer witness to distinguish fail-closed from pipeline failure (review 46947)

The bound witness asserted only classify_unified_test_claim_vacuity(...) ==
Unknown, which is the same output produced by an ingest Rejected, a missing
fn declaration, and a genuinely-inconclusive body — so it stayed green under
total pipeline breakage, not only under honest fail-closed classification.
Now asserts ingest Accepted, the fn genuinely Absent from real decl lookup,
and classification still Unknown as three independent facts, each of which
reds under its own regression.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* WIP: Make the vacuity lens honest and live

* Vacuity consumer witness: prove the bound dispatcher isn't a constant-Unknown collapse (review 47124)

Two findings from review 47124 on PR #7620:

1. vacuity_consumer_witness_classified_sites appended every site for
   every VacuityEvidence outcome including Unknown, making the derived/
   classified set-equality check invariant to classifier output (a
   DESIGN.md §5 vacuous-evidence violation). Fixed: Unknown-classified
   sites are now dropped instead of kept.

2. The bound witness only ever drove classify_unified_test_claim_vacuity
   through its Absent-fn arm, whose honest answer is Unknown — so a
   wholesale collapse of the dispatcher to `_ => Unknown` would still
   pass. Fixed: added a second, independent assertion that drives the
   SAME public dispatcher through its NodeCorpus{EqualsClaim} arm with
   LiveSurfaceSnapshot/LiteralOracle provenance (the PR #7614 shape),
   asserting ProvenDuplicate. Proven by mutation: temporarily collapsing
   classify_unified_test_claim_vacuity to `Unknown` reds the witness by
   execution; restoring it greens all 5 witnesses again.

Also fixes an unrelated namespace collision surfaced while writing the
new assertion: TestgenLayer.Unit is one of three same-named `Unit`
symbols in the corpus (dag/std/types.dag, src/v2/std/cardinality.dag),
so the bare reference is ambiguous — used the fully qualified
v2.std.verification.Unit rather than an explicit import, since adding
an import line to this previously-import-free file switched it out of
whole-corpus namespace-only visibility and broke unrelated bare
references (filesystem_read's hermetic capability grant,
classify_vacuity_same_eval_record, vacuity_self_application_probe).

Verified by real claim_batch execution: 5/5 PASS.

* WIP: Make the vacuity lens honest and live

* Fix CI red on PR #7620 head 6a2cdef: enroll vacuity_self_application_fixture as known infra

lens_registry_completeness_holds_live failed because
v2.lens.vacuity_self_application_fixture (new fixture module from this PR)
is a v2.lens.* candidate with no LensIdV0 binding — it is fixture data
for the consumer-witness, not an enforcing lens itself.

Companion fixes (non_fold_residue frontier row + long-lane split of the
4 over-5s-budget vacuity_consumer_witness_* witnesses) were already
captured by the prior auto-WIP commit and pushed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Fix lens_contract_vacuity's consumer-witness pointer after the long-lane split (review 47204)

The witness_test.dag long-lane split moved
vacuity_consumer_witness_real_test_fn_gap_stays_unknown_by_execution to
src/v2/test/claim/long/vacuity_consumer_witness_long_test.dag but left
the contract's ScheduleWitnessEntry pointing at the old path, so the
declared consumer witness could not resolve to a real function.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* Derive vacuity_falsification_suite_rows from vacuity_falsification_suite_cases (review 47215)

vacuity_falsification_suite_rows was a manually maintained roster
duplicating the same 12 VacuityCensusRow values already carried by
vacuity_falsification_suite_cases's row field — a second membership
representation of one fact (DESIGN.md §2/§3). Derive it via list_map
over the cases roster instead, so the two can no longer drift.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* WIP: Make the vacuity lens honest and live

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
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.

1 participant