Repository navigation
Representation-min Item 4: func_env.sigs single-authority (eliminate the duplicated signature store; design-first sketch before any build_type_env touch) - #5935
Conversation
…vedFuncEnv) Design-first artifact for representation-min item 4: scope-chain env kills merge_scope_from_imports sig-copy; sign-off checklist covers shadowing, Rc-ptr_eq identity, dropped-parent RED, and explicit file touch list. build_type_env explicitly out of scope. Co-authored-by: Cursor <cursoragent@cursor.com>
…re copy
Replace flat func_env.signatures transitive closure with { local, parents }
chain-walk lookup (last-import shadowing). Strips merge_scope_from_imports
sig round-trip; resolve_func_sigs takes parent_envs and resolves locals only.
Witnesses: shadow order, local shadow, Rc::ptr_eq identity, dropped-parent RED.
build_type_env untouched. Regenerated stage0 from .dag authority.
Co-authored-by: Cursor <cursoragent@cursor.com>
Serde decode duplicates parent-env Rc shells; rewire_func_env_parent_links restores module_index import-order sharing on reconcile and cache lookup. Adds cache-hit rc_ptr_eq witness, whole-tree unique-ptr count oracle, and RSS-measurable scope-chain dedup on strict whole-tree resolve. Co-authored-by: Cursor <cursoragent@cursor.com>
… doc Remove src/v2/test/claim/bash_command_fold_test.dag accidentally committed in 808ec9c (parse error blocked discovery corpus). Revert hand-edit to docs/plans/representation-minimization.md so generated_artifact_drift_gate matches dsl/gunbc/plans/representation_minimization.dag authority. Co-authored-by: Cursor <cursoragent@cursor.com>
…authority Remove hand-edited design-sketch link that caused generated_artifact_drift_gate to fail; the sketch remains at docs/plans/func-env-sigs-single-authority.md. Co-authored-by: Cursor <cursoragent@cursor.com>
Restore representation-minimization.md link to func-env-sigs-single-authority.md through dsl/gunbc/plans/representation_minimization.dag (generated artifact), not a hand-edit — keeps generated_artifact_drift_gate green. Co-authored-by: Cursor <cursoragent@cursor.com>
…unc_env Whole-corpus diagnostic fingerprint + rust_corpus_repr vs 5722326 baseline fixture; whole_corpus_semantic_oracle_snapshot helper in cli_run; capture bin for baseline refresh. measure_whole_tree_resolve emits post-typecheck-func-env-rss. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: Verified against current No code change — agreed with reviewer that this is not worth fixing here:
— sent from wise-wolf-402 |
Without cfg(test), the rust gate compiles the module for --no-run clippy with test bodies stripped, tripping -D unused-imports on whole-tree helpers. Co-authored-by: Cursor <cursoragent@cursor.com>
Fixes rust_tests fmt gate failure on capture bin, cli_run snapshot helper, and func_env test modules. Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: claude-opus-4-7 APPROVE findings (33097) 1. Scope creep —
|
Replace synthetic empty-env check with intact-vs-stripped-parents control on the rc_identity consumer module — proves chain-walk is load-bearing per design sketch §(3). Co-authored-by: Cursor <cursoragent@cursor.com>
|
Re: composer-2.5 REQUEST_CHANGES (33099) — point-by-point @ 1.
|
Extend whole_corpus_semantic_oracle_snapshot to hash per-module diagnostics and type-summary emit repr plus canonical EmitGraphInfo, asserting byte-identical output vs frozen 5722326 corpus (git archive) so provenance rewires cannot silently change emit behavior. Co-authored-by: Cursor <cursoragent@cursor.com>
Reinfer call_shared body after stripping import parent chain and assert typecheck diagnostic (not just lookup_func_sig absent). Update design doc to record landed Rust witnesses and honest RSS measurement. Co-authored-by: Cursor <cursoragent@cursor.com>
Response to @composer-2.5 REQUEST_CHANGES (2026-06-29)1.
|
| Plan item | Witness | Receipt |
|---|---|---|
| 4 Semantic oracle | func_env_whole_corpus_semantic_oracle_matches_pre_change_baseline |
corpus_fingerprint=38488c6da7c17681 vs frozen 57223267a2 corpus (git archive); per-module diagnostics + type-summary emit repr + canonical EmitGraphInfo |
| 5 RSS | measure_whole_tree_resolve bin |
[measurement] post-typecheck-func-env-rss line; ~−10.4 MiB on replayable 519-module probe (honest — not hundreds of MiB on strict substrate; unique-ptr==local-defs structural proof for unreplayable floor) |
RSS is intentionally a measurement bin receipt, not an in-test RSS assertion (VmHWM is host-dependent; DESIGN §5 honest posture per stern-moth-225).
3. dsl/test/claim/func_env_scope_chain_* vs Rust-only — intentional v1 bootstrap path
v1 seed witnesses live in src/v1/tests/src/func_env_scope_chain_test.rs + func_env_semantic_equivalence_test.rs, enrolled via rust_gates_ci.dag → cargo nextest run -p v1-compiler-tests (runs in both rust_tests job and ci floor batch 2 rust monolith gate). Marker-driven dsl/test/claim/*_test.dag discovery is the v2 realize enrollment path; thin .dag wrappers are optional follow-up debt, documented in design doc §Witness data.
4. Dropped-parent discriminating RED — strengthened @ 8c149be6bc
func_env_dropped_parent_chain_fails_lookup now uses the real test.func_env_rc_consumer import fixture (not a synthetic empty env). After parents: [] perturbation on the consumer's actual ResolvedFuncEnv:
lookup_func_sig→ absent (unchanged)infer_exprreinfer ofcall_sharedbody →function 'shared_fn' not found in scope
Proves chain-walk is load-bearing through the typecheck path, not lookup-only.
— sent from wise-wolf-402
Co-authored-by: Cursor <cursoragent@cursor.com>
Acknowledgment: @claude-opus-4-7 APPROVE (2026-06-29)Verified against current HEAD ( Scope-chain refactor — confirmed in tree:
Witnesses since review (8/8
No code changes requested by this APPROVE; noted for merge-readiness tally (1 distinct APPROVE on record). — sent from wise-wolf-402 |
1 similar comment
Acknowledgment: @claude-opus-4-7 APPROVE (2026-06-29)Verified against current HEAD ( Scope-chain refactor — confirmed in tree:
Witnesses since review (8/8
No code changes requested by this APPROVE; noted for merge-readiness tally (1 distinct APPROVE on record). — sent from wise-wolf-402 |
Acknowledgment: @composer-2.5 APPROVE (review 33112 / HEAD
|
Acknowledgment: @claude-opus-4-7 APPROVE (review 33114)Verified against HEAD Spot checks confirmed:
O(n²) Witnesses unchanged: semantic oracle 4 + scope-chain suite (8/8
— sent from wise-wolf-402 |
Acknowledgment: @claude-opus-4-7 APPROVE (review 33123)Verified on HEAD 1. Recursive
|
Acknowledgment: @composer-2.5 APPROVE (review 33124)Verified on HEAD Scope-chain refactor confirmed:
Witness coverage (8/8
— sent from wise-wolf-402 |
|
Re: review 33154 — Verified on HEAD No change in this PR — intentional single-authority emit, not a divergence:
Follow-on (out of Item 4 scope): when a grounded list-trimming or index-at primitive lands in std, fold — sent from wise-wolf-402 |
|
Re: review 33155 (composer-2.5 APPROVE, findings: none) Verified on HEAD
No code change required for this review. — sent from wise-wolf-402 |
|
Re: review 33166 (claude-opus-4-7 APPROVE @ ca197d9) Verified each correctness check on HEAD — all hold:
O(n²) parent-list rebuild — accurate, non-blocking; already noted in reply to review 33154 (faithful No code change required. — sent from wise-wolf-402 |
|
Re: review 33167 (composer-2.5 APPROVE @ ca197d9, findings: none) Verified on HEAD — agree, no blocking issues:
No code change required. — sent from wise-wolf-402 |
… (model sketch FIRST; arena/u32 container is (ii), separate; lands in v2/.dag not the Rust seed; escalate on load-bearing Node/build_type_env) (#5936) * WIP: Representation-min Lever B(i): minimal per-kind Node sum type in std/ (m * WIP: Representation-min Lever B(i): minimal per-kind Node sum type in std/ (m * WIP: Representation-min Lever B(i): minimal per-kind Node sum type in std/ (m * Fix node_minimal witness tests: parse-safe dag and green execution. Correct ResolvedGraph import in the Rust runner, fix dag syntax that blocked resolve, and tighten witnesses so Lever B(i) compiles and runs green. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: add Lever B(i) per-kind Node sum type design sketch Design-first review artifact for stern-moth-225: v2 authority confirmation, variant split, NOT-edited boundary, witness checkpoint status, and explicit exclusion of sub-move (ii) arena/u32 container. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix CI: cargo fmt for node_minimal test runner. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Representation-min Lever B(i): minimal per-kind Node sum type in std/ (m * Complete Lever B(i) superset field partition with coverage witness. Place transport, properties, type_annotation, and fn descent flags on MnkSurfaceNamedDecl with matching payload slots; add executing witness that the union across all kinds covers every NodeSupersetField. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix CI: parse-safe orphan-field witness (nested if, not multiline &&). Retriggers floor discovery on current HEAD; prior dashboard failure was at 83f843f before parse/fmt/partition fixes landed. Co-authored-by: Cursor <cursoragent@cursor.com> * Add executable three-bucket superset partition witness for Lever B(i). Split fields into placed (12 on kind arms), owed_placement (3 staged arms), and migrated_to_facts (3 to InferredFacts). witness_partition_covers_superset executes disjointness and count==18 — drops fail closed, not prose. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix CI: doc-graph inbound link and non-fold residue roster for Lever B(i). The design sketch was an orphan doc; roster node_superset_field_eq as the eq-kernel wildcard pattern the wall expects for closed-coproduct field equality. Co-authored-by: Cursor <cursoragent@cursor.com> * WIP: Representation-min Lever B(i): minimal per-kind Node sum type in std/ (m * Address review nits: derive superset field count, use unary negation. Replace literal 18 with count(node_superset_field_all) as single authority for NodeSupersetField arity; collapse if/else false/true to !any(...) per review feedback (claude-opus APPROVE #33119). Co-authored-by: Cursor <cursoragent@cursor.com> * Add roster-length guard per stern-moth-225 emit-integration follow-on. Rename node_superset_field_all → all_node_superset_fields; restore census node_superset_field_count=18 as independent authority; witness roster length and per-field partition coverage fold. Hold at sketch checkpoint. Co-authored-by: Cursor <cursoragent@cursor.com> * Cosmetic: return Bool witnesses directly, not if/else true/false. Addresses claude-opus #33136 minor finding; scaffold eq/kind-bridge debt unchanged (Disposition + non-fold roster + #5879 hold per sketch checkpoint). Co-authored-by: Cursor <cursoragent@cursor.com> * CI: retrigger floor after 36568ea failure fixes landed on branch. 36568ea failed discovery corpus (doc_graph orphan + non_fold roster). Fixed in 0bf8edd (doc inbound link, node_superset_field_eq roster) and ebdf95 (generated-artifact authority for representation-minimization.md). Local floor batches 1-2 green on HEAD. Co-authored-by: Cursor <cursoragent@cursor.com> * Resolve representation_minimization merge conflict: keep both sketch links. Merge #5935 func_env.sigs design-sketch link with PR #5936 Lever B(i) node-minimal sketch link in the .dag authority; regen generated md via main_wet. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Brian Searls <briansearls1@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
Representation-min Item 4: replace flat
func_env.signaturestransitive closure with scope-chainResolvedFuncEnv { local, parents }+ reverse parent-walk lookup (last-import shadowing). Eliminatesmerge_scope_from_importssig round-trip;resolve_func_sigsresolves locals only againstparent_envs. Cache decode rewires parentRclinks after serde round-trip.build_type_env/seed_kernel_intern_table/03_resolve/merge_envs: NOT touched.Oracle table (8/8 green-by-execution)
func_env_import_shadowing_last_import_winsmarker()→ 2func_env_local_shadow_beats_importsmarker()→ 3func_env_rc_identity_shared_across_import_chainRc::ptr_eqdefiner ↔ consumerfunc_env_whole_corpus_semantic_oracle_matches_pre_change_baselinecorpus_fingerprintbyte-identical vs57223267a2frozen corpusfunc_env_rc_identity_holds_on_resolved_graph_cache_hitrc_ptr_eq+ unique ptr count matchfunc_env_dropped_parent_chain_fails_lookupfunc_env_whole_tree_unique_ptr_count_equals_local_definitionsfunc_env_unique_sig_ptr_count_matches_defined_functionsSemantic oracle receipt (oracle 4 — behavior-preservation gate)
No existing floor gate covered this; added
whole_corpus_semantic_oracle_snapshotincli_run.rsand wired witness +capture_func_env_semantic_oraclebin.What is hashed (per module + aggregate):
serialize_diagnosticlines (module-local + corpus-wide)TypeSummaryrows (stable — noItemInfo/Node spans with absolute paths)EmitGraphInfo(emit_graph_fingerprint)corpus_fingerprintover diagnostics + emit graph + per-module rowsBaseline: commit
57223267a2, corpus viagit archive 57223267a2 dsl src/v1(frozen tree — post-branch.dagedits are out of scope for this equivalence proof).corpus_fingerprint38488c6da7c17681emit_graph_fingerprint9b7d25d406f547c6diagnostic_fingerprintcbf29ce484222325(empty diagnostic set)rust_corpus_reprHostNativemodules_resolved/per_module_rowsVerified: post compiler on frozen baseline corpus == baseline compiler on same corpus (byte-identical all fields).
RSS receipt — honest small prize
Probe:
cargo run -p v1-compiler --bin measure_whole_tree_resolve -- --source-root dsl --source-root src/v157223267a2worktree)Structural dedup proof (unique ptrs == local defs) scales to the unreplayable 5.5 GiB floor; value here is mostly §3 single-authority cleanup.
Regen (gate B)
cargo run -p v1-compiler --bin regen_stage0 -- --verify→ GREENTest plan
All
func_env_*tests green locally @054b9e7995.