Repository navigation
ConstructorCallAdmission: refuse cross-module calls not listed in admit_callers - #7860
Conversation
…ed calls. Post-resolution check via func_decl_binding_for_call and decl_ref caller coords on InferScope; witnesses and stage0 regen at fixed point. Co-authored-by: Cursor <cursoragent@cursor.com>
…ngs. Imported callees resolve defining-module path via func_decl_owner_module when the name is not in str_bindings; local_binding_for_item preserves item.properties on fn census nodes so fn_admit_callers can read admit_callers. Co-authored-by: Cursor <cursoragent@cursor.com>
Response to review 48870 (composer-2.5 REQUEST_CHANGES)Verified and fixed in 1. Wrong owner for imported callees — 2.
Opus non-blocking (review 48868): — sent from royal-crab-235 |
PR #7838 had an empty diff after #7860 landed constructor admission on main, which made per-head modeling-coherence unavailable (fail-closed). Update the infer frontier note and direct-door behavioral-probe note so the PR carries reviewable .dag modeling receipts. Co-authored-by: Cursor <cursoragent@cursor.com>
Resolve merge conflicts by taking main's ConstructorCallAdmissionRefused surface (#7860), updating lookup fn_admit_callers to decl_ref API, adding FuncSigCallerNotAdmitted infer match arms, and regen stage0 emit. Co-authored-by: Cursor <cursoragent@cursor.com>
… constructor (#7859) * WIP: ConstructorReferenceAdmission: refuse unlisted call edges to a sealed co * WIP: ConstructorReferenceAdmission: refuse unlisted call edges to a sealed co * Rebase on main and regen stage0 for ConstructorReferenceAdmission. Resolve SourceAnnotationRefused merge in 00_core and restore infer import list after rebase; run regen to fixed point so CI regen_verify_gate passes. Co-authored-by: Cursor <cursoragent@cursor.com> * Import fn_admit_callers in infer_lookup and regen stage0. Fixes build failure: emitted lookup calls fn_admit_callers without importing it. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix compile after ConstructorReferenceAdmissionViolation diagnostic. Add cli_run histogram match arms for the new variant and align the compiler_tests witness with ConstructorReferenceAdmissionViolation. Co-authored-by: Cursor <cursoragent@cursor.com> * Register constructor admission witness in compiler_tests_rust.dag. The hand-maintained compiler_tests.rs already carried constructor_call_admission_refuses_unlisted_cross_module_caller but compiler_tests_rust.dag did not emit it, so regen_verify_gate redded with a stale compiler_tests.rs diff. Add ct_constructor_call_admission_test so stage0 regen and the committed witness stay aligned. Co-authored-by: Cursor <cursoragent@cursor.com> * Rebase on main (#7860) and align lookup admission with infer authority Resolve merge conflicts by taking main's ConstructorCallAdmissionRefused surface (#7860), updating lookup fn_admit_callers to decl_ref API, adding FuncSigCallerNotAdmitted infer match arms, and regen stage0 emit. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
main is red. Two legitimate module-owned declarations share one spelling: gunbc.build_cache_ensure ensure_is_converged(EnsureBuildCacheAdmission) gunbc.compile_pool_ensure ensure_is_converged(EnsureCompilePoolAdmission) Both consumers called the name bare, so no import selected an identity, and once the second declaration entered the pool NEITHER resolved — including build_cache_ensure_test.dag, untouched for 34 hours. That asymmetry is the tell: the file that breaks and the file that changed are different files, so this is a pool-membership resolution defect, not a defect in either module. A semantic merge conflict, which is why both sides merged green with no textual conflict: #7860 (339bf59, Aug 5) and #7937 (523a6d3, Aug 7) share no file, no line, no directory below dag/. Each was correct alone — one candidate for the bare name. Only the union is invalid. Repair is the two missing imports. NOT a rename: build_cache_ensure_is_converged / compile_pool_ensure_is_converged would buy accidental global uniqueness at the cost of every declaration carrying its module name lexically, against DistinctSameSpelledDeclarationsPreserved. The module path already carries the namespace; the importer chooses the identity. Production declarations unchanged. Verified by execution: whole-tree compile-clean at the gate's modeled invocation (--source-root dag --source-root src/v2 --source-root src/v1 --dependency-pool-index primary-precedence --target dag) exits 0 with zero "not found in scope" diagnostics. Explicit declaration identity therefore does dominate the ambient dependency pool — no resolver defect underneath. Claude-Session: https://claude.ai/code/session_012DrzU3z7PJzhN5mxvZAfAs Co-authored-by: Claude <noreply@anthropic.com>
Summary
ConstructorCallAdmissionRefusedwhen a callee withadmit_callersis invoked from a module/decl not in the permitteddecl_reflist.func_decl_binding_for_call(imported and census paths), with caller identity carried onInferScope.caller_decl_name.constructor_call_admission_refuses_unlisted_cross_module_callerand stage0 regen at fixed point.Split from the mixed Lane 4 behavioral-qualification work (#7838 / #7792) per operator disposition: horn construction wall only.
Test plan
regen_stage0 --verify(fixed point)cargo check -p v1-compiler-tests --testsMade with Cursor