Skip to content

v4 T-4 D4: create extdeps/languages/resolver.dag — shared GroundingMap home - #3219

Closed
briansrls wants to merge 7 commits into
mainfrom
session/keen-gull-671-resolver-dag
Closed

briansrls wants to merge 7 commits into
mainfrom
session/keen-gull-671-resolver-dag

Conversation

@briansrls

@briansrls briansrls commented May 17, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Encoding-half of operator-ratified D4 (src/v4/DECISIONS.md, PR #3216): creates the new file src/v4/extdeps/languages/resolver.dag, the shared D2-resolver registry.

  • type GroundingMap<IRCarrier> { spelling: String } is its first resident — D2's D2a(2) surface-spelling carrier, homed once here instead of re-declared in five language files (parallel-declaration P2 forbids; feedback_import_not_redeclare_carriers).
  • STRICT D4 admission rule documented in-header: resolver.dag hosts ONLY structurally-language-INVARIANT resolver types. Spec-varying types (OverflowDisposition, NaN/Inf) stay per-language.
  • Zero-import leaf file (String is kernel-ambient).
  • STRUCTURE.md: enumeration gains the resolver.dag line; checksum count bumped 64→65 (per invariant Add SVG viz, test helpers, and makegen scaffold #1, enumeration is authoritative).

Sequencing

Prepared in parallel with #3216 per the dispatch brief. Cites D4 as ratified; lands after #3216 merges the D4/D5 rows to main. This PR is the encoding-half of D4 — NOT a downstream consumer.

Out of scope (separate fan-out, canonical rust.dag first): the per-language import … resolver { GroundingMap } lines + per-primitive data <lang>_<prim>_grounding instances. rust.dag's current provisional 🟡 TRACKED-SCAFFOLD GroundingMap declaration (rust.dag:1718) relocates here in that fan-out.

Test plan

🤖 Generated with Claude Code

SG-0 hand-path delta: +1 (EXPECTED_HAND_AUTHORED_TEST +1; EXPECTED_HAND_AUTHORED_NON_TEST 0, EXPECTED_HAND_AUTHORED_FRAGMENTS 0)

SG-0 pairing: (b) operator-ratified budget. DECISIONS.md row D4 (operator-ratified 2026-05-16) mandates this exact hand-path add: D4's encoding targets explicitly include the extdeps/languages/* P5(b) receipt (the INVARIANTS.md row + sg0_census_test.rs EXPECTED_HAND_AUTHORED_TEST entry + the compile_to_dag smoke harness — the mandated triple). The +1 is operator-budgeted, not a discretionary census add. Authorization: #3216 (the operator-ratified D4/D5 ratification PR).

briansrls and others added 4 commits May 17, 2026 00:17
…p home

Encoding-half of operator-ratified D4 (DECISIONS.md, PR #3216): the
shared D2-resolver registry. GroundingMap<IRCarrier> { spelling: String }
is its first resident — homed once here instead of re-declared in five
language files (parallel-declaration P2 forbids).

STRICT admission rule per D4: hosts ONLY structurally-language-INVARIANT
resolver types. Zero-import leaf file. STRUCTURE.md enumeration + checksum
bumped 64->65. Smoke test asserts 0-diagnostic compile_to_dag.

The per-language `import ... resolver { GroundingMap }` lines + the
per-primitive grounding instances are a separate fan-out, not this PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The v2-bootstrap whole-source-root parse requires every v4 .dag file to
open its declarations with a `module` line (single-file compile_to_dag
does not — hence the smoke test false-passed). Mirrors the sibling
extdeps/languages/* files.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The new compile_to_dag smoke test is a hand-authored Rust test; per
INVARIANTS §P5(b) + the typescript-extdeps precedent a new such test
must land its three receipts in the same PR: the integration.rs mod
line (already present), an EXPECTED_HAND_AUTHORED_TEST census entry,
and a matching INVARIANTS.md row. Adds the latter two.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls briansrls closed this May 17, 2026
@briansrls briansrls reopened this May 17, 2026
briansrls and others added 2 commits May 17, 2026 00:40
…-resolver-dag

# Conflicts:
#	src/v4/STRUCTURE.md
The closed-tree checksum scopes the enumerated substrate tree + the
test/claim/impossible_bug/ fixtures, and excludes the test/claim/manual/
Phase-1.5 anti-regression anchors — so a raw src/v4/**/*.dag filesystem
count reads higher. One-line scope note added at the count line so the
checksum is coherent against its own scope definition.

(This push also re-triggers CI: the SG-0 gate reads the pull_request
event payload's body, which a `gh run rerun` does not refresh — a fresh
synchronize event is required to pick up the PR-body SG-0 lines.)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Re the cursor/composer-2 review's prose nit (resolver.dag header "2026-05-16" vs STRUCTURE.md "2026-05-17"):

Not an inconsistency — the two dates intentionally mark two distinct events, and resolver.dag already states both:

  • resolver.dag:8 — "DECISIONS.md row D4 (operator-ratified 2026-05-16)" — the date D4 was ratified (matches the D4 row's own operator-ratified 2026-05-16).
  • resolver.dag:48 — "file created 2026-05-17" — the date this file was added.
  • STRUCTURE.md ledger — "+1 .dag 2026-05-17: resolver.dag — operator-ratified D4" — the file-addition date, with "operator-ratified D4" as the why-clause. Same convention as the dag.dag ledger line directly above it.

A decision ratified one day and encoded the next is expected (ratified ≠ encoded ≠ landed is the standing v4 discipline). No fix needed; leaving as-is.

The exploratory point about the PR-description P5(b) receipt: the two SG-0 lines + the in-repo INVARIANTS row are present in the PR body and the diff respectively; CI's SG-0 gate checks the PR-body receipt mechanically.

— sent from keen-gull-671

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 713d5f76 · Trigger: schedule
  • Thinking: 294s wall

Non-blocking — Strengths

  • src/v4/extdeps/languages/resolver.dag GroundingMap is a product carrier with the language-varying spelling left to per-language data instances, so it avoids a shared coproduct or parallel per-language type authority.

ROADMAP — Verified

  • T-PB-B / pb_rust_tests_outside_residual_zero: The added Rust smoke test is paired with the SG-0 census entry and INVARIANTS P5 receipt naming the existing zero-Rust-test lane and dissolution trigger.

✅ Mixed .dag/docs/test change looks consistent with the thesis, modeling discipline, and P5 receipt requirements; no blocking concerns.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: a2f941e3 · Trigger: manual
  • Comparison: main @ ba9337f1 ... session/keen-gull-671-resolver-dag @ a2f941e3
  • Conversation: View conversation

1. Story of the diff

This PR creates a shared v4 language-resolver home for facts that are invariant across target-language specs: src/v4/extdeps/languages/resolver.dag declares module v4.extdeps.languages.resolver and introduces GroundingMap<IRCarrier> { spelling: String } as the common carrier for per-primitive surface spellings (src/v4/extdeps/languages/resolver.dag:68, src/v4/extdeps/languages/resolver.dag:86-88). The file is intentionally narrow: it admits only structurally language-invariant resolver types and explicitly keeps spec-varying facts such as overflow disposition and NaN/Inf handling out of the shared registry (src/v4/extdeps/languages/resolver.dag:15-27). The PR then updates the v4 structure ledger/checksum to include the new file (src/v4/STRUCTURE.md:35, src/v4/STRUCTURE.md:38, src/v4/STRUCTURE.md:114-124) and adds a tracked Rust integration smoke test that compiles the new .dag file and requires zero diagnostics (src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs:13-25). Because that smoke test is new hand-authored Rust, the diff also registers it in integration.rs, the SG-0 hand-authored test census, and the INVARIANTS debt ledger (src/v3/compiler/tests/integration.rs:276-277, src/v3/compiler/tests/integration/sg0_census_test.rs:830-833, INVARIANTS.md:345).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation). — Compliant. This is .dag model/substrate-adjacent authoring rather than a Rust implementation mutation: the new authority is a v4 extdeps language module (src/v4/extdeps/languages/resolver.dag:68) with one shared carrier (src/v4/extdeps/languages/resolver.dag:86-88), and it does not touch dag.rs or mutate the compiler’s runtime substrate types.
  2. INVARIANTS.md + modeling-discipline.md. — Compliant. P2 single-authority discipline is handled explicitly: the file says these are “one declaration, imported by each language file, never re-declared” (src/v4/extdeps/languages/resolver.dag:3-7), fences the admission rule to invariant shared types (src/v4/extdeps/languages/resolver.dag:15-27), and names the existing provisional Rust-local declaration as something that relocates here in the fan-out (src/v4/extdeps/languages/resolver.dag:51-56). P3 fail-closed is covered by the smoke test’s compile_to_dag result split and zero-diagnostics assertion (src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs:15-25).
  3. CODING.md. — Compliant. The new Rust test stays simple and explicit: it has no hidden mutable state, passes the source/path directly to compile_to_dag, and matches structured CompileError cases rather than probing strings (src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs:7-25). The panic! surface is confined to test code, which is consistent with the style guidance.
  4. TESTING.md. — Compliant. The test is correctly integration-level because the behavior under test is whether the new .dag authority can pass the v3 compile/lower/infer surface with zero diagnostics (src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs:3-5, src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs:13-25). It is also one claim: v4_extdeps_resolver_dag_compiles only proves clean compilation of resolver.dag.
  5. LOCKED DESIGN DECISIONS. — N/A. The diff does not alter a locked thesis/design document. It references an operator-ratified D4 placement decision and follows it by anchoring the shared home here (src/v4/extdeps/languages/resolver.dag:8-13, src/v4/extdeps/languages/resolver.dag:58-65), but there is no diff-cited divergence from a locked design.
  6. TRACKED vs UNTRACKED DEBT. — Compliant. The new hand-authored Rust smoke harness is tracked: the INVARIANTS row documents the reason, the same-PR SG-0 census line, the dissolution trigger, and the interim ratchet (INVARIANTS.md:345), while the census actually includes the path in this PR (src/v3/compiler/tests/integration/sg0_census_test.rs:830-833). The staged pre-fan-out state is also bounded: resolver.dag says per-language imports and data instances are separate fan-out work, with the current provisional Rust-local GroundingMap relocating here in that fan-out (src/v4/extdeps/languages/resolver.dag:51-56).

2.5. Top-down PM intent review

Compliant. The highest-level intent is preserved: target-language grounding remains .dag data, not a new hand-written compiler path, and the shared resolver home reduces duplicate authority rather than creating a permanent parallel representation. The potentially risky part — spelling: String — is scoped as a source-syntax boundary value for emit/ingest, while the typed carrier remains GroundingMap<IRCarrier> rather than an untyped lookup table (src/v4/extdeps/languages/resolver.dag:34-42, src/v4/extdeps/languages/resolver.dag:74-88). I do not see a diff-cited case where this PR makes a must-have target optional, turns a dissolution goal into permanent scaffolding, or adds hand-written implementation beyond the tracked smoke receipt.

3. Verdict

APPROVE. The PR is narrow and disciplined: it creates the shared v4 resolver authority, updates the v4 structure ledger, and registers the temporary Rust smoke test with the required SG-0/P5 tracking. I found no blocking invariant or PM-intent mismatch in the diff.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: a2f941e3 · Trigger: schedule
  • Thinking: 148s wall

✅ No new concerns in this re-review.

@briansrls

Copy link
Copy Markdown
Contributor Author

Closing per operator-ratified Phase 0 of the D2 foundation reversal.

The operator declared D2 (the alias-identity primitive-inhabitance form) WRONG; a fact-bundle model replaces it. resolver.dag exists almost entirely as the shared D2-resolver registry (GroundingMap<IRCarrier>, the D4 "completes-D2" home) — per the verified D2-impact map this is the (a) close disposition: the file's reason to land is removed by the reversal.

This is NOT a git-revert of any merged commit — it is a clean close of an unmerged PR. The resolver.dag work is not lost: the closed branch is preserved, and the genuinely-durable fact (surface-spelling is a real per-language fact) re-homes in the forthcoming fact-bundle design (the substrate-first Phase-1+ rework). The binding-gate four-check this PR cleared was correct work; the foundation it encoded is what reversed, above the PR.

Operator-ratified; T-4 mgr executing Phase 0 off the verified impact map. — sent from vivid-carp-207

@briansrls briansrls closed this May 17, 2026
@briansrls
briansrls deleted the session/keen-gull-671-resolver-dag branch June 1, 2026 18:42
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