Skip to content

ci: replace doc-enforced rules with automated CI guard scripts#40

Open
pablopunk wants to merge 2 commits into
mainfrom
fractal-nvm-let-s-look-through-src-docs-see-if-acc041
Open

ci: replace doc-enforced rules with automated CI guard scripts#40
pablopunk wants to merge 2 commits into
mainfrom
fractal-nvm-let-s-look-through-src-docs-see-if-acc041

Conversation

@pablopunk

Copy link
Copy Markdown
Owner

Summary

Five new CI guard scripts + two behavioral test suites that automate rules previously documented in src/docs/. When a rule is enforced by CI, the doc becomes a reference rather than the sole guardrail.

New CI scripts (scripts/check-*.cjs, all run under mise exec -- pnpm test)

Script What it guards Doc it automates
check-extension-fixture-coverage Every ctx.ui.* method has a dev fixture extension-api-ui-fixtures.md
check-os-platform-boundaries No process.platform in renderer/shared; warns main-process os-architecture.md
check-window-config AeroSpace contract: type:panel, accessory, visibleOnAllWorkspaces window-management.md
check-appearance-contract appearance field on ExtensionCommand, ExtensionActionContribution, ExtensionItem extension-result-appearance-contract.md
check-logging Log file name, read bounds, Error stripping safety logging.md

Enhanced: check-packaged-resources now guards against src/fixtures being packaged in production.

New behavioral tests

Test file Coverage
data-loader.test.ts (4 tests) Loader lifecycle, opaque handle, empty state default, retry after failure (bug fix: entry was deleted on error preventing retry)
file-index-sorting.test.ts (3 tests) Sort-before-slice ordering, dateAddedMs with birthtime fallback, includeDimensions defaults

Refactored

  • src/electron/main.ts: ~70 lines extracted to data-loader.ts and file-index-sorting.ts for testability. No behavioral changes.

Review history

Two review rounds with 5 reviewer agents. Retry lifecycle bug found and fixed in round 1, all fixes verified green in round 2.

Add five new CI check scripts that automate rules previously
documented in src/docs/, plus behavioral tests for two
undocumented contracts:

CI guard scripts (scripts/check-*.cjs):
- check-extension-fixture-coverage — every ctx.ui.* method has
  a fixture; uses TS compiler API to cross-check API surface vs
  fixture calls vs doc allowlist
- check-os-platform-boundaries — no process.platform in
  renderer/shared code; warns on main-process branches outside
  the os.ts capability layer
- check-window-config — verifies AeroSpace-compatible window
  contract (type:panel, accessory policy, visibleOnAllWorkspaces)
- check-appearance-contract — appearance field present on all
  three result-shaped extension types
- check-logging — log file name, read bounds, Error stripping

Existing script enhanced:
- check-packaged-resources — added fixture exclusion guard

Behavioral tests:
- data-loader.test.ts — loader lifecycle, retry after failure,
  empty state, error message propagation
- file-index-sorting.test.ts — sort-before-slice ordering,
  dateAddedMs fallback, includeDimensions defaults

Refactored main.ts to extract testable data-loader registry
and file-index sorting helpers into dedicated modules.

All new checks and tests run under mise exec -- pnpm test.
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nvm Ready Ready Preview, Comment Jun 12, 2026 12:51pm

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@pablopunk, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 59 minutes and 11 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more credits in the billing tab to continue.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f230b734-0c35-4384-bb3f-17d88af5340f

📥 Commits

Reviewing files that changed from the base of the PR and between 6326b5f and b54d67a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (12)
  • package.json
  • scripts/check-appearance-contract.cjs
  • scripts/check-extension-fixture-coverage.cjs
  • scripts/check-logging.cjs
  • scripts/check-os-platform-boundaries.cjs
  • scripts/check-packaged-resources.cjs
  • scripts/check-window-config.cjs
  • src/electron/data-loader.test.ts
  • src/electron/data-loader.ts
  • src/electron/file-index-sorting.test.ts
  • src/electron/file-index-sorting.ts
  • src/electron/main.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtsx@​4.22.31001008293100

View full report

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