Skip to content

UN-4363 [FEAT] Enforce the frontend v1 rules as their own PR checks: seam, purity, bundle, separation and accessibility - #2434

Draft
johnyrahul wants to merge 3 commits into
mainfrom
UN-4363-v1-ci-gates
Draft

johnyrahul wants to merge 3 commits into
mainfrom
UN-4363-v1-ci-gates

Conversation

@johnyrahul

@johnyrahul johnyrahul commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Johny · project thread

What

  • P0-T10 (UN-4363), sub-tasks UN-4606 to UN-4611: the frontend v1 rules become PR checks that report apart from v0.
  • New workflow ci-frontend-v1.yaml with one job per guard: v1 · Biome, v1 · Typecheck, v1 · Purity, v1 · Unit tests, v1 · Build, bundle and separation, v1 · Guard fixtures.
  • New workflow ci-frontend-v1-seam.yaml: v1 · Seam.
  • The v1 steps move out of the v0 typecheck job in ci-frontend-lint.yaml.

Why

  • The P0-T10 spec (PT page) says the v1 rules must be enforced by CI, not by review, with each guard shown failing by a fixture.
  • Before this, the seam, bundle and separation guards did not exist. Accessibility rules were warnings. v1 results were mixed into the v0 typecheck check.

How

  • Seam (scripts/check-v1-seam.mjs + scripts/v1-seam-allowlist.json):
    • Applies when a change set is v1 work, meaning it touches src/v1/ or v1 tooling (scripts/*v1*, test-fixtures/v1-*).
    • It then fails on any changed v0 file (src/ outside v1, or public/) not in the allowlist. The allowlist covers routes, the root mount and src/index.css.
    • Plain v0 fixes touch no v1 file, so they pass untouched.
    • The v0-change label makes the check list the files instead of failing. The seam check is in its own workflow because it re-runs on label changes.
  • Purity: check-v1.mjs --code plus check-v1-styles.mjs. Adds a fixture showing v1 cannot import the antd shims.
  • Quality:
    • biome.json sets the 11 a11y rules that are warn repo-wide to error under src/v1.
    • lint:v1 and the CI job use --error-on-warnings, so any Biome warning under v1 fails.
  • Bundle (scripts/check-v1-bundle.mjs):
    • Runs the production build with an extra Rollup reporter.
    • For every v1 chunk, it walks the chunks it loads and fails on any v0 module or antd.
    • Today there are 0 v1 chunks, because nothing loads v1 until P0-T03. The guard then has nothing to check, and the fixtures prove it bites.
  • Separation (scripts/check-v1-separation.mjs): no tracked folder under src/v1/plugins/. The other half, "builds with no overlay", is the Build job itself, which runs on a clean OSS checkout.
  • Fixtures: 17 new rows in boundary.fixtures.mjs, including two real mini Vite builds for the bundle guard. v1-important-css now expects Biome's noImportantStyles first, and runs the styles script directly to keep its own branch covered.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why. (PS: Admins do not merge the PR without this section filled)

Database Migrations

  • None.

Env Config

  • None.

Relevant Docs

  • frontend/src/v1/README.md, section "Scripts".
  • P0-T10 plan

Related Issues or PRs

Dependencies Versions

  • None.

Notes on Testing

Screenshots

  • N/A

Checklist

I have read and understood the Contribution Guidelines.


Generated by Claude Code

…0-T10)

- ci-frontend-v1.yaml: v1 checks as their own jobs (Biome, Typecheck,
  Purity, Unit tests, Build/bundle/separation, Guard fixtures), moved out of
  the v0 typecheck job so v1 reports apart from v0.
- ci-frontend-v1-seam.yaml + scripts/check-v1-seam.mjs: v1 work may change
  v0 (src/ outside v1, public/) only at scripts/v1-seam-allowlist.json. Change
  sets that touch no v1 file pass; the v0-change label turns it into a report.
- scripts/check-v1-separation.mjs: no tracked plugin folder under
  src/v1/plugins (enterprise code stays in unstract-cloud).
- scripts/check-v1-bundle.mjs: production build, then no v1 chunk or chunk
  it loads holds a v0 module or antd.
- biome.json: a11y rules are errors under src/v1; lint:v1 fails on warnings.
- 17 fixture cases proving each new guard fails and passes as specified,
  including two real Vite builds for the bundle guard.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HzRGGUgsEDiwJ56zKJ4ASv
@johnyrahul johnyrahul self-assigned this Nov 4, 2026
claude and others added 2 commits November 4, 2026 09:23
…ud findings

- chmod +x on the three new shebang scripts (pre-commit
  check-shebang-scripts-are-executable).
- Explicit compare functions for every sort.
- Split the bundle guard's check() into reachable() and describe() to bring
  its cognitive complexity under the limit; output is unchanged.
- git from PATH marked NOSONAR with the reason, as in the fixture runner.
- String.raw in the glob escaper; no nested template literal.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HzRGGUgsEDiwJ56zKJ4ASv
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

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.

2 participants