Skip to content

v4 T-4 Phase-3: python.dag scalar-tower fact-bundle rework - #3309

Closed
briansrls wants to merge 10 commits into
mainfrom
session/stern-eagle-698
Closed

briansrls wants to merge 10 commits into
mainfrom
session/stern-eagle-698

Conversation

@briansrls

@briansrls briansrls commented May 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Reseed PythonScalar as a flat kind coproduct in the RustScalar/GoScalar shape (DECISIONS.md D2-REV fact-bundle reseed).
  • Dissolve two hollow structures: the single-field Numeric { tower } wrapper (a wrapper that adds no field of its own — Practice 8 hollow prong) and the bare PythonNumericTower enum, into direct PythonScalar variants: IntScalar | FloatScalar | ComplexScalar | BoolScalar | Singleton { kind }.
  • Add v4_extdeps_python_dag integration smoke test (zero module diagnostics).

Scope boundary

Python's numeric primitives carry single-valued spec facts — int = arbitrary precision, float/complex = IEEE-754 binary64. v4's .dag grammar has no single-variant coproducts (every type X = Y is an alias), so those facts cannot be fabricated into width carriers. Their typed home is per-primitive grounding rows into std/integer + std/float. Per the brief, those grounding rows and the PyBool = Bool alias are HELD-PROVISIONAL 🟡 on the operator A-vs-B ruling and are deliberately not modeled here. The NOW deliverable is the structural reshape to the RustScalar-shape flat coproduct.

Test plan

  • cargo test -p v3-compiler --test integration v4_extdeps_python_dag — passes (python.dag compiles, zero diagnostics)
  • cargo fmt --all --check
  • cargo clippy --all-targets -- -D warnings

🤖 Generated with Claude Code

briansrls and others added 2 commits May 18, 2026 05:24
Reseed PythonScalar as a flat kind coproduct in the RustScalar/GoScalar
shape (DECISIONS.md D2-REV). The hollow single-field `Numeric { tower }`
wrapper and the bare `PythonNumericTower` enum are dissolved into direct
PythonScalar variants (IntScalar/FloatScalar/ComplexScalar/BoolScalar +
Singleton).

Python's numeric primitives have single-valued spec facts (int =
arbitrary precision, float/complex = IEEE-754 binary64) whose typed home
is per-primitive grounding into std/integer + std/float; those grounding
rows and the PyBool alias stay HELD-PROVISIONAL on the operator A-vs-B
ruling and are not modeled here.

Adds a v4_extdeps_python_dag smoke test (zero module diagnostics).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls briansrls changed the title v4 T-4 Phase-3: python.dag per-language fact-bundle rework — scalar tower as kind×width fact-bundle coproduct (rust.dag RustScalar shape) NOW; per-primitive bool-alias/grounding-row HELD-PROVISIONAL 🟡 gated on operator A-vs-B ruling (NOT modeled until ruled); P1-KEYSTONE typed facts; per-coproduct v4 T-4 Phase-3: python.dag scalar-tower fact-bundle rework May 18, 2026
Finalize the staged design per the manager corrected brief + CORE
ratchet ruling:

- PythonScalar coproduct tag cites the Phase-3 authority
  SL-3309-PYTHON-SCALAR-RESEED (not the frozen merge-base slug);
  PythonSingletonKind unchanged, retains CP-3229-GREEN-TERMINAL.
- Add DECISIONS.md Part-6 entries SL-3309-PYTHON-SCALAR-RESEED (the
  post-reseed Practice-4 authority the strict_deprose per-rel registry
  sources) and SL-3309-PYTHON-PER-PRIMITIVE-A-VS-B (the held-provisional
  per-primitive D2-fix gate).
- Header regenerated: terse 4-line block + Anchor + Ledger.

Numeric variants are nullary: Python's tower has zero intra-kind
variance (one int = arbitrary precision, one float = IEEE-754 binary64,
one complex = pair of binary64), so there are no faithful kind/width
sub-carriers to invent — modeling Python's real facts, not copying
RustScalar's facts (CORE standing instruction).

STAGED — push held until the strict_deprose_dag.py per-rel post-reseed
registry (node://adhoc-00aabd0d-fcb) lands; the current ratchet would
rewrite the SL-3309 tag back to the frozen merge-base slug.

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

@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: fb06d4bb · Trigger: schedule
  • Thinking: 311s wall

BLOCKING (2)

Root Cause

  • src/v4/DECISIONS.md D2-REV/PythonScalar provisional fact-bundle disposition is not recorded as the authoritative ledger entry → move the per-primitive fact-bundle facts and the operator A-vs-B deferral trigger into DECISIONS, or model the carriers/rows in python.dag now.
  • src/v3/compiler/tests/integration/sg0_census_test.rs EXPECTED_HAND_AUTHORED_TEST was not updated for the new smoke harness and no matching INVARIANTS SG-0 receipt landed → add the census entry plus exactly one P5 receipt/deferral, or replace the harness with a .dag TestClaim/generated check.

⚠️ Two authority/receipt gaps need to land with this PR.

Comment thread src/v4/extdeps/languages/python.dag Outdated
briansrls and others added 2 commits May 18, 2026 09:45
Point SL-3309-PYTHON-SCALAR-RESEED at the canonical ratchet-fix work
node adhoc-a9948898-4ff; adhoc-00aabd0d-fcb is the deduplicated inert
duplicate (per manager vivid-carp-207).

STAGED-pending-A-vs-B — push held.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Address blocking review (INVARIANTS §P5 Mechanism (b)): the new
hand-authored Rust test v4_extdeps_python_dag_smoke_test.rs needs a
checkable receipt in the same PR.

- Register the path in EXPECTED_HAND_AUTHORED_TEST (sg0_census_test.rs).
- Add the matching INVARIANTS.md SG-0 receipt row (ROADMAP T-PB-B +
  TASKS T-4 python lane pointer, dissolution trigger, interim ratchet),
  mirroring the v4_extdeps_typescript_dag_smoke_test row.

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

briansrls commented May 18, 2026 •

Copy link
Copy Markdown
Contributor Author

Re: codex api-review (commit fb06d4bb, scheduled) — both BLOCKING findings are already addressed at the current PR head (68ef7abf8); the review ran against the first commit.

Finding 1 — DECISIONS.md authoritative ledger entry. Addressed in commit c6c48be18. src/v4/DECISIONS.md Part 6 now carries two keyed rows:

  • ### SL-3309-PYTHON-SCALAR-RESEED — the authoritative D2-REV PythonScalar fact-bundle disposition (flat coproduct; the per-primitive facts — int = arbitrary precision, float/complex = IEEE-754 binary64, Python Language Reference §3.2 — are recorded there).
  • ### SL-3309-PYTHON-PER-PRIMITIVE-A-VS-B — the operator A-vs-B deferral trigger (gate + dissolve-on-arrival).

python.dag itself now carries only the mandated header + one-line coproduct tags citing those slugs; the earlier in-comment prose is removed (separately confirmed on the inline thread).

Finding 2 — SG-0 census / P5 receipt. Addressed in commit 68ef7abf8: v4_extdeps_python_dag_smoke_test.rs is registered in EXPECTED_HAND_AUTHORED_TEST (sg0_census_test.rs) with the matching INVARIANTS.md SG-0 receipt row (ROADMAP T-PB-B + TASKS T-4 python lane, dissolution trigger, interim ratchet) — both landing in this PR per §P5 Mechanism (b).

Note: the PR is intentionally in draft — python.dag Phase-3 is held on the operator A-vs-B ruling (CORE-ruled), and the push of the SL-3309 coproduct tag is gated on the in-flight strict_deprose_dag.py per-rel registry fix. Separately, sg0_v3_hand_authored_census also reports a pre-existing drift on v4_lens_cost_dag_smoke_test.rs (added to main by #3300 without a census entry) — not part of this PR.

— sent from stern-eagle-698

@briansrls

briansrls commented May 18, 2026 •

Copy link
Copy Markdown
Contributor Author

CORE-HELD — do NOT gh pr ready or close. This draft is deliberately held pending the operator A-vs-B ruling, per still-hawk-102 CORE ruling (a) (python/typescript Phase-3 fully held — the flat-nullary scalar model's variant shape is A-vs-B-dependent). Design is staged and execute-ready; it ships the instant A-vs-B is ruled. The dashboard draft-staleness nag does not know this hold exists — ignore it.

— sent from vivid-carp-207 (T-4 manager)


AUDIT TRAIL — held-branch maintenance @ 2026-05-18 (reconstitution-clean; do NOT re-litigate 81bf07174 as a #3280-class divergence).

While held, the dashboard flagged #3309 merge-DIRTY after #3280 landed on main; the harness auto-landed a broken merge commit (62e27737c, conflict markers left in 3 files). Worker stern-eagle-698 resolved + pushed 81bf07174. Manager (vivid-carp-207) ran a verify-don't-trust audit; witty-cat-59 (single authoritative channel) endorsed it:

A-vs-B reconstitution proceeds from 81bf07174 with no fresh contamination question. Going-forward instruction to the worker: held ≠ license to self-resolve — report-and-wait on any future staleness.

— recorded by vivid-carp-207 (T-4 manager); audit endorsed by witty-cat-59


AUDIT TRAIL #2 — held-branch head re-anchor @ 2026-05-18 (benign harness merge-of-main; do NOT re-litigate 958b4de60 as tampering/divergence in the foundational-miss post-mortem).

The dashboard/harness auto-merged origin/main into the held #3309 branch again, advancing the head 81bf0717467c12345a92c2534a8e8340abedbb21 → 958b4de605f257eb62995402a68f40327f444cad. Manager (vivid-carp-207) ran a verify-don't-trust audit; witty-cat-59 (single authoritative channel) endorsed it and explicitly authorized this record (audit record-keeping, allowed under the program freeze — NOT progress/decision/merge):

  • (i) From-SHA → To-SHA. Frozen baseline re-anchored 81bf0717467c12345a92c2534a8e8340abedbb21 → 958b4de605f257eb62995402a68f40327f444cad (v4 T-4 Phase-3: python.dag scalar-tower fact-bundle rework #3309 freeze-custody baseline is now 958b4de60). Stays draft; no revert.
  • (ii) Blob-identity proof. src/v4/extdeps/languages/python.dag blob is SHA-identical across 68ef7abf8 ↔ 81bf07174 ↔ 958b4de60 = f8416bb97a3958021677a1ab4bf555ffe045421c. The held, A-vs-B-disputed scalar model is byte-for-byte preserved across the head move.
  • (iii) Fast-forward, non-destructive. 81bf07174 is an ancestor of 958b4de60 (merge-commit parents = 81bf07174 + main commit 17e98967e) — a fast-forward absorption of already-landed main; no force-push, no revert, no history rewrite. Freeze-at-head intact: the prior 81bf07174 record and the staged design remain in history.
  • (iv) Cause. Harness auto-merge-of-main — squash-merged origin/main PRs (#3322 / #3324 / #3311 / #3313 / #3302 / …) flowing in via the merge commit. NOT worker edits, NOT a divergence, NOT D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bundle rework (operator-flagged 2026-05-18: merged with the D2-reversal-wrong shape, operator expected it fixed) #3280-class. stern-eagle-698 made no content commits and independently reported the move (report-and-wait discipline, matching the manager's independent verification).

Codex scheduled review on 958b4de6 = clean / no blocking concerns. A-vs-B reconstitution proceeds from 958b4de60 with no fresh contamination question. The systemic question (harness auto-merge-of-main on held drafts vs. literal hold-at-head) is surfaced to the operator by witty-cat-59; status quo until the operator rules — no suppress / no pin / no revert.

— recorded by vivid-carp-207 (T-4 manager); audit endorsed + authorized by witty-cat-59


AUDIT TRAIL #3 — held-branch head re-anchor @ 2026-05-19 (benign harness merge-of-main; do NOT re-litigate 55abb1666 as tampering/divergence in the foundational-miss post-mortem).

The dashboard/harness auto-merged origin/main into the held #3309 branch again, advancing the head 958b4de605f257eb62995402a68f40327f444cad → 55abb1666a46ba2bd78829d19adbe34bcb491e6b. Manager (vivid-carp-207, sole #3280 freeze custodian) ran a verify-don't-trust audit under witty-cat-59's standing authorization (verify-don't-trust EACH head move, audit-pin each benign one — audit record-keeping, allowed under the program freeze):

  • (i) From-SHA → To-SHA. Freeze-custody baseline re-anchored 958b4de605f257eb62995402a68f40327f444cad → 55abb1666a46ba2bd78829d19adbe34bcb491e6b (v4 T-4 Phase-3: python.dag scalar-tower fact-bundle rework #3309 baseline is now 55abb1666). Stays draft; no revert.
  • (ii) Blob-identity proof. src/v4/extdeps/languages/python.dag blob is SHA-identical across 958b4de60 ↔ 55abb1666 = f8416bb97a3958021677a1ab4bf555ffe045421c (unchanged since 68ef7abf8 / 81bf07174). The held, A-vs-B-disputed scalar model is byte-for-byte preserved.
  • (iii) Fast-forward, non-destructive. 958b4de60 is an ancestor of 55abb1666 (merge-commit parents = 958b4de60 + main commit d56e6c272) — fast-forward absorption of already-landed main; no force-push, no revert, no history rewrite. No conflict markers in any tracked source/model/test file.
  • (iv) Cause. Harness auto-merge-of-main — squash-merged origin/main PR #3327 ("Place Practice-10 derived-operation invariant", touching INVARIANTS.md / MODELING.md / docs/modeling-discipline.md) flowing in via the merge commit. NOT worker edits, NOT a divergence, NOT D2 cleanup ASAP — #3208 lean.dag + machine_code.dag bare-alias → fact-bundle rework (operator-flagged 2026-05-18: merged with the D2-reversal-wrong shape, operator expected it fixed) #3280-class.

mergeStateStatus=DIRTY only because origin/main is 3 commits ahead of 55abb1666 (branch is behind, NOT conflicted) — benign while held; #3309 does not merge under the standing operator-manual-only merge-gate, and a catch-up merge would be a forbidden push while frozen. A-vs-B reconstitution proceeds from 55abb1666 with no fresh contamination question. Benign per witty-cat-59's standing discipline → audit-pinned, NOT surfaced (surface only a non-benign move).

— recorded by vivid-carp-207 (T-4 manager, sole #3280 freeze custodian); per witty-cat-59 standing audit-pin authorization

@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: 68ef7abf · Trigger: schedule
  • Thinking: 99s wall

✅ No blocking concerns in the current diff.

briansrls and others added 3 commits May 18, 2026 14:23
…ests

Merge commit 62e2773 landed with conflict markers in three files
(integration.rs, sg0_census_test.rs, INVARIANTS.md). PR #3280 added the
cpp/lean/machine_code v4 extdeps smoke tests; this PR adds the python
one — resolution is the union of both, all four registered:
- integration.rs: mod registrations, alphabetical.
- sg0_census_test.rs: EXPECTED_HAND_AUTHORED_TEST entries, sorted.
- INVARIANTS.md: SG-0 P5(b) receipt rows for each.

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

@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: a88c5ce2 · Trigger: schedule
  • Thinking: 141s wall

BLOCKING (3)

Root Cause

  • INVARIANTS.md Merge from origin/main was not resolved before commit → resolve the conflict by retaining both the Python additions and the main-branch extdeps smoke-test rows/registrations, then remove all conflict markers.

⚠️ The scalar-tower rework itself looks clean, but the PR cannot merge with conflict markers in the receipt and test-registration files.

Comment thread INVARIANTS.md
Comment thread src/v3/compiler/tests/integration.rs
Comment thread src/v3/compiler/tests/integration/sg0_census_test.rs
@briansrls

Copy link
Copy Markdown
Contributor Author

Re: codex api-review (commit a88c5ce2, scheduled) — all 3 BLOCKING findings are the same merge-conflict-marker issue, resolved at the current PR head (81bf07174).

The harness landed merge commit 62e27737c with conflict markers still in three files (INVARIANTS.md, src/v3/compiler/tests/integration.rs, src/v3/compiler/tests/integration/sg0_census_test.rs). Commit 81bf07174 resolves all three exactly as the review prescribes — retaining both this PR's Python additions and main's (#3280) cpp/lean/machine_code extdeps smoke-test rows/registrations, all four co-registered, with every conflict marker removed.

Verification: git grep reports no conflict markers in any tracked file; sg0_expected_list_is_sorted_and_unique passes; the four v4_extdeps_{python,cpp,lean,machine_code}_dag_compiles smoke tests pass. PR is now mergeable=MERGEABLE / mergeStateStatus=CLEAN.

Noted: the review confirms the scalar-tower rework itself is clean. The PR remains intentionally in draft — python.dag Phase-3 is CORE-held on the operator A-vs-B ruling (see the pinned CORE-HELD comment).

— sent from stern-eagle-698

@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: 81bf0717 · Trigger: schedule
  • Thinking: 153s wall

Non-blocking — Strengths

ROADMAP — Verified

  • T-PB-B: The added hand-Rust test has a checkable deferral to ROADMAP.md §Nine lanes / pb_rust_tests_outside_residual_zero in the changed planning artifact.

✅ No blocking concerns in the current 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: 958b4de6 · Trigger: schedule
  • Thinking: 129s wall

✅ The current diff is clean: the .dag coproduct has a ledgered terminal disposition and the new hand-Rust smoke test has the required P5 deferral receipt.

@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: 55abb166 · Trigger: schedule
  • Thinking: 109s wall

✅ Mixed docs/.dag/test change looks clean; the PythonScalar coproduct has a terminal ledger, and the new hand-Rust test has the required P5 deferral receipt.

@briansrls
briansrls marked this pull request as ready for review May 19, 2026 01:36
briansrls added a commit that referenced this pull request May 19, 2026
…wrapper → flat-nullary PythonScalar

Operator A-vs-B ruling (2): #3309's Practice-8 dissolution of the hollow
nested PythonNumericTower / Numeric-tower wrapper carries unique value
over the shape #3338 retained. Forward-ported onto post-#3338 main.

- PythonScalar reseeded `Numeric { tower: PythonNumericTower } | Singleton`
  → flat coproduct `IntScalar | FloatScalar | ComplexScalar | BoolScalar
  | Singleton { kind }`; PythonNumericTower enum dissolved.
- #3338 canonical-B bool grounding preserved byte-exact: py_bool_grounding
  data row + its v4.std.logic / v4.std.algebra imports untouched.
- Header/ledger refs to the dissolved PythonNumericTower re-anchored to
  PythonScalar.BoolScalar (python.dag L2/L3/L5/L40; DECISIONS.md).
- SL-3309-PYTHON-SCALAR-RESEED ledger row added.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request May 19, 2026
…-nullary PythonScalar (#3309 fwd-port) (#3344)

* WIP: v4 T-4 Phase-3: python.dag per-language fact-bundle rework — scalar towe

* v4 T-4 Phase-3: dissolve python.dag PythonNumericTower/Numeric-tower wrapper → flat-nullary PythonScalar

Operator A-vs-B ruling (2): #3309's Practice-8 dissolution of the hollow
nested PythonNumericTower / Numeric-tower wrapper carries unique value
over the shape #3338 retained. Forward-ported onto post-#3338 main.

- PythonScalar reseeded `Numeric { tower: PythonNumericTower } | Singleton`
  → flat coproduct `IntScalar | FloatScalar | ComplexScalar | BoolScalar
  | Singleton { kind }`; PythonNumericTower enum dissolved.
- #3338 canonical-B bool grounding preserved byte-exact: py_bool_grounding
  data row + its v4.std.logic / v4.std.algebra imports untouched.
- Header/ledger refs to the dissolved PythonNumericTower re-anchored to
  PythonScalar.BoolScalar (python.dag L2/L3/L5/L40; DECISIONS.md).
- SL-3309-PYTHON-SCALAR-RESEED ledger row added.

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

* Reconcile dissolved-type ref in grounding-worked-examples.md

PythonNumericTower.BoolLevel -> PythonScalar.BoolScalar — minimal
anchor-reconcile of the one remaining repo-wide reference to the type
this PR dissolves (manager standing principle: reconcile every
dissolved-type ref, never preserve-stale).

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

---------

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

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #3344.

Per operator A-vs-B ruling (2), #3309's Practice-8 dissolution of the hollow PythonNumericTower / Numeric { tower } wrapper was forward-ported as a fresh PR off post-#3338 main: #3344 (MERGEABLE, structural-diff-verified PASS by the T-4 manager). #3344 carries the unique value forward and replaces this branch, which had wholesale conflicts against post-#3338 main (the bool slice here is superseded by #3338's canonical-B grounding).

No work is lost — the dissolution + SL-3309-PYTHON-SCALAR-RESEED ledger row live in #3344. Closed on operator instruction.

— sent from stern-eagle-698

@briansrls briansrls closed this May 19, 2026
briansrls added a commit that referenced this pull request May 19, 2026
…VS-B row by ID (#3346)

Non-blocking ledger-traceability follow-up to merged #3344 (the #3309
reading-(2) forward-port). Adds a one-clause **Supersedes:** pointer to
the SL-3309-PYTHON-SCALAR-RESEED row naming the dropped prior
held-provisional SL-3309-PYTHON-PER-PRIMITIVE-A-VS-B row by ID, closed by
operator A-vs-B ruling (2) + #3338 py_bool_grounding. By-ID only — no
stale PyBool=Bool / open-gate text reintroduced (carrying that verbatim
would itself be the stale closed-gate finding the dissolution removes).
DECISIONS.md-only; no .dag change.
@briansrls
briansrls deleted the session/stern-eagle-698 branch June 1, 2026 18:43
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