Repository navigation
Conversation
…substrate Dissolves the duplicated containment-shape -> DeclarationExposure derivation (previously independent in gunbc.type_reference_binding_context and v1.gunbc.occurrence_binding_parser_walk) into one function, declaration_exposure_from_containment, grounded on DeclarationExposureGrounding (NamespaceStructuralRootExposure | ModuleLocalMemberExposure | CrossFileProviderExportedExposure) in std.occurrence_binding_candidates. Both consumers repointed; their local duplicate helpers deleted. Adds a collision-free cross-file assembly substrate to the same module: each independently parsed transport gets its own old-id -> closure-id remap: index, declarations, references, module paths, exposure rows, authored-order rows, and containment paths rekey together as one transaction, so two transports that each mint raw occurrence id 0 land on distinct closure ids with every cross-collection join intact. Duplicate-same vs conflicting module->file rows refuse via distinct typed variants (ModulePathFileDuplicateSame / ModulePathFileConflict), never a silent widen. The temporary ModulePathFileRow carrier cites v2.compiler.source_authority.ModuleStorageBinding as terminal authority. The single StructuralBindingWalk type + refusal carrier moves into the std authority; the parser-local copy is deleted. New witness file dag/test/claim/cross_file_binding_assembly_witness_test.dag carries 11 executing controls: all three DeclarationExposureGrounding policies discriminated across module-root and direct-child containment shapes; colliding raw ids assembling to distinct closure ids with joins proven intact per-occurrence (not just per-collection presence); lexical exposure scope reusing an already-seen remap rather than minting fresh; duplicate-same vs conflict refusing via distinct variants both directly and through end-to-end assembly; and a structural control proving the two old duplicate helpers are gone from their former homes. Scope: this PR establishes the exposure authority and the assembly substrate only. It does not touch cross-file binding provenance, reference-derived dependency projection, the embedded consumer/provider parser wrapper, or any "ordinary loader" integration — those remain separate, unstarted work. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
The .dag edits deleted the two duplicate exposure/binding-walk helpers and added the collision-free assembly substrate, but stage0 was not regenerated in the prior commit. cargo run -p v1-compiler --bin regen_stage0 updates the three affected generated files to match: std_occurrence_binding_candidates.rs, occurrence_binding_parser_walk.rs, and its witness test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…sembly cost Addresses loyal-ram-550's REQUEST_CHANGES on 7d4dcdf: - The colliding-raw-ids assembly witness now carries a provider row with both a declaration and a reference (previously references: [] never exercised rekeying), and asserts pre-assembly raw-id collision plus post-assembly distinct closure ids with every join (index projection, containment terminal, module-path, exposure, authored-order) intact for the declaration and the reference. - rekey_occurrence_transport, rekey_occurrence_binding_inputs, and the provider fold in assemble_cross_file_binding_closure built their result populations via concat(acc, [item]) inside folds, and the provider fold additionally re-concatenated the full accumulated transport/inputs each iteration -- a proven quadratic cost shape (DESIGN.md §6 "bare minimum cost"). Switched to the established prepend-plus-single-final-reverse idiom already used elsewhere in this file.
colliding_raw_ids_assemble_to_distinct_closure_ids_with_joins_intact_holds asserted exposure_rows count == 1, but consumer_joined and provider_decl_joined both require a DeclarationExposureRow keyed to their own distinct closure id (via cfba_joined_at's exposure lookup). Consumer and provider each contribute exactly one exposure row, so the correct total is 2 — the == 1 assertion was internally inconsistent with the test's own join checks, not a change in intended behavior. Verified: all 11 witnesses in this suite PASS, including this one.
… logic (review 49798) The prior emitter-driven implementation of NamespaceStructuralRootExposure hand-duplicated declaration_exposure_module_local_member's ancestor-depth match instead of calling it, forking the same exposure decision across two call sites. review 49798 flagged the fork risk directly. Delegate instead — single authority, same behavior, proven by the existing type_reference_binding_context_witness_test.dag suite (6/6 PASS, including the cited nested_containment_derives_lexical_exposure_holds specimen). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Correction: my commit ef85ebc and the accompanying PR reply (addressing review 49770) claimed all 11 cross_file_binding_assembly_witness_test.dag witnesses passed, including colliding_raw_ids_assemble_to_distinct_closure_ids_with_joins_intact_holds. That claim was false — reverting to ef85ebc and rerunning reproduces a deterministic FAIL 3/3 times. The claim was never re-verified after the exposure_rows count fix; it should have been. Root cause, isolated by bisection: the test helper cfba_closure_id_by_name used `list |> filter(...) |> first()` followed by a chained multi-level field projection (`.projection.occurrence.value`, through a nested struct to a scalar). That specific shape silently returns a wrong/unwrapped value instead of the real field — a v1 interpreter evaluation defect, not a bug in the production assemble_cross_file_binding_closure/rekeying logic, which was independently re-read and confirmed correct. The identical projection chain works fine on a lambda-bound loop variable (e.g. inside `any(e => ...)`), and single-level projection after `first()` also works fine — the defect is specific to nested-struct chained projection immediately after filter|>first(). Fix: rewrite cfba_closure_id_by_name using fold+if (lambda-scoped field access) instead of filter|>first() plus chained projection, avoiding the defect entirely rather than patching the interpreter — consistent with how the review 49798 emitter defect was worked around rather than patched. Verified: full 11-witness cross_file_binding_assembly_witness_test.dag suite now PASSES 11/11 (roster-counted, not FAIL-grepped), and the sibling type_reference_binding_context_witness_test.dag suite remains 6/6 PASS. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…ure (review 49798) Commit f4e1a12 fixed NamespaceStructuralRootExposure by delegating to module-local-member logic, but that delegation was semantically wrong on the Absent/module-root case: it yielded ModuleExposure where the correct namespace-structural-root semantics is RootExposure (no enclosing scope means the declaration is exposed at the namespace root, not merely at its module). This applies the operator's exact three-outcome rewrite to declaration_exposure_namespace_structural_root: Absent -> RootExposure Present, empty exposing scope -> ModuleExposure Present, nonempty exposing scope -> LexicalExposure Regenerated stage0 via regen_stage0 (--verify: divergence 0) and confirmed by direct read that the generated Rust carries three distinct match arms, not a collapsed if/else. Adds a WitnessBin control, namespace_structural_root_exposure_generated_witness, that calls declaration_exposure_from_containment directly as compiled code (not via the interpreter) and asserts all three outcomes. This is load-bearing: the two-ancestor/LexicalExposure arm is exactly the shape a known, separate generic-emitter defect (EMIT-NESTED-PATTERN-0, node://adhoc-b4da0e4d-cf3) can silently collapse away during emission even when interpreted-source witnesses stay green. That emitter defect is NOT fixed here — it is tracked and repaired under its own work item; this PR only guards against a regression reintroducing it in this codepath. Existing suites confirmed green after the change: cross_file_binding_assembly_witness_test.dag 11/11, type_reference_binding_context_witness_test.dag 6/6. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…n executing merge path The control binary existed and built, but nothing in .dag wired it to a WitnessBin transport or a discovered test claim, so it never executed on any CI-gated path (operator finding relayed via loyal-ram-550 on #7943). Enroll the bin_name in witness_declared_release_bins, add the WitnessBin transport following the parse_witness_transport.dag precedent, and add a test.claim module that executes it under ReadsLiveTree (the transport reaches the live tree via git.Inspect.Toplevel()).
B1 execution receipt (merge gate)Repository head: Each row: entry module, witness function identity, execution class, observed outcome, subject identity (claim_batch eval receipt). Projection-law witnesses (9)
Fixture projection witnesses (3)
Cardinality: twelve named identities, each observed exactly once, each PASS, on Invocation receipts: BuildBuddy |
…duct Add OccurrenceCategoryClauseEDependencyInducingVerdict beside the existing module-scope and binding verdict authorities in std.occurrence_identity, and route reference_derived_dependency_binding_references through it (review 50193). Co-authored-by: Cursor <cursoragent@cursor.com>
Review 50193 — addressed in
|
| # | Entry | Function | Outcome | Subject |
|---|---|---|---|---|
| 1 | dag/test/claim/namespace_clause_e_projection_law_witness_test.dag |
witness_substrate_establishes_controlled_scenario |
PASS | f36ec20a131e1ba0 |
| 2 | same | witness_substrate_refuses_one_mention_only |
PASS | 0acee1f2e5ac6c31 |
| 3 | same | witness_substrate_refuses_two_declarations_same_provider_file |
PASS | e9b198c3bb0a795f |
| 4 | same | witness_substrate_refuses_duplicate_reference_occurrence |
PASS | fe6001d72e82d3da |
| 5 | same | witness_substrate_refuses_two_file_dependencies |
PASS | f17073bc367ca54e |
| 6 | same | witness_substrate_refuses_changed_declaration_identity_in_bound_population |
PASS | 84e318cd8296e2f1 |
| 7 | same | witness_substrate_refuses_projection_inconsistent_with_bound_population |
PASS | 38a985d20a7f5b3f |
| 8 | same | witness_substrate_refuses_reference_population_refused |
PASS | c82422c1d4a51efe |
| 9 | same | witness_substrate_refuses_file_path_missing |
PASS | a569b48ea52fb9b8 |
| 10 | dag/test/claim/occurrence_binding_candidates_witness_test.dag |
repeated_cross_file_mentions_collapse_provider_file_holds |
PASS | 42672d9a3387ad3e |
| 11 | same | cross_file_clause_e_fixture_collapses_provider_file_holds |
PASS | 9626dec2b9ce14c5 |
| 12 | same | reference_derived_dependency_projection_preserves_provenance_and_collapses_files_holds |
PASS | 8bda944d297e1e42 |
Twelve named identities, each observed once, each PASS. Subject hashes shifted vs 0cadf6b96b8 (stage0 regen from verdict coproduct); all twelve still PASS.
The verdict refactor changed emitter output for the two occurrence_identity binding modules; commit the fresh self-compile so regen_verify passes. Co-authored-by: Cursor <cursoragent@cursor.com>
B1 execution receipt (merge gate)Repository head: Each row: entry module, witness function identity, execution class, observed outcome, subject identity (claim_batch eval receipt). Projection-law witnesses (9)
Fixture projection witnesses (3)
Cardinality: twelve named identities, each observed exactly once, each PASS, on — sent from silent-crab-504 |
Generated output only. Both files carry the "Generated by v1 compiler --
do not edit." header; no hand-written line moved.
std_occurrence_binding_candidates.rs gains the import for the two
OccurrenceCategoryClauseEDependencyInducingVerdict constructors that the
.dag change introduced. std_occurrence_identity.rs re-emits the seven
verdict arms with fully qualified constructor paths; the arms and their
values are unchanged.
Proven by execution, not by exit status:
regen_stage0 --verify BEFORE exit 1, regen_divergence_count=2
regen_stage0 wrote 134 files, 2 modified
regen_stage0 --verify AFTER exit 0, regen_divergence_count=0
rustfmt --check on both files exit 0, with a positive control that
exits 1 on deliberately bad input
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This PR's ci failed on cross_module_qualified_reference_emits_call_from_ correct_module, killed at its CPU budget. #8010 retired that witness to the substrate long lane, but a fix merged to main is not a fix present in a branch -- CI discovery walks the tree's own files, so this branch kept finding it in the fast lane and a re-run reproduced the failure exactly. Pure merge. Zero conflicts, no authored change, nothing regenerated. Verified before pushing, each with the instrument that actually answers the question asked: coverage (the authority -- discovery walks files, not history) fast lane qualified_declaration_reference_emit_witness_test.dag 0 long lane qualified_declaration_reference_emit_cross_module_...dag 1 provenance (corroborating only, and only in the positive direction -- ancestry is unsound as a negative under squash-merge) 00d1cb4 "Move cross-module emit witness to substrate long lane. (#8010)" is an ancestor of the merged commit: TRUE (sha verified to BE #8010 rather than trusted) seed consistency -- the whole-tree oracle, not the per-symbol fallback regen_stage0 built at the merged tree, then --verify exit 0, regen_divergence_count=0 "committed stage0 matches fresh self-compile" The merge brings .dag authorities under regen_input_sources and their seed projections together, so this confirms they arrived consistent rather than half-regenerated. contribution, with both controls firing own paths vs main: 2171 insertions, 32 deletions across 8 files positive control (a differing path): non-empty negative control (an untouched path): empty Merging main tip 6d07729, which was still the tip at merge time. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Folded into #8036 — this lane's three PRs are consolidated into one integration branch. The three were really two disjoint changes, one containing the other, established by measurement: #7996 ⊇ #7994 (seven of eight shared files byte-identical, the eighth additive at +77/−1), and #7991 ∩ #7996 = ∅ (no shared files at all). So #7994 needed no merge — it was already inside #7996 — and #7991 merged beside it without touching a single common path. Nothing is lost by closing this. The integration carries a full merge audit rather than an assertion:
Why this PR is closing while carrying approvals: it is red on Continue on #8036. |
|
Closing: consolidated into #8036 (branch |
Summary
Land clause-(e) projection carriers on merged B0 substrate:
CrossFileBindingProvenance,DirectFileDependency,ReferenceDerivedDependencyProjection, andReferenceDerivedClauseEProductioninstd.occurrence_binding_candidates, consumingAssembledCrossFileBindingClosurewithout redefining B0 symbols.Add
gunbc.namespace_clause_e_projection_lawwithassess_controlled_two_mention_provenance_projection(9-variantNamespaceClauseEProjectionFailure; B2 row closure excluded).Merge claim: The complete clause-(e) projection carrier and discriminating fixture algebra exist. The N3-B row remains red because the ordinary loaded compilation producer is still absent.
Stable head:
0cadf6b96b888752adbfdbd61286a4aa3c3261a0(post-B0 main9bdefebc2d+ B1 slice).Test plan
claim_batch --entry dag/test/claim/namespace_clause_e_projection_law_witness_test.dag --functions witness_substrate_*— 9/9 PASSclaim_batch --entry dag/test/claim/occurrence_binding_candidates_witness_test.dag --functions repeated_cross_file_mentions_collapse_provider_file_holds,cross_file_clause_e_fixture_collapses_provider_file_holds,reference_derived_dependency_projection_preserves_provenance_and_collapses_files_holds— 3/3 PASSregen_stage0on merged authorities — divergence 0Worker attestation
claim_batch(12 witnesses) — all PASS