Skip to content

Restore src/v2 — comparison artifact + frozen-buildable - #3148

Merged
briansrls merged 3 commits into
mainfrom
v2-restoration
May 15, 2026
Merged

briansrls merged 3 commits into
mainfrom
v2-restoration

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Summary

Restores src/v2/ to the repository for honest v2-vs-v3 comparison + as the bootstrap source for ongoing v4 work (see PR #3147 for v4 context). v2 retired with ~1 hand-Rust residual; v3 sits at ~192 hand-authored files. Restoring v2 enables side-by-side review.

Three commits:

  1. Restore src/v2 for honest v2-vs-v3 comparison — restores the full v2 tree (126 files: .dag pipeline + stage0 + tests + docs) from the parent of the deletion commit 39ba75728 (R3 gate Daglang compiler scaffolding #42, PR R3 gate #42: delete src/v2/ directory (T-V2-Retirement G-2) #2693). No Cargo workspace changes in this commit.

  2. ci: re-enable v2 (frozen-buildable), freeze v3 via affected-set gating — re-adds src/v2/stage0 + src/v2/tests to Cargo workspace + restores the [profile.dev.package.v2-compiler] block. New CI structure:

    • affected job: detects v2/v3 affected from PR diff, emits outputs
    • New v2 job: runs bootstrap_fixed_point test only when src/v2/ or workspace deps affected (~2-3 min build + test)
    • v3 job: gated to run only when src/v3/ or dsl/ affected, OR push-to-main (was always-on; now frozen-on-PR per v3 abandonment)
    • self_host_ratchet: tolerates v3 being skipped (skipped-result is acceptable no-op)
    • scripts/detect-affected-components.sh: keeps detection logic out of YAML to satisfy gate Add external dependency type definitions for cloud, git, GitHub, LLM, and Rust #103's path-regex policy
  3. ci: tighten v3 affected-set — drop Cargo.toml/lock trigger — refinement: workspace dep changes do NOT trigger v3 CI under freeze. Saves CI minutes on every Cargo.toml-touching PR. If v3 is ever revived, the first src/v3/ PR catches latent dep-bump breakage at that point.

Net CI policy after merge

  • v2 affected: src/v2/ OR Cargo.{toml,lock} (v2 binary is frozen-buildable; deps changes can break the build)
  • v3 affected: src/v3/ OR dsl/ ONLY (FROZEN — workspace dep changes do NOT trigger v3 CI; v3 is abandoned)
  • push-to-main: always runs v3 + self_host_ratchet as trunk safety net

Verified locally

  • cargo build -p v2-compiler --release → builds clean (~1m, no bitrot)
  • cargo fmt --all --check → clean
  • cargo test -p v2-compiler-tests --release bootstrap_fixed_point -- --ignored --exact → passes (v2 still self-hosts at fixed point)
  • bash scripts/check-workflow-path-regex-inventory.sh → clean (path-regex policy passes)

Test plan

  • affected CI job emits correct outputs (v2=true since src/v2/ changed)
  • v2 CI job runs and passes (bootstrap_fixed_point test green)
  • v3 CI job does NOT run (this PR touches Cargo.toml but per new policy that does not trigger v3 — only src/v3/ or dsl/ do)
  • fmt, ci jobs pass

Context

Per operator request 2026-05-15: split out from PR #3147 (v4 program) so v2-restoration can be reviewed independently. PR #3147 continues with v4 scaffold + audit doc; this PR is the v2-only piece.

🤖 Generated with Claude Code

briansrls and others added 3 commits May 15, 2026 03:16
v2 was deleted in commit 39ba757 (R3 gate #42, PR #2693). Restoring
the full src/v2 tree from the parent of that commit so the v3 retirement
trajectory can be honestly evaluated against v2's proven 1-residual
self-hosted shape.

Restored src/v2/ contains the complete .dag pipeline (00_core through
05_emit*) plus stage0 and tests. Root Cargo.toml workspace entries are
NOT re-added — restoration is for source-comparison purposes; v2 is not
re-included in the build until/unless explicitly decided.

Per docs/design-pure-bootstrap-zero.md framing: v2 retired with 1
hand-Rust residual. v3 currently sits at 56 NON_TEST + 134 TEST + 2
FRAGMENTS = 192 hand-authored files. The comparison surface this enables
is load-bearing for the v4 program decision.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Coordinated CI policy change to support the v4 program (PR #3147):
both v2 and v3 are now frozen-buildable — workspace members that build
on demand but only run their heavy CI when their source is touched (or
on push-to-main for trunk verification).

## Changes

**Cargo.toml**: re-add `src/v2/stage0` + `src/v2/tests` to workspace
members, plus the `[profile.dev.package.v2-compiler]` block that v2's
Rc-aware stage0 needs (debug-assertions = false, opt-level = 2).
Verified locally: `cargo build -p v2-compiler --release` builds clean
in ~1m, no bitrot.

**.github/workflows/ci.yml**:

- New `affected` job: runs first (~30s), computes `v2`/`v3` outputs by
  diffing against origin/main (or HEAD~1 on push). Other jobs depend
  on its outputs.
- New `v2` job: runs `bootstrap_fixed_point --ignored` test only when
  src/v2/ or workspace deps are affected. Verifies v2's self-host
  property is preserved across any v2 modification.
- `v3` job: gated at top level — runs only when src/v3/, dsl/, or
  workspace deps affected, OR push-to-main. Effectively freezes v3 on
  PRs that don't touch it (the typical case during v4 development).
- v3-specific steps inside the shared `ci` job (bootstrap snapshot
  freshness gate, gate #103 path-regex inventory + integration tests)
  are gated on the same condition.
- `self_host_ratchet` job: now tolerates v3 being skipped (treats
  result=skipped as a valid no-op rather than a failure).

**scripts/detect-affected-components.sh**: new script that does the
git-diff-based detection. Lives outside ci.yml so it doesn't trip
gate #103's `workflow_no_path_regex_policy_ci_yml` policy (which
forbids path-selection substrings inside .github/workflows/*.yml).
Single authority: when v3 is unfrozen and the v3 affected-set lens
becomes canonical again, this script can be replaced by an invocation
of that lens — workflow integration point stays the same.

## Why this shape

- v2 is restored as comparison artifact + v4 bootstrap source. Editing
  v2 is rare but allowed; when it happens, fixed-point must hold.
- v3 is frozen pending the v4 program. Most PRs (v4 work, docs,
  process changes) don't touch v3 — gating skips the heavy v3 build/
  test (saves ~10-15min per PR).
- Both v2 and v3 are still in workspace so `cargo build --workspace`
  works for development; CI only invokes them via `-p` when affected.
- push-to-main always runs both v2 and v3 CI as trunk safety net,
  even when nothing in v2/v3 changed (catches dep-bump regressions).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per operator review: under v3 freeze, workspace dep changes should NOT
trigger v3 CI. v3 is abandoned; we don't care if it incidentally breaks
because of a dep bump. If v3 is ever revived, the first src/v3/ PR
catches any latent breakage at that point — costs nothing now.

Net rule (now enforced):
  v2 affected: src/v2/ OR Cargo.{toml,lock}    (v4 depends on v2 binary)
  v3 affected: src/v3/ OR dsl/ ONLY            (frozen — only explicit work)
  v4 affected: src/v4/ OR Cargo.{toml,lock}    (v4 builds via v2)

Effect on this PR: next CI run cancels the in-flight v3 job (via
cancel-in-progress concurrency policy) and skips v3 entirely. Future
v4 PRs that touch Cargo.toml will not drag the ~30min v3 build.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls
briansrls merged commit fdaedb1 into main May 15, 2026
6 checks passed
@briansrls
briansrls deleted the v2-restoration 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