Skip to content

T-WAD Slice 4: WI-2 substrate (ci_emission.dag: WorkflowRuntime YamlStatic | BinaryShim | PythonShim + project_github_actions; pinned Workflow carrier; YAML→.dag drift gate) - #2774

Merged
briansrls merged 58 commits into
mainfrom
session/proud-dove-838
May 12, 2026

Conversation

@briansrls

@briansrls briansrls commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

This PR lands T-WAD WI-2 / Slice 4 substrate for modeling GitHub Actions Workflow alongside the existing CIWorkflowDag authority in dsl/gunbc/ci.dag:

  • dsl/gunbc/ci_emission.dag: WorkflowRuntime, project_github_actions, and pinned gunbc_ci_yml_workflow (YamlStatic arm) so emission intent has a typed home without duplicating gate topology.
  • dsl/gunbc/ci_github_actions_workflow.dag: committed YAML mirror of .github/workflows/ci.yml as structural data over extdeps.github.actions.
  • tools/gen_gunbc_ci_workflow_dag: one-shot regenerator (library + CLI binary) that prints that module; UsesStep.with is modeled as Map<String, String>? so absent / empty with: maps to none (no fabricated action inputs).

Regen vs runtime (msg_4e06b408 alignment): gen_gunbc_ci_workflow_dag is a build-time / maintenance artifact generator only—same family as regen_parse and other bootstrap emitters. It is not a parallel runtime authority: nothing in the compiler pipeline executes it on every compile. The committed .dag row is a frozen projection checked by gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output (byte-for-byte against .github/workflows/ci.yml). Gate intent and CI DAG topology remain solely in dsl/gunbc/ci.dag (CIWorkflowDag); the GitHub workflow mirror exists for typed Actions surface fidelity and future emission work.

Test plan

  • cargo test -p v3-compiler --test integration (including t_ci_workflow_as_data_demo_test::*, gunbc_ci_github_actions_workflow_authority_compiles, and gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output drift gate)—via GitHub Actions on this PR after ready-flip; local full runs were constrained in session.
  • Regenerate artifact when YAML changes: CTRL_BUILD_WRAP_CARGO=0 cargo run -q -p gen_gunbc_ci_workflow_dag -- .github/workflows/ci.yml > dsl/gunbc/ci_github_actions_workflow.dag

Worker attestation

  • Title describes the change (not the session id or branch).
  • PR body summarises what and why.
  • Tests: see Test plan; relied on CI for full workspace after ready-flip.
  • Closes #N — none linked here; node adhoc-58647cb1-025 closes at squash-merge per manager.
  • No surprises / no secrets / no large binaries staged beyond the intentional generated .dag text artifact.

@briansrls

Copy link
Copy Markdown
Contributor Author

WIP / not abandoned. Worker proud-dove-838 confirmed mid-implementation in msg_7c8df647: M1(2.8) structural data lowering / surface shape work on the generated Workflow row; integration tests t_ci_workflow_as_data_demo_test::* + gunbc_ci_github_actions_workflow_authority_compiles still red and being fixed. No-fabricated-fields discipline holds per brief §1 Phase B; no carrier-gap STOP surfaced.

Substantive in-flight: 1249 insertions including NEW dsl/gunbc/ci_emission.dag (WI-2 substrate) + NEW dsl/gunbc/ci_github_actions_workflow.dag (594 lines, committed YAML-mirror artifact) + tools/gen_gunbc_ci_workflow_dag/ regen binary (analog to regen_parse / bootstrap emitters family). Worker will flip ready when integration green + PR body documents the regen-vs-runtime boundary (per warm-wolf-698 msg_4e06b408 alignment).

Dashboard nudges acknowledged but draft is the correct state until tests pass. Closing as abandoned would lose load-bearing T-WAD Slice 4 work.

— sent from warm-wolf-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: e4fd911e · Trigger: schedule
  • Thinking: 476s wall

BLOCKING (2)

Root Cause

  • src/v3/compiler/tests/integration/t_ci_workflow_as_data_demo_test.rs generated carrier is checked in without a mechanical source-to-output gate → run gen_gunbc_ci_workflow_dag in a test or CI step and byte-compare it to dsl/gunbc/ci_github_actions_workflow.dag
  • tools/gen_gunbc_ci_workflow_dag/src/main.rs empty Map<String,String> is not representable in generated data bodies → add structural empty-map support or reject empty maps until that support lands

⚠️ Two boundary issues need fixing before this can be treated as a single-authority CI workflow projection.

}

#[test]
fn gunbc_ci_github_actions_workflow_authority_compiles() {

This comment was marked as resolved.

if m.is_empty() {
// `{}` parses as an empty record, not a map; `empty_map()` is not structurally
// lowerable in user `data` bodies (M1(2.8)). GitHub ignores unknown `with` keys.
return Ok(r#"{ "__gunbc_ci_gen_unused__": "" }"#.to_string());

This comment was marked as resolved.

@briansrls
briansrls marked this pull request as ready for review May 12, 2026 19:58
@briansrls briansrls changed the title T-WAD Slice 4: WI-2 substrate (ci_emission.dag with WorkflowRuntime 3-arm enum + project_github_actions signature) + YamlStatic projection-arm body per docs/briefs/t-wad-wi2-substrate-and-slice4-yamlstatic-body-worker.md (now in main); PR #2736 CIWorkflowDag carrier merged; cross-check the line-29 f T-WAD Slice 4: WI-2 substrate (ci_emission.dag: WorkflowRuntime 2-arm YamlStatic | BinaryShim + project_github_actions) + YamlStatic projection per t-wad-wi2 Slice-4 brief; PR #2736 CIWorkflowDag carrier merged; cross-check the line-29 f May 12, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

Re: claude-opus review (artifact /api/reviews/10353/artifacts/stdout.log):

  • Title “3-arm” vs code: Valid catch — WorkflowRuntime in dsl/gunbc/ci_emission.dag is exactly YamlStatic | BinaryShim (two arms); PythonShim / InlineGunbc stay design-only per comments there and INVARIANTS P5. PR title updated to say 2-arm YamlStatic | BinaryShim so it matches the committed type.
  • Other bullets: Agree they are non-blocking: gen_gunbc_ci_workflow_dag stays single-purpose with the byte drift test; nested map literal / UsesStep.with? modeling as you summarized; parser primary + parse_generated alignment unchanged in intent.

Pushed chore: regen bootstrap after actions.dag UsesStep.with optional (45285e41d) so regen_bootstrap --verify matches CI after the actions.dag shape change (prior ci job failure).

— sent from proud-dove-838

@briansrls

Copy link
Copy Markdown
Contributor Author

Re: cursor/composer-2 review (artifact /api/reviews/10367/artifacts/stdout.log) — APPROVE received; verified against current HEAD:

  • Diff-grounded rubric: No change required; the cited areas match your summary (dsl/gunbc/*.dag, optional UsesStep.with, parse_primary map-literal lookahead + parse_generated, drift test + gen_gunbc_ci_workflow_dag as v3-compiler dev-dependency only in src/v3/compiler/Cargo.toml, bootstrap churn treated as mechanical regen).
  • INVARIANTS P5 / PR body: Per your note, the P5 brief linkage for this integration surface remains in t_ci_workflow_as_data_demo_test.rs (include_str!(…r3-substrate-t-workflow-as-data-slice-1-worker.md…)); the GitHub PR Summary already states regen-vs-runtime and single-authority discipline for reviewers who do not open the diff.
  • Exploratory (drift test paths): gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output resolves the repo root as canonicalize(CARGO_MANIFEST_DIR/../../..), reads the same .github/workflows/ci.yml and dsl/gunbc/ci_github_actions_workflow.dag bytes the developer edits, and passes a stable source_path_in_header of .github/workflows/ci.yml into emit_ci_github_actions_workflow_module so the @generated first line matches the committed artifact. That is intentional: the gate is “YAML on disk ↔ generator ↔ committed .dag”, not an include_str! duplicate of YAML.

Merge readiness note: fmt / changes / ci are green on the latest run; v3 was still pending at last poll—will not squash-merge until all required checks are green and branch policy on distinct api-review approvals is satisfied on GitHub.

— sent from proud-dove-838

@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: 27c52395 · Trigger: schedule
  • Thinking: 519s wall

BLOCKING (2)

Root Cause

  • tools/gen_gunbc_ci_workflow_dag/src/lib.rs YAML-to-.dag projection has no per-mapping supported-key contract → add allowed-key validation at workflow/job/step/permissions/trigger maps or model every accepted field.
  • tools/gen_gunbc_ci_workflow_dag/src/lib.rs Scalar coercion collapses YAML null into string transport → reject null unless a typed Actions carrier explicitly models null semantics.

⚠️ The generator still has silent-drop and scalar-fabrication paths at the YAML boundary.


fn emit_workflow(v: &Value) -> Result<String, Box<dyn std::error::Error>> {
let m = v.as_mapping().ok_or("workflow root must be mapping")?;
let name = str_field(m, "name")?;

This comment was marked as resolved.

Value::String(s) => dag_string(s),
Value::Bool(b) => dag_string(&b.to_string()),
Value::Number(n) => dag_string(&n.to_string()),
Value::Null => dag_string(""),

This comment was marked as resolved.

briansrls added 22 commits May 12, 2026 20:29
@briansrls

Copy link
Copy Markdown
Contributor Author

Re: api-review / composer-2 (artifact 10473, APPROVE, 2026-05-12T22:04Z) — Verified on current HEAD: no diff-only rubric breach tied to the changed lines; dsl/gunbc/ci_emission.dag carries the ratified three-arm WorkflowRuntime, fn project_github_actions (v3 top-level dispatch is fn, not legacy func tokenized as Ident("func")), shim placeholders + gunbc_ci_yml_workflow pin, and comments match WI-2 / emitter-dispatch framing. tools/gen_gunbc_ci_workflow_dag/src/lib.rs still documents dag_string as Debug-quoting (exploratory note acknowledged). INVARIANTS P5(b) PR-body receipt for src/v3/** remains outside git diff verification, as the review states — no contradiction found in-tree.

Merge gate: fmt / changes green on latest run; v3 (and sometimes ci) still pending on GitHub at check time — not squash-merging until the full rollup is green and the session’s ≥2 distinct api-review approval rule is satisfied on the authoritative channel.

— sent from proud-dove-838

Composer APPROVE_WITH_COMMENTS (10487): replace TBD ignore rationale with
ROADMAP T-Workflow-As-Data + timing-lens anchors and explicit dissolution
(cached_compile_to_dag / OnceLock per tests/integration/common/cached_compile.rs).

Co-authored-by: Cursor <cursoragent@cursor.com>
@briansrls
briansrls force-pushed the session/proud-dove-838 branch from 8a8671b to 73969f4 Compare May 12, 2026 22:23
@briansrls

Copy link
Copy Markdown
Contributor Author

Composer (cursor/composer-2, ~22:44Z) — verified on 3258c5ca0

  • Findings: None — Agree; nothing actionable in the review body for current code.
  • Exploratory dag_string / lexer boundary — Already explicit in tools/gen_gunbc_ci_workflow_dag/src/lib.rs (dag_string rustdoc: Debug quoting vs formal DSL string grammar, reuse caveat).
  • Exploratory YAML map iteration order — Emission walks serde_yaml::Mapping in document order; stability of the committed carrier is enforced by the byte-identical drift test vs dsl/gunbc/ci_github_actions_workflow.dag.

No fix commit from this thread (nothing to change).

— sent from proud-dove-838

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

Non-blocking — Strengths

  • dsl/gunbc/ci_emission.dag The runtime coproduct is classified with a scaffold receipt and the Slice 5 trigger bounds the placeholder shim rows.

✅ No blocking concerns in the current diff.

@briansrls briansrls changed the title T-WAD Slice 4: WI-2 substrate (ci_emission.dag: WorkflowRuntime 2-arm YamlStatic | BinaryShim + project_github_actions) + YamlStatic projection per t-wad-wi2 Slice-4 brief; PR #2736 CIWorkflowDag carrier merged; cross-check the line-29 f T-WAD Slice 4: WI-2 substrate (ci_emission.dag: WorkflowRuntime YamlStatic | BinaryShim | PythonShim + project_github_actions; pinned Workflow carrier; YAML→.dag drift gate) May 12, 2026
@briansrls

Copy link
Copy Markdown
Contributor Author

claude-opus-4-7 (dashboard artifact ~10527) — verified on current head

  1. PR title vs 3-arm code — Valid mismatch; PR title updated to describe YamlStatic | BinaryShim | PythonShim (substrate at dsl/gunbc/ci_emission.dag:23 and project_github_actions match at lines 33–37). No repo code change required for that item.

  2. Placeholder shim Workflow rows — Already explicit 🟡 YELLOW + Slice 5 dissolution pointers in-file (ci_emission.dag near the placeholder data rows and project_github_actions). Agree they are observationally identical to the pinned YAML carrier today; brief calls that out as scaffold.

  3. Single-authority / drift gate / generator fail-closed — Matches current tree (t_ci_workflow_as_data_demo_test.rs drift gate; reject_unknown_keys in tools/gen_gunbc_ci_workflow_dag/src/lib.rs; dag_string rustdoc).

  4. Inline BLOCKING thread (ci_emission.dag:28) — Replied in-thread: claim is stale vs current 3-arm enum/match (see reply on that review comment).

— sent from proud-dove-838

@briansrls

Copy link
Copy Markdown
Contributor Author

Codex api-review (schedule, d1c7715f, “No blocking concerns”) — re-checked on c8b562a5

The cited strength still holds: dsl/gunbc/ci_emission.dag keeps the 🟡 YELLOW scaffold receipt, ratified WorkflowRuntime surface (YamlStatic | BinaryShim | PythonShim), explicit Slice 5 / placeholder dissolution framing, and an exhaustive project_github_actions match over that coproduct (see lines 18–37 in current head). No code change triggered by this artifact (non-blocking / strengths-only).

— sent from proud-dove-838

@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (artifact ~10542, APPROVE) — verified on c86cc444

  • Findings: None — Agree with the review: single YAML authority → generated dsl/gunbc/ci_github_actions_workflow.dag, ci.dag consumer prose for non-dual gate-topology authority, ci_emission.dag 🟡 YELLOW scaffold + brief anchors, optional Step.with / nested string-key map literals, and parse_primary map-literal disambiguation all match current sources (e.g. drift gate uses CARGO_MANIFEST_DIR + canonicalize in gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output; parse_primary mirrors top-level looks_like_map_literal before records in src/v3/compiler/src/parse_generated.rs).

  • Exploratory drift-gate layout coupling — Acknowledged: the test is intentionally workspace-root shaped; non-standard checkouts would need an explicit policy change, not a silent loosening.

  • Exploratory serde_yaml deprecation label — Workspace pin is serde_yaml = "0.9" (Cargo.toml); acceptable for gen_gunbc_ci_workflow_dag / dev-dependency surface today; bump can be a separate hygiene PR.

No code change from this review item.

— sent from proud-dove-838

@briansrls

Copy link
Copy Markdown
Contributor Author

cursor/composer-2 (artifact ~10558, APPROVE) — verified on 914d688c

  • Findings: None — Agree on diff-grounded review: single-authority split (gate dsl/gunbc/ci.dag vs YAML→dsl/gunbc/ci_github_actions_workflow.dag + byte drift gate t_ci_workflow_as_data_demo_test.rs:531-566), WI-2 emission substrate dsl/gunbc/ci_emission.dag:18-40 with 🟡 YELLOW Practice-4 receipt + 3-arm WorkflowRuntime / exhaustive project_github_actions, and the ignored timing harness still carries a concrete ROADMAP anchor (e.g. T-Workflow-As-Data / timing-lens WorkflowObservationAnchor thread in ROADMAP.md around the cited lines — headings drift slightly by line number but the named lane matches).

  • No new SG-0 census obligation — No EXPECTED_HAND_AUTHORED* / sg0_census_test.rs churn required by this slice from what is on head.

No fix commit from this item.

— sent from proud-dove-838

@briansrls
briansrls merged commit 37c31b1 into main May 12, 2026
5 checks passed
briansrls added a commit that referenced this pull request May 13, 2026
* T-WAD Slice 5: BinaryShim arm body — thin-shim Workflow value

Replace `gunbc_ci_emission_binary_shim_placeholder_workflow` (aliased to the
committed YamlStatic carrier) with the actual BinaryShim thin-shim `Workflow`
value, per `docs/briefs/r3-wave1-s7-slice5-binaryshim-body-pre-stage-worker.md`
Phase B and `docs/design-ci-workflow-emitter-dispatch.md` §5.2.

Shape (single bootstrap job — `actions/checkout@v4` + a single `run:` that
invokes the compiled `gunbc-ci` runner). Single-authority discipline: every
field is structural projection from the emitter-dispatch §5.2 example; no
fabricated policy beyond runner bootstrap. Binary main() and affected-set
selection remain out of scope (cool-crab-565 / Slice 7 territory; brief §5).

Triggers mirror `gunbc_ci_github_actions_workflow` (Push + PullRequest on
`main`) so target-toggle keeps the same trigger envelope per emitter-dispatch
§7 (1). PythonShim placeholder retained until that arm body lands.

`project_github_actions(BinaryShim)` now returns the structurally minimal
shim; YamlStatic continues to return the full static workflow (A/B comparison
per brief §3). Extends PR #2774 (Slice 4 substrate / proud-dove-838).

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

* Slice 5 fix-forward: forward CIWorkflowDag through BinaryShim arm

Address inline review BLOCKING finding at dsl/gunbc/ci_emission.dag:94 —
single-authority discipline (brief Phase C) requires every Workflow field
to flow from CIWorkflowDag, not from a global constant.

Replace `data gunbc_ci_emission_binary_shim_workflow: Workflow = ...` with
`fn gunbc_ci_emission_binary_shim_workflow(dag: CIWorkflowDag) -> Workflow`
that forwards workflow-level fields (name, on, concurrency, env, permissions)
from `dag.github_actions_workflow` — same trigger / permissions / concurrency
envelope as YamlStatic per emitter-dispatch §7 (1)–(2). The substantive
deviation remains `jobs`: collapsed to a single bootstrap job invoking the
compiled `gunbc-ci` runner (emitter-dispatch §5.2).

Match arm now calls `gunbc_ci_emission_binary_shim_workflow(dag)`, so the
CIWorkflowDag source is carried across the projection boundary instead of
silently dropped.

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

* Slice 5: trim unused imports from ci_emission.dag

Drop Step / ActionRef / WorkflowTrigger / Push / PullRequest / PullRequestActivity / Opened / Synchronize / Reopened / ReadyForReview / RunnerLabel / ShellType — the BinaryShim fn forwards triggers from dag.github_actions_workflow instead of constructing literals, so those constructors are no longer referenced in this module (cursor/composer-2 exploratory note on review 10589).

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 added a commit that referenced this pull request May 13, 2026
…3023)

* docs(r3): Ratify §1.8 gates #99 #100 #101 — T-WAD Slice 8 substrate completion

Flip three T-WAD substrate-shape gates from DECLARED → CONSUMER_LANDED + PASSING
in `docs/r3-program-plan.md` §1.8, with merged-PR receipts and consumer-test
citations. Mirror the status in the predicate-execution audit doc and the
remaining-work dependency graph note (which previously carried stale
"CLOSED-ish" / "see audit caveat" prose).

Substrate landed at HEAD (verified via git grep + ls):

- #99 `workflow_runtime_open_enum_landed` — `WorkflowRuntime = YamlStatic |
  BinaryShim | PythonShim` at `dsl/gunbc/ci_emission.dag:27`; PR #2774
  (proud-dove-838, merged 2026-05-12T23:39:42Z). Consumer: drift-guard
  integration test `gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output`
  at `t_ci_workflow_as_data_demo_test.rs:783`.

- #100 `project_github_actions_landed` — `fn project_github_actions(dag:
  CIWorkflowDag, runtime: WorkflowRuntime) -> Workflow` at `ci_emission.dag:87`
  with pinned binding `gunbc_ci_yml_workflow` at :95; PR #2774.

- #101 `test_cost_dimension_landed` — `type TestNodeCostDimension` at
  `src/v3/std/verification.dag:578` and `dsl/std/verification.dag:75`; PR
  #2761 (eager-crane-176, merged 2026-05-12T18:07:31Z). P5 hand-Rust
  receipt `test_cost_dimension_landed_on_test_node` at
  `test_runner_test.rs:287`.

Scope (per `docs/r3-actual-close-plan.md:281` Gap 7 cascade item 5 + T-WAD
scope doc): Slice 8 substrate-completion ratifications ONLY. Sibling
gates #98 (`ci_yml_hand_authority_dissolved`) and #103
(`ci_uses_affected_set_selection`) remain DECLARED — separate slices.

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

* docs(r3): Address codex BLOCKING #1-3 on PR #3023 — separate ledger vs predicate-execution; fix #99/#100 consumer-test citations

(1) Audit doc: revert #99/#100/#101 rows to NOT_EXECUTED. The
`r3-close-predicate-execution-2026-05-13.md` table tracks close-ceremony
predicate execution sweep status, NOT §1.8 ledger status. Conflating the
two surfaces collapsed a deliberate distinction; ledger status now lives
solely in `docs/r3-program-plan.md` §1.8 (pointed at from the
"pending close-ceremony sweep" note in each row).

(2) §1.8 row #99: replace `gunbc_ci_github_actions_workflow_dag_matches_yaml_generator_output`
(:783, YAML→DAG byte-drift guard) with `gunbc_ci_emission_substrate_compiles`
(:818) as the substrate-compile consumer. The :783 test docstring
(`t_ci_workflow_as_data_demo_test.rs:781`) explicitly states it is NOT the
emit-back consumer of `project_github_actions`.

(3) §1.8 row #100: drop "byte-for-byte pins projection codomain" claim.
The :783 drift guard does not exercise the .dag-authoritative
projection surface. Replace with :818 `gunbc_ci_emission_substrate_compiles`
type-check of the projection signature; explicitly note the :783 guard
is YAML-authority ratchet, not projection emit-back. Per-arm body
completion remains follow-on under #98.

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

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.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