Skip to content

ci: narrow ui-preview scope, dedupe fumadocs/ui-kit rebuilds, fix TS buildinfo collision#7332

Merged
JSONbored merged 1 commit into
mainfrom
claude/ci-resource-optimizations
Jul 19, 2026
Merged

ci: narrow ui-preview scope, dedupe fumadocs/ui-kit rebuilds, fix TS buildinfo collision#7332
JSONbored merged 1 commit into
mainfrom
claude/ci-resource-optimizations

Conversation

@JSONbored

Copy link
Copy Markdown
Owner

Summary

Five independently-verified CI resource/correctness fixes, following an exhaustive audit + adversarial review of .github/workflows/ci.yml and its siblings (two other proposed fixes from the same audit were investigated and rejected after adversarial review found they'd break real CI paths — see Notes).

  • ui-preview.yml's path filter matched the whole packages/** workspace (not just what apps/loopover-ui depends on), triggering a pointless UI preview build+deploy (~101s, confirmed on 5 real recent runs) on every miner/mcp/engine/discovery-index-only PR. Narrowed to packages/loopover-ui-kit/**, the only package the UI app actually imports (confirmed via dependency grep — zero hits for the excluded packages).
  • ci.yml had two independent, unaware-of-each-other steps regenerating the same fumadocs content collections — one unconditional, one already correctly gated on push||ui==true, added by two different commits ~2 hours apart. Removed the unconditional duplicate; confirmed nothing between the two runs on it.
  • ci.yml's UI lint/typecheck/test steps each re-triggered ui:kit:build's full aggregate, redundantly rebuilding ui-kit a package a dedicated "Build UI-kit package" step already built once earlier in the same job. Scoped the three steps to call the underlying workspace subcommands directly instead (mirroring the same fix already applied to "UI build"). Deliberately did not touch package.json's ui:lint/ui:typecheck/ui:test scripts themselves — ui-deploy.yml and CONTRIBUTING.md's documented local gate sequence both call them directly with no prior ui-kit build and depend on that self-sufficiency (verified by reproducing a real TS2307 failure when that self-sufficiency is removed).
  • packages/loopover-engine/tsconfig.json inherited the root config's tsBuildInfoFile unresolved, silently writing its incremental build state to the same .tsbuildinfo the root Typecheck step caches — masked today only by step order (a landmine for the next reorder). Fixed the same way packages/loopover-miner/tsconfig.json already documents and fixes this exact collision. Verified locally: engine build goes cold→2.7s, warm→1.0s, and stays warm after a full root typecheck run (previously would have gone cold again).
  • The changes job's whitespace check ran bare git diff --check against a fresh checkout — comparing the working tree to the index, which are always identical immediately after checkout, so it silently passed regardless of the PR's actual diff content. Now fetches the real comparison SHA and diffs against that. Verified in an isolated scratch clone that this correctly detects a real trailing-whitespace violation that the old form would have missed.

Config/workflow-only change; no application source touched.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves — N/A, maintainer-initiated CI infra/performance work following up on ci: enforce codecov on miner/mcp/engine/discovery-index-only PRs #7326, not tied to a single pre-filed contributor issue.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck (clean, after building @loopover/engine)
  • npm run test:coverage locally — not run in full (no src/** change, no patch-coverage obligation). Instead ran the specific test files that reference the modified steps/scripts (ci-ui-build-openapi, codecov-policy, ci-generated-artifact-drift-checks, ci-cf-typegen-check, ci-dependency-cache, ci-skip-draft-prs, observability-ci, coding-agent-miner, path-matchers — 141 tests, all passing) plus targeted manual verification of each change (see Summary) including a live npm --workspace @loopover/ui run lint/typecheck run against a real prebuilt ui-kit, and a real cold/warm/warm-after-typecheck timing check of the engine buildinfo fix.
  • npm run test:workers — not run; untouched by this change.
  • npm run build:mcp / npm run test:mcp-pack — not run; no packages/loopover-mcp change.
  • npm run ui:openapi:check — not run; no OpenAPI-affecting change.
  • npm run ui:lint / ui:typecheck / ui:build — the underlying workspace commands were run directly and verified (see above); the aggregate npm run wrapper scripts themselves are unchanged.
  • npm audit --audit-level=moderate — not run; no dependency change.
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — N/A, CI/tsconfig configuration only; existing meta-tests over these exact files were re-run and confirmed unaffected (see above).

If any required check was skipped, explain why:

  • Same reasoning as PR ci: enforce codecov on miner/mcp/engine/discovery-index-only PRs #7326: this is CI/tsconfig configuration, not application source, so the UI/MCP/worker/dependency toolchains are unaffected and weren't exercised in full locally. Every actually-modified command/config was verified directly and is listed in the Summary above, plus this PR's own live CI run exercises the real pipeline end to end.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests — N/A, no such change.
  • API/OpenAPI/MCP behavior is updated and tested where needed — N/A.
  • UI changes use live API data or real empty/error/loading states — N/A, no UI change.
  • Visible UI changes include a UI Evidence section — N/A, no visible/UI change.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs (none touched here).

Notes

  • This PR intentionally does not include two other optimizations investigated in the same audit, both rejected after adversarial review: (1) deduping build:miner's internal @loopover/engine rebuild — reproduced a real TS2307 failure this would cause on miner-only PRs that don't also touch package-lock.json; and (2) collapsing validate-code's ~13 independent drift checks into one backgrounded step — breaks 3 existing meta-tests that assert exact step names/conditions, for a real but modest gain (measured ~2.5s, not the full max-of-times claimed, due to CPU contention). A third, larger optimization (scoping the 6-shard test suite to just the changed package for miner/mcp/engine/discovery-index-only PRs) was also investigated and found to need a real design — not a same-session patch — since it silently breaks Codecov's after_n_builds: 6 gate and vitest --changed demonstrably misses regressions reached through packages/loopover-engine's gitignored dist/.
  • Like ci: enforce codecov on miner/mcp/engine/discovery-index-only PRs #7326, this touches .github/workflows/** (a guarded path), so it'll be held for manual owner review rather than auto-merged, which is expected here.

…buildinfo collision and vacuous whitespace check

Five independently-verified fixes from a CI resource-usage audit, each
adversarially reviewed before landing (two other proposed fixes from
the same audit were rejected after adversarial review found they'd
break real CI paths -- see conversation):

- ui-preview.yml's path filter matched the whole packages/** workspace,
  triggering a pointless UI preview build+deploy (~101s) on every
  miner/mcp/engine/discovery-index-only PR. Narrowed to
  packages/loopover-ui-kit/**, the only package apps/loopover-ui
  actually depends on.
- ci.yml had two independent, unaware-of-each-other steps regenerating
  the same fumadocs content collections -- one unconditional, one
  correctly gated on push||ui==true. Removed the unconditional
  duplicate.
- ci.yml's UI lint/typecheck/test steps each triggered ui:kit:build's
  full aggregate script, redundantly rebuilding ui-kit a package
  "Build UI-kit package" already built once earlier in the same job.
  Scoped to call the underlying workspace subcommands directly instead
  -- package.json's ui:lint/ui:typecheck/ui:test themselves are left
  untouched, since ui-deploy.yml and CONTRIBUTING.md's documented local
  gate sequence both call them directly with no prior ui-kit build and
  depend on that self-sufficiency.
- packages/loopover-engine/tsconfig.json inherited the root config's
  tsBuildInfoFile unresolved, so its build silently wrote to the same
  .tsbuildinfo the root Typecheck step caches -- masked today only by
  step order, a landmine for the next reorder. Given its own path,
  mirroring the identical fix already applied to
  packages/loopover-miner/tsconfig.json.
- The `changes` job's whitespace check ran bare `git diff --check`
  against a fresh checkout, comparing the working tree to the index --
  always identical right after checkout, so it silently passed
  regardless of the PR's actual diff. Now diffs against the real
  comparison SHA.
@JSONbored JSONbored self-assigned this Jul 19, 2026
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
loopover-ui f158305 Commit Preview URL

Branch Preview URL
Jul 19 2026, 06:00 PM

@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.03%. Comparing base (7d857aa) to head (f158305).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7332      +/-   ##
==========================================
- Coverage   91.03%   91.03%   -0.01%     
==========================================
  Files         714      714              
  Lines       72118    72118              
  Branches    19232    19232              
==========================================
- Hits        65652    65651       -1     
- Misses       5426     5427       +1     
  Partials     1040     1040              
Flag Coverage Δ
rees 88.56% <ø> (ø)
shard-1 41.72% <ø> (-0.01%) ⬇️
shard-2 35.72% <ø> (ø)
shard-3 31.62% <ø> (ø)
shard-4 32.58% <ø> (ø)
shard-5 30.57% <ø> (+<0.01%) ⬆️
shard-6 43.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.
see 1 file with indirect coverage changes

@JSONbored
JSONbored merged commit 10138fe into main Jul 19, 2026
15 checks passed
@JSONbored
JSONbored deleted the claude/ci-resource-optimizations branch July 19, 2026 18:04
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