Skip to content
Closed
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions INVARIANTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ Per **Dispatch-Discipline Mechanisms (b)** above, each **new** path added to `EX
| `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_cpp_abi_dag_smoke_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-29 C++ ABI / target data-model feeder (`src/v4/extdeps/cpp_abi.dag`, consumed by T-4 `cpp.dag`). **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/cpp_abi.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust `compile_to_dag` probe. **Interim ratchet:** `v4_extdeps_cpp_abi_dag_compiles` asserts `compile_to_dag` succeeds with empty `dag.diagnostics()` for the pinned `include_str!` source. |
| `src/v3/compiler/tests/integration/v4_extdeps_python_dag_smoke_test.rs` | **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`; **TASKS.md** T-4 python language-model lane (`src/v4/extdeps/languages/python.dag`, D2-REV Phase-3 scalar-tower fact-bundle reseed — DECISIONS.md `SL-3309-PYTHON-SCALAR-RESEED`). **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/python.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_python_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/v4_std_fact_density_dag_smoke_test.rs` | **TASKS.md** **T-30** (`src/v4/TASKS.md` — structural hollow-alias / fact-density gate); **ROADMAP:** `ROADMAP.md` § **Nine lanes** row **T-PB-B** / `pb_rust_tests_outside_residual_zero`. **Spec:** `docs/modeling-discipline.md` **Practice 8** — *Interim floor: the hollow-alias discriminator* (Practice 8 *Interim floor* on `main` post-#3226 `77b9e7d72` + Practice 9 #3234 `125fc88c8`; diff `main` if §8/§9 drift). **P2 / Practice 5:** this smoke is a **parse + inference cleanliness** probe for `src/v4/std/fact_density.dag` only — it does **not** claim a **generated** substrate consumer for `SourceSpecReadFact` (INVARIANTS §P2: declaration without generated consumer = staging; see `STRUCTURE.md`). **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/std/fact_density.dag` is exercised only by `.dag` `TestClaim` rows / a generated harness without this per-file Rust `compile_to_dag` probe. **Interim ratchet:** `v4_std_fact_density_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`. |
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 @@ -275,6 +275,8 @@ mod timing_lens_substrate_carrier_test;
mod v2_oracle_no_remaining_test_consumers_test;
#[path = "integration/v4_extdeps_cpp_abi_dag_smoke_test.rs"]
mod v4_extdeps_cpp_abi_dag_smoke_test;
#[path = "integration/v4_extdeps_python_dag_smoke_test.rs"]
Comment thread
briansrls marked this conversation as resolved.
Resolved
mod v4_extdeps_python_dag_smoke_test;
#[path = "integration/v4_extdeps_typescript_dag_smoke_test.rs"]
mod v4_extdeps_typescript_dag_smoke_test;
#[path = "integration/v4_lens_cost_dag_smoke_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 @@ -829,6 +829,10 @@ const EXPECTED_HAND_AUTHORED_TEST: &[&str] = &[
// source ratchet — no `v2-compiler` crate references outside `src/v2/`.
"src/v3/compiler/tests/integration/v2_oracle_no_remaining_test_consumers_test.rs",
"src/v3/compiler/tests/integration/v4_extdeps_cpp_abi_dag_smoke_test.rs",
// T-4 Python primitive scaffold: `compile_to_dag` smoke on
Comment thread
briansrls marked this conversation as resolved.
Resolved
// `src/v4/extdeps/languages/python.dag` (zero module diagnostics).
// SG-0 ratchet per INVARIANTS §P5(b) + `v4_extdeps_typescript_dag_smoke_test` precedent.
"src/v3/compiler/tests/integration/v4_extdeps_python_dag_smoke_test.rs",
// T-4 TypeScript primitive scaffold: `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,28 @@
//! **Layer:** integration
Comment thread
briansrls marked this conversation as resolved.
Resolved
//!
//! Smoke `compile_to_dag` on `src/v4/extdeps/languages/python.dag` —
//! T-4 Python primitive scaffold must lower+infer with **zero** module
//! diagnostics after the D2-REV scalar-tower fact-bundle Phase-3 rework
//! (flat `PythonScalar` coproduct; per-primitive grounding rows gated).

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

const PYTHON_DAG: &str = include_str!("../../../../v4/extdeps/languages/python.dag");
const PYTHON_PATH: &str = "src/v4/extdeps/languages/python.dag";

#[test]
fn v4_extdeps_python_dag_compiles() {
match compile_to_dag(PYTHON_DAG, PYTHON_PATH) {
Ok(dag) => assert!(
dag.diagnostics().is_empty(),
"{PYTHON_PATH}: expected empty diagnostics, got {:?}",
dag.diagnostics().iter().collect::<Vec<_>>()
),
Err(CompileError::Semantic(dag)) => panic!(
"{PYTHON_PATH}: semantic errors: {:?}",
dag.diagnostics().iter().collect::<Vec<_>>()
),
Err(other) => panic!("{PYTHON_PATH}: {other:?}"),
}
}
24 changes: 24 additions & 0 deletions src/v4/DECISIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1476,6 +1476,30 @@ Verbatim `//` lines from merge-base `float.dag` (lines **104–144** — modelin

- **`rust.dag` / `RustNever`:** D2a(1) `type RustNever = Never` is in‑file. D2a(2) `rust_never_grounding` and **numeric** cost/width refinement (distinct from inhabitance `Never`/`Unit`) stay on the existing **GroundingMap** + **T‑25 / nat / integer** triggers already named in TASKS / SL‑3229 ledger rows.

### SL-3309-PYTHON-SCALAR-RESEED — `extdeps/languages/python.dag` scalar-tower fact-bundle reseed

**Authority:** v4 T-4 Phase-3 fact-bundle rework (DECISIONS.md `D2-REV`); manager `vivid-carp-207` corrected brief 2026-05-18; CORE ratchet ruling — single-owner `strict_deprose_dag.py` per-rel post-reseed registry work-item `node://adhoc-a9948898-4ff`.

**Disposition:** **🟢 terminal** — `PythonScalar` is reseeded from the pre-reseed `Numeric { tower: PythonNumericTower } | Singleton { kind }` form into a flat coproduct `IntScalar | FloatScalar | ComplexScalar | BoolScalar | Singleton { kind: PythonSingletonKind }`. This dissolves two merge-base hollow defects: the single-field `Numeric { tower }` wrapper (Practice-8 hollow prong — a wrapper adding no field of its own) and the bare `PythonNumericTower` enum (a classifier reading zero spec facts). The flat coproduct mirrors `rust.dag` `RustScalar`'s *structure* (a flat scalar coproduct with nullary variants), not its facts.

**Why the numeric variants are nullary (Python ≠ Rust).** `RustScalar` carries `kind` / `width` sub-carriers because Rust's integer/float primitives genuinely range over signedness and width (`i8`…`u128`, `f32`/`f64`). Python's numeric tower has **zero intra-kind variance**: exactly one `int` (arbitrary precision), one `float` (IEEE-754 binary64), one `complex` (pair of binary64) — Python Language Reference §3.2 (the standard type hierarchy). Per the CORE standing instruction — `rust.dag` is a *shape* reference, never a fact-template; a byte-symmetric copy asserting a non-fact is wrong — Python's numeric variants carry no fabricated `kind` / `width` carrier. A single-inhabitant carrier is also ungrammatical in v4 (`type X = Y` parses as an alias), and a free `kind × width` product over-generates invalid combinations (`Integral × FixedBinary64`, `Real × Unbounded`).

**Ratchet authority:** this `###` row is the post-reseed Practice-4 authority for the live `PythonScalar` coproduct; the merge-base `92cb26402` tag map predates the reseed and classifies the now-dissolved pre-reseed shape. `strict_deprose_dag.py`'s per-rel post-reseed registry (`node://adhoc-a9948898-4ff`) sources `PythonScalar`'s tag from this row. `PythonSingletonKind` is unchanged from merge-base and retains `CP-3229-GREEN-TERMINAL`.

**PR receipt:** gunbc **#3309**.

### SL-3309-PYTHON-PER-PRIMITIVE-A-VS-B — `python.dag` per-primitive D2-fix shape (held-provisional)

**Authority:** manager `vivid-carp-207` corrected brief 2026-05-18; operator A-vs-B ruling pending.

**Disposition:** **🟡 held-provisional** — the per-primitive D2-fix shape for Python's scalar primitives (the `type PyBool = Bool` bare-alias plus a per-primitive `data <prim>_grounding: GroundingMap { spelling }` spelling-row form) is **not modeled in either direction** until the operator A-vs-B ruling decides whether bare-alias + `{ spelling: String }`-`GroundingMap` satisfies the D2-fix, or the bare alias must be eliminated / carry real coincidence facts. Python's genuine per-primitive facts (`int` = arbitrary-precision → `std/integer` `Int`; `float` / `complex` = IEEE-754 binary64 → `std/float` `Float64`) are exactly this held grounding — for Python the scalar-tower facts and the held per-primitive grounding are the same surface (cf. `SL-3309-PYTHON-SCALAR-RESEED`). The pre-existing `type PyBool = Bool` row is left in place as the unruled state; it is neither extended nor removed here.

**Gate:** the operator A-vs-B ruling on the per-primitive D2-fix shape.

**Dissolve-on-arrival:** when the A-vs-B ruling lands, model the per-primitive grounding rows in the ruled shape and close this row.

**PR receipt:** gunbc **#3309**.

### SL-3229-T4-FORMAT-T6T7 — T-4.6 format parse/emit bodies (compiler pipeline P3)

**Gate (live cite, Practice 9):** `🟡 gated — feature: T-6/T-7 parse + T-10 emit pipeline-stage substrate`
Expand Down
26 changes: 11 additions & 15 deletions src/v4/extdeps/languages/python.dag
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
// src/v4/extdeps/languages/python.dag
// Scope: Python 3.14 Reference surface (numeric tower, singleton kinds, scalar sum, cost shape, partial D2 resolver).
// Owns: PythonNumericTower, PythonSingletonKind, PythonScalar, PythonCost, PyBool.
// Consumes: Kernel-ambient Bool, Int; std/integer, std/float, std/cardinality when T-3 alias rows land (DECISIONS.md D2-REV).
// Status: extdeps python slice; numeric overflow and resolver deferrals per DECISIONS.md D2-REV + Part 6 (PR #3229 · CP-3229-GREEN-TERMINAL); principal int unbounded—no overflow carrier in-file.
// Anchor: https://docs.python.org/3.14/reference/
// Scope: Python 3.14 Reference surface (scalar fact-bundle coproduct, singleton kinds, cost shape).
// Owns: PythonSingletonKind, PythonScalar, PythonCost, PyBool.
// Consumes: Kernel-ambient Bool, Int.
// Status: extdeps python slice; D2-REV Phase-3 scalar-tower fact-bundle reseed; per-primitive D2-fix shape held-provisional on operator A-vs-B ruling (DECISIONS.md SL-3309-PYTHON-PER-PRIMITIVE-A-VS-B).
// Anchor: https://docs.python.org/3.14/reference/datamodel.html#the-standard-type-hierarchy
// Ledger: DECISIONS.md Part 6 (PR #3229): CP-3229-GREEN-TERMINAL, SL-3309-PYTHON-SCALAR-RESEED.

module v4.extdeps.languages.python

// 🟢 coproduct dissolution — DECISIONS.md Part 6 · CP-3229-GREEN-TERMINAL.
type PythonNumericTower
= BoolLevel
| IntegralLevel
| RealLevel
| ComplexLevel

// 🟢 coproduct dissolution — DECISIONS.md Part 6 · CP-3229-GREEN-TERMINAL.
type PythonSingletonKind
= NoneT
| NotImplementedT
| EllipsisT

// 🟢 coproduct dissolution — DECISIONS.md Part 6 · CP-3229-GREEN-TERMINAL.
// 🟢 coproduct dissolution — DECISIONS.md Part 6 · SL-3309-PYTHON-SCALAR-RESEED.
type PythonScalar
= Numeric { tower: PythonNumericTower }
= IntScalar
| FloatScalar
| ComplexScalar
| BoolScalar
| Singleton { kind: PythonSingletonKind }

type PythonCost {
Expand All @@ -31,4 +28,3 @@ type PythonCost {
}

type PyBool = Bool
// 🟢 Singleton / `Unit` D2a slice — DECISIONS.md §PR-3252-extdeps-deferrals + §PR-3252-cardinality-std (Practice 9).