Skip to content

CI gates

CI Gates

This file documents the quality gates wired into .github/workflows/library-ci.yml and their current enforcement state. Updating this file is part of changing a gate's enforcement level — if you flip a step from continue-on-error: true to required, update the table here in the same PR.

Gate matrix

GateToolScopeStatePromotion blocker
Package unit testspnpm test:packages:ci (vitest)All workspacesREQUIRED—
Legacy root vitest suite./node_modules/.bin/vitestRoot src/NOT WIREDRoot src/ was removed when the code moved into packages/, so the root run finds no tests and no workflow invokes it.
Bundle size budgetssize-limitcore/react/vue/ngWARNBudgets are still pre-build measurements off src/index.ts; core currently reports ~242 kB against a 30 kB limit.
Publish hygiene (exports/types/main)publint --strictcore/react/vue/ngWARNpublint needs dist/ to verify file existence under pkg.exports.
Type-resolution (ESM)@arethetypeswrong/cli (attw)plot-contracts/script/core/script-chart/agent-runtime/vue/react/ngREQUIRED—
UI token gatespnpm lint:ui (stylelint, bulk suppressions)packages/vue/srcWARN (temporarily demoted)The tokens-v2 adaptation of the Vue components is incomplete. stylelint-suppressions.json still lists the pre-reorg flat component paths (packages/vue/src/components/<File>.vue), which the semantic folder move invalidated, so recorded debt resurfaces as new violations on top of the ones still being added. Restore REQUIRED once the tokens are applied and the suppression baseline is re-recorded.
SFC style src banscripts/check-style-src.mjs (part of pnpm lint)packages/vue/srcREQUIREDNone. Shared CSS must be imported from <script setup>; <style src> duplicates the stylesheet per consumer and breaks under Vitest 5's persistent transform cache (vitejs/vite-plugin-vue#877).
Per-package buildpnpm -r build (tsc)All workspacesWARNThe recursive run also targets packages/desktop-electron (electron-builder) and examples/angular-universal (ng build, fails outside its own workspace), so it is not a library gate. The publishable packages are built by the test job instead.
Coverage threshold@vitest/coverage-v8RootNOT WIREDIntentionally deferred until Round 1E lands real engine code worth covering.

Package test scheduling

pnpm test:packages:ci runs workspace test scripts without topological sorting, then runs script-chart on its own. Package builds still run in dependency order before this step: tests can consume built workspace exports, but do not need another package's tests to finish first. Each package keeps its own Vitest configuration and file isolation.

The command limits concurrency to two packages, each with at most three Vitest workers. This caps file workers at six; the two Vitest host processes are additional. The modest overcommit on the four-vCPU CI runners accommodates worker startup, imports and I/O. Increasing package concurrency or worker counts can instead slow the suites down and trigger the script tests' existing timeouts. script-chart executes the complete built-in script catalog inside its existing five-second test deadline. It runs after the parallel phase so that this CPU-heavy test does not compete with core transforms or other script execution. It remains part of the same required gate, with the same worker cap, isolation and timeout. Re-evaluate both limits together when the runner size or test workload changes.

The Node 26 job runs the complete package suite. For a local comparison, set TZ=Asia/Shanghai, use the same machine and clear the Vitest caches before each run so both commands start cold:

pnpm test:packages --clearCache
pnpm test:packages     # existing dependency-ordered baseline
pnpm test:packages --clearCache
pnpm test:packages:ci  # bounded scheduling, followed by script-chart

Compare the package-test step's elapsed time, test-file/test counts and exit status. Workflow totals include runner queueing and unrelated gates. The normal pnpm test:packages command remains available for dependency-ordered local runs.

attw profile

pnpm lint:types runs scripts/lint-types.mjs, which pins one profile for every publishable package:

  • --profile esm-only — each publishable package ships ESM only, and Node 26+ supports require() of ESM, so the legacy Node CJS resolution rules only produce false alarms here.
  • --exclude-entrypoints style.css for the Vue package — a CSS entry is not JavaScript and can never resolve as a type.

The package list and the per-package exclusions live in that script, so the profile has a single definition. Gate the new package by adding it there.

UI token gates

Biome provides the repository lint, formatting and import checks through pnpm lint. pnpm lint:ui enforces ADR 0004 on packages/vue/src:

  • stylelint (stylelint.config.mjs, plugin scripts/lint/stylelint-plugin-klc.mjs): no raw colours, no raw px for padding/margin/gap/radius/font-size, no raw z-index, no textarea resize handle, no transition: all. Fallbacks inside var(--token, fallback) are allowed.

Existing style debt is recorded in stylelint-suppressions.json; CI fails only when a file gains violations. After fixing debt run pnpm lint:ui:prune.

Temporarily demoted to WARN (the workflow step carries continue-on-error: true): the tokens-v2 adaptation of the Vue components is not finished, so the gate reports ~226 raw-px violations. The suppression entries also still point at the pre-reorg flat paths (packages/vue/src/components/<File>.vue), which the semantic folder move invalidated, so re-record the baseline once the components settle. Restore [REQUIRED] when the adaptation lands.

Per-package bundle budgets

These are pre-build, source-based measurements (size-limit reads from packages/<x>/src/index.ts). They will be re-measured against dist/index.js once the build pipeline lands.

PackageLimit (gzip)Today's measurementRationale
core30 KB~1.6 KBHeadroom for signals + controller scaffolding + a minimal indicator set.
react8 KB~0.8 KBThin wrapper around core (use* hooks); peers excluded from the budget.
vue8 KB~1.1 KBThin composable layer; vue excluded from the budget.
angular10 KB~1.2 KBAngular decorator runtime traditionally adds 1–2 KB; extra slack on top.

If a limit trips, do not raise it reflexively — first check whether a tree shake or peer-dep externalization is the right move.

Publishing readiness (Round 1E target)

When Round 1E lands and we are ready to publish:

  1. library-ci.yml already builds every package under the type-resolution gate before running it; lint:publish and size:packages reuse those builds.
  2. Flip the remaining warn-only gates to required (remove continue-on-error: true) once their blockers in the matrix are resolved.
  3. Re-baseline the size budgets against the real dist/index.js.
  4. Verify publishConfig.provenance: true is honored by the publish workflow (it requires id-token: write permission and OIDC-enabled runners — already the default on ubuntu-latest).

Promotion order for the remaining warn-only gates

lint:types (attw) is required as of #189. The two gates still warn-only:

  1. publint --strict — cheapest to fix, catches broken exports/main/ types paths before a user ever installs the package. Failure here means the package is literally unimportable. It passes today; promote it once the exports shape of every publishable package is settled.
  2. size-limit — still measured pre-build off src/index.ts, so the budgets must be re-baselined against the real dist/ output before the gate can be trusted.

Promoting attw first was deliberate: unlike the other two, it was the only gate that could see the type/runtime mismatch shipped in #189 (extensionless relative imports, .vue declaration specifiers, a leaked workspace path), so it had to go live before the packages could be called correct.

Local commands

pnpm test:packages     # workspace tests
pnpm test:packages:ci  # same tests, with bounded CI scheduling
pnpm size:packages     # bundle budgets
pnpm lint:publish      # publint --strict, every publishable package
pnpm lint:types        # attw (esm-only profile), every publishable package

On this page