Skip to content
1 change: 1 addition & 0 deletions INVARIANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ Per **Dispatch-Discipline Mechanisms (b)** above, each **new** path added to `EX
| `src/v3/compiler/tests/integration/common/wiring_scanner_test.rs` | **ROADMAP:** same **v3 lens capability honesty pass** bullet — Band-C `tests/integration.rs` `#[path]` wiring is enforced by `integration_rs_wiring_scan.rs` + `cementing_dispatch.rs`. **Dissolution:** remove when `integration.rs` wiring can be validated structurally for cementing modules without line scanners. **Interim ratchet:** unit tests for helpers promoted from the retired `cementing_lens_registry_dispatch_test.rs` monolith. |
| `src/v3/compiler/tests/integration/ctrl_pr_digests_dag_smoke_test.rs` | **Project plan:** `docs/r4-ctrl-dag-migration-project-plan.md` §3 — catalog **#8** `dsl/ctrl/pr_digests.dag` (Wave-1 ctrl → `.dag` subsystem modeling). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + the matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke test. **Dissolution:** remove when `compile_to_dag` (or a single generated harness) validates `module … service …` ctrl carrier files end-to-end without a parallel Rust string/lexer ratchet, or when the contract migrates to `.dag` `TestClaim` coverage. **Interim ratchet:** `ctrl_pr_digests_dag_tokenizes_and_matches_expected_surface` requires clean tokenization plus presence of `module ctrl.pr_digests`, `import extdeps.github.pulls { PullRequest, PullReview, ReviewComment }`, `std.errors` / `std.types` imports, the four Practice-4 sum/record carriers (with `🟡 STAGED` / `🟢 TERMINAL` markers per `dsl/ctrl/README.md`), `ReviewCommentBody` + `review_line_comments` wiring, and `service ctrl.PrDigests` / the four `operation` blocks / `readonly`. |
| `src/v3/compiler/tests/integration/extdeps_sql_transport_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row `T-PB-B` / `pb_rust_tests_outside_residual_zero`; this Rust integration receipt keeps HTTP/SQL/audit extdeps compiled by the existing v3 parser before downstream emission-target consumers rely on them. **Dissolution:** remove when extdeps transport and Phase 3 emission-target files are covered by a `.dag`-native parse/authority suite or generated test harness rather than per-file Rust `compile_to_dag` probes. **Interim ratchet:** `rest_transport_dag_compiles_cleanly` and `sql_transport_dag_compiles_cleanly` pin `dsl/extdeps/transports/rest.dag` and `dsl/extdeps/transports/sql.dag`; `http_server_extdep_dag_compiles_cleanly`, `sql_migration_extdep_dag_compiles_cleanly`, and `audit_event_extdep_dag_compiles_cleanly` pin `dsl/extdeps/http/server.dag`, `dsl/extdeps/sql/migration.dag`, and `dsl/extdeps/audit/event.dag` as parseable staged emission-target substrate. The field-sensitive companions (`http_server_target_fields_are_authoritative_substrate_edges`, `sql_migration_target_fields_bound_raw_sql_scaffold`, `audit_event_target_fields_preserve_cloudevents_core_names`) consume the new target-contract fields directly so they fail on raw `String`/`Int` regressions, missing SQL scaffold bounds, or CloudEvents alias drift while the first real projection consumer is still staged; the audit ratchet also locks CloudEvents core fields to branded carriers and `std.types.Timestamp` rather than raw strings. |
| `src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-4 + **DECISIONS.md** row **D4** — the shared D2-resolver registry (`src/v4/extdeps/languages/resolver.dag`, first resident `GroundingMap<IRCarrier>`). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `src/v4/extdeps/languages/resolver.dag` (or the v4 extdeps fixture set it belongs to) is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust `compile_to_dag` probe. **Interim ratchet:** `v4_extdeps_resolver_dag_compiles` asserts `compile_to_dag` succeeds with empty `dag.diagnostics()` for the pinned `include_str!` source. |
| `src/v3/compiler/tests/integration/v4_extdeps_typescript_dag_smoke_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-4 typescript language-model lane (`src/v4/extdeps/languages/typescript.dag`, DECISIONS.md D2 resolver slice). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the smoke harness. **Dissolution:** remove when `src/v4/extdeps/languages/typescript.dag` (or the v4 extdeps fixture set it belongs to) is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust `compile_to_dag` probe. **Interim ratchet:** `v4_extdeps_typescript_dag_compiles` asserts `compile_to_dag` succeeds with empty `dag.diagnostics()` for the pinned `include_str!` source. |
| `src/v3/compiler/tests/integration/file_attachment_substrate_carrier_test.rs` | **R3 program plan:** `docs/r3-program-plan.md` §1.8 gate **#62** `substrate_gap_file_ingestion_closed` (T-Workflow-As-Data substrate-gap class; worker brief `docs/briefs/r3-substrate-gate-62-file-attachment-carrier-worker.md`). **Dissolution:** remove when a `.dag` `TestClaim` / PB-B-1 runner receipt can assert `FileAttachment` field names + cross-module nominal wiring against `generated_full_bootstrap_dag()` without this hand-Rust structural ratchet (same dissolution posture as `timing_lens_substrate_carrier_test.rs` for gate #55). **Interim ratchet:** `file_attachment_shape_locked` + `file_attachment_field_types_locked` + `file_attachment_field_count_is_five` pin the ratified Refined-B-1 five-field subset of `WorkflowObservationAnchor` (`NodeId`, `ContentHash`, `WorkflowProducerId`, `WorkflowRunId`, `Nanoseconds`) exactly as declared in `src/v3/std/timing_lens.dag`; existence proof carrier construction stays in-module as `gate_62_file_attachment_demo_record`. |
| `src/v3/compiler/tests/integration/lens_application_substrate_carrier_test.rs` | **R3 program plan:** `docs/r3-program-plan.md` §1.8 gate **#89** `section_ref_substrate_landed` (T-Lens-Application-Surface — `SectionRef` disjoint sum over `DeclarationScope` and `NodeScope` in `src/v3/std/lens_application.dag`; design authority `docs/design-lens-application-surface.md` §1.2–§2). **PR receipt (P5 Mechanism (b)):** this INVARIANTS row + matching `EXPECTED_HAND_AUTHORED_TEST` line in `sg0_census_test.rs` land in the same PR as the harness. **Dissolution:** remove when a `.dag` `TestClaim` / PB-B-1 runner receipt can assert `SectionRef` variant labels, field names, and `DeclarationId` / `NodeId` nominal wiring against `generated_full_bootstrap_dag()` without this hand-Rust structural ratchet (same dissolution posture as gate **#62** `file_attachment_substrate_carrier_test.rs`). **Interim ratchet:** `gate_89_section_ref_is_disjoint_sum_from_lens_application_authority` pins variant order (`DeclarationScope` then `NodeScope`) and payload fields to `lens_application.dag`. |
Expand Down
2 changes: 2 additions & 0 deletions src/v3/compiler/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ mod thesis_validation_test;
mod timing_lens_substrate_carrier_test;
#[path = "integration/v2_oracle_no_remaining_test_consumers_test.rs"]
mod v2_oracle_no_remaining_test_consumers_test;
#[path = "integration/v4_extdeps_resolver_dag_smoke_test.rs"]
mod v4_extdeps_resolver_dag_smoke_test;
#[path = "integration/v4_extdeps_typescript_dag_smoke_test.rs"]
mod v4_extdeps_typescript_dag_smoke_test;
#[path = "integration/value_body_substrate_mirror_isomorphism_test.rs"]
Expand Down
4 changes: 4 additions & 0 deletions src/v3/compiler/tests/integration/sg0_census_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,10 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// R3 T-V2-Retirement §1.8 gate #41 (`v2_oracle_no_remaining_test_consumers`): comment-aware
// source ratchet — no `v2-compiler` crate references outside `src/v2/`.
"src/v3/compiler/tests/integration/v2_oracle_no_remaining_test_consumers_test.rs",
// T-4 D4: `compile_to_dag` smoke on the shared D2-resolver registry
// `src/v4/extdeps/languages/resolver.dag` (zero module diagnostics).
// SG-0 ratchet per INVARIANTS §P5(b) + the typescript-extdeps precedent.
"src/v3/compiler/tests/integration/v4_extdeps_resolver_dag_smoke_test.rs",
// T-4 typescript D2-resolver slice: `compile_to_dag` smoke on
// `src/v4/extdeps/languages/typescript.dag` (zero module diagnostics).
// SG-0 ratchet per INVARIANTS §P5(b) + `extdeps_sql_transport_test` precedent.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//! **Layer:** integration
//!
//! Smoke `compile_to_dag` on `src/v4/extdeps/languages/resolver.dag` —
//! the shared D2-resolver registry (D4). A zero-import leaf file: it must
//! lower+infer with **zero** module diagnostics (v2/v3 surface 0-diag gate).

use v3_compiler::compile_to_dag;
use v3_compiler::CompileError;

const RESOLVER_DAG: &str = include_str!("../../../../v4/extdeps/languages/resolver.dag");
const RESOLVER_PATH: &str = "src/v4/extdeps/languages/resolver.dag";

#[test]
fn v4_extdeps_resolver_dag_compiles() {
match compile_to_dag(RESOLVER_DAG, RESOLVER_PATH) {
Ok(dag) => assert!(
dag.diagnostics().is_empty(),
"{RESOLVER_PATH}: expected empty diagnostics, got {:?}",
dag.diagnostics().iter().collect::<Vec<_>>()
),
Err(CompileError::Semantic(dag)) => panic!(
"{RESOLVER_PATH}: semantic errors: {:?}",
dag.diagnostics().iter().collect::<Vec<_>>()
),
Err(other) => panic!("{RESOLVER_PATH}: {other:?}"),
}
}
14 changes: 10 additions & 4 deletions src/v4/STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ src/v4/
verification.dag # TestClaim schema (imported from v3)
report.dag # advisory carrier (NOT fail-closed Diagnostic); used by synthesis lens

extdeps/ # external system contracts (21 files)
extdeps/ # external system contracts (22 files)
languages/ # language models (direction-agnostic — emit AND ingest)
dag.dag # gunbc `.dag` — B2-OMNI language #1 (C1 extension 2026-05-16; relay merry-ibex-337)
resolver.dag # shared D2-resolver registry (GroundingMap); D4
rust.dag
python.dag
go.dag
Expand Down Expand Up @@ -110,12 +111,17 @@ src/v4/
fixture/ # canonical input programs
```

**Total: 65 .dag files + 5 docs + 5 .gitkeep = 75 files.** (Per invariant
**Total: 66 .dag files + 5 docs + 5 .gitkeep = 76 files.** (Per invariant
#1 the enumeration above — not the count — is authoritative; the count is
a checksum, updated on every operator-ratified file addition/removal.
Count scope = the substrate tree enumerated above plus the `test/claim/
impossible_bug/` fixtures; it excludes the `test/claim/manual/` Phase-1.5
hand-authored anti-regression anchors (a raw `src/v4/**/*.dag` filesystem
count therefore reads higher by the manual-anchor file count).
+1 .dag 2026-05-16: `extdeps/languages/dag.dag` — operator-ratified C1 closed-tree
extension (Option A, relay merry-ibex-337). −5 .dag 2026-05-15: work-direction
meta-layer cut, operator-ratified.)
extension (Option A, relay merry-ibex-337). +1 .dag 2026-05-17:
`extdeps/languages/resolver.dag` — operator-ratified D4. −5 .dag 2026-05-15:
work-direction meta-layer cut, operator-ratified.)

## Scalar/numeric concept decomposition

Expand Down
88 changes: 88 additions & 0 deletions src/v4/extdeps/languages/resolver.dag
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
// src/v4/extdeps/languages/resolver.dag
//
// Scope: the SHARED registry for D2-resolver types — types used by every
// extdeps/languages/* file that are STRUCTURALLY LANGUAGE-INVARIANT
// (their structure provably cannot vary across the modeled language
// specs). These are convergence carriers: one declaration, imported
// by each language file, never re-declared.
// Anchor: src/v4/DECISIONS.md row D4 (operator-ratified 2026-05-16) — the
// governing decision that homes the shared resolver types here.
// D4 completes D2 (the extdeps resolver shape): D2 specified the
// per-primitive three-thin-facts shape; D4 pins WHERE D2's shared
// types live so the five language files import rather than
// re-declare (parallel-declaration P2 forbids).
//
// Admission rule (STRICT — per D4):
// resolver.dag hosts ONLY structurally-language-INVARIANT resolver
// types. The admission test is a proof obligation: can you prove the
// type's structure is invariant across the modeled language specs?
// - GroundingMap<IRCarrier> { spelling: String } PASSES — every modeled
// language grounds an IR carrier to exactly one surface spelling
// string; the record shape does not vary.
// - Spec-VARYING types STAY per-language and are NOT admitted here:
// OverflowDisposition (Rust panic-or-wrap vs Go wrap vs C/C++ UB vs
// Python arbitrary-precision — the variant set itself varies),
// NaN/Inf handling carriers, language-grammar facts. Those are D2.5 /
// L-2 per-language facts; homing them here would re-import the
// parallel-taxonomy anti-pattern this file exists to prevent.
// Future structurally-invariant shared resolver types (e.g. a
// C5-fidelity Modeled | Declared-normalized | Fail-closed disposition
// classifier) land here without a fresh placement decision — D4 is the
// standing ratification for this file's purpose.
//
// Owns:
// - GroundingMap<IRCarrier> { spelling: String } — the per-primitive
// surface-spelling carrier (D2's D2a(2) "grounding map"). IRCarrier is
// a phantom type parameter naming the IR carrier this grounding maps
// (RustI32, PyInt, GoInt64, ...); each language file declares
// per-primitive instances `data <lang>_<prim>_grounding:
// GroundingMap<<AliasCarrier>> = GroundingMap { spelling: "<token>" }`.
// `spelling` is a String boundary value — the canonical source text
// for emit / ingest, living at the source-syntax boundary, not in
// kernel/lens code.
//
// Consumes:
// - (none) — String is kernel-ambient (STRUCTURE.md:147-148); no import
// is required. resolver.dag is a zero-import leaf of the .dag tree.
//
// Status: T-4 D4 — file created 2026-05-17 (keen-gull-671), the
// encoding-half of operator-ratified D4 (DECISIONS.md, PR #3216).
// Created in parallel with #3216; lands after #3216 merges the D4/D5
// rows to main. The per-language `import … resolver { GroundingMap }`
// lines + per-primitive `data <lang>_<prim>_grounding` instances are a
// separate fan-out (canonical rust.dag first, then python/go/cpp/ts) —
// NOT this file's scope. rust.dag's current provisional GroundingMap
// declaration (the 🟡 TRACKED-SCAFFOLD at rust.dag:1718) relocates here
// in that fan-out; this file is its pinned home.
//
// Closed-tree extension (per D4 + INVARIANTS #1): this file is a
// ratified addition to the closed .dag tree. STRUCTURE.md's enumeration
// gains the resolver.dag line; the checksum count is bumped to match.
// The enumeration — not the count — is authoritative.
//
// Brief: this file's I/O contract is the immutable contract for the
// worker. Splitting this file requires explicit operator ratification
// (substrate extension = stop signal).


module v4.extdeps.languages.resolver


// ─────────────────────────────────────────────────────────────────────
// GroundingMap<IRCarrier> — the per-primitive surface-spelling carrier.
//
// A Conj record (no Practice-4 ledger — a single-field product, not an
// enumeration). IRCarrier is a phantom type parameter: it does not appear
// in the body; it names — at the type level — which IR carrier a given
// grounding instance maps, so `GroundingMap<RustI32>` and
// `GroundingMap<PyInt>` are distinct facts (P1/P2 fidelity).
//
// The structure is provably language-INVARIANT: every modeled language
// spec grounds each IR carrier to exactly one canonical surface spelling.
// What VARIES across languages is the spelling VALUE (`i32` vs `int` vs
// `int64`) — carried by per-language `data` instances — never the record
// SHAPE. This is exactly the D4 admission test, and is why GroundingMap
// is the first resident here rather than re-declared five times.
type GroundingMap<IRCarrier> {
spelling: String
}
Loading