Skip to content

Re-pin door-ledger histogram receipt to current attributed frontier (#6551 moved determinism's refusal to the packaged-parse fork) - #6580

Merged
briansrls merged 13 commits into
mainfrom
session/smart-eagle-362
Jul 14, 2026
Merged

briansrls merged 13 commits into
mainfrom
session/smart-eagle-362

Conversation

@gunbai-bot

@gunbai-bot gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What

Re-pin the door-ledger cause-histogram receipt (ledger_cause_histogram_over_mixed_affected_set, from #6540) to the current attributed frontier. The witness went RED on clean main after #6551 (Determinism Phase A); this repins it to the causes the door actually produces today — no broadening.

Why it went red (external, not a regression)

#6551 added a coproduct to dag/std/determinism.dag:

DeterminismAxis = Deterministic | NonDeterministic { source: DeclarationRef }

The ledger's admission pre-parse uses the packaged parse(), which rejects coproduct-syntax modules at parse_grammar_choice_overlap_residue (the known packaged-parse fork — parse() rejects, parse_production tolerates; MigrationOwned, dissolves with the packaged/parse_production reconciliation). So std.determinism's refusal moved earlier — from the fact_density lens (fact_density_hollow_alias_locus) to the parse fork — and no longer reaches the lens at all.

Diagnosed by execution (per-module cause probe on clean main, then deleted):

  • std.determinism → parse_grammar_choice_overlap_residue
  • std.error_primitives → resolve_reason_unbound_symbol
  • std.bit → resolve_reason_unbound_symbol

The change (one test file, still discriminating)

-  && ledger_cause_count(rows, ^fact_density_hollow_alias_locus) == 1
+  && ledger_cause_count(rows, ^parse_grammar_choice_overlap_residue) == 1
+  && ledger_cause_count(rows, ^fact_density_hollow_alias_locus) == 0

This is not a masked-green broadening: it swaps one specific expected cause for another specific cause, and adds a discriminating fact_density_hollow_alias_locus == 0 check that would go RED if determinism regressed back to the lens. The receipt still tracks two distinct, correctly-attributed frontier causes over one real affected set (1 parse-cause + 2 resolve-causes). compile_door_ledger_witness_note is updated to record the frontier move.

The fact_density lens frontier is now covered by crisp-newt-633's dedicated fact_density witnesses (#6579), not here.

Verified green-by-execution

ledger_cause_histogram_over_mixed_affected_set PASS (~127s, wet, freshly-built claim_batch) on main+this-edit. Re-verified on the post-merge tree.

Test-only witness update; no substrate/pipeline change.

🤖 Generated with Claude Code

Brian Searls and others added 13 commits July 14, 2026 00:09
…idate-once)

grammar_validate_for_parse (5 whole-grammar checks + FIRST/nullable analysis,
~9.2s, all pure fns of the invariant grammar) ran inside parse_module — so a
door call over a K-module import closure re-validated the SAME grammar K times,
and compute_grammar_first_analysis ran twice per module (ambiguity check +
parse_table_for_production). The cache-interface fields on ParseTableRealization
(grammar_digest/materialization) were inert; the backend lookup is Miss-stubbed,
so this was a recompute-per-module bug, not a missing cache.

Fix (correctness by construction): PreparedGrammar carrier + prepare_grammar
(well-formed + validate + analyze, once) hoisted ABOVE fold_list in
program_assembly_fold_ingest; parse_module_prepared reuses it per module.
parse_module / parse_production / parse_table_for_production / read_to_normalized_root
keep backward-compatible wrappers (prepare then parse). Empty-ingest guarded so
zero modules never pay the one-time prepare. Only fold_step's signature changed
(internal, no external callers).

Behavioral equivalence proven by execution: ledger histogram witness green with
IDENTICAL causes (determinism->fact_density, error_primitives->resolve_unbound,
bit->resolve_ambiguous_export); parse-table amortization green (2-file fold = one
preparation, ~9.2s not ~18.4s); new empty-ingest guard witness green (4ms, no prepare).

Cross-call content-addressed memo (across door calls) is the follow-up, gated on
wiring the currently Miss-stubbed cache backend.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 14, 2026 05:55
@briansrls
briansrls merged commit 2cc13b1 into main Jul 14, 2026
3 of 6 checks passed
@briansrls
briansrls deleted the session/smart-eagle-362 branch July 14, 2026 06:27
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