feat: add frontend LOC ratchet warnings - #691
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the 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 have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR implements a frontend architecture LOC baseline ratchet that runs as a warn-only CI check. The script gains ChangesFrontend LOC baseline ratchet with warn-only CI checks
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Code Review
This pull request implements a warn-only CI check for frontend architecture governance. The frontend-inventory.mjs script is updated to support baseline comparisons using git diff, enabling it to issue warnings for touched production files that exceed 200 or 500 Lines of Code (LOC). Additionally, the GitHub Actions workflow now includes a frontend-architecture job, and new tests have been added to verify the script's reporting logic and CI integration. The architecture manifest has also been updated to reflect the latest baseline metrics and project status. I have no feedback to provide.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/opencode/test/github/frontend-inventory.test.ts`:
- Around line 23-29: Replace the manual temp-repo creation in the test
(mkdtempSync, git init/config calls) with the shared tmpdir fixture: use "await
using tmpdir({ git: true }) as workspace" (imported from fixture/fixture.ts) to
obtain a git-initialized workspace and automatic cleanup, then copy
inventoryScript into path.join(workspace, "frontend-inventory.mjs") and create
the packages/app/src dir as before; remove the explicit git(...) calls and the
manual mkdtempSync to rely on the fixture-managed repo and root commit.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 60a23f6f-6440-4454-85dc-4b4a84e970a8
📒 Files selected for processing (5)
.github/frontend-architecture-manifest.md.github/workflows/ci.ymlpackages/opencode/test/github/ci-workflow.test.tspackages/opencode/test/github/frontend-inventory.test.tsscript/frontend-inventory.mjs
Prepare PawWork v2026.5.18 for the stable desktop release. - Bump the desktop package version to 2026.5.18. - Scope the diagnostics unreadable-file retention test to POSIX permission semantics so Windows advisory does not fail on chmod behavior that Windows does not enforce the same way. Verification: - Focused desktop diagnostics test passed locally: 11 pass / 0 fail. - Release typecheck passed locally for packages/desktop-electron. - PR #706 CI passed, including ci, desktop-smoke, e2e-artifacts, CodeQL, dependency-review, label-policy, commit-lint, and title lint. Release notes: - Drafted against the merged range since v2026.5.17: #691, #692, #693, #694, #702, and #703. - Cold-read review completed before merge; wording was tightened to avoid overclaiming diagnostics impact and to keep verification short.
Summary
frontend-architectureCI job that writes the frontend inventory JSON and runs LOC ratchet warnings.script/frontend-inventory.mjswith a warn-only--check-baselinemode for touched production frontend files above>500/>200LOC.Why
#688 needs executable frontend governance in separate slices. LOC is the smallest first slice because the inventory script and manifest already exist; this PR makes that signal visible in CI without turning LOC into a hard merge gate or touching UI rewrite code.
Related Issue
Refs #688.
Human Review Status
Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.
Review Focus
Please check that the new CI job is scoped as warn-only LOC governance, that it is wired into
ci / checkas an infrastructure signal, and that this PR does not expand into dependency boundary or cognitive-complexity work.Risk Notes
git diffcan compare PR base/head reliably.How To Verify
Screenshots or Recordings
Not required; no visible UI changes.
Checklist
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit
New Features
Tests