Skip to content

refactor(engine): extract shared CLI runtime from Program.cs into CliRuntime.cs (issue 21) - #41

Merged
Xxx91n merged 3 commits into
mainfrom
arch/21-cliruntime-extraction
Sep 5, 2026
Merged

refactor(engine): extract shared CLI runtime from Program.cs into CliRuntime.cs (issue 21)#41
Xxx91n merged 3 commits into
mainfrom
arch/21-cliruntime-extraction

Conversation

@Xxx91n

@Xxx91n Xxx91n commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Summary (architecture-recovery issue 21)

Pure mechanical move: the 26 shared CLI runtime members (constants, ValidCommands, JsonOpts, DebugLog, help text, ScrubExceptionMessage, SecretString, protection predicates, provider-hash recording, mutation lock, environment snapshot, atomic writes) move verbatim from src/Program.cs (446 lines) into new src/CliRuntime.cs (326 lines, still partial class Program). Program.cs stays the thin Main dispatcher (138 lines).

Zero-behavior-change evidence chain

  • Byte-slice move with conservation check (head+M1+K+M2+tail === src); 10 anchor guards passed; no signature/visibility/output changes; no new seams or abstractions; usings preserved.
  • Post-write probes: 26/26 moved member defs present in CliRuntime.cs, absent from Program.cs; Main + its call sites intact; both files LF, no CR.
  • Doc live pointers synced (8 files, 10 spots): AGENTS.md architecture sentence + structure tree, docs/architecture.md, ADR 0005 (×2), hard-boundaries.md (RecordProviderHash), reference-index.md, CONTEXT.md, domain.md, CONTRIBUTING.md.
  • Full delivery report: .scratch/architecture-recovery/reports/21-cliruntime-extraction.md (also mirrored in the branch docs archive when sedimented).

Stack note

Stacked on arch/17-verify-cli-staging (AGENTS.md cross-stack dependency, ticket-03 defense line 1). This PR's diff therefore includes the two issue-17 CI staging commits; CI green here validates the combined merge state.

Acceptance

  • CliRuntime independent file; Program.cs back to thin Main dispatch
  • Zero behavior change: dotnet tests all green (CI), CLI output snapshots unchanged ← this PR's CI run
  • Reference-point sync (AGENTS.md tree, docs live pointers, hard-boundaries.md)
  • Pure move, no behavior/interface change
  • codegraph sync

Env Manager Bot added 3 commits September 5, 2026 02:07
The verify job cargo compiles of the Tauri crate validate tauri.conf.json
bundle.resources, but the five declared files were never staged in CI
(locally frontend/scripts/prebuild.mjs does it during npm run build),
so every main push failed at "Run Tauri crate tests". Insert a fail-closed
staging step after "Build CLI" copying the five resources into
frontend/src-tauri/bin/. Docs synced: build-and-release.md CI section +
AGENTS.md Tauri-shell bullet.
…y (issue 17)

Run 33904993947 proved the five CLI resources stage correctly (5/5 logged)
and the resource gate passed, but compile then hit a second gate:
tauri::generate_context! (main.rs:1409) panics when frontendDist
("../../dist", repo-root dist/) does not exist - the real dist/ is only
produced by "Build frontend", which runs after the cargo steps. Seed a
dist/index.html placeholder in the same staging step; vite build
overwrites it with real output later.
@Xxx91n
Xxx91n merged commit 8ac9b09 into main Sep 5, 2026
9 checks passed
@Xxx91n
Xxx91n deleted the arch/21-cliruntime-extraction branch September 5, 2026 12:26
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