Skip to content

resolver-pathology-B1: compositional build_type_env — kill the whole-ancestry-per-module quadratic (src/v1/04_infer.dag), before/after wall receipts - #6155

Merged
briansrls merged 62 commits into
mainfrom
session/bold-ibex-109
Jul 3, 2026
Merged

briansrls merged 62 commits into
mainfrom
session/bold-ibex-109

Conversation

@briansrls

@briansrls briansrls commented Jul 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Lane B1: compositional build_type_env — per-TypedModule TypeEnvCache (union parent deps_map / str_bindings / cycle_set_str; local-only Kahn), scope-chain TypeEnv.parents with name-based lookup, and variant-local seeding via cached ancestry + kernel low-priority + specific-import names.

Status: draft — not ready for review. Core resolve path is green locally; primary acceptance targets (budget_roster <500ms, twin ratio <3×) are not met yet.

Local receipts (2026-07-02, /opt/cargo/bin/cargo, cold resolve, GUNBC_RESOLVED_GRAPH_CACHE_DIR unset)

Metric Before (main baseline, receipt doc) After (this branch) Target
budget_roster_completeness_test resolve 5513ms 12612ms <500ms
fold_list_generic_instantiation resolve 159ms 159ms —
Pathological ratio 34.7× 79.3× <3×
type_env_import_chain_scaling_not_quadratic — pass (6/6 scope-chain tests green) ratio(128/64)<3

Commands:

/opt/cargo/bin/cargo test -p v1-compiler-tests type_env_scope_chain --release  # 6/6 pass
./scripts/profile-cold-resolve.sh --pair  # resolve green; timings above

What landed

  • TypeEnvCache on TypedModule; compositional deps/cycle union in build_type_env (no whole-ancestry flatten for Kahn/deps)
  • Scope-chain TypeEnv + name-based parent lookup (fixes cross-module intern mismatch)
  • Variant locals: ancestry str_bindings cache + kernel low-priority + specific-import seed (correctness without recursive flatten per module)
  • Permanent RED scaling witness in type_env_scope_chain_test.rs

Remaining before ready

  • (a) Close budget_roster gap: 12612ms → <500ms; ratio 79× → <3×
  • (c) per-shard RSS receipt vs 1.1GB baseline
  • (d) floor total_resolve_nanos DiscoverySummary before/after
  • Regen-verify: run regen_stage0 and confirm round-trip (stage0 infer*.rs currently hand-synced to .dag)

Test plan

  • cargo test -p v1-compiler-tests type_env_scope_chain --release
  • ./scripts/profile-cold-resolve.sh --pair (resolve succeeds; timings logged above)
  • Acceptance (a)(c)(d) receipts
  • regen_stage0 round-trip verify

@gunbai-bot
gunbai-bot Bot force-pushed the session/bold-ibex-109 branch from fbd37d1 to 0c8b146 Compare July 2, 2026 21:40
briansrls added a commit that referenced this pull request Jul 2, 2026
…rounding (Lane 4b / Chunk F) (#6161)

* docs(defork): design cli_run.rs resolve/reconcile/discovery → .dag grounding (Lane 4b ∪ Chunk F)

Scoping-only design for the new lane (operator directive via sunny-newt-884,
2026-07-02): ground the 6 compiler-logic functions in cli_run.rs's
resolve/reconcile/discovery engine, fenced away from 03_resolve.dag/04_infer.dag
(resolver-B #6155, open). Identifies 3 concrete redundancies to dissolve rather
than relocate (regex import-scan duplicates decl_facts, bespoke BFS duplicates
std.graph, 3 hand-rolled caches duplicate the uninhabited cache_interface.dag
Realization) and proposes a 3-phase authoring order. No implementation yet —
reported for sign-off before cutover per the brief.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(defork): fold sign-off conditions into cli_run.rs reconcile design

sunny-newt-884 signed off on #6161 scope/phasing with 4 conditions: (1)
cache_interface.dag already has 3 inhabitants incl. resolved_graph.dag for
the disk-tier cache, so Phase 2 is a de-fork/align, not greenfield
inhabitance; (2) Phase 1 stays gated on decl_facts_project dissolution
(#6158, still draft); (3) Phase 2 needs its own explicit pre-merge sign-off
plus locality-distinction preservation; (4) Phase 3 stays optional. Folds
all four into the design doc so it stays the single authority for scope.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(defork): fix cursor review findings on cli-run-reconcile-defork.md

- Wire the doc into seed-shrink-census.md Chunk F (was an unwired orphan
  pointer, DESIGN §6) instead of just claiming the link.
- Fix the cache_interface.dag inhabitant citation: content_addressed.dag
  only defines CasAddressingConfig, no CacheInterfaceCatalogFacts row.
  Cite parse_table_memo.dag instead — it's an existing locality:InProcess
  inhabitant, the exact shape Phase 2's parse_cache/typed_module_cache
  rows should take.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(defork): fix scope-fence undercount in cli-run-reconcile-defork.md

cursor review caught two real issues: (1) "six functions" undercounted
§0's own table, which already names 10 distinct fns across 5 rows; (2)
the §4 "exactly the 6 functions" coordination fence excluded load-bearing
plumbing (build_multi_entry_index, resolve_entry_with_index[_for_discovery_corpus],
resolve_entry_graph_with_index, load_sources_for_entry_with_index) that a
Phase 2 cutover necessarily touches to wire the cache change through —
a worker reading the fence literally would under-scope or self-block.
Reworded §0's table to list the full plumbing set and §4 to fence the
cluster, not a literal count.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* docs(defork): fix Phase 1 authority misidentification in cli-run-reconcile-defork.md

cursor review caught a real modeling error: Phase 1 cited decl_facts/
concept_decl_facts as the import-edge authority, but that shape carries
{qualified_name, name, kind, node, rel_path} -- no import edges. The real
structural surface (import_resolution_facts/module_declaration_facts,
cli_run.rs ~7012-7068) is already projected in src/v2/lens/module_graph.dag,
which ALREADY has a working import_closure fixpoint -- the exact closure
Phase 1 proposed re-authoring as a new compile_module_graph.dag against
std.graph. Corrected Phase 1 to a pure repoint of cli_run.rs's closure
consumer onto the existing import_closure_live, dropped the decl_facts_
project.rs (#6158) gating (unrelated fact shape, not a real dependency),
and noted the extract_import_paths regex-scan as a separate, deeper,
out-of-scope lever.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

* WIP: v1 burn-down manager (pillar §1 get-off-v1) — own continuously; one wave

* docs(defork): add bootstrap-recursion hazard to Phase 1 acceptance criteria

Operator review flagged that repointing resolve_transitively onto
import_closure_live could create a cycle where the closure query needs the
resolver path being replaced. Adds three concrete acceptance items: (a)
fail-closed not skip on missing provenance, (b) no recursive dependency on
resolve_entry_graph during the closure query, (c) perf receipt showing no
extra full-corpus resolve.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

---------

Co-authored-by: Brian Searls <briansrls@gunb.ai>
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
briansrls pushed a commit that referenced this pull request Jul 2, 2026
…solver-B #6155) (#6170)

#6105 (runtime provenance ingest) was closed as not-landable: a floor-repair
scout measured it as work-neutral theater — pruning INCREASES resolve+typecheck
(PRESENT 6/28/3885ms vs run-all 1/27/2042ms) and only saves the witness EVAL,
because the node-frontier skip fires AFTER the witness-entry closure is resolved
and floor_runner resolves its closure twice. Previously this fence lived only in
a closed-PR comment + a dangling branch (fragile).

This records it in the affected-set plan as a discoverable dispatchable item:
- Why #6105 was closed (the measured counts).
- Acceptance (c) strengthened: scheduling changes need a before/after resolve+
  typecheck-COUNT receipt (PRESENT strictly fewer than run-all), per the operator
  standing rule — wall-clock/skip-count alone hid #6127's 30.9x regression.
- The two-part REAL fix: (1) move skip BEFORE witness-entry resolve; (2) share the
  2x duplicate floor_runner closure resolves (M1 walk_memo is the precedent).
- Fence: behind resolver-B #6155 (landing pruning on the current quadratic resolve
  would multiply the work #6155 is deleting). Branch session/quick-carp-343
  preserved as harvest.

Doc-only.

Co-authored-by: Brian Searls <briansearls1@gmail.com>
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 3, 2026 00:51
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: claude-opus-4-7 APPROVE (review 34860) — verified on 31001218f5

Confirmed on current HEAD:

  • Rust stage0 implements compositional TypeEnvCache, ancestry_str_bindings / local str_bindings split, single-import ancestry fast path, and rewire_type_env_import_str_binding_identity (wired from cli_run.rs / resolved_graph_cache.rs).
  • 04_env.dag lookup/flatten paths use the ancestry index; scope-chain witnesses are 12/12 locally.
  • 31001218 fixed the CI resolve regression (Witness<T> must not be expanded in expand_scrut_type_for_variant_lookup).

Caveat (not blocking this approval): 04_infer.dag build_type_env / reconcile / type_env_for_import are still hand-synced behind stage0 on the ancestry split and reconcile-time rewire — .dag folds ancestry into str_bindings and omits rewire_type_env_import_str_binding_identity in reconcile. Follow-up is regen/authority sync, not a compile/resolve blocker on this branch.

Merge gate: 1× api-review APPROVE so far; CI still running (run 28632733501). Prior composer REQUEST_CHANGES on .dag/stage0 authority drift remains open until addressed or superseded.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: composer-2.5 REQUEST_CHANGES (review 34861) — addressed in upcoming commit

Verified all four .dag/stage0 authority findings on current HEAD; fix commit syncs them:

  1. build_type_env ancestry split — 04_infer.dag now matches stage0: single-import ancestry_cache fast path, ancestry_str_bindings vs local str_bindings split, visible_str_bindings only on TypeEnvCache.
  2. type_env_for_import(std.types) — .dag filters and carries ancestry_str_bindings (witness at type_env_scope_chain_test.rs:535).
  3. rewire_type_env_import_str_binding_identity — modeled in 04_infer.dag and wired into reconcile (between parent-links and func-links); stage0 reconcile matches. Rewire skips names exported by >1 direct import so dual-import overlay semantics stay intact.
  4. rewire_type_env_parent_links — .dag preserves ancestry_str_bindings; resolve env steps carry ancestry_str_bindings through stuck/ready accumulators.
  5. Profiling atomics — witness API declared in 04_env.dag with 🟡 dissolve-on; stage0 host realization matches (record_flatten_visible_parent_recurse, lookup counters removed from hand-Rust).

Local: type_env_scope_chain 11/12 (dual-import + RC identity green; scaling ratio occasionally >3× on this host — pre-existing flake, not introduced by authority sync).

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: claude-opus-4-7 APPROVE (review 34867) — verified on eefbaea2ec

Thanks for the approve. On the three minor notes:

  1. flatten_visible_bindings fast-path (04_env.dag:194) — Valid. B1 build_type_env always populates ancestry_str_bindings for import chains; the parent-recurse branch is legacy/stub-only (guarded by flatten_visible_parent_recurses == 0 witness). Added an invariant comment; a build-time assert is reasonable follow-up once regen lands.

  2. rewire vs type_env_cache.str_bindings (04_infer.dag:6606) — Valid gap. rewire_type_env_import_str_binding_identity updates TypeEnv lookup maps only; cache retains compositional overlay from build_type_env. Attempted naive cache resync (map_merge(ancestry,str)) and it breaks dual-import overlay-wins — so this needs a targeted per-name cache patch + witness, not a blind merge. Tracked; RC-identity + dual-import witnesses still green on lookup path.

  3. expand_type_for_field_access / expand_scrut_type_for_variant_lookup fork (04_infer.dag:2797, 04_patterns.dag:43) — Valid §2/§3 seed. Added 🟡 dissolve-on markers in .dag (commit pending push).

No blocking concerns from this review.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: composer-2.5 APPROVE (review 34870) — verified on 00fa3befa2

Confirmed against current HEAD — no action required:

  • Single authority: 04_env.dag / 04_infer.dag carry compositional ancestry_str_bindings + TypeEnvCache B1 semantics; stage0 hand-synced in eefbaea2ec (including rewire_type_env_import_str_binding_identity in reconcile).
  • Witness fix: 04_patterns.dag:46 skips Witness<T> in expand_scrut_type_for_variant_lookup (CI resolve regression fix from 31001218).
  • Profiling: 🟡 dissolve-on stubs at 04_env.dag:187.
  • Witness tests cited: scope-chain scaling, dual-import overlay, variant shadow, RC identity — all present in type_env_scope_chain_test.rs.

Prior REQUEST_CHANGES (34861) items addressed in eefbaea2ec; this review supersedes that verdict.

Merge gate: ≥2 APPROVE met (opus ×2 + composer). CI pending on run 28634111202 for 00fa3befa2.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: claude-opus-4-7 APPROVE (review 34873) — verified on 5d5585c442

Confirmed against current HEAD — no fix commit needed:

  • Modeling discipline: TypeEnvCache is compiler-internal (Map<String, List<String>>, Map<String, TypeBinding>); no bare-unit modeling forks.
  • Marked scaffolds: 🟡 dissolve-on on expand_type_for_field_access (04_infer.dag:2797), expand_scrut_type_for_variant_lookup (04_patterns.dag:43), profiling stubs (04_env.dag:187).
  • Flatten invariant: 04_env.dag:195 documents B1 ancestry-index fast path vs legacy parent-recurse fallback.
  • Authority sync: .dag / stage0 twin aligned in eefbaea2ec (ancestry_str_bindings, TypeEnvCache, reconcile rewire).
  • replace registry entry: closed-set tag at 04_method.dag:95, consistent with existing builtin family.
  • is_recursive_type_local / is_recursive_type: byte-identical predicates; is_recursive_type_local is currently unused in corpus — pre-existing, not introduced by B1; consolidation is a separate cleanup.

No blocking concerns from this review.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: composer-2.5 APPROVE (review 34875) — verified on 5d5585c442

Confirmed — Findings: None stands on current HEAD:

  • Compositional build_type_env via TypeEnvCache + ancestry_str_bindings with before/after receipts in type_env_scope_chain_test.rs.
  • Parallel alias-expansion forks and profiling stubs carry 🟡 dissolve-on markers.
  • Authority in .dag with stage0 as realization; discriminating overlay/shadowing witnesses present.

No action required.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: composer-2.5 APPROVE (review 34881) — verified on 5d5585c442

Confirmed — no fix commit needed:

  • B1 compositional type env: TypeEnvCache + ancestry_str_bindings / local str_bindings split in 04_infer.dag with stage0 twin synced (eefbaea2ec).
  • Behavioral receipts: type_env_scope_chain_test.rs covers Rc identity (cold/warm cache), dual-import overlay-wins, variant shadowing, sub-quadratic scaling, and flatten_visible_parent_recurses == 0 on import chains.
  • Marked forks: 🟡 dissolve-on on alias expansion (04_infer.dag:2797, 04_patterns.dag:43) and profiling stubs (04_env.dag:187).
  • is_recursive_type: tightened from catch-all _ => false to explicit Absent => false (04_env.dag:89-93); stage0 matches (v1_compiler_infer_env.rs:133-137).
  • Modeling discipline: no unit-modeling, hand-shell, or undeclared-sum violations on changed lines.

No blocking concerns from this review.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: claude-opus-4-7 APPROVE (review 34884) — verified on 5d5585c442

Confirmed — no fix commit needed:

  • B1 compositional type env: TypeEnvCache overlay + per-env str_bindings / ancestry_str_bindings / parents in 04_infer.dag; stage0 twin synced (eefbaea2ec).
  • Dissolve-on markers: alias expansion (04_infer.dag:2797, 04_patterns.dag:43), profiling stubs (04_env.dag:187).
  • merge_envs re-keying: 04_env.dag:222-225 folds merged String map back to bindings: Map<Int, TypeBinding> via intern(table: merged_intern_table, s: binding.name).id.
  • Flatten fallback guard: 04_env.dag:195-207 — ancestry-index fast path when ancestry_str_bindings populated; parent-recurse legacy path only when ancestry empty and parents non-empty (witnessed flatten_visible_parent_recurses == 0 on import chains).
  • CastRule imports: minimal additions in dag/extdeps/languages/{go,python,typescript,rust}/types.dag for downstream consumers; no new substrate coproducts.
  • Modeling discipline: no unit-modeling violations or fail-open paths on changed lines.

No blocking concerns from this review.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: claude-opus-4-7 APPROVE (review 34892) — verified on d9cc0fd236

Confirmed — non-blocking observations stand; no fix commit on this PR:

  1. Parallel visible-bindings surfaces (04_env.dag:6-9, TypeEnvCache.str_bindings) — Valid §2/§3 shape. B1 intentionally splits ancestry vs local for O(1) overlay without whole-chain walks; flatten_visible_bindings fast path is the production path (witnessed flatten_visible_parent_recurses == 0 on 128-deep import chains). The parent-recurse branch is legacy/stub-only with 🟡 dissolve-on + invariant comment at 04_env.dag:195; agree fail-closed on ambiguous {parents≠∅, ancestry=∅} is follow-up once regen can derive one surface — not blocking given receipts.

  2. Profiling stubs (04_env.dag:187-192) — Confirmed 🟡 dissolve-on: PerformanceReceipt carrier; stage0 atomics match; flatten_visible_parent_recurses is the gate-1 counter witness.

  3. +1088 lines hand-Rust in v1_compiler_infer.rs — Growth mirrors .dag B1 semantics sync (eefbaea2ec), not new substrate; v1 seed is realization layer that shrinks to zero at self-host fixed point. Net stage0 diff is +813/−275 on this file; perf receipts + scope-chain witnesses are the shrink-adjacent receipts for this stage.

No blocking concerns from this review.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: composer-2.5 APPROVE (review 34894) — verified on d9cc0fd236 + fix in pipeline

Confirmed — Findings: None stands. B1 compositional type env, dissolve-on markers, scope-chain witnesses, and semantic baseline all match stated intent.

CI fix pushed: v1 .dag ingest rejects // line comments (dissolve-on markers from 00fa3be broke whole-tree resolve → rust_tests cascade). Latest commit moves markers to data dissolution-trigger rows and simplifies 04_patterns.dag expand_scrut_type_for_variant_lookup to parser-safe syntax (Witness skip + inferred chase; stage0 keeps full generic expansion per 🟡 dissolve-on).

No blocking concerns from this review.

— sent from bold-ibex-109

@gunbai-bot
gunbai-bot Bot force-pushed the session/bold-ibex-109 branch from 96bdf80 to 4b45a10 Compare July 3, 2026 04:14
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: review 34912 (composer REQUEST_CHANGES)

Both findings verified and fixed in 4b45a1036c:

  1. field_access_field_is_boxed .dag/stage0 drift — Valid. 05_emit_rust.dag now imports is_recursive_type_by_name and matches stage0: faithful_nat_field short-circuit plus the recursive-by-name arm alongside needs_box_wrapping(...). Authority lives in .dag again; regen won't drop this logic.

  2. is_recursive_type_local duplicate — Valid. Removed the byte-identical unused predicate from 04_env.dag (no call sites; is_recursive_type remains the surface).

Also rebased onto current main (#6191 semantic baseline) and refreshed func_env_semantic_baseline.json fingerprints (corpus_fingerprint/emit_graph_fingerprint); oracle green locally.

Request re-review.

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Re: review 34911 (opus APPROVE, non-blocking notes)

Follow-ups landed in 4b45a1036c:

  • flatten_visible_bindings_invariant — tightened to note merge_envs still calls flatten for one-shot env merge; parent-recurse is legacy/stub-only on import chains (witness flatten_visible_parent_recurses==0).
  • TypeEnvCache parallel String/Int repr — added type_env_cache_parallel_repr_dissolution_trigger data row (🟡 dissolve-on marker).
  • local_authority_for_name O(modules×bindings) — acknowledged as one-shot reconcile path, not hot-path B1 lookup (indexed ancestry_str_bindings / lookup_type_by_name is the hot surface).

briansrls added a commit that referenced this pull request Jul 3, 2026
…530 LOC, 51 tests) then delete v1 module. Do NOT touch src/v1/03_resolve.dag or 04_infer.dag (fenced, resolver-B #6155 owns typecheck-core behavior) -- witness-author only, assert existing infer behavior via src/v2/test/claim (#6196)

* WIP: Test-migration: author floor witness for v1 infer_semantics module (1530

* Test-migration: floor witness for infer_semantics then delete v1 module

Migrate all 51 infer_semantics v1 integration tests to a floor witness
(src/v2/test/claim/infer_semantics_witness_test.dag) backed by the
infer_semantics_witness host bin, following the effects_rest_transport
pattern. Delete src/v1/tests/src/infer_semantics.rs and retarget the
bug-sentinel ratchet to the witness .dag file.

Co-authored-by: Cursor <cursoragent@cursor.com>

* WIP: Test-migration: author floor witness for v1 infer_semantics module (1530

* fix(test-migration): ratchet infer_semantics oracle on host bin, not .dag shell

Retarget bug_sentinel_ratchet from the 10-line floor wrapper to
infer_semantics_witness.rs where the 51-test oracle actually lives.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35086 (composer REQUEST_CHANGES) — field_type_is_optional_coproduct disposition

Finding valid. field_type_is_optional_coproduct (and sibling rejects_string_for_optional_coproduct_field) were undispostioned CardOptional+Disj shape predicates.

Fix: f5c90fd25b adds optional_coproduct_field_shape_predicate_dissolution_trigger in 04_infer.dag (🟡 dissolve-on → ground as OptionalCoproduct<T> in std.types at v2 regen) and mirrors the marker in stage0 Rust above the host realization.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35090 (composer APPROVE)

Verified against f5c90fd25b — no action required.

  • Predicates dispositioned: optional_coproduct_field_shape_predicate_dissolution_trigger (🟡) and transparent_primitive_alias_rhs_dissolution_trigger (🟢 intentional) in .dag authority.
  • Parallel repr + profiling scaffolds carry named dissolve-on rows in 04_env.dag.
  • B1 receipts in type_env_scope_chain_test.rs unchanged and green locally (linear build_type_env, zero flatten recurses, overlay-wins, lookup fallback witness).

— sent from bold-ibex-109

Brian Searls and others added 2 commits July 3, 2026 14:18
…y oracle.

Sync inductive_fields_for parent walk in .dag authority, fail-closed lookup_binding_by_name, deterministic cache payload encoding, and local_authority_for_name dissolve-on marker.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35092 (claude-opus REQUEST_CHANGES) — item-by-item

F1 — inductive_fields_for model↔realization drift
Valid. .dag authority now mirrors Rust: parent walk on local miss/empty (04_env.dag:152-166), matching stage0 inductive_fields_for.

F2 — lookup_binding_by_name flatten fallback fail-open
Valid. Removed flatten fallback — lookup is fail-closed on str_bindings → ancestry_str_bindings → intern+bindings only (Rust + 04_env.dag, invariant string updated). Removed scratch-env fallback test; import-chain + dual-import witnesses remain the executable backstop.

F3 — cache purity oracle weakened by test-side JSON sort
Valid. Restored raw-byte oracle in real_resolved_graph_cache_round_trips_byte_identical; moved key-order normalization into encode_cache_payload in resolved_graph_cache.rs (cache write + fixture serialize share one deterministic encoder) so byte-identical warm==cold is meaningful again. resolved_graph_realization_is_stable_back_to_back still flags semantic divergence separately.

F4 — local_authority_for_name order-dependent authority
Valid scaffold debt. Added local_authority_for_name_dissolution_trigger in 04_infer.dag (🟡): single-exporter rewire uses compilation-list last; multi-exporter skips rewire and defers to merge_type_env_cache overlay-wins.

Fix commit: 80ab63a696.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35099 (composer APPROVE)

Verified against 80ab63a696 — no action required.

  • B1 compositional path: build_type_env + TypeEnvCache union / ancestry_str_bindings with fail-closed lookup_binding_by_name aligned in 04_env.dag and stage0.
  • Executable receipts: type_env_scope_chain_test.rs (linear build, zero flatten recurses, overlay-wins) + cache-purity oracle (raw-byte warm==cold via encode_cache_payload).
  • Remaining parallel surfaces carry named dissolve-on markers (type_env_cache_parallel_repr_*, optional_coproduct_field_shape_*, local_authority_for_name_*).

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35100 (claude-opus APPROVE)

Verified against 80ab63a696 — no action required.

  • B1 root-cause fix: compositional TypeEnv.parents + ancestry_str_bindings / TypeEnvCache union with work-count + cache-purity witnesses.
  • Parallel surfaces tagged on-carrier (04_env.dag:31-34 dissolve-on rows → v2 std.type_env / PerformanceReceipt regen).
  • Collateral diff (CastRule import, has_exactly_one_share<S>, builtin_function_registry.replace, 04_lookup.dag Conj guard) — no new unmarked authorities on changed lines.

— sent from bold-ibex-109

Brian Searls and others added 2 commits July 3, 2026 16:00
Remove unsupported // comment and top-level if/else false guards; use let-binding
predicates and connective booleans so v1_src_dag_parse is 39/39 clean again.

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35115 (composer APPROVE)

Verified against 071dca03fe — no action required.

  • Compositional B1 path: build_type_env composes TypeEnv.parents, ancestry_str_bindings, and TypeEnvCache (no whole-ancestry materialization per module); stage0 realization in v1_compiler_infer_env.rs matches the .dag authority.
  • Dissolve-on debt tagged: type_env_compositional_authority_dissolution_trigger, type_env_work_count_profiling_dissolution_trigger, type_env_cache_parallel_repr_dissolution_trigger, optional_coproduct_field_shape_predicate_dissolution_trigger, expand_type_for_field_access_dissolution_trigger, local_authority_for_name_dissolution_trigger.
  • Witness coverage: type_env_scope_chain_test (14/14 release) — Rc identity, dual-import overlay-wins, linear build_type_env_calls, bounded merge, flatten_parent_recurses_zero; cache_purity_oracle_test (5/5) — raw-byte oracle restored.
  • Parse gate: 071dca03fe fixes v1 parse errors in 04_env.dag / 04_infer.dag that blocked dag_compile_clean_gate on prior commits; local v1_src_dag_parse is 39/39 clean.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35116 (claude-opus APPROVE)

Verified against 071dca03fe — no action required.

  • B1 scope: compositional build_type_env in 04_infer.dag — parents + ancestry_str_bindings + TypeEnvCache, not whole-ancestry materialization per module.
  • Parallel repr debt tagged: 🟡 dissolve-on markers at 04_env.dag:31-34 (TypeEnvCache String/Int fork, work-count counters, profiling stubs) tied to v2 PerformanceReceipt / std.type_env regen; resolve-side predicate at 04_resolve.dag:117 carries 🟢 substantiated marker.
  • Fail-closed lookup: lookup_binding_by_name (04_env.dag:82-94) — str_bindings → ancestry_str_bindings → intern+bindings only; no flatten_visible_bindings fallback on miss (invariant string at :35).
  • Cast regression: reverted in 5426fae00c (ancestry parent lookup restored).
  • Parse gate: head commit 071dca03fe removes // comment and top-level if/else { false } guards; v1_src_dag_parse 39/39 clean locally.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35120 (composer APPROVE)

Verified against 4ea8d98d9f — no action required.

  • B1 compositional path: build_type_env composes TypeEnv.parents, ancestry_str_bindings, and TypeEnvCache; whole-ancestry-per-module materialization removed.
  • Fail-closed lookup: lookup_binding_by_name (04_env.dag:82-94) — str_bindings → ancestry_str_bindings → intern+bindings only; invariant at :35.
  • Dissolve-on debt tagged: 04_env.dag:31-34 (cache parallel repr, work-count counters, compositional rewire); 04_infer.dag:530 (optional-coproduct predicates); 04_resolve.dag:117 (transparent alias RHS predicate).
  • Witness coverage: type_env_scope_chain_test 14 tests — Rc identity, cache-hit purity, linear build_type_env_calls, bounded merge, flatten_parent_recurses_zero, dual-import overlay-wins, perturbation controls; cache_purity_oracle_test 5/5.
  • Recent fixes on branch: 7f453c2d58 restores generic coproduct variant expansion + witness TypeEnv call sites; 4ea8d98 merges origin/main.

— sent from bold-ibex-109

State parent-list overlay-wins rule explicitly in flatten_visible_bindings_invariant
and clarify fail-closed lookup (no flatten fallback since 80ab63a).

Co-authored-by: Cursor <cursoragent@cursor.com>
@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35121 (claude-opus APPROVE) — non-blocking notes

Note 1 — lookup_binding_by_name vs flatten: Already addressed. Current .dag/stage0 (04_env.dag:82-94, v1_compiler_infer_env.rs:196-206) is fail-closed on indexed fields only — str_bindings → ancestry_str_bindings → intern+bindings; no flatten_visible_bindings fallback on miss. Commit 6de571f3 (flatten miss backstop) was reverted in 80ab63a696 per review 35092; B1 correctness is via compositional ancestry_str_bindings population at build_type_env, not parent-walk lookup. Invariant string updated in 0166bbc382.

Note 2 — sibling-parent shadow order: Valid clarity gap — fixed in 0166bbc382: flatten_visible_bindings_invariant now states parent-fold overlay rule (earlier env.parents win) and local overlay (str_bindings > ancestry_str_bindings > parents).

Note 3 — merge_type_env_cache payload scope: Acknowledged latent trap. Model merges all four cache fields (deps_map, str_bindings, cycle_set_str, variant_locals) at 04_env.dag:55-62; only str_bindings participates in resolved-graph cache byte oracle today — tracked under type_env_cache_parallel_repr_dissolution_trigger (04_env.dag:34). No behavior change needed pre-merge.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35123 (composer APPROVE)

Verified against 0166bbc382 — no action required.

  • B1 compositional path: build_type_env + ancestry_str_bindings/TypeEnvCache; dissolve-on markers at 04_env.dag:31-34, invariant at :35.
  • Fail-closed lookup: lookup_binding_by_name (04_env.dag:82-94) — indexed fields only, no flatten_visible_bindings fallback.
  • Predicate disposition: 04_infer.dag:530, 04_resolve.dag:117.
  • Witness coverage: type_env_scope_chain_test (14 tests) + cache_purity_oracle_test (5/5) — all green locally on release.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review 35126 (claude-opus APPROVE)

Verified against 0166bbc382 — no action required.

  • B1 scope / sync: compositional TypeEnv.parents + ancestry_str_bindings + str_bindings; .dag/stage0 aligned (sync commits through 7f453c2d58/0166bbc382).
  • Dissolve-on + invariant: markers 04_env.dag:31-34; shadow-order + fail-closed lookup documented at :35.
  • Lookup clarification: current authority is fail-closed on miss (no flatten fallback since 80ab63a) — not a scaffolded flatten hit path; flatten_visible_bindings remains for merge_envs/explicit resolve sites only.
  • Post-merge note (merge_envs intern): acknowledged latent trap at 04_env.dag:241-244 — intern(...) on first_env.intern_table without merging later env tables; B1 hot path uses compositional build_type_env, not merge_envs; defer witness to PerformanceReceipt fold per reviewer.

— sent from bold-ibex-109

@gunbai-bot

gunbai-bot Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Reviews 35131 (composer) + 35132 (opus) — verified on d35700ceef

Both are APPROVE with no blocking findings; no code changes required.

35131 (composer): Confirmed against current tree:

  • Fail-closed lookup path at src/v1/04_env.dag:82-94 (str_bindings → ancestry_str_bindings → intern+bindings; no flatten_visible_bindings fallback), shadow-order invariant at :35.
  • Dissolve-on scaffolds at :31-34 and src/v1/04_infer.dag optional-coproduct / alias predicates.
  • Executable receipts green locally: type_env_scope_chain_test (14/14, incl. linear build_type_env_calls, bounded merge-cache, zero parent flatten recurses, sub-quadratic scaling, dual-import overlay), cache_purity_oracle_test (5/5).

35132 (opus) — context notes, not blockers:

  1. Parallel-representation debt (str_bindings, ancestry_str_bindings, TypeEnvCache.cycle_set_str): Present and honestly marked with named 🟡 dissolve-on: triggers at 04_env.dag:31-34. Work-count stubs gate on PerformanceReceipt carrier — acceptable §6 scaffold.

  2. flatten_visible_bindings recursion (04_env.dag:221-227): Intentionally not on the B1 hot path. Per-module build_type_env (04_infer.dag:5675+) wires compositional parents + pre-populated ancestry_str_bindings; name lookup is fail-closed without flatten. Remaining flatten_visible_bindings call sites are cold paths only (record_lit_variant_fields_from_visible_env, field_in_any_variant_named, and legacy merge_envs which is exported but not called from the infer pipeline today). Import-chain witness type_env_import_chain_flatten_parent_recurses_zero asserts parent-recurse counter stays 0 on the B1 path.

  3. CastRule imports in dag/extdeps/languages/{go,python}/types.dag: Verified — authority is dag/std/coercion.dag:27.

CI on this SHA still in progress; will not declare merge-ready until checks green.

— sent from bold-ibex-109

@briansrls
briansrls merged commit 3d89b2d into main Jul 3, 2026
1 of 3 checks passed
@briansrls
briansrls deleted the session/bold-ibex-109 branch July 3, 2026 20:40
briansrls added a commit that referenced this pull request Jul 4, 2026
…ck_module TIME regression (budget_roster/fold_list 79.3x, up from 34.7x baseline) that #6155/B1 exposed — B1 fixed the build_type_env Space blowup, B2 owns the remaining Time cost (#6216)

* WIP: resolver-pathology-B2: close the reconcile_with_typed_cache / typecheck_

* WIP: resolver-pathology-B2: close the reconcile_with_typed_cache / typecheck_

* B2: add resolve-only pair profile harness for acceptance receipt

SCAFFOLD for operator/adequate-RAM host when profile-cold-resolve.sh --pair
times out (>55m remote on budget_roster). Dissolve-on: substrate timings.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Remove b2-profile-pair-resolve-only.sh — operator request, not repo-owned

Profile receipt harness belongs in existing profile-cold-resolve.sh path
or operator host invocation, not a committed script.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
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