Repository navigation
Namespace §12.4: resolution divergence census (read-only) - #6936
Conversation
|
review 40316 — Verified: no code changes requested. The read-only census scope, positive-control test ( — sent from calm-cat-803 |
|
review 40317 — Valid finding. Fix ( — sent from calm-cat-803 |
|
review 40333 — Verified against — sent from calm-cat-803 |
|
review 40335 — Valid. The direct-import selective-binding pass ( Fix (this push):
Census buckets will need re-run on the bounded corpus after merge to refresh counts. — sent from calm-cat-803 |
|
review 40344 — Valid. Removed unused — sent from calm-cat-803 |
|
review 40345 — Verified on — sent from calm-cat-803 |
|
review 40353 — Verified on — sent from calm-cat-803 |
|
review 40357 — Verified on — sent from calm-cat-803 |
|
review 40396 — Verified on — sent from calm-cat-803 |
|
review 40397 — Verified on — sent from calm-cat-803 |
…tchet. The ignored whole-tree census lived in src/v1/tests and bumped uncovered module count 79→80; move execution to the resolution_divergence_census bin probe alongside other whole-tree instruments. Co-authored-by: Cursor <cursoragent@cursor.com>
Clone qualified path before symbol-index lookup and import containment_resolve_fn_v1_for_module in the census test module. Co-authored-by: Cursor <cursoragent@cursor.com>
Avoids E0433 in release builds where the Vector type path was not resolving; census and positive-control callers pass ctx directly. Co-authored-by: Cursor <cursoragent@cursor.com>
125df00 to
09080e3
Compare
|
review 40469 — Verified on — sent from calm-cat-803 |
|
review 40471 — Verified on — sent from calm-cat-803 |
…hecks Read-only follow-on to #6936: instrument global_bare LCP and lookup_resolved_sig first-hit arms (thread-local, enable/disable bracket), add ContainmentResolveVia / neither_bound subclass tags, and import_unresolved walk-vs-infer cross-check rows. Single-pass parent scan for fn silent-pick recording (review 40548). Co-authored-by: Cursor <cursoragent@cursor.com>
…hecks Read-only follow-on to #6936: instrument global_bare LCP and lookup_resolved_sig first-hit arms (thread-local, enable/disable bracket), add ContainmentResolveVia / neither_bound subclass tags, and import_unresolved walk-vs-infer cross-check rows. Review 40558: restore first-hit short-circuit in lookup_resolved_sig when telemetry is off; full ParentSigScan only inside the census bracket. Co-authored-by: Cursor <cursoragent@cursor.com>
…uling (#6973) Folds the operator ruling of 2026-07-21 into namespace-resolution-design.md as §13. Semantics are ratified (operator, in-session: "fail loudly" / "full path required at all times + users can alias" / "familiar frontend, very strict/ precise underneath" / "this looks good"); wording is the lane's draft, operator reviews here. The rule: resolve a reference's first segment to the UNIQUE binder on its ancestor chain — zero = loud Unresolved, 2+ = located typed Ambiguous with the full candidate list + fix menu, exactly one = project downward. No nearest-wins; shadowing is a refusal (Elm precedent); refusal at the reference site. Amends §3/§6 ("exactly one nearest" -> "exactly one on the chain; multiple = refusal"). Invariant: no edit elsewhere can silently CHANGE what an existing reference means — only loudly break it. Fallback chains (nearest-wins / global-unique-fallback / first-hit / silent-pick) rejected as a class; uniqueness replaces priority order (Rule 2 on the ancestor chain). Also captures: aliases as ordinary binding nodes (import->alias transmutation, source of truth = the walk's resolved target, #6936 buckets); global_bare dies as a resolution mechanism (migration-oracle only, then delete); builtins bind at root (dissolves the prelude-shaped neither_bound class); the (Y) expected-type filter FLAGGED not ruled (adjacent to the rejected fallback class, needs its own ruling); and sequencing (§10 step-1 in flight #6968; transmutation lands with-or-before the strict flip, never imports-first). Relayed from sunny-wolf-225 (fix governor); gates Phase 1 dispatch. Sibling to the DESIGN.md #6809 gate-discharge doc fix (#6969), kept separate to preserve that PR's approvals. Co-authored-by: Brian Searls <briansrls@gunb.ai> Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The 12 per-file rows caused importer-missing cascade (live hubs like 00_compile import excluded scaffolds). Census unblock uses slice-1's ephemeral --exclude-subpath CLI layer (83-module closure), not authority rows — comparability with #6936 denominator preserved. Co-authored-by: Cursor <cursoragent@cursor.com>
* resolution divergence census slice 2: silent-pick telemetry + cross-checks Read-only follow-on to #6936: instrument global_bare LCP and lookup_resolved_sig first-hit arms (thread-local, enable/disable bracket), add ContainmentResolveVia / neither_bound subclass tags, and import_unresolved walk-vs-infer cross-check rows. Single-pass parent scan for fn silent-pick recording (review 40548). Co-authored-by: Cursor <cursoragent@cursor.com> * resolution divergence census slice 2: silent-pick telemetry + cross-checks Read-only follow-on to #6936: instrument global_bare LCP and lookup_resolved_sig first-hit arms (thread-local, enable/disable bracket), add ContainmentResolveVia / neither_bound subclass tags, and import_unresolved walk-vs-infer cross-check rows. Review 40558: restore first-hit short-circuit in lookup_resolved_sig when telemetry is off; full ParentSigScan only inside the census bracket. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Census slice 2 * WIP: Census slice 2 * WIP: Census slice 2 * WIP: Census slice 2 * Revert partial whole_tree_strict_resolve exclusion bake from #6967. The 12 per-file rows caused importer-missing cascade (live hubs like 00_compile import excluded scaffolds). Census unblock uses slice-1's ephemeral --exclude-subpath CLI layer (83-module closure), not authority rows — comparability with #6936 denominator preserved. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Read-only census comparing
lookup_resolved_sig(first-hit overfunc_env.parents) against the landed SymbolIndex containment walk (symbol_index_lexical_lookup+ direct-import selective binding + global-bare fallback) at every bare call site. No resolution or dispatch behavior was changed — census code only observes both mechanisms' return values.Harness:
resolution_divergence_censusbin +resolution_divergence_census_*helpers incli_run.rs.Census execution
Command (bounded scope — see below):
Full raw output captured in this PR's census run (2026-07-20).
Scope (honest bound)
dag+src/v2(witness_layer_roots)gunbc.ci_layer_roots.whole_tree_resolve_exclusion_substrings(904 modules)Strict whole-tree resolve over the unbounded floor corpus currently fails on 27 seed modules; excluding them cascades to 83 total before the graph compiles. This is a partial census over the strict-resolve-green subset, not the full 2255-module index.
Bucket counts
Diverge rows
None on the bounded floor corpus. Every site where both mechanisms bound a callee, they bound the same declaration (node pointer or qualified path).
Positive control (harness sanity)
Planted fixture under
target/gunbc-resdiv-posctl-{pid}/(not committed — deleted fromdag/test/claim/X/):test.claim.X.twin_p:twin_sig(a: Bool) -> Booltest.claim.X.twin_q:twin_sig(a,b,c) -> Bool+twin_q_anchortest.claim.X.planted: importstwin_sigfrom twin_p,twin_q_anchorfrom twin_q; callstwin_sigResult:
Diverge=1— import chain bindstwin_q(3 params via first-hit overfunc_env.parents); containment bindstwin_p(direct-import selective binding). Executed byresolution_divergence_positive_control_planted_siteincli_run.rs#[cfg(test)].ContainmentAmbiguous (53 rows — full list)
Import chain first-hit found a binding; containment walk hit
GlobalBareAmbiguous. Homonym callees:nat_compareextdeps.git.versioning,extdeps.version.semver,v2.std.float,v2.lens.cost,v2.test.std_text.carrier_claimsstd.nat/v2.std.natrepeat_stringstd.layout,extdeps.languages.markdown,extdeps.render.terminal,tools.emit_host_transportstd.render_repeat_string_bootstrap/std.renderstring_is_emptyv2.compiler.tokenize,v2.std.qualified_name,v2.compiler.self_host,v2.lens.affected_set.entry_selection,v2.test.std_text.carrier_claimsv2.std.textsql_named_edgev2.extdeps.formats.sql_create_table_foldv2.extdeps.formats.sql_targetresolvev2.compiler.ingested_fixture_arrows,v2.compiler.source_authorityv2.compiler.resolveci_repo_root_shellv2.workflow.ci_release_build_emit,v2.workflow.ci_workflow_run_emit,gunbc.falsifier_workflowgunbc.ci_spec/gunbc.merge_admission_produceexit_oktools.floor_effect_gate_witness(6 sites)tools.ci_gatesThese are not divergences — containment refused (ambiguous global bare); import chain still bound via first-hit.
import_unresolved (1854 rows)
Containment walk bound (usually via
GlobalBareUniqueor direct-import selective binding) butlookup_resolved_sigreturnedNone. These are sites where the global-bare / containment table has a binding the import-chain first-hit never reached — evidence for re-export transitivity gaps (import surface names a symbol butfunc_env.parentschain does not carry the binding). Not counted as divergence per §12.4 bucket rules.neither_bound (739 rows)
Neither mechanism bound the callee: builtins/intrinsics, locals, or genuinely unbound call sites. Not divergence — both agree on absence.
ContainmentUnresolved triage
0 rows. No site where import chain bound but containment walk returned
Unresolved.Cost shape (§12.3 — may matter more than census)
QualifiedNamemap lookup at the calling module, not a multi-hop ancestor walk.global_bare).foldover the containment structure would be substitution, not a rewrite — unless future homonym density forces more lexical steps (only 3 sites at step 2 observed).Read-only attestation
Diff touches only census observation code in
cli_run.rs(new types +resolution_divergence_census_from_ctx,symbol_index_lexical_lookup_v1,containment_resolve_fn_v1) and theresolution_divergence_censusbin. No edits tolookup_resolved_sig,v1_compiler_infer_lookup,v1_interpreterdispatch, ordag/std/symbol_index.dag.Test plan
cargo test -p v1-compiler --lib resolution_divergence_positive_control_planted_site— positive control Diverge=1cargo run -p v1-compiler --bin resolution_divergence_census— census executed green with bounded scope (output above)cargo test --workspace/ floor witnesses (no new.dagmodules; migration-debt ratchet preserved by using bin +#[cfg(test)]not v1#[test]module)