Skip to content

Reduce CI queueing and repeated validation - #2471

Merged
integry merged 3 commits into
mainfrom
2470/claude-opus-5-reduce-ci-queueing-and-du-20260923-0944-l91
Sep 23, 2026
Merged

integry merged 3 commits into
mainfrom
2470/claude-opus-5-reduce-ci-queueing-and-du-20260923-0944-l91

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

CI jobs competed for four rootless workers while repeating focused tests, dependency installations and workspace builds. This PR removes proven duplicate execution and consolidates Linux CLI validation, retaining the full-suite, browser, package and native-platform checks.

Closes #2470.

Changes:

  • Map focused MCP, unit, notification, visual-preview and hosted-tunnel tests to full-suite discovery, and remove their duplicate CI invocations. Developer-facing scripts remain available; regression tests guard the mapping.
  • Run CLI skill and init-JSON validation together per Node version, sharing one install/build and failing the job if any constituent fails or is skipped.
  • Reuse successful workspace builds within a job. Desktop preparation uses source/toolchain keys and a local output inventory; no build cache is shared between jobs or PRs.
  • Retry the observed Electron HTTP 5xx and npm timeout failures through the existing bounded download helper; permanent failures and required package artifacts remain enforced.
  • Preserve rootless preflight and cleanup, hosted fallbacks, four-shard completeness verification, PWA/browser tests and native package acceptance. No runner permissions, branch protection or release policy changes.

Measured on initial head 815ed7b against #2469:

Check #2469 This PR
Validate Changes execution 9m45s 2m34s
Full Test Suite, including queueing 15m39s 10m54s
Last shard start delay 8m47s 3m59s

Full-suite run passed all shards and the aggregate gate. These are observed runs, not a controlled benchmark. Final head is 24ef610. The build-cache follow-up fixes incomplete output and deleted tracked sources; independent clean-checkout execution passed all 38 cache/retry tests. Final-head CI and desktop timing remain pending. Initial hosted desktop failures were Electron checksum HTTP500 and npm ETIMEDOUT; bounded handling of those signatures is included.

The separate server maintenance reclaimed ~56GiB of deleted blocks from the four CI backing images and enabled a CI-only daily trim timer. Runner counts/CPU/RAM limits and production Docker remain unchanged; this is not a prerequisite code change in the PR.

…is CI configuration and build tooling with no user-visible UI surface.

What I implemented

1. Removed duplicate test execution (evidence-based mapping first)

I built the equivalence mapping before removing anything: `scripts/run-test-suite.mjs --list` yields the full-suite manifest (522 units), and every file named by the focused suites resolves to a discovered unit — `test:unit` (35), `test:mcp` + `test:mcp:browser` (12), `test:notifications:server` (12), `test:visual-previews:server` (17), hosted-tunnel (12). Their UI halves are `propr-ui` vitest files, covered by the four `propr-ui#N/4` workspace parts. I verified the environment claims too: the job-level `PROPR_DEMO_MODE=true` was inert (the two tests that need it set it themselves at module top level; the CLI tests inject it through fixtures), and the shard job installs the same Chromium `test:mcp:browser` needs.

Removed from `pr-build-check.yml`: the whole `visual-previews` job, and the MCP, fast-unit, hosted-tunnel and notification steps. The hosted-tunnel command moved to a new `test:hosted-tunnel` package script so it stays developer-facing; all focused scripts remain in `package.json`.

Kept because nothing else covers them: the PWA/browser smoke test (Playwright `*.pw.ts` — matched by neither full-suite discovery nor the propr-ui vitest config), `cli:pack`, `release:verify`, actionlint, shellcheck, and the changed-area gate with its `Fail Job` step.

2. Consolidated the Linux CLI jobs. `cli-init-json` (Node 22/24) is gone; its command is now a step of `CLI Agent Skill (Node N)`, reusing one `npm ci` and one dependency build. That check name is unchanged. Agent-Skill tests, init JSON and the CLI build are separate `continue-on-error` steps with a fail-closed gate, so each constituent still reports independently — and anything other than an explicit `success` (failed, cancelled, skipped, never ran) fails the check with an `::error::` annotation.

Branch protection: the `main` ruleset carries only `deletion`/`non_fast_forward`, and `gh pr checks 2469 --required` reports no required status checks. Nothing I removed was a configured merge gate.

3/4. Redundant builds. `npm run test:prepare` left the validate job with the MCP step; `cli:pack` already builds `@propr/shared`/`@propr/local-setup`, so the changed-area checks and the smoke test reuse that output, guarded by both a recorded success and the built file's presence. I also made the root `tsc` build's real dependency explicit (`packages/api` imports `@propr/local-setup` via published types; `@propr/core`/`@propr/shared` are mapped to sources) — I verified this by deleting `packages/local-setup/dist` and reproducing `TS2307`.

For desktop, `prepare:renderer` is a pre-script of `package`, `typecheck`, `test` and `make`, so macOS x64 ran four `tsc` builds up to four times over identical sources. `apps/desktop/scripts/prepare-renderer.mjs` now stamps a content key (git-reported source files, CLI-copied assets, lockfile, Node/platform/arch) and skips only on an exact match with all outputs present. Measured locally: 11.5 s → 0.21 s on repeat; editing one source byte correctly forced a full rebuild and restoring it returned the original key. The stamp lives in `node_modules/.cache` — discarded by `npm ci`, clean checkout and `git clean -ffdxq` — so nothing crosses a job, machine or trust boundary. No caching action, no artifact reuse.

5. `pr-test-on-label.yml` is untouched: four shards, per-shard Redis isolation, coverage verification, cancellation and nightly behaviour are unchanged. No timeouts, shards or workers added.

Validation

`actionlint` (with embedded shellcheck) and the CI shellcheck target set both pass; the only actionlint warnings repo-wide are pre-existing `macos-15-intel` label complaints in desktop workflows. New tests: `test/ciWorkflowDeduplication.test.mjs` (re-derives the manifest and fails if any deduplicated file stops being covered, a focused script disappears, the build check runs one again, or the full suite gains a path filter) and `apps/desktop/scripts/prepare-renderer.test.mjs` (13 cases: reuse, invalidation on source/lockfile/toolchain change, missing output, fail-closed on build failure and on silent output loss). `test/ciRunnerRouting.test.mjs` gained a test that executes the combined CLI gate's shell against every outcome combination. All touched suites pass locally, as does the new `test:hosted-tunnel:server` script (337 tests).

What I could not do

The issue asks for real resulting-PR CI on the rootless pool with head SHA, durations and queue time against the 15m39s / 585s / 684s baseline. The PR does not exist yet at this point, so all timing claims here are projections, not measurements — the only measured numbers are the local `prepare:renderer` 11.5 s → 0.21 s and the job-count reduction (11 rootless jobs → 8). I deliberately did not attempt the macOS `make --skip-package` shortcut: it would change what produces the staged artifacts that the DMG-mount and packaged-lifecycle steps then validate, and I can't run that path to prove it safe. Desktop therefore keeps its ~14-minute floor, and no claim about total PR time below that is warranted.
@integry

integry commented Sep 23, 2026

Copy link
Copy Markdown
Owner

The CI consolidation looks consistent with the requested scope. Before considering the desktop reuse portion ready, please fix two reproduced invalidation holes in apps/desktop/scripts/prepare-renderer.mjs:

  1. After a successful prepare, delete one generated file that is not in the hand-picked outputs list while keeping dist/index.js/index.d.ts. prepareRenderer reports reused:true because missingOutputs checks only selected entrypoints/assets. Real TypeScript outputs include imported sibling modules; an incomplete dist tree must trigger rebuild. Record and validate the complete generated output inventory (or use another sound completeness check), including nested JS/declarations and copied assets. Keep this within-job reuse; don't broaden caching across jobs.
  2. git ls-files --cached lists a tracked source that has been deleted but not committed. computeInputKey then readFileSync throws ENOENT before rebuilding. I reproduced this by returning a tracked source in listFiles, preparing once, deleting it, then preparing again. Deleting/renaming a source is a normal changed input: invalidate/rebuild, don't fail hashing before the compiler gets to validate the new tree. Distinguish missing inputs from real permission/read errors and preserve fail-closed behavior.

Add targeted regression coverage for both cases. Keep default local/unsharded workflows safe; if reuse cannot be made reliably transparent, explicitly scope it to the intended CI use instead of silently changing every developer build. Preserve the existing cache clean-build, changed-source, failed-build, toolchain and cross-job isolation behavior. Do not weaken tests or skip package validation. Let the current CI results supply any additional concrete failure evidence; no need to change runner capacity.

@propr-dev

propr-dev Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 08e9d1f

Summary of Changes

Both holes are fixed in apps/desktop/scripts/prepare-renderer.mjs, and I reproduced each one against the pre-fix script before and after the change.

1. Incomplete output trees were reused

missingOutputs only checked the hand-picked entry points, so deleting packages/shared/dist/internal/helper.js while keeping dist/index.js/index.d.ts still returned reused: true (confirmed against the previous commit's script).

The stamp now records the complete generated inventory: listOutputFiles walks every workspace's outputDirectory (packages/<pkg>/dist, newly declared per workspace) recursively and records each file's path and size — nested JS, nested declarations and the copied asset trees (dist/skill/propr/**, dist/native/prebuilds/**, dist/assets/**). outputDifferences compares the tree on disk against that inventory before any reuse, reporting missing, changed-size and unexpected files. .tsbuildinfo is excluded from the inventory as it is from the key, because tsc --noEmit rewrites it without producing output. STAMP_SCHEMA_VERSION is bumped to 2 and readStamp rejects a stamp whose inventory is absent or malformed, so a v1 or hand-edited stamp can never grant reuse. The declared outputs list stays as the post-build check that fails a build exiting 0 without emitting what later steps load.

On the real repository the inventory is 380 entries / 34 KB; reuse still costs 0.10 s against an 11.2 s build. Deleting packages/cli/dist/api/agentRuntime.js (named by nothing in outputs) now logs rebuilding, the generated tree no longer matches the recorded build (1 difference(s), first: missing packages/cli/dist/api/agentRuntime.js), rebuilds, restores the file and reuses again at the same key.

2. ENOENT while hashing a deleted-but-tracked source

computeInputKey now hashes through hashInput, which treats ENOENT/ENOTDIR as an absent input: the file is keyed as absent (invalidating the stamp and rebuilding, so the compiler judges the new tree) and collected into a vanished list purely for the log line. Every other read failure — permission denial, EISDIR, I/O error — still throws, so a key that cannot be computed honestly never matches a previous one.

Verified on the real tree: deleting a tracked packages/client/test/client.test.ts logs rebuilding, 1 listed source file(s) no longer exist…, rebuilds, and the new key is itself stable and reusable; restoring the file returns the original key db916f7f… exactly.

Scope and coverage

Reuse remains within-job and on by default — I checked that it stays transparent rather than scoping it to CI: nothing in the desktop workflows or forge.config.ts writes into packages/*/dist (they only assert presence/absence), and the one workflow step that mutates dist/skill/propr/SKILL.md is a macOS CLI job that never runs prepare:renderer. Nothing crosses jobs; the stamp still lives under node_modules/.cache.

11 new tests (28 total in the file, all passing under both node --test and the tsx --test path npm test -w @propr/desktop uses) cover: deletion of an unnamed generated sibling, of a nested declaration and of a copied asset member; truncation; an unrecorded file appearing; .tsbuildinfo not defeating reuse; the inventory actually recording the whole tree; stamps with no usable inventory; the deleted-source rebuild with key stability and restoration; absent-keying in computeInputKey; and fail-closed on a non-absence read error. The existing clean-build, changed-source, lockfile, toolchain, missing-declared-output, failed-build, --force and cross-job isolation tests are unchanged and still pass, as do test/testSuiteRunner.test.mjs, test/ciWorkflowDeduplication.test.mjs and test/ciRunnerRouting.test.mjs. docs/ci-runners.md now describes both invalidation rules. No preview files: this is build tooling with no user-visible surface.


🤖 Implementation Details

  • Model: Claude Opus 5 (high)
  • Requested By: @integry
  • Time: 9m 59s
  • Tokens: 2,580,387 (2,543,012 in / 37,375 out)
  • Cost: $2.67

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment ID: 5792886803✓

@propr-dev

propr-dev Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned linux-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned linux-x64 package
  • Result: failure
  • Commit: 815ed7b9cfbf (815ed7b9cfbfc63faf4c4b5b8f7b8a038c7ff926)
  • Details: View CI failure

Failure evidence

.github:13
No files were found with the provided path: desktop-acceptance-artifacts. No artifacts will be uploaded.

.github:103
Process completed with exit code 1.

@propr-dev

propr-dev Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

CI failed: Validate unsigned darwin-x64 package

Please investigate and fix this CI failure.

  • Check: Validate unsigned darwin-x64 package
  • Result: failure
  • Commit: 815ed7b9cfbf (815ed7b9cfbfc63faf4c4b5b8f7b8a038c7ff926)
  • Details: View CI failure

Failure evidence

.github:20
Process completed with exit code 196.

@integry

integry commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Evidence for the queued CI-failure follow-ups on 815ed7b: Linux x64 failed downloading https://github.com/electron/electron/releases/download/v44.0.0/SHASUMS256.txt with HTTP 500. The existing wrapper then printed "Command failed without a transient download signature; not retrying." The missing acceptance artifact is a consequence, not the root cause. macOS x64 failed in npm ci with syscall read ETIMEDOUT before package validation.

Treat these as transient dependency-download failures: verify them on the next cache-fix head, or rerun failed jobs. If a code change is justified, keep it to bounded retries for these specific download/network failures in the existing retry mechanism, with regression tests; do not retry arbitrary assertion/build failures or relax required artifact/native acceptance. Preserve the in-progress build-cache invalidation fix and avoid unrelated changes.

Measured positive result on this first head: Validate Changes passed in 154 seconds vs585 seconds on #2469. Full-suite and final desktop timings remain to be verified.

…rer.mjs`, and I reproduced each one against the pre-fix script before and after the change.

Both holes are fixed in `apps/desktop/scripts/prepare-renderer.mjs`, and I reproduced each one against the pre-fix script before and after the change.

## 1. Incomplete output trees were reused

`missingOutputs` only checked the hand-picked entry points, so deleting `packages/shared/dist/internal/helper.js` while keeping `dist/index.js`/`index.d.ts` still returned `reused: true` (confirmed against the previous commit's script).

The stamp now records the **complete generated inventory**: `listOutputFiles` walks every workspace's `outputDirectory` (`packages/<pkg>/dist`, newly declared per workspace) recursively and records each file's path and size — nested JS, nested declarations and the copied asset trees (`dist/skill/propr/**`, `dist/native/prebuilds/**`, `dist/assets/**`). `outputDifferences` compares the tree on disk against that inventory before any reuse, reporting missing, changed-size and unexpected files. `.tsbuildinfo` is excluded from the inventory as it is from the key, because `tsc --noEmit` rewrites it without producing output. `STAMP_SCHEMA_VERSION` is bumped to 2 and `readStamp` rejects a stamp whose inventory is absent or malformed, so a v1 or hand-edited stamp can never grant reuse. The declared `outputs` list stays as the post-build check that fails a build exiting 0 without emitting what later steps load.

On the real repository the inventory is 380 entries / 34 KB; reuse still costs 0.10 s against an 11.2 s build. Deleting `packages/cli/dist/api/agentRuntime.js` (named by nothing in `outputs`) now logs `rebuilding, the generated tree no longer matches the recorded build (1 difference(s), first: missing packages/cli/dist/api/agentRuntime.js)`, rebuilds, restores the file and reuses again at the same key.

## 2. ENOENT while hashing a deleted-but-tracked source

`computeInputKey` now hashes through `hashInput`, which treats `ENOENT`/`ENOTDIR` as an absent input: the file is keyed as `absent` (invalidating the stamp and rebuilding, so the compiler judges the new tree) and collected into a `vanished` list purely for the log line. Every other read failure — permission denial, `EISDIR`, I/O error — still throws, so a key that cannot be computed honestly never matches a previous one.

Verified on the real tree: deleting a tracked `packages/client/test/client.test.ts` logs `rebuilding, 1 listed source file(s) no longer exist…`, rebuilds, and the new key is itself stable and reusable; restoring the file returns the original key `db916f7f…` exactly.

## Scope and coverage

Reuse remains within-job and on by default — I checked that it stays transparent rather than scoping it to CI: nothing in the desktop workflows or `forge.config.ts` writes into `packages/*/dist` (they only assert presence/absence), and the one workflow step that mutates `dist/skill/propr/SKILL.md` is a macOS CLI job that never runs `prepare:renderer`. Nothing crosses jobs; the stamp still lives under `node_modules/.cache`.

11 new tests (28 total in the file, all passing under both `node --test` and the `tsx --test` path `npm test -w @propr/desktop` uses) cover: deletion of an unnamed generated sibling, of a nested declaration and of a copied asset member; truncation; an unrecorded file appearing; `.tsbuildinfo` not defeating reuse; the inventory actually recording the whole tree; stamps with no usable inventory; the deleted-source rebuild with key stability and restoration; absent-keying in `computeInputKey`; and fail-closed on a non-absence read error. The existing clean-build, changed-source, lockfile, toolchain, missing-declared-output, failed-build, `--force` and cross-job isolation tests are unchanged and still pass, as do `test/testSuiteRunner.test.mjs`, `test/ciWorkflowDeduplication.test.mjs` and `test/ciRunnerRouting.test.mjs`. `docs/ci-runners.md` now describes both invalidation rules. No preview files: this is build tooling with no user-visible surface.

PR: #2471
Comment by: @integry (ID: 5792886803)
Model: claude-opus-5
@integry integry changed the title [2470 by Claude Opus 5] Reduce CI queueing and duplicate validation after rootless sharding Reduce CI queueing and repeated validation Sep 23, 2026
@propr-dev

propr-dev Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Applied the requested follow-up changes in commit 24ef610

Processed 3 comments:

  • Comment 1 by @propr-dev[bot] (ID: 5792901750✓)
  • Comment 2 by @propr-dev[bot] (ID: 5792917345✓)
  • Comment 3 by @integry (ID: 5792928207✓)

Summary of Changes

Both failures on 815ed7b9 were transient dependency downloads, and I confirmed the exact output from the job logs before changing anything.

Root causes

  1. linux-x64 — @electron/get failed with HTTPError: Response code 500 (Internal Server Error) for https://github.com/electron/electron/releases/download/v44.0.0/SHASUMS256.txt, and the wrapper printed "Command failed without a transient download signature; not retrying." Its 5xx pattern is \b(?:status|statusCode|HTTP)\b[^\n]{0,20}\b5\d{2}\b — HTTP has no trailing word boundary inside HTTPError, and the phrase actually printed is Response code 500, which no pattern covered. The missing desktop-acceptance-artifacts upload was the downstream symptom; I left if-no-files-found: error and the native acceptance steps untouched.
  2. darwin-x64 — npm ci failed with npm error code ETIMEDOUT / syscall read (exit 196) in the Install locked dependencies step, which ran bare and had no retry at all. The signature itself (ETIMEDOUT) was already recognized; the step just wasn't wrapped.

Changes (bounded to the existing retry mechanism)

  • apps/desktop/scripts/retry-transient-download.mjs:26 — added response code to the 5xx alternation so HTTPError: Response code 5xx is recognized. 4xx stays permanent, so a genuine 404 for a missing artifact still fails on the first attempt.
  • .github/workflows/desktop-release-guard.yml:191 — the validation job's npm ci now runs through the same wrapper (3 attempts, 15s/30s backoff). A lockfile/package.json mismatch has no download signature, so it still fails immediately and is not masked.

Tests

  • retry-transient-download.test.mjs — the verbatim Forge 500 lines and the npm ETIMEDOUT block are asserted transient; Response code 404 and the npm ci out-of-sync error are asserted permanent. New behavioral test retries a timed-out install (exit 196 → success, one backoff) and refuses to retry the lockfile defect.
  • release-workflow.test.ts — asserts the install step is wrapped, raises the wrapper call-site count 3 → 4, and pins the new 5xx pattern. Signed production packaging is still asserted to contain no wrapper.

Verification — retry-transient-download.test.mjs 10/10 pass; run against the pre-fix script from HEAD the 500 case fails (expected transient: HTTPError: Response code 500 …), so the regression is real. release-workflow.test.ts 28/28 pass, and the pre-fix workflow yields install-wrapped: false, wrapper-uses: 3 against the new assertions. ciRunnerRouting.test.mjs (43) and desktop-icon-assets.test.mjs (6) still pass, and the workflow YAML parses with the step resolving as expected. The prepare-renderer cache-invalidation fix from 08e9d1f3 is untouched.

One thing I deliberately did not do: the other npm ci steps in this workflow (native-windows-durability, renderer-axe-boundary) are still unwrapped, since only the package job was reported failing — say the word if you want them covered too. No preview files: this is CI configuration and build tooling with no user-visible surface.


🤖 Implementation Details

  • Model: Claude Opus 5 (high)
  • Requested By: @propr-dev[bot], @integry
  • Time: 5m 49s
  • Tokens: 1,512,674 (1,494,344 in / 18,330 out)
  • Cost: $1.57

Undo Changes • View Task Execution


💡 ProPR Slash Commands
Command Description Example
/merge Merge target branch into this PR and resolve conflicts /merge
/review Request an AI code review /review or /review claude-sonnet
/fix Implement fixes for issues found by /review /fix or /fix address the null check issue
/switch Change the AI model for this PR /switch claude-opus
/use Override the model for a single follow-up run /use claude-sonnet
/ultrafix Loop review→fix cycles until score goal is met /ultrafix or /ultrafix goal=8 max=10

🤖 Generated by ProPR
Processing comment IDs: 5792901750✓, 5792917345✓, 5792928207✓

…oads, and I confirmed the exact output from the job logs before changing anything.

Both failures on `815ed7b9` were transient dependency downloads, and I confirmed the exact output from the job logs before changing anything.

**Root causes**

1. **linux-x64** — `@electron/get` failed with `HTTPError: Response code 500 (Internal Server Error) for https://github.com/electron/electron/releases/download/v44.0.0/SHASUMS256.txt`, and the wrapper printed *"Command failed without a transient download signature; not retrying."* Its 5xx pattern is `\b(?:status|statusCode|HTTP)\b[^\n]{0,20}\b5\d{2}\b` — `HTTP` has no trailing word boundary inside `HTTPError`, and the phrase actually printed is `Response code 500`, which no pattern covered. The missing `desktop-acceptance-artifacts` upload was the downstream symptom; I left `if-no-files-found: error` and the native acceptance steps untouched.
2. **darwin-x64** — `npm ci` failed with `npm error code ETIMEDOUT / syscall read` (exit 196) in the *Install locked dependencies* step, which ran bare and had no retry at all. The signature itself (`ETIMEDOUT`) was already recognized; the step just wasn't wrapped.

**Changes** (bounded to the existing retry mechanism)

- `apps/desktop/scripts/retry-transient-download.mjs:26` — added `response code` to the 5xx alternation so `HTTPError: Response code 5xx` is recognized. 4xx stays permanent, so a genuine `404` for a missing artifact still fails on the first attempt.
- `.github/workflows/desktop-release-guard.yml:191` — the validation job's `npm ci` now runs through the same wrapper (3 attempts, 15s/30s backoff). A lockfile/`package.json` mismatch has no download signature, so it still fails immediately and is not masked.

**Tests**

- `retry-transient-download.test.mjs` — the verbatim Forge 500 lines and the npm `ETIMEDOUT` block are asserted transient; `Response code 404` and the `npm ci` out-of-sync error are asserted permanent. New behavioral test retries a timed-out install (exit 196 → success, one backoff) and refuses to retry the lockfile defect.
- `release-workflow.test.ts` — asserts the install step is wrapped, raises the wrapper call-site count 3 → 4, and pins the new 5xx pattern. Signed production packaging is still asserted to contain no wrapper.

**Verification** — `retry-transient-download.test.mjs` 10/10 pass; run against the pre-fix script from `HEAD` the 500 case fails (`expected transient: HTTPError: Response code 500 …`), so the regression is real. `release-workflow.test.ts` 28/28 pass, and the pre-fix workflow yields `install-wrapped: false, wrapper-uses: 3` against the new assertions. `ciRunnerRouting.test.mjs` (43) and `desktop-icon-assets.test.mjs` (6) still pass, and the workflow YAML parses with the step resolving as expected. The prepare-renderer cache-invalidation fix from `08e9d1f3` is untouched.

One thing I deliberately did not do: the other `npm ci` steps in this workflow (`native-windows-durability`, `renderer-axe-boundary`) are still unwrapped, since only the `package` job was reported failing — say the word if you want them covered too. No preview files: this is CI configuration and build tooling with no user-visible surface.

PR: #2471
Comment by: @propr-dev[bot] (ID: 5792901750)
Comment by: @propr-dev[bot] (ID: 5792917345)
Comment by: @integry (ID: 5792928207)
Model: claude-opus-5
@integry

integry commented Sep 23, 2026

Copy link
Copy Markdown
Owner

/review astra opus

@propr-dev

propr-dev Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @integry

Posted 2 reviews:

View Task Details

@propr-dev

propr-dev Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — astra

Overall Evaluation

The consolidation is focused and well covered, but two localized corrections are needed before merge in the new renderer preparation script. The supplied current-head status shows 18 passed, 8 pending, no failures, and 7 neutral/skipped checks.

✅ Combined CLI validation fails closed — The final gate checks each constituent’s outcome and rejects failed, cancelled, skipped, or missing execution.

✅ Reported invalidation holes are addressed — Recursive output inventories detect missing nested files, while deleted tracked inputs change the source key instead of throwing during hashing.

Merge blockers

Every finding below was introduced by this PR and must be resolved before merging.

F1: 🔴 Preserve Windows workspace build execution

  • Required behavior: Replacing renderer preparation must preserve its existing ability to invoke workspace builds on Windows.
  • Evidence: apps/desktop/scripts/prepare-renderer.mjs:251 — defaultRun() calls spawnSync(command, args, ...) without a shell, while buildCommand() selects npm.cmd on Windows. Windows .cmd files require a command shell; this invocation fails, and status ?? 1 converts the spawn failure into a failed workspace build. Consequently, desktop preparation fails before the first build for Windows development, testing, and packaging.
  • Minimum fix: Execute these fixed npm arguments through a Windows command shell, or invoke npm’s JavaScript entry point through Node. Add a regression that exercises execution, rather than only checking the returned command string.

F2: 🔴 Detect same-size generated output changes

  • Required behavior: Reuse must require the generated output tree to match the recorded successful build.
  • Evidence: apps/desktop/scripts/prepare-renderer.mjs:204 and apps/desktop/scripts/prepare-renderer.mjs:212 — The inventory records only paths and sizes, and outputDifferences() compares only those values. After successful preparation, replacing an emitted JavaScript file with different bytes of the same length leaves both the input key and inventory comparison unchanged. prepareRenderer() therefore returns reused: true and allows the altered artifact to reach subsequent consumers.
  • Minimum fix: Record and compare content digests for generated files, reject stamps lacking those digests, and add a regression covering a same-length output overwrite.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Exercise real compiler output recovery

The preparation fixtures use a build double that always recreates outputs. An integration test that deletes an emitted sibling and runs the actual workspace compiler would also verify recovery in the presence of .tsbuildinfo. This would strengthen confidence in the rebuild path; the supplied context does not establish a separate compiler-recovery defect.

Score

The consolidation and focused regression coverage are strong, but two correctness issues remain in the new preparation path. Neither requires a broad redesign; pending checks alone do not lower the score.

Score: 6/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 3m 50s
  • Tokens: 77,586 (70,191 in / 7,395 out)
  • Cost: $0.97

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@propr-dev

propr-dev Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — opus

Overall Evaluation

This PR consolidates CI work after the rootless sharding change: it removes five focused Linux test invocations from Validate Changes (MCP, fast-unit, hosted-tunnel, notifications) and the whole visual-previews job, folds cli-init-json into cli-node-matrix behind a fail-closed result gate, adds within-job build reuse for Validate Changes and a content-keyed prepare-renderer.mjs for the desktop, and extends the existing bounded download retry to npm ci plus the Response code 5xx phrase that @electron/get emits. The scope matches issue #2470, nothing is made optional, no caching crosses a job/runner/commit boundary, and the documentation is unusually explicit about what moved versus what disappeared.

The two invalidation holes raised in the previous review cycle are both addressed in the current diff, and the surrounding test coverage is substantial. I found no defect I can prove from the changed code; the residual risks are verification gaps rather than demonstrable regressions.

✅ Fail-closed CLI consolidation with per-constituent reporting — .github/workflows/pr-build-check.yml gives agent_skill, init_json and cli_build independent continue-on-error steps and enforces them in Enforce combined CLI validation results with if: always(); workspace_build deliberately has no continue-on-error, so its failure skips the constituents and the ${2:-did not run} default still fails the check. test/ciRunnerRouting.test.mjs actually executes the gate script under bash for failure/cancelled/skipped/empty, which is the right way to test a shell gate.

✅ Both previously reported prepare-renderer holes are genuinely closed — listOutputFiles/outputDifferences record the complete dist inventory (nested modules, declarations, copied asset trees) rather than the hand-picked entry points, and hashInput now keys an ENOENT/ENOTDIR input as absent (invalidating the stamp) while still throwing on EISDIR and other read failures. apps/desktop/scripts/prepare-renderer.test.mjs covers the orphaned-sibling, nested-declaration, copied-asset, truncation, unexpected-file, .tsbuildinfo-ignored and deleted-tracked-source cases individually.

✅ The deduplication claim is machine-checked, not asserted — test/ciWorkflowDeduplication.test.mjs re-derives the full-suite manifest via planRun/unitKey and fails if any named file of a removed suite stops being a discovered unit, if the build check starts invoking one again, or if pr-test-on-label.yml acquires a path filter. It also pins the inverse: no *.pw.ts spec is discoverable, which is what justifies keeping the Playwright smoke test and its single Chromium install in the build check.

Verdict: ready to merge once the pending checks (notably Validate Changes and the remaining shards) land green.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Confirm or guard @propr/client before the PWA smoke test

.github/workflows/pr-build-check.yml removes npm run test:prepare, which previously built both @propr/shared and @propr/client before the Run PWA and Mobile Browser Smoke Test step (pr-test-on-label.yml still asserts test -f packages/client/dist/index.js after that script). The replacement guard only restores shared (test -f packages/shared/dist/index.js || npm run build -w @propr/shared), on the documented grounds that the propr-ui vite config aliases @propr/client to workspace source. That claim is plausible — npm run typecheck -w propr-ui is a separate step from npm run build -w propr-ui, suggesting build is vite-only — but the ui change filter (/^(propr-ui\/|packages\/(client|shared)\/)/) does not match any file in this PR, so the smoke-test path is not exercised by this PR's own checks. Adding a symmetric test -f packages/client/dist/index.js || npm run build -w @propr/client line costs nothing when the alias claim holds and removes the possibility of a latent break on the first UI-touching PR.

S2: 🟢 Output inventory compares path and size only

outputDifferences in apps/desktop/scripts/prepare-renderer.mjs compares {path, size} pairs. A generated file replaced in place with different content of identical length would be accepted as "exactly the tree that was built". Within a single CI job nothing rewrites dist between prepare runs, so this is not a practical hole today, but hashing the inventory entries (or at least recording mtimeMs) would make the completeness check match the strength of the input key. Optional because the key already covers every source byte and the reuse window is one job on one machine.

S3: 🟢 prepare-renderer.test.mjs parses tsconfig.json with JSON.parse

The declares an output directory that contains every declared output test does JSON.parse(readFileSync(join(repository, workspace.directory, 'tsconfig.json'))) for all four workspaces, and the matches the entry point test does the same for each package.json and then string-concatenates ${workspace.directory}/${manifest.main}. TypeScript configs are conventionally JSONC, and a main written as ./dist/index.js would not match the outputs list. Both are now full-suite units, so a future comment or a leading ./ would fail an unrelated PR. A JSONC-tolerant read and a replace(/^\.\//, '') on main/types would make these assertions robust without weakening them.

S4: 🟢 PROPR_DEMO_MODE is no longer set for the migrated suites

The removed visual-previews job set PROPR_DEMO_MODE: 'true' at job level, and the removed inline hosted-tunnel step set it per command; the retained test:hosted-tunnel:server script in package.json still sets it, but the full-suite shards that now own those files set only NODE_ENV: test. docs/ci-runners.md argues the variable was inert in both cases. Since these files already ran in the shards before this PR, nothing regresses, but keeping the variable in the local script while documenting it as inert is contradictory — either drop it from test:hosted-tunnel:server or record why the local script needs it.

S5: 🟢 if: always() turns a cancelled run into a failed check

Enforce combined CLI validation results runs on always(), so a workflow cancellation (for example from cancel-in-progress on a new push) will execute the gate, see cancelled outcomes, and exit 1 — reporting CLI Agent Skill (Node N) as failed rather than cancelled. That is the safe direction, but if: !cancelled() would preserve the fail-closed behaviour for skipped/failed constituents while keeping cancellations legible in the checks list.

S6: 🟢 Generated docker/launcher/manifest.json may sit outside the input key

RENDERER_INPUT_PATHS includes docker/launcher, but listSourceFiles uses --exclude-standard, so any ignored generated file there (the copy-assets header notes manifest.json is "written by scripts/build-images.sh") would be excluded from the key while still being copied into packages/cli/dist/orchestrator/. The inventory would only catch a size change, not an equal-length regeneration. The new test asserts docker/launcher/orchestrator.mjs is listed but says nothing about manifest.json; adding that assertion would either prove the concern moot or surface it.

Score

The PR delivers exactly the requested consolidation with strong, executable evidence for its deduplication and reuse claims, and the two invalidation holes flagged in the prior cycle are demonstrably fixed in the current diff. I found no provable defect; the only material reservation is that the changed PWA-smoke-test path is not exercised by this PR's own change filters, and several required checks are still pending.

Score: 8/10


🤖 Review Details

  • Model: Claude Opus 5
  • Time: 4m 52s
  • Tokens: 120,184 (96,076 in / 24,108 out)
  • Cost: $1.20

View Task


💡 Next step: Comment /fix to address F# merge blockers only.
F# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. Suggestions require a separate ordinary follow-up request.

🤖 Review by ProPR

@integry
integry merged commit 04cf316 into main Sep 23, 2026
37 checks passed
@integry
integry deleted the 2470/claude-opus-5-reduce-ci-queueing-and-du-20260923-0944-l91 branch September 23, 2026 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reduce CI queueing and duplicate validation after rootless sharding

1 participant