@starci/eslint-canon-be 3.11.5 → 3.11.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -75,6 +75,7 @@ rules:
75
75
  - {kind: machine, id: required-files, at: scripts/hfs/architecture/required-files.mjs}
76
76
  - {kind: machine, id: repository-tree-required, at: scripts/hfs/architecture/hfs.mjs}
77
77
  - {kind: runtime, id: runtime-required, at: scripts/hfs/runtime-check.mjs}
78
+ docs: [contexts/code/be/folder.md]
78
79
  - id: R03
79
80
  code: "HFS_UNTRACKED_ROOT_ENTRY"
80
81
  editions: [lite, full]
@@ -155,6 +156,7 @@ rules:
155
156
  failureCodes: ["HFS_AGENT_DATA_TRACKED"]
156
157
  enforcers:
157
158
  - {kind: work-validate, id: agent-data-tracked, at: scripts/work/validate/check-example-work.mjs}
159
+ docs: [contexts/hfs/README.md#rule-notes]
158
160
  - id: R09
159
161
  code: "HFS_IDENTITY_CUSTODY"
160
162
  law: "An identity points its secret at `secrets/identity-<slug>.enc`; UAT chooses by role."
@@ -164,6 +166,7 @@ rules:
164
166
  enforcers:
165
167
  - {kind: work-validate, id: sealed-custody-location, at: scripts/work/validate/check-work-artifacts.mjs}
166
168
  - {kind: work-validate, id: identity-custody-role, at: scripts/work/validate/check-example-work.mjs}
169
+ docs: [contexts/hfs/README.md#rule-notes]
167
170
  - id: R10
168
171
  code: "HFS_STACKS_SHAPE"
169
172
  editions: [lite, full]
@@ -336,6 +339,7 @@ rules:
336
339
  - {kind: eslint-be, id: no-inline-suppression}
337
340
  - {kind: eslint-fe, id: no-inline-lint-config}
338
341
  - {kind: stylelint, id: no-inline-lint-config}
342
+ docs: [contexts/code/shared/format.md]
339
343
  - id: R19
340
344
  code: "HFS_FORMAT"
341
345
  editions: ["lite", "full"]
@@ -365,6 +369,7 @@ rules:
365
369
  - {kind: eslint-fe, id: file-size-growth}
366
370
  - {kind: sonar, id: cognitive-complexity, at: knowledge/sonar-gate.yaml}
367
371
  - {kind: runtime, id: runtime-size, at: scripts/hfs/runtime-rules/size.mjs}
372
+ docs: [contexts/code/be/function.md]
368
373
  - id: R21
369
374
  code: "HFS_DUPLICATE_CODE"
370
375
  law: "No duplicated blocks or twice-defined helpers."
@@ -378,6 +383,7 @@ rules:
378
383
  - {kind: eslint-fe, id: duplicate-symbol}
379
384
  - {kind: eslint-fe, id: cross-app-duplicate}
380
385
  - {kind: sonar, id: duplicated-lines-density, at: knowledge/sonar-gate.yaml}
386
+ docs: [contexts/code/be/function.md]
381
387
  - id: R22
382
388
  code: "HFS_TS_STRICT"
383
389
  editions: ["lite", "full"]
@@ -474,10 +480,10 @@ rules:
474
480
  witness:
475
481
  - {path: packages/eslint/be/legacy-owner-graph.a16.spec.mjs, editions: [lite, full]}
476
482
  templateNa: "Tier and package direction are constraints on cross-owner import graphs; no dedicated cross-owner graph scaffold is generated."
477
- law: "The tier direction matrix; a shared package never imports an app. Front-end page and layout owners may import overlay entries; every other cross-owner feature-to-feature edge is forbidden, including layout-to-page and overlay-to-overlay. Components never import overlays. The one platform-to-domain edge is the lite entity registry (be.platform.database.entities) importing a capability's `<c>Entities` alone from its `index.ts`."
483
+ law: "The tier direction matrix; a shared package never imports an app. Front-end page and layout owners may import overlay entries; every other cross-owner feature-to-feature edge is forbidden, including layout-to-page and overlay-to-overlay. Components never import overlays. The one platform-to-domain edge is the lite entity registry (be.platform.database.entities) importing a capability's `<c>Entities` alone from its `index.ts`. A component library's tiers (`tiers.grammar`: leaf, branch, composite, frame) import nothing above themselves, and its `data-tier` stamp is its folder."
478
484
  kinds: [lint, design]
479
485
  gates: [settle, land, ci]
480
- failureCodes: ["BE_TIER_DIRECTION", "FE_TIER_DIRECTION", "ARCH_PACKAGE_IMPORTS_APP"]
486
+ failureCodes: ["BE_TIER_DIRECTION", "FE_TIER_DIRECTION", "FE_GRAMMAR_TIER_DIRECTION", "FE_GRAMMAR_TIER_STAMP", "ARCH_PACKAGE_IMPORTS_APP"]
481
487
  enforcers:
482
488
  - {kind: eslint-be, id: tier-direction}
483
489
  - {kind: eslint-fe, id: tier-direction}
@@ -1253,7 +1259,7 @@ rules:
1253
1259
  - {path: packages/hfs/src/hfs-i18n-catalog-coverage.spec.mjs, editions: [lite, full]}
1254
1260
  - id: R61
1255
1261
  code: "FE_STYLE_TOKEN_ONLY"
1256
- law: "Application CSS uses the selected Grammar tokens for layout and the declared brand owner for brand values; every source declaration resolves. Status foregrounds reach 3:1 against their tinted surface and page background in each theme, body text reaches 4.5:1, and an insufficiently contrasting solid tone is never text. The selected Grammar owns the concrete token pairs, typography, scale and visual values."
1262
+ law: "Application CSS uses the selected Grammar tokens for layout and the declared brand owner for brand values; every source declaration resolves. Status foregrounds reach 3:1 against their tinted surface and page background in each theme, body text reaches 4.5:1, content on a tone background uses the tone's soft pair and a mark with no background of the tone uses the tone itself. The selected Grammar owns the concrete token pairs, typography, scale and visual values."
1257
1263
  docs: [knowledge/patterns/fe/index.yaml#FE-RULE-OWNERSHIP, packages/stylelint/README.md, packages/eslint/fe/docs/brand-values.md, docs/source-process.md#the-test-ladder, knowledge/hfs/rules.yaml#R225]
1258
1264
  kinds: [lint, design]
1259
1265
  gates: [pre-commit, settle, land, ci]
@@ -1266,7 +1272,8 @@ rules:
1266
1272
  - {kind: stylelint, id: globals-shape}
1267
1273
  - {kind: stylelint, id: globals-import-order}
1268
1274
  - {kind: stylelint, id: no-token-redefinition}
1269
- - {kind: stylelint, id: brand-layer-shape}
1275
+ - {kind: stylelint, id: no-grammar-private-token}
1276
+ - {kind: stylelint, id: theme-layer-shape}
1270
1277
  - {kind: stylelint, id: status-contrast}
1271
1278
  - {kind: stylelint, id: no-css-module}
1272
1279
  - {kind: stylelint, id: no-class-selector}
@@ -1275,9 +1282,7 @@ rules:
1275
1282
  - {kind: eslint-fe, id: no-raw-brand-value}
1276
1283
  - {kind: eslint-grammar-core, id: no-fractional-step}
1277
1284
  - {kind: eslint-fe, id: no-arbitrary-value}
1278
- - {kind: eslint-grammar-core, id: no-hand-rolled-heading}
1279
1285
  - {kind: eslint-grammar-core, id: no-unresolved-token-class}
1280
- - {kind: eslint-grammar-core, id: no-heading-tag-outside-heading-component}
1281
1286
  - {kind: eslint-grammar-core, id: status-text-uses-soft-foreground}
1282
1287
  proves:
1283
1288
  - {path: packages/stylelint/source-resolves.spec.mjs, editions: [lite, full], codes: [FE_STYLE_SOURCE_UNRESOLVED]}
@@ -1859,7 +1864,7 @@ rules:
1859
1864
  editions: ["lite","full"]
1860
1865
  docs: ["docs/frontend-source-authoring.md#r91-source-form"]
1861
1866
  proves: [{"path":"packages/eslint/fe/r91-source-form.spec.mjs","editions":["lite","full"]}]
1862
- exemplifiedBy: [{"path":"packages/hfs/templates/fe/skeleton-lite/apps/web/src/components/composites/SiteShell/index.tsx","edition":"lite"},{"path":"packages/hfs/templates/fe/skeleton/apps/app/src/features/pages/AppHomePage/index.tsx","edition":"full"},{"path":"packages/eslint/fe/r91-source-form.spec.mjs","editions":["lite","full"]}]
1867
+ exemplifiedBy: [{"path":"packages/hfs/templates/fe/skeleton-lite/apps/web/src/components/frames/SiteShell/index.tsx","edition":"lite"},{"path":"packages/hfs/templates/fe/skeleton/apps/app/src/features/pages/AppHomePage/index.tsx","edition":"full"},{"path":"packages/eslint/fe/r91-source-form.spec.mjs","editions":["lite","full"]}]
1863
1868
  witness: [{"path":"packages/eslint/fe/r91-source-form.spec.mjs","edition":"lite","codes":["FE_SOURCE_FORM","FE_SOURCE_LAYOUT_INVALID"]},{"path":"packages/eslint/fe/r91-source-form.spec.mjs","edition":"full","codes":["FE_SOURCE_FORM","FE_SOURCE_LAYOUT_INVALID"]}]
1864
1869
  gates: ["pre-commit","settle","land","ci"]
1865
1870
  - id: R92
@@ -1875,6 +1880,7 @@ rules:
1875
1880
  - {kind: eslint-fe, id: no-public-classname-prop}
1876
1881
  - {kind: eslint-fe, id: no-public-frame-css-props}
1877
1882
  - {kind: eslint-fe, id: no-css-door-type-laundering}
1883
+ - {kind: eslint-fe, id: tier-children}
1878
1884
  - {kind: eslint-fe, id: base-props-atom}
1879
1885
  - {kind: eslint-fe, id: base-import-pair}
1880
1886
  - {kind: eslint-fe, id: no-data-status-shape}
@@ -1915,10 +1921,8 @@ rules:
1915
1921
  enforcers:
1916
1922
  - {kind: eslint-grammar-core, id: no-vendor-icon-outside-icon-leaf}
1917
1923
  - {kind: eslint-grammar-core, id: heroicons-is-the-glyph-vendor}
1918
- - {kind: eslint-grammar-core, id: no-off-scale-glyph-size}
1919
1924
  - {kind: eslint-grammar-core, id: no-icon-size-class}
1920
1925
  - {kind: eslint-grammar-core, id: destructive-menu-entry-needs-danger-tone}
1921
- - {kind: eslint-grammar-core, id: no-decorative-icon-in-metric-cell}
1922
1926
  - {kind: eslint-grammar-core, id: vendor-primitive-has-named-owner}
1923
1927
  - {kind: eslint-fe, id: grammar-entry}
1924
1928
  - {kind: machine, id: grammar, at: scripts/hfs/architecture/frontend-grammar.mjs}
@@ -3695,7 +3699,7 @@ rules:
3695
3699
  editions: [lite, full]
3696
3700
  docs: [docs/architecture.md#r213]
3697
3701
  templateNa: "Full apps keep TypeORM migrations under be/; the managed db/migrations scaffold is lite's."
3698
- law: "A migration is `db/migrations/<ts14>_<kebab>.sql`; the stamp is a valid UTC instant, active stamps are unique, and a new migration sorts strictly after the committed active migrations in HEAD. Repository history includes the archive: moving an active migration to the archive retires it from ordering, so a replacement baseline may predate archived stamps and later migrations append after the baseline. Wall-clock time, commit time and remote-branch stamps do not set the ordering boundary. A migration already on the base is immutable (a diff or an unarchived removal is a finding); a file that does not parse as PostgreSQL is a shape failure."
3702
+ law: "A migration is `db/migrations/<ts14>_<kebab>.sql`; the stamp is a valid UTC instant, active stamps are unique, and a new migration sorts strictly after the committed active migrations in HEAD. Repository history includes the archive: moving an active migration to the archive retires it from ordering, so a replacement baseline may predate archived stamps and later migrations append after the baseline. Wall-clock time, commit time and remote-branch stamps do not set the ordering boundary. A migration already on the base is immutable (a diff or an unarchived removal is a finding); a file that does not parse as PostgreSQL is a shape failure. `starci app db migrate` applies each migration in one transaction with its history row, so a top-level BEGIN, START TRANSACTION, COMMIT, END, ROLLBACK, ABORT, SAVEPOINT, RELEASE or PREPARE TRANSACTION, or a COMMIT or ROLLBACK inside a DO block, is a shape failure named by file:line; a function or procedure body is never judged."
3699
3703
  kinds: [check]
3700
3704
  gates: [settle, land, ci]
3701
3705
  failureCodes: ["DB_MIGRATION_SHAPE"]
@@ -3776,7 +3780,7 @@ rules:
3776
3780
  - {path: packages/hfs/src/hfs-lite-secrets.spec.mjs, edition: lite}
3777
3781
  - id: R221
3778
3782
  code: "CI_TRIGGERS_RELEASE_ONLY"
3779
- law: "Workflow triggers are push filtered to v* tags or release/candidate-* branches, and workflow_dispatch. Runtime workflows and app ci.yml also admit main. App ci.yml includes the candidate branch filter for starci app release push. Other branches, events, path filters and ignore filters are refused."
3783
+ law: "Workflow triggers are push filtered to v* tags or release/candidate-* branches, workflow_call (a reusable workflow has no trigger of its own) and workflow_dispatch. Runtime workflows and app ci.yml also admit main, and app ci.yml admits pull_request to main (branches ['main'] only: a pull request run has no secret and no environment). App ci.yml includes the candidate branch filter for starci app release push. pull_request_target, workflow_run, schedules, other branches, events, path filters and ignore filters are refused."
3780
3784
  scope: runtime
3781
3785
  editions: [lite, full]
3782
3786
  docs: [docs/git-governance.md#r221]
@@ -3809,6 +3813,7 @@ rules:
3809
3813
  failureCodes: ["RIGHTS_ROLE_DENIED", "RIGHTS_GIT_PUSH", "RIGHTS_GIT_TAG", "RIGHTS_GIT_COMMIT", "RIGHTS_GIT_SYNC", "RIGHTS_NPM_PUBLISH", "RIGHTS_NPM_CI_UNLOCKED", "RIGHTS_SUITE_RUN", "RIGHTS_RELEASE_CUT", "RIGHTS_RAW_TOOL"]
3810
3814
  enforcers:
3811
3815
  - {kind: runtime, id: role-rights, at: scripts/hfs/runtime-rules/rights-policy.mjs}
3816
+ docs: [contexts/hfs/README.md#rule-notes]
3812
3817
  - id: R224
3813
3818
  code: "RIGHTS_PROTECTED_ZONE"
3814
3819
  law: "The protected zone declared once in modules/kernel/protected-zone.yaml is edited only by the owner path; a supervisor self-upgrade files an owner proposal, and an op never writes the .claude runtime checkout."
@@ -3818,6 +3823,7 @@ rules:
3818
3823
  failureCodes: ["RIGHTS_PROTECTED_ZONE", "RIGHTS_OP_RUNTIME_WRITE"]
3819
3824
  enforcers:
3820
3825
  - {kind: runtime, id: protected-zone, at: scripts/hfs/runtime-rules/rights-policy.mjs}
3826
+ docs: [contexts/hfs/README.md#rule-notes]
3821
3827
  - id: R225
3822
3828
  code: "RT_HOOK_SHAPE"
3823
3829
  law: "The app hook templates keep the gate model: pre-commit is L0 only (no typecheck or test run); pre-push invokes the bundled scripts/guards/release-push-gate.mjs policy for fast-forward main, a clean outgoing secret scan and annotated v* tags, then the harness's `starci deps check` (every committed @starci pin installable from npm, no local package copy ahead of npm). It runs no build, test, typecheck or lint."
@@ -3827,6 +3833,7 @@ rules:
3827
3833
  failureCodes: ["RT_HOOK_SHAPE", "RIGHTS_PUSH_NOT_RELEASE"]
3828
3834
  enforcers:
3829
3835
  - {kind: runtime, id: hook-shape, at: scripts/hfs/runtime-rules/hook-shape.mjs}
3836
+ docs: [contexts/hfs/README.md#rule-notes]
3830
3837
  - id: R227
3831
3838
  code: "RT_SYNTAX_INVALID"
3832
3839
  editions: [lite, full]
@@ -4195,7 +4202,7 @@ rules:
4195
4202
  editions: [lite, full]
4196
4203
  docs:
4197
4204
  - {path: docs/application-stacks.md#r251-deploy-workflow, editions: [lite, full]}
4198
- law: "In lite and full apps, deployment jobs declare a protected environment, explicit permissions and concurrency, materialize sealed secrets through SOPS_AGE_KEY or starci app secret materialize, and reference only the age key and transport SSH key/known_hosts secrets. They never embed a dotenv blob or write a dotenv file. Every remote workflow action uses a 40-hex commit SHA (local actions are allowed and container actions require a full sha256 digest); supply-chain reports each unpinned uses reference at its source line, including disabled jobs and steps; installed tools are checksum or digest verified, or supplied by a pinned action. App workflows start only on release tags [v*], the release candidate branches release/candidate-* (required in ci.yml: starci app release push waits for that run, owner ruling candidate-ci 2026-10-18) or workflow_dispatch; ci.yml also runs on main, and other branch pushes are refused."
4205
+ law: "In lite and full apps, deployment jobs declare a protected environment, explicit permissions and concurrency, materialize sealed secrets through SOPS_AGE_KEY or starci app secret materialize, and reference only the age key and transport SSH key/known_hosts secrets; every job that reads secrets.SOPS_AGE_KEY, a deployment job or not, is bound to the GitHub Environment whose members it opens, so it reads that environment's server key and never a repository secret of that name. Deployment jobs never embed a dotenv blob or write a dotenv file. Every remote workflow action uses a 40-hex commit SHA (local actions are allowed and container actions require a full sha256 digest); supply-chain reports each unpinned uses reference at its source line, including disabled jobs and steps; installed tools are checksum or digest verified, or supplied by a pinned action. App workflows start only on release tags [v*], the release candidate branches release/candidate-* (required in ci.yml: starci app release push waits for that run, owner ruling candidate-ci 2026-10-18), workflow_call or workflow_dispatch; ci.yml also runs on main and on pull_request to main (read-only workflow permissions, no environment bound in the file), and other branch pushes are refused. A release deploys through the reusable stack-deploy.yml (ruling app-cicd-auto-deploy): the job of ci.yml that calls it (deploy-<env>, after the verdict job) holds permissions, concurrency and with.environment, the called deploy job binds the GitHub Environment (deployment refs restricted to v* tags) and reads SOPS_AGE_KEY there, and the transport is the sealed member vps-ci opened with that key, so the CI deploy key, the host and the pinned host keys are never GitHub secrets, workflow text or log lines; STARCI_DEPLOY_PAUSED on the environment stops the automatic deploy. The secrets allowlist and the dotenv ban are judged on the deployment jobs, not on the check jobs beside them."
4199
4206
  kinds: [check]
4200
4207
  gates: [settle, land, ci]
4201
4208
  failureCodes: ["HFS_DEPLOY_WORKFLOW", "HFS_WORKFLOW_PIN", "HFS_CI_TOOL_INSTALL", "HFS_APP_WORKFLOW_TRIGGER"]
@@ -4205,7 +4212,7 @@ rules:
4205
4212
  proves:
4206
4213
  - {path: packages/hfs/src/hfs-deploy-workflow.spec.mjs, editions: [lite, full]}
4207
4214
  exemplifiedBy:
4208
- - {path: packages/hfs/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml, edition: lite}
4215
+ - {path: packages/hfs/templates/app/ci-workflows-lite/github/workflows/stack-deploy.yml, edition: lite}
4209
4216
  - {path: packages/hfs/templates/app/ci-workflows/github/workflows/ci.yml, edition: full}
4210
4217
  - {path: packages/hfs/src/hfs-deploy-workflow.spec.mjs, editions: [lite, full]}
4211
4218
  witness:
@@ -4224,7 +4231,7 @@ rules:
4224
4231
  proves:
4225
4232
  - {path: packages/hfs/src/hfs-script-hygiene.spec.mjs, editions: [lite, full]}
4226
4233
  exemplifiedBy:
4227
- - {path: packages/hfs/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml, edition: lite}
4234
+ - {path: packages/hfs/templates/app/ci-workflows-lite/github/workflows/stack-deploy.yml, edition: lite}
4228
4235
  - {path: packages/hfs/templates/app/ci-workflows/github/workflows/ci.yml, edition: full}
4229
4236
  - {path: packages/hfs/src/hfs-script-hygiene.spec.mjs, editions: [lite, full]}
4230
4237
  witness:
@@ -4331,7 +4338,7 @@ rules:
4331
4338
  editionWhy: "owner:lite-backing-services makes the db service lite's database; database configuration, extension, migration and seed requirements apply to that backing."
4332
4339
  docs: [docs/microservices.md#r259]
4333
4340
  templateNa: "Extension use, contract migrations, vault operations and seed literals are product-authored db content, rather than a scaffolded SQL surface."
4334
- law: "DB_CONFIG_EXT: extensions belong to the database allowlist, vault writes and migration role passwords are refused, and seed data holds no real email or phone. Destructive DDL belongs only to *_contract_* migrations whose targets are no longer referenced by back-end SQL or entities. Seeds contain no real email or phone literals."
4341
+ law: "DB_CONFIG_EXT: extensions belong to the database allowlist, vault writes and migration role passwords are refused, and seed data holds no real email or phone. Destructive DDL belongs only to *_contract_* migrations whose targets are no longer referenced by back-end SQL or entities, and a contract migration that is new since the previous release tag (the newest v* tag HEAD contains) never destroys an object that the back-end sources of that tag still reference: the deploy applies it right after the accept, while that release is the rollback target, so the code change goes in one release and its contract migration in the next. Seeds contain no real email or phone literals."
4335
4342
  kinds: [check]
4336
4343
  gates: [settle, land, ci]
4337
4344
  failureCodes: ["DB_EXTENSION_ALLOWED", "DB_MIGRATION_DESTRUCTIVE", "HFS_SEED_PII", "DB_VAULT_WRITE"]
@@ -4600,7 +4607,7 @@ rules:
4600
4607
  - {path: packages/hfs/src/hfs-doc-fresh.spec.mjs, edition: full}
4601
4608
  - id: R271
4602
4609
  code: "HFS_RELEASE_TAG_MISMATCH"
4603
- law: "A lite or full product release uses a v-prefixed semantic version tag equal to package.json version; images.yml publishes images under that release tag, and every database deployment refuses a non-tag ref before migration."
4610
+ law: "A lite or full product release uses a v-prefixed semantic version tag equal to package.json version; images.yml pushes each image under the immutable tag sha-<github.sha> and adds the release name v<version> only as a retag of that digest on a release tag run, under a guard that rejects any other ref; and every database deployment refuses a non-tag ref before migration (a lite app migrates inside its stack deploy, which stack-deploy.yml starts only from a release tag, so its db-deploy.yml is retired and starci app sync removes it)."
4604
4611
  kinds: [check]
4605
4612
  gates: ["settle","land","ci"]
4606
4613
  failureCodes: ["HFS_RELEASE_TAG_MISMATCH", "HFS_DB_DEPLOY_UNGUARDED"]
@@ -4614,7 +4621,7 @@ rules:
4614
4621
  exemplifiedBy:
4615
4622
  - {"path":"packages/hfs/templates/app/ci-workflows-lite/github/workflows/images.yml","edition":"lite"}
4616
4623
  - {"path":"packages/hfs/templates/app/ci-workflows/github/workflows/images.yml","edition":"full"}
4617
- - {"path":"packages/hfs/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml","edition":"lite"}
4624
+ - {"path":"packages/hfs/templates/app/ci-workflows-lite/github/workflows/stack-deploy.yml","edition":"lite"}
4618
4625
  - {path: packages/hfs/src/hfs-release-provenance.spec.mjs, edition: lite}
4619
4626
  - {path: packages/hfs/src/hfs-release-provenance.spec.mjs, edition: full}
4620
4627
  witness:
@@ -4622,10 +4629,10 @@ rules:
4622
4629
  - {path: packages/hfs/src/hfs-release-provenance.spec.mjs, edition: full}
4623
4630
  - id: R272
4624
4631
  code: "BE_APP_BOOT_PROOF_MISSING"
4625
- law: "Every lite back-end app proves its real Nest AppModule composition by compiling the dependency graph with explicit fixture options and infrastructure doubles; unresolved providers, circular dependencies and a missing or failed proof are refused. The app check wiring verb uses the same proof. Full retains its existing e2e boot proof."
4632
+ law: "Every lite back-end app proves its real Nest AppModule composition by compiling the dependency graph with explicit fixture options and infrastructure doubles; unresolved providers, circular dependencies and a missing or failed proof are refused. The proof worker runs within its own budget from its spawn and is retried once when it runs out; a second timeout reaches no verdict and is reported as BOOT_PROOF_TIMEOUT, a warning, never as a failed proof. The app check wiring verb uses the same proof. Full retains its existing e2e boot proof."
4626
4633
  kinds: [check]
4627
4634
  gates: ["settle","land","ci"]
4628
- failureCodes: ["BE_APP_BOOT_PROOF_MISSING"]
4635
+ failureCodes: ["BE_APP_BOOT_PROOF_MISSING", "BOOT_PROOF_TIMEOUT"]
4629
4636
  enforcers:
4630
4637
  - {kind: hfs, id: boot-proof, at: scripts/hfs/rules/boot-proof.mjs}
4631
4638
  editions: ["lite"]
@@ -5468,7 +5475,6 @@ rules:
5468
5475
  gates: [pre-commit, settle, land, ci]
5469
5476
  failureCodes: ["FE_NESTED_VARIANT", "FE_LIST_PANEL_PADDING", "FE_GRAMMAR_LAYOUT_ONLY", "FE_DIVIDER_FULL_BLEED"]
5470
5477
  enforcers:
5471
- - {kind: eslint-fe, id: nested-control-variant}
5472
5478
  - {kind: eslint-fe, id: no-list-panel-padding}
5473
5479
  - {kind: eslint-fe, id: no-app-surface-paint}
5474
5480
  - {kind: eslint-fe, id: divider-full-bleed}
@@ -5479,15 +5485,15 @@ rules:
5479
5485
  templateNa: "Product composition is proved by the FE canon's Grammar import and surface fixtures; a template cannot choose product slots or lists."
5480
5486
  proves:
5481
5487
  - {path: packages/eslint/fe/divider-full-bleed.spec.mjs, editions: [lite, full], codes: [FE_DIVIDER_FULL_BLEED]}
5482
- - {path: packages/eslint/fe/surface-rules.spec.mjs, editions: [lite, full], codes: [FE_NESTED_VARIANT, FE_LIST_PANEL_PADDING, FE_GRAMMAR_LAYOUT_ONLY]}
5488
+ - {path: packages/eslint/fe/surface-rules.spec.mjs, editions: [lite, full], codes: [FE_LIST_PANEL_PADDING, FE_GRAMMAR_LAYOUT_ONLY]}
5483
5489
  - {path: packages/eslint/fe/ui-rulings.spec.mjs, editions: [lite, full], codes: [FE_NESTED_VARIANT, FE_GRAMMAR_LAYOUT_ONLY]}
5484
5490
  exemplifiedBy:
5485
5491
  - {path: packages/eslint/fe/divider-full-bleed.spec.mjs, editions: [lite, full], codes: [FE_DIVIDER_FULL_BLEED]}
5486
- - {path: packages/eslint/fe/surface-rules.spec.mjs, editions: [lite, full], codes: [FE_NESTED_VARIANT, FE_LIST_PANEL_PADDING, FE_GRAMMAR_LAYOUT_ONLY]}
5492
+ - {path: packages/eslint/fe/surface-rules.spec.mjs, editions: [lite, full], codes: [FE_LIST_PANEL_PADDING, FE_GRAMMAR_LAYOUT_ONLY]}
5487
5493
  - {path: packages/eslint/fe/ui-rulings.spec.mjs, editions: [lite, full], codes: [FE_NESTED_VARIANT, FE_GRAMMAR_LAYOUT_ONLY]}
5488
5494
  witness:
5489
5495
  - {path: packages/eslint/fe/divider-full-bleed.spec.mjs, editions: [lite, full], codes: [FE_DIVIDER_FULL_BLEED]}
5490
- - {path: packages/eslint/fe/surface-rules.spec.mjs, editions: [lite, full], codes: [FE_NESTED_VARIANT, FE_LIST_PANEL_PADDING, FE_GRAMMAR_LAYOUT_ONLY]}
5496
+ - {path: packages/eslint/fe/surface-rules.spec.mjs, editions: [lite, full], codes: [FE_LIST_PANEL_PADDING, FE_GRAMMAR_LAYOUT_ONLY]}
5491
5497
  - {path: packages/eslint/fe/ui-rulings.spec.mjs, editions: [lite, full], codes: [FE_NESTED_VARIANT, FE_GRAMMAR_LAYOUT_ONLY]}
5492
5498
  cases:
5493
5499
  - id: case-1
@@ -5501,10 +5507,9 @@ rules:
5501
5507
  law: "An app Button or IconButton declares an intent and never a variant; Grammar resolves the variant from intent and placement (CTA-6). A destructive confirm lives in a confirmation dialog, a render holds at most one commit, and a collection item holds none."
5502
5508
  kinds: [codemod, lint, design]
5503
5509
  gates: [pre-commit, settle, land, ci]
5504
- failureCodes: ["FE_BUTTON_INTENT", "FE_BUTTON_INTENT_REQUIRED", "FE_BUTTON_NO_VARIANT", "FE_DESTRUCTIVE_CONFIRM_IN_DIALOG", "FE_SINGLE_COMMIT_PER_RENDER", "FE_NO_COMMIT_IN_COLLECTION_ITEM"]
5510
+ failureCodes: ["FE_BUTTON_INTENT", "FE_BUTTON_INTENT_REQUIRED", "FE_DESTRUCTIVE_CONFIRM_IN_DIALOG", "FE_SINGLE_COMMIT_PER_RENDER", "FE_NO_COMMIT_IN_COLLECTION_ITEM"]
5505
5511
  enforcers:
5506
5512
  - {kind: eslint-fe, id: button-intent-required}
5507
- - {kind: eslint-fe, id: button-no-variant}
5508
5513
  - {kind: eslint-fe, id: destructive-confirm-in-dialog}
5509
5514
  - {kind: eslint-fe, id: single-commit-per-render}
5510
5515
  - {kind: eslint-fe, id: no-commit-in-collection-item}
@@ -5513,11 +5518,11 @@ rules:
5513
5518
  - knowledge/ui/composition/cta.yaml
5514
5519
  - docs/code-pattern-enforcement.md#r319-button-intent
5515
5520
  proves:
5516
- - {path: packages/eslint/fe/button-intent.spec.mjs, editions: [lite, full], codes: [FE_BUTTON_INTENT, FE_BUTTON_INTENT_REQUIRED, FE_BUTTON_NO_VARIANT, FE_DESTRUCTIVE_CONFIRM_IN_DIALOG, FE_SINGLE_COMMIT_PER_RENDER, FE_NO_COMMIT_IN_COLLECTION_ITEM]}
5521
+ - {path: packages/eslint/fe/button-intent.spec.mjs, editions: [lite, full], codes: [FE_BUTTON_INTENT, FE_BUTTON_INTENT_REQUIRED, FE_DESTRUCTIVE_CONFIRM_IN_DIALOG, FE_SINGLE_COMMIT_PER_RENDER, FE_NO_COMMIT_IN_COLLECTION_ITEM]}
5517
5522
  exemplifiedBy:
5518
- - {path: packages/eslint/fe/button-intent.spec.mjs, editions: [lite, full], codes: [FE_BUTTON_INTENT, FE_BUTTON_INTENT_REQUIRED, FE_BUTTON_NO_VARIANT, FE_DESTRUCTIVE_CONFIRM_IN_DIALOG, FE_SINGLE_COMMIT_PER_RENDER, FE_NO_COMMIT_IN_COLLECTION_ITEM]}
5523
+ - {path: packages/eslint/fe/button-intent.spec.mjs, editions: [lite, full], codes: [FE_BUTTON_INTENT, FE_BUTTON_INTENT_REQUIRED, FE_DESTRUCTIVE_CONFIRM_IN_DIALOG, FE_SINGLE_COMMIT_PER_RENDER, FE_NO_COMMIT_IN_COLLECTION_ITEM]}
5519
5524
  witness:
5520
- - {path: packages/eslint/fe/button-intent.spec.mjs, editions: [lite, full], codes: [FE_BUTTON_INTENT, FE_BUTTON_INTENT_REQUIRED, FE_BUTTON_NO_VARIANT, FE_DESTRUCTIVE_CONFIRM_IN_DIALOG, FE_SINGLE_COMMIT_PER_RENDER, FE_NO_COMMIT_IN_COLLECTION_ITEM]}
5525
+ - {path: packages/eslint/fe/button-intent.spec.mjs, editions: [lite, full], codes: [FE_BUTTON_INTENT, FE_BUTTON_INTENT_REQUIRED, FE_DESTRUCTIVE_CONFIRM_IN_DIALOG, FE_SINGLE_COMMIT_PER_RENDER, FE_NO_COMMIT_IN_COLLECTION_ITEM]}
5521
5526
  templateNa: "The intent of an action comes from the product decision in the .starciwork specification; a template cannot choose it."
5522
5527
  cases:
5523
5528
  - id: case-1
@@ -5576,7 +5581,7 @@ rules:
5576
5581
  ruling: "The label of a status chip starts with an uppercase letter (owner ruling chip-label-uppercase); StatusDot capitalises a text label it renders, and the lint refuses a lowercase literal label at its source."
5577
5582
  - id: R323
5578
5583
  code: "FE_PAGE_HEADER_HAND_ROLLED"
5579
- law: "A page is headed by Grammar's PageHeader; a Breadcrumbs trail followed by a SectionHeader in one parent is a page head composed by hand, with no band, no top inset and no separator."
5584
+ law: "A page is headed by the header of Grammar's Page; PageHeader and Breadcrumbs are Page's parts and are not exported, so importing either from the Grammar composes a page head by hand, with no band, no top inset and no separator."
5580
5585
  kinds: [lint]
5581
5586
  gates: [pre-commit, settle, land, ci]
5582
5587
  failureCodes: ["FE_PAGE_HEADER_HAND_ROLLED"]
@@ -5596,10 +5601,10 @@ rules:
5596
5601
  date: "2026-10-28"
5597
5602
  source: owner
5598
5603
  quote: "Publish Grammar 0.15.3 with PageHeader now, then move all 18 pages to it before deploying. (translated from Vietnamese)"
5599
- ruling: "A page is headed by Grammar's PageHeader (owner ruling page-header-band): a surface band whose content shares the page content's edges and which ends in its own full-width separator, page tabs standing on it; the lint refuses a page head composed by hand from Breadcrumbs and SectionHeader."
5604
+ ruling: "A page is headed by Grammar's Page header (owner ruling page-header-band): a surface band whose content shares the page content's edges and which ends in its own full-width separator, page tabs standing on it; the lint refuses a PageHeader or Breadcrumbs imported by hand, since both are Page's own parts."
5600
5605
  - id: R324
5601
5606
  code: "FE_PAGE_TABS_OUTSIDE_HEADER"
5602
- law: "Page tabs are the header's tabs; a Tabs that is the first element of a Page body or the next element after a PageHeader is a page tab bar drawn outside the band."
5607
+ law: "Page tabs are the header's tabs; a Tabs that is the first element of a Page body is a page tab bar drawn outside the band."
5603
5608
  kinds: [lint]
5604
5609
  gates: [pre-commit, settle, land, ci]
5605
5610
  failureCodes: ["FE_PAGE_TABS_OUTSIDE_HEADER"]
@@ -5622,7 +5627,7 @@ rules:
5622
5627
  ruling: "A route page is one Grammar Page (owner ruling page-frame); page tabs are its header's tabs, and the lint refuses a Tabs at the top of the Page body or right after a PageHeader."
5623
5628
  - id: R325
5624
5629
  code: "FE_ROUTE_PAGE_OUTSIDE_PAGE"
5625
- law: "A page owner draws one Grammar Page with nothing beside it; a sibling of the Page, or a bare PageHeader or PageContainer in the page owner, re-decides the inset and rhythm Page owns."
5630
+ law: "A page owner draws one Grammar Page with nothing beside it; a sibling of the Page re-decides the inset and rhythm Page owns, and PageHeader and PageContainer are Page's parts, not exports to import from the Grammar."
5626
5631
  kinds: [lint]
5627
5632
  gates: [pre-commit, settle, land, ci]
5628
5633
  failureCodes: ["FE_ROUTE_PAGE_OUTSIDE_PAGE"]
@@ -5890,6 +5895,118 @@ rules:
5890
5895
  - {path: packages/eslint-canon-be/src/event-bus-lite.spec.ts, edition: lite, codes: [BE_EVENT_BUS_LITE_SHAPE]}
5891
5896
  witness:
5892
5897
  - {path: packages/eslint-canon-be/src/event-bus-lite.spec.ts, edition: lite, codes: [BE_EVENT_BUS_LITE_SHAPE]}
5898
+ - id: R337
5899
+ code: "HFS_AUTH_COOKIE_DOMAIN_MISSING"
5900
+ law: "In a lite app whose api uses the skeleton's passport (a tracked src/modules/integrations/passport/passport.config.ts), a docker-swarm environment whose rendered stack serves the web and the api on different hosts gives the api an AUTH_COOKIE_DOMAIN: a declared value in services.api.environment, a row of the environment's runtime/env/KEYS.md or a key sealed under its secrets/. Otherwise the refresh cookie is host-only on the api host, is absent from the Cookie header the web server forwards to the api, the api refuses the session and the user loops back to sign-in. The hosts are read from the rendered stack (web: NEXT_PUBLIC_SITE_URL, AUTH_WEB_ORIGIN, deploy.verify.http, HTTP_SECURITY_ALLOWED_ORIGINS; api: AUTH_JWT_ISSUER, GOOGLE_CALLBACK_URL, NEXT_PUBLIC_API_URL, deploy.verify.http), ports ignored, an unknown host is not judged. The finding names both hosts and their common parent domain as the value to set. A declared AUTH_COOKIE_DOMAIN that is not a bare domain (no scheme, port, path, leading dot or IP) or is not a parent of the web and the api hosts is a finding too. Same host: no key is required."
5901
+ kinds: [check]
5902
+ gates: [settle, land, ci]
5903
+ failureCodes: ["HFS_AUTH_COOKIE_DOMAIN_MISSING"]
5904
+ enforcers:
5905
+ - {kind: hfs, id: stacks-auth-cookie-domain, at: scripts/hfs/rules/stacks-auth-cookie-domain.mjs}
5906
+ editions: [lite]
5907
+ docs:
5908
+ - contexts/project/stacks.md
5909
+ proves:
5910
+ - {path: packages/hfs/src/hfs-stacks-auth-cookie-domain.spec.mjs, edition: lite}
5911
+ exemplifiedBy:
5912
+ - {path: packages/hfs/templates/app/skeleton-lite/.starcistacks, edition: lite}
5913
+ - {path: packages/hfs/templates/be/skeleton-lite/src/modules/integrations/passport/passport.config.ts, edition: lite}
5914
+ - {path: packages/hfs/src/hfs-stacks-auth-cookie-domain.spec.mjs, edition: lite}
5915
+ witness:
5916
+ - {path: packages/hfs/src/hfs-stacks-auth-cookie-domain.spec.mjs, edition: lite}
5917
+
5918
+ - id: R338
5919
+ code: "FE_GENERATED_ART_OUTSIDE_FRAME"
5920
+ law: "Generated art, a .webp or .png under the public /images/ tree, renders only through Grammar's Mascot (the character size scale sm, md, lg, hero) or inside a MediaFrame; a bare Image, img or other src-taking element drawing it takes whatever box its page gives, so the same art comes out at a different size on every screen."
5921
+ kinds: [lint]
5922
+ gates: [pre-commit, settle, land, ci]
5923
+ failureCodes: ["FE_GENERATED_ART_OUTSIDE_FRAME"]
5924
+ enforcers:
5925
+ - {kind: eslint-grammar-core, id: generated-art-in-mascot-or-media-frame}
5926
+ editions: [lite, full]
5927
+ docs: [knowledge/patterns/fe/ui.yaml#FE-UI]
5928
+ templateNa: "A template draws no generated art; the art is the app's."
5929
+ proves:
5930
+ - packages/eslint-grammar-core/src/mascot.spec.ts
5931
+ exemplifiedBy:
5932
+ - {path: packages/eslint-grammar-core/src/mascot.spec.ts, editions: [lite, full], codes: [FE_GENERATED_ART_OUTSIDE_FRAME]}
5933
+ witness:
5934
+ - {path: packages/eslint-grammar-core/src/mascot.spec.ts, editions: [lite, full], codes: [FE_GENERATED_ART_OUTSIDE_FRAME]}
5935
+ cases:
5936
+ - id: case-1
5937
+ date: "2026-10-30"
5938
+ source: owner
5939
+ quote: "Generated art renders at one consistent size across screens (relayed by the nivo-lite app)."
5940
+ ruling: "Grammar's Mascot owns the character size scale (sm 96px, md 160px, lg 240px, hero up to its cap), always contained on a transparent ground; generated art under /images/ renders through Mascot or inside MediaFrame, never a bare Image."
5941
+ - id: R339
5942
+ code: "FE_MASCOT_ASSET_SLOT_MISSING"
5943
+ law: "Every Grammar Mascot names its assetSlot (a non-empty value), tying the rendered art to the asset workflow's request; an element with a spread attribute is not judged."
5944
+ kinds: [lint]
5945
+ gates: [pre-commit, settle, land, ci]
5946
+ failureCodes: ["FE_MASCOT_ASSET_SLOT_MISSING"]
5947
+ enforcers:
5948
+ - {kind: eslint-grammar-core, id: mascot-asset-slot-required}
5949
+ editions: [lite, full]
5950
+ docs: [knowledge/patterns/fe/ui.yaml#FE-UI]
5951
+ templateNa: "A template draws no mascot; the art is the app's."
5952
+ proves:
5953
+ - packages/eslint-grammar-core/src/mascot.spec.ts
5954
+ exemplifiedBy:
5955
+ - {path: packages/eslint-grammar-core/src/mascot.spec.ts, editions: [lite, full], codes: [FE_MASCOT_ASSET_SLOT_MISSING]}
5956
+ witness:
5957
+ - {path: packages/eslint-grammar-core/src/mascot.spec.ts, editions: [lite, full], codes: [FE_MASCOT_ASSET_SLOT_MISSING]}
5958
+ cases:
5959
+ - id: case-1
5960
+ date: "2026-10-30"
5961
+ source: owner
5962
+ quote: "A Mascot reuses the provenance props of Image and MediaFrame; a Mascot without an assetSlot is a finding (relayed by the nivo-lite app)."
5963
+ ruling: "Mascot takes AssetSlotProps (assetSlot, assetSha256, assetPrompt) and emits them as data-asset-* on its root; the lint requires assetSlot on every Mascot."
5964
+ - id: R340
5965
+ code: "FE_RAISED_SURFACE_IN_SURFACE"
5966
+ law: "A surface never stands inside another surface (owner decision, dialogs and drawers included): a SurfaceCard that a SurfaceCard, a Pane surface, or a Dialog, Drawer, AlertDialog or Popover of the same file encloses is refused. The Grammar has one depth, raised."
5967
+ kinds: [lint]
5968
+ gates: [pre-commit, settle, land, ci]
5969
+ failureCodes: ["FE_RAISED_SURFACE_IN_SURFACE"]
5970
+ enforcers:
5971
+ - {kind: eslint-grammar-core, id: no-raised-surface-in-surface}
5972
+ editions: [lite, full]
5973
+ docs: [knowledge/patterns/fe/ui.yaml#FE-UI]
5974
+ templateNa: "A template forces no surface depth; the app composes its surfaces."
5975
+ proves:
5976
+ - packages/eslint-grammar-core/src/surface-depth.spec.ts
5977
+ exemplifiedBy:
5978
+ - {path: packages/eslint-grammar-core/src/surface-depth.spec.ts, editions: [lite, full], codes: [FE_RAISED_SURFACE_IN_SURFACE]}
5979
+ witness:
5980
+ - {path: packages/eslint-grammar-core/src/surface-depth.spec.ts, editions: [lite, full], codes: [FE_RAISED_SURFACE_IN_SURFACE]}
5981
+ cases:
5982
+ - id: case-1
5983
+ date: "2026-10-31"
5984
+ source: owner
5985
+ quote: "A list inside another surface is outlined (BOUNDARY-5, DNA-COMMON-NO-RAISED-SURFACE-IN-SURFACE); the list SurfaceCard takes its depth from the surface context (grammar 0.16.2)."
5986
+ ruling: "A list SurfaceCard resolves its depth from the surface context like every SurfaceCard kind; an app that forces depth=\"top\" on a surface nested in another surface raises a surface inside a surface, so the lint refuses it."
5987
+ - id: R341
5988
+ code: "FE_FREESTYLE_REASON_MISSING"
5989
+ law: "A Grammar Freestyle region, the one sanctioned place where an app writes its own plain elements and CSS because no Grammar component fits, names its reason: a non-empty string literal saying why. The rules that judge hand-written elements, classes, styles and generated art leave the raw elements of a Freestyle subtree alone; a Grammar component inside it is judged as before. An element with a spread attribute is not judged."
5990
+ kinds: [lint]
5991
+ gates: [pre-commit, settle, land, ci]
5992
+ failureCodes: ["FE_FREESTYLE_REASON_MISSING"]
5993
+ enforcers:
5994
+ - {kind: eslint-grammar-core, id: freestyle-has-reason}
5995
+ editions: [lite, full]
5996
+ docs: [knowledge/patterns/fe/ui.yaml#FE-UI]
5997
+ templateNa: "A template writes no Freestyle region; the app adds one only when no Grammar component fits."
5998
+ proves:
5999
+ - packages/eslint-grammar-core/src/freestyle.spec.ts
6000
+ exemplifiedBy:
6001
+ - {path: packages/eslint-grammar-core/src/freestyle.spec.ts, editions: [lite, full], codes: [FE_FREESTYLE_REASON_MISSING]}
6002
+ witness:
6003
+ - {path: packages/eslint-grammar-core/src/freestyle.spec.ts, editions: [lite, full], codes: [FE_FREESTYLE_REASON_MISSING]}
6004
+ cases:
6005
+ - id: case-1
6006
+ date: "2026-10-31"
6007
+ source: owner
6008
+ quote: "cái trang này free style đi trò div và làm bth thôi, thêm 1 component Freestyle hoặc tên gì đó tương đương đi trò, ý là cho custom nhưng vẫm bám grammar trừ bất đắc dĩ ntn"
6009
+ ruling: "The Grammar has one sanctioned escape hatch, Freestyle: a region where the app writes its own plain divs and CSS because no Grammar component fits; it names its reason (the lint requires it), and the rest of the page still follows the Grammar."
5893
6010
  - id: R342
5894
6011
  code: "BE_ENTITY_EXTENDS_BASE"
5895
6012
  law: "An @Entity class does not repeat the columns every table shares: a database-set created_at or updated_at (CreateDateColumn, UpdateDateColumn, or a Column on those names, or on createdAt / updatedAt, with insert false, update false or a default) and, beside both, the generated uuid id are inherited from AbstractEntity or UuidAbstractEntity of @modules/platform/database (BE-PERSISTENCE-3, ruling entity-base). The finding names the base to extend: UuidAbstractEntity with the uuid key, AbstractEntity without it. A table whose timestamps the application sets (a plain Column), or that lacks one of them, extends nothing and maps its own; the base file platform/database/abstract.entity.ts is exempt."
@@ -5913,6 +6030,28 @@ rules:
5913
6030
  source: owner
5914
6031
  quote: "Entities do not repeat the columns every table shares; the owner approved a lint so they never repeat them again (ruling entity-base, 2026-10-31)."
5915
6032
  ruling: "A table whose migration has created_at, updated_at (set by the database) and the generated uuid id maps them by extending AbstractEntity or UuidAbstractEntity from @modules/platform/database; an entity that declares them itself is a finding. A table without them extends nothing."
6033
+ - id: R343
6034
+ code: "HFS_CHECK_CACHE_FORGED"
6035
+ editions: ["lite", "full"]
6036
+ docs: [contexts/hfs/README.md#rule-notes]
6037
+ law: "An app's committed check cache (.starcistacks/cache/) is trusted in CI only as it stands at the trusted base; a record whose key matches the tree and whose findings differ from the inherited or computed result is HFS_CHECK_CACHE_FORGED (a hard blocker at any count), a touched key without a current record is HFS_CHECK_CACHE_STALE and a missing cache is HFS_CHECK_CACHE_MISSING (both report-only warnings)."
6038
+ kinds: [codemod]
6039
+ gates: [ci]
6040
+ failureCodes: ["HFS_CHECK_CACHE_FORGED", "HFS_CHECK_CACHE_STALE", "HFS_CHECK_CACHE_MISSING"]
6041
+ enforcers:
6042
+ - {kind: hfs, id: check-cache, at: packages/hfs/cache/trust.mjs}
6043
+ proves:
6044
+ - {path: packages/hfs/src/hfs-check-cache.spec.mjs, editions: [lite, full]}
6045
+ exemplifiedBy:
6046
+ - {path: packages/hfs/src/hfs-check-cache.spec.mjs, editions: [lite, full]}
6047
+ witness:
6048
+ - {path: packages/hfs/src/hfs-check-cache.spec.mjs, editions: [lite, full], codes: [HFS_CHECK_CACHE_FORGED, HFS_CHECK_CACHE_STALE, HFS_CHECK_CACHE_MISSING]}
6049
+ cases:
6050
+ - id: case-1
6051
+ date: "2026-10-31"
6052
+ source: owner
6053
+ quote: "app check cache lại vào file dc không? sau chỉ check diff; chốt starcistacks lưu hết nhé và check diff và triển cho ci và local lun."
6054
+ ruling: "The app commits its check results in .starcistacks/cache/; CI trusts only the cache at the trusted base, a forged record blocks at any count, stale and missing only warn (ruling app-check-cache)."
5916
6055
  - id: R344
5917
6056
  code: "BE_AI_VIRTUAL_KEY"
5918
6057
  law: "An app's ai-router gateway has one client key, STARCI_AI_KEY (sk-starci-<app>-<48 hex>, sealed in the ai member, used by the integrations/ai LangChain client and the agent runtime alike), and no admin token: integrations/ai reads exactly that secret name with env.secret, as a literal, and the custody owner integrations/ai-gateway passes the gateway no adminToken."
@@ -5936,3 +6075,453 @@ rules:
5936
6075
  source: owner
5937
6076
  quote: "Xóa ai api key và openclaw ai key chỉnh thành starci ai key là key ảo"
5938
6077
  ruling: "Per app and environment the ai member holds the upstream provider keys and one random virtual key STARCI_AI_KEY that the gateway mounts and every client uses; the gateway has no admin API (ruling be-ai-one-virtual-key)."
6078
+ - id: R345
6079
+ code: "FE_PANE_GRID_CHILD_NOT_PANE"
6080
+ law: "A child of a Grammar PaneGrid is a literal Pane element, written directly or returned by a conditional (`cond ? <Pane/> : null`, `cond && <Pane/>`) or a `.map`; a wrapper component, a raw element, a fragment or a variable is refused, because PaneGrid places each child by the area of a Pane and drops the rest, leaving its cell blank. A Freestyle subtree leaves the raw elements inside it alone."
6081
+ kinds: [lint]
6082
+ gates: [pre-commit, settle, land, ci]
6083
+ failureCodes: ["FE_PANE_GRID_CHILD_NOT_PANE"]
6084
+ enforcers:
6085
+ - {kind: eslint-grammar-core, id: pane-grid-children}
6086
+ editions: [lite, full]
6087
+ docs: [contexts/ui/components/pane-grid.md]
6088
+ templateNa: "A template draws no pane grid; an app adds one with its multi-pane screens."
6089
+ proves:
6090
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_GRID_CHILD_NOT_PANE]}
6091
+ exemplifiedBy:
6092
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_GRID_CHILD_NOT_PANE]}
6093
+ witness:
6094
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_GRID_CHILD_NOT_PANE]}
6095
+ cases:
6096
+ - id: case-1
6097
+ date: "2026-10-31"
6098
+ source: owner
6099
+ quote: "trò thiết kế hệ thống padding đồng nhất cho grammar chứ mỗi nơi 1 padding trò thấy k"
6100
+ ruling: "A Pane owns its content inset and every band in it is a PaneSection; a PaneGrid holds Panes only, so the lint refuses a wrapper component that the grid would drop."
6101
+ - id: R346
6102
+ code: "FE_PANE_CHILD_NOT_SECTION"
6103
+ law: "A Grammar Pane holds PaneSection elements or one nested PaneGrid; a raw element, or a Grammar component other than PaneSection, PaneGrid and Freestyle, placed directly in a Pane skips the inset the pane publishes to its bands. A project component is judged in its own file, and a Freestyle subtree leaves its raw elements alone."
6104
+ kinds: [lint]
6105
+ gates: [pre-commit, settle, land, ci]
6106
+ failureCodes: ["FE_PANE_CHILD_NOT_SECTION"]
6107
+ enforcers:
6108
+ - {kind: eslint-grammar-core, id: pane-children}
6109
+ editions: [lite, full]
6110
+ docs: [contexts/ui/components/pane-grid.md]
6111
+ templateNa: "A template draws no pane grid; an app adds one with its multi-pane screens."
6112
+ proves:
6113
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_CHILD_NOT_SECTION]}
6114
+ exemplifiedBy:
6115
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_CHILD_NOT_SECTION]}
6116
+ witness:
6117
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_CHILD_NOT_SECTION]}
6118
+ cases:
6119
+ - id: case-1
6120
+ date: "2026-10-31"
6121
+ source: owner
6122
+ quote: "trò thiết kế hệ thống padding đồng nhất cho grammar chứ mỗi nơi 1 padding trò thấy k"
6123
+ ruling: "A Pane owns its content inset and every band in it is a PaneSection whose boxes align to that edge, so the lint refuses a band hand-built in a pane."
6124
+ - id: R347
6125
+ code: "FE_PANE_SECTION_PADDING"
6126
+ law: "The outermost element a Grammar PaneSection renders, and the root of a same-file component returned as its child, carries no padding or margin utility (`p-*`, `px-*`, `py-*`, `ps/pe/pt/pb/pl/pr-*`, `m-*`, `mx/my/ms/me/mt/mb/ml/mr-*`, their negative forms, or an arbitrary padding or margin property; zero and auto values place or reset and are not one), because the Pane owns the content inset and the section applies it. A Freestyle subtree leaves its raw elements alone."
6127
+ kinds: [lint]
6128
+ gates: [pre-commit, settle, land, ci]
6129
+ failureCodes: ["FE_PANE_SECTION_PADDING"]
6130
+ enforcers:
6131
+ - {kind: eslint-grammar-core, id: no-pane-section-padding}
6132
+ editions: [lite, full]
6133
+ docs: [contexts/ui/components/pane-grid.md]
6134
+ templateNa: "A template draws no pane grid; an app adds one with its multi-pane screens."
6135
+ proves:
6136
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_SECTION_PADDING]}
6137
+ exemplifiedBy:
6138
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_SECTION_PADDING]}
6139
+ witness:
6140
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_SECTION_PADDING]}
6141
+ cases:
6142
+ - id: case-1
6143
+ date: "2026-10-31"
6144
+ source: owner
6145
+ quote: "trò thiết kế hệ thống padding đồng nhất cho grammar chứ mỗi nơi 1 padding trò thấy k"
6146
+ ruling: "One padding system for everything placed in a PaneGrid: the Pane publishes the inset and the PaneSection applies it, so no band adds its own."
6147
+ - id: R348
6148
+ code: "FE_PANE_GRID_FRAME"
6149
+ law: "A Grammar PaneGrid is the one child of `Page chrome=\"panes\"` or stands inside a Pane; a PaneGrid drawn in a SurfaceCard of any kind, a Page of another chrome, or wrapped inside `Page chrome=\"panes\"` re-decides the frame and the bottom edge that Page owns. A grid whose frame lives in another file is judged where the frame is, and a Freestyle subtree is not judged."
6150
+ kinds: [lint]
6151
+ gates: [pre-commit, settle, land, ci]
6152
+ failureCodes: ["FE_PANE_GRID_FRAME"]
6153
+ enforcers:
6154
+ - {kind: eslint-grammar-core, id: pane-grid-page}
6155
+ editions: [lite, full]
6156
+ docs: [contexts/ui/components/pane-grid.md]
6157
+ templateNa: "A template draws no pane grid; an app adds one with its multi-pane screens."
6158
+ proves:
6159
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_GRID_FRAME]}
6160
+ exemplifiedBy:
6161
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_GRID_FRAME]}
6162
+ witness:
6163
+ - {path: packages/eslint-grammar-core/src/pane.spec.ts, editions: [lite, full], codes: [FE_PANE_GRID_FRAME]}
6164
+ cases:
6165
+ - id: case-1
6166
+ date: "2026-10-31"
6167
+ source: owner
6168
+ quote: "sao trang lan agent có gap 1 khoảng trên vậy??? … phải dính vào chứ"
6169
+ ruling: "A tabbed app page's PaneGrid attaches flush under the tab line, full width and to the bottom, with no card, radius or gap: Page chrome=\"panes\"."
6170
+ - id: R349
6171
+ code: "FE_HAND_BUILT_PANES"
6172
+ law: "A multi-pane frame is a Grammar PaneGrid of Panes, which draws the dividers between panes; a vertical Divider used as a column seam (among the plain columns of a flex row, or anywhere inside a SurfaceCard composition=\"joined\") and a joined SurfaceCard that holds a flex row of two or more plain columns are a pane frame drawn by hand and are refused. A short vertical separator between controls and a row whose classes cannot be read in the file are not judged."
6173
+ kinds: [lint]
6174
+ gates: [pre-commit, settle, land, ci]
6175
+ failureCodes: ["FE_HAND_BUILT_PANES"]
6176
+ enforcers:
6177
+ - {kind: eslint-fe, id: no-hand-built-panes}
6178
+ editions: [lite, full]
6179
+ docs: [contexts/ui/components/pane-grid.md]
6180
+ templateNa: "A template draws no multi-pane frame; an app adds one with its multi-pane screens."
6181
+ proves:
6182
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_HAND_BUILT_PANES]}
6183
+ exemplifiedBy:
6184
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_HAND_BUILT_PANES]}
6185
+ witness:
6186
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_HAND_BUILT_PANES]}
6187
+ cases:
6188
+ - id: case-1
6189
+ date: "2026-10-31"
6190
+ source: owner
6191
+ quote: "sao trang lan agent có gap 1 khoảng trên vậy??? … phải dính vào chứ"
6192
+ ruling: "A multi-pane frame is the Grammar's PaneGrid, never columns and a vertical Divider composed by hand inside a card."
6193
+ - id: R350
6194
+ code: "FE_SPACING_UTILITY"
6195
+ law: "Every spacing value is the Grammar's, on its one scale 0 4 8 12 24 32: an app names the relation between the blocks it places through a role prop (Stack and Cluster gap identity, inline, row, section or region; Grid kind cards, form or main-rail; PaneSection; Page) and writes no padding, margin, gap or space utility and no arbitrary spacing value in a class string; a Grammar stylesheet writes no spacing length off the scale and no fluid spacing value."
6196
+ kinds: [lint]
6197
+ gates: [pre-commit, settle, land, ci]
6198
+ failureCodes: ["FE_SPACING_UTILITY", "FE_SPACING_OFF_SCALE"]
6199
+ enforcers:
6200
+ - {kind: eslint-fe, id: no-spacing-utility}
6201
+ - {kind: stylelint, id: spacing-scale}
6202
+ editions: [lite, full]
6203
+ docs: [contexts/ui/presentation.md]
6204
+ templateNa: "A template's own layout is moved onto the role props by starci app codemod spacing-roles; the rule counts at warn for one cohort."
6205
+ proves:
6206
+ - {path: packages/eslint-canon-fe/src/spacing.spec.ts, editions: [lite, full], codes: [FE_SPACING_UTILITY]}
6207
+ exemplifiedBy:
6208
+ - {path: packages/eslint-canon-fe/src/spacing.spec.ts, editions: [lite, full], codes: [FE_SPACING_UTILITY]}
6209
+ witness:
6210
+ - {path: packages/eslint-canon-fe/src/spacing.spec.ts, editions: [lite, full], codes: [FE_SPACING_UTILITY]}
6211
+ cases:
6212
+ - id: case-1
6213
+ date: "2026-10-31"
6214
+ source: owner
6215
+ quote: "hay full 3 bỏ 4 đi!!! thầy nghĩ nên v"
6216
+ ruling: "One spacing scale with no 16; every container holds its content 12 in, and an app names relations through role props, never spacing utilities."
6217
+ - id: R351
6218
+ code: "FE_TABLE_IN_CARD"
6219
+ law: "A DataTable is not placed inside a SurfaceCard, on the page or in a pane: plain rows with a few facts are a SurfaceCard kind=list with the label outside and the note in its footer, and a table that belongs to a card is an owner decision named in this rule. The rule reads the JSX of the file: a DataTable enclosed by a SurfaceCard element, or rendered by a component of the same file that a SurfaceCard encloses."
6220
+ kinds: [lint]
6221
+ gates: [pre-commit, settle, land, ci]
6222
+ failureCodes: ["FE_TABLE_IN_CARD"]
6223
+ enforcers:
6224
+ - {kind: eslint-fe, id: no-table-in-card}
6225
+ editions: [lite, full]
6226
+ docs: [contexts/ui/components/list-table.md]
6227
+ templateNa: "A template draws no table in a card; an app adds one with its list screens."
6228
+ proves:
6229
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_TABLE_IN_CARD]}
6230
+ exemplifiedBy:
6231
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_TABLE_IN_CARD]}
6232
+ witness:
6233
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_TABLE_IN_CARD]}
6234
+ cases:
6235
+ - id: case-1
6236
+ date: "2026-11-01"
6237
+ source: owner
6238
+ quote: "quá phức tạp mới nhét bảng vào card"
6239
+ ruling: "Plain rows are a SurfaceCard kind=\"list\" with a bottom note in its footer; a DataTable is not put in a SurfaceCard."
6240
+ - id: R352
6241
+ code: "FE_COMMAND_FILLS_HEADER"
6242
+ law: "A page or pane command hugs its label and sits at the end of its header row: a Grammar Button with width=\"fill\" in the actions of a Page header or the labelEnd of a SurfaceCard is refused; width=\"fill\" is for a form submit, an auth panel and a phone action bar, which a file cannot show and the rule does not judge."
6243
+ kinds: [lint]
6244
+ gates: [pre-commit, settle, land, ci]
6245
+ failureCodes: ["FE_COMMAND_FILLS_HEADER"]
6246
+ enforcers:
6247
+ - {kind: eslint-fe, id: no-fill-command-in-header}
6248
+ editions: [lite, full]
6249
+ docs: [contexts/ui/components/button.md]
6250
+ templateNa: "A template draws no header command with a fill width."
6251
+ proves:
6252
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_COMMAND_FILLS_HEADER]}
6253
+ exemplifiedBy:
6254
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_COMMAND_FILLS_HEADER]}
6255
+ witness:
6256
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_COMMAND_FILLS_HEADER]}
6257
+ cases:
6258
+ - id: case-1
6259
+ date: "2026-11-01"
6260
+ source: owner
6261
+ quote: "(owner order relayed by the coordinator, 2026-11-01) a page or pane command hugs its label and sits at the end of its header row; Button width=fill is only for a form submit, an auth panel, or a phone action bar"
6262
+ ruling: "A header command is never width fill; fill is for a form submit, an auth panel and a phone action bar."
6263
+ - id: R353
6264
+ code: "FE_TAG_GROUP_SELECTION"
6265
+ law: "A TagGroup holds values the user entered, to remove or to order, and has no selection: selectionMode, selectedIds, defaultSelectedIds and onSelectionChange on it are refused. Peer values that filter a collection that stays in place are a FilterButtonGroup (sm toggle buttons on one row, the rest behind a +n search list)."
6266
+ kinds: [lint]
6267
+ gates: [pre-commit, settle, land, ci]
6268
+ failureCodes: ["FE_TAG_GROUP_SELECTION"]
6269
+ enforcers:
6270
+ - {kind: eslint-fe, id: no-selectable-tag-group}
6271
+ editions: [lite, full]
6272
+ docs: [contexts/ui/components/chip.md]
6273
+ templateNa: "A template draws no filter row."
6274
+ proves:
6275
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_TAG_GROUP_SELECTION]}
6276
+ exemplifiedBy:
6277
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_TAG_GROUP_SELECTION]}
6278
+ witness:
6279
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_TAG_GROUP_SELECTION]}
6280
+ cases:
6281
+ - id: case-1
6282
+ date: "2026-11-01"
6283
+ source: owner
6284
+ quote: "sao cái này không phải cụm button... button size xs kiểu nhóm button"
6285
+ ruling: "A filter over a collection is a FilterButtonGroup of sm toggle buttons; the TagGroup has no selection."
6286
+ - id: R354
6287
+ code: "FE_HEADING_ABOVE_CARD"
6288
+ law: "A card has a label by design, so a heading over it is wrong: a Section (not kind=\"list\") whose only child is one SurfaceCard (of any kind), and a card whose ariaLabel is the Section title, are refused; the title moves to the label, the count to fact, the action to labelEnd and the note to footer. Several cards under one Section stay legal."
6289
+ kinds: [lint]
6290
+ gates: [pre-commit, settle, land, ci]
6291
+ failureCodes: ["FE_HEADING_ABOVE_CARD"]
6292
+ enforcers:
6293
+ - {kind: eslint-fe, id: no-heading-above-card}
6294
+ editions: [lite, full]
6295
+ docs: [contexts/ui/components/card.md]
6296
+ templateNa: "A template draws no section header above a card."
6297
+ proves:
6298
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_HEADING_ABOVE_CARD]}
6299
+ exemplifiedBy:
6300
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_HEADING_ABOVE_CARD]}
6301
+ witness:
6302
+ - {path: packages/eslint-canon-fe/src/surface-rules.spec.ts, editions: [lite, full], codes: [FE_HEADING_ABOVE_CARD]}
6303
+ cases:
6304
+ - id: case-1
6305
+ date: "2026-11-01"
6306
+ source: owner
6307
+ quote: "bản thân card đã có label, vốn là mục đích thiết kế"
6308
+ ruling: "A card carries its own title, count, action and note; a Section around a single card is refused."
6309
+ - id: R355
6310
+ code: "FE_SURFACE_CARD_KIND"
6311
+ law: "A SurfaceCard is one component whose kind the compiler checks, and what a kind draws is not drawn by hand around it: a card of the body kind holds no raw ul, ol, li or dl, no Divider, and no Heading standing as a second title, and a Section whose only child is one SurfaceCard frames one subject twice."
6312
+ kinds: [lint]
6313
+ gates: [pre-commit, settle, land, ci]
6314
+ failureCodes: ["FE_SURFACE_CARD_KIND"]
6315
+ enforcers:
6316
+ - {kind: eslint-grammar-core, id: surface-card-kind}
6317
+ editions: [lite, full]
6318
+ proves:
6319
+ - packages/eslint-grammar-core/src/surface-card.spec.ts
6320
+ exemplifiedBy:
6321
+ - {path: packages/eslint-grammar-core/src/surface-card.spec.ts, editions: [lite, full], codes: [FE_SURFACE_CARD_KIND]}
6322
+ witness:
6323
+ - {path: packages/eslint-grammar-core/src/surface-card.spec.ts, editions: [lite, full], codes: [FE_SURFACE_CARD_KIND]}
6324
+ - id: R356
6325
+ code: "FE_SURFACE_NESTING"
6326
+ law: "Across files, a card is not drawn inside a card, a Pane surface or an overlay, a DataTable is not drawn inside a card, a PaneGrid stands only in Page chrome=\"panes\" or a Pane, a Section or Heading holds more than one card, and a labelled card is not repeated in a Grid: the render graph replaces every component by what it draws and every children by what its caller handed it."
6327
+ kinds: [lint]
6328
+ gates: [pre-commit, settle, land, ci]
6329
+ failureCodes: ["FE_SURFACE_NESTING"]
6330
+ enforcers:
6331
+ - {kind: machine, id: surface-nesting, at: scripts/hfs/architecture/surface-nesting.mjs}
6332
+ editions: [lite, full]
6333
+ docs: [contexts/ui/components/card.md]
6334
+ templateNa: "A template draws no card, table or grid."
6335
+ proves:
6336
+ - {path: packages/hfs/src/surface-nesting.spec.mts, editions: [lite, full], codes: [FE_SURFACE_NESTING]}
6337
+ exemplifiedBy:
6338
+ - {path: packages/hfs/src/surface-nesting.spec.mts, editions: [lite, full], codes: [FE_SURFACE_NESTING]}
6339
+ witness:
6340
+ - {path: packages/hfs/src/surface-nesting.spec.mts, editions: [lite, full], codes: [FE_SURFACE_NESTING]}
6341
+ cases:
6342
+ - id: case-1
6343
+ date: "2026-11-01"
6344
+ source: owner
6345
+ quote: "Surface in surface is banned totally, dialogs and drawers included."
6346
+ ruling: "The one-file card laws (R340, R348, R351, R354, R366) are closed across files by the render graph; the machine reports the inner element and the chain that led to it."
6347
+ - id: R357
6348
+ code: "FE_TEXT_BLOCK"
6349
+ law: "Text holds a run of words: a block component or block element inside it is refused."
6350
+ kinds: [lint]
6351
+ gates: [pre-commit, settle, land, ci]
6352
+ failureCodes: ["FE_TEXT_BLOCK"]
6353
+ enforcers:
6354
+ - {kind: eslint-grammar-core, id: text-inline-only}
6355
+ editions: [lite, full]
6356
+ docs: [contexts/ui/components/text.md]
6357
+ templateNa: "A template writes no Text with a block inside."
6358
+ proves:
6359
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_TEXT_BLOCK]}
6360
+ exemplifiedBy:
6361
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_TEXT_BLOCK]}
6362
+ witness:
6363
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_TEXT_BLOCK]}
6364
+ cases:
6365
+ - id: case-1
6366
+ date: "2026-11-01"
6367
+ source: owner
6368
+ quote: "A card carries its own label; text is inline."
6369
+ ruling: "Text is inline only, so a layout cannot hide inside a paragraph."
6370
+ - id: R358
6371
+ code: "FE_TEXT_HEADING"
6372
+ law: "A strong Text that is the first child of a group and is followed only by blocks is a hand heading: the group takes a Section title, a card label or Heading."
6373
+ kinds: [lint]
6374
+ gates: [pre-commit, settle, land, ci]
6375
+ failureCodes: ["FE_TEXT_HEADING"]
6376
+ enforcers:
6377
+ - {kind: eslint-grammar-core, id: no-text-heading}
6378
+ editions: [lite, full]
6379
+ docs: [contexts/ui/components/text.md]
6380
+ templateNa: "A template writes no heading by hand."
6381
+ proves:
6382
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_TEXT_HEADING]}
6383
+ exemplifiedBy:
6384
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_TEXT_HEADING]}
6385
+ witness:
6386
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_TEXT_HEADING]}
6387
+ cases:
6388
+ - id: case-1
6389
+ date: "2026-11-01"
6390
+ source: owner
6391
+ quote: "No free heading in apps."
6392
+ ruling: "A heading is a Section title, a card label or Heading, never a strong Text."
6393
+ - id: R359
6394
+ code: "FE_ONE_HIGHLIGHT"
6395
+ law: "A render states one highlighted thing: a second isHighlight on a Grammar element in one component render is refused."
6396
+ kinds: [lint]
6397
+ gates: [pre-commit, settle, land, ci]
6398
+ failureCodes: ["FE_ONE_HIGHLIGHT"]
6399
+ enforcers:
6400
+ - {kind: eslint-grammar-core, id: one-highlight-per-render}
6401
+ editions: [lite, full]
6402
+ docs: [contexts/ui/components/card.md]
6403
+ templateNa: "A template highlights nothing."
6404
+ proves:
6405
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_ONE_HIGHLIGHT]}
6406
+ exemplifiedBy:
6407
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_ONE_HIGHLIGHT]}
6408
+ witness:
6409
+ - {path: packages/eslint-grammar-core/src/text-rules.spec.ts, editions: [lite, full], codes: [FE_ONE_HIGHLIGHT]}
6410
+ cases:
6411
+ - id: case-1
6412
+ date: "2026-11-01"
6413
+ source: owner
6414
+ quote: "One accent fill per render."
6415
+ ruling: "When two things are highlighted neither is."
6416
+ - id: R361
6417
+ code: "FE_RENDER_PROP_ACROSS_SERVER"
6418
+ law: "A function is not handed from a server file to a client component: React serialises props across that line and a function is not serialisable; pass data, or move the callback into the client branch that owns the interaction."
6419
+ kinds: [lint]
6420
+ gates: [pre-commit, settle, land, ci]
6421
+ failureCodes: ["FE_RENDER_PROP_ACROSS_SERVER"]
6422
+ enforcers:
6423
+ - {kind: machine, id: render-prop-across-server, at: scripts/hfs/architecture/render-prop-across-server.mjs}
6424
+ editions: [lite, full]
6425
+ docs: [contexts/code/fe/function.md]
6426
+ templateNa: "A template hands no function across the server line."
6427
+ proves:
6428
+ - {path: packages/hfs/src/surface-nesting.spec.mts, editions: [lite, full], codes: [FE_RENDER_PROP_ACROSS_SERVER]}
6429
+ exemplifiedBy:
6430
+ - {path: packages/hfs/src/surface-nesting.spec.mts, editions: [lite, full], codes: [FE_RENDER_PROP_ACROSS_SERVER]}
6431
+ witness:
6432
+ - {path: packages/hfs/src/surface-nesting.spec.mts, editions: [lite, full], codes: [FE_RENDER_PROP_ACROSS_SERVER]}
6433
+ cases:
6434
+ - id: case-1
6435
+ date: "2026-11-01"
6436
+ source: owner
6437
+ quote: "a block takes data"
6438
+ ruling: "A render callback is for a client branch; a block takes data and renders it itself."
6439
+ - id: R362
6440
+ code: "FE_GRAMMAR_TIER_STATE"
6441
+ law: "In the Grammar package a leaf and a composite hold no useState, useReducer or effect, and a component's own props and its ReactNode slots stay inside its tier's budget (leaf 8, branch 12, composite 12, frame 10 props; 3 slots). Both run as counting rules: their findings are the tier refactor list."
6442
+ kinds: [lint]
6443
+ gates: [pre-commit, settle, land, ci]
6444
+ failureCodes: ["FE_GRAMMAR_TIER_STATE", "FE_GRAMMAR_PROP_BUDGET"]
6445
+ enforcers:
6446
+ - {kind: runtime, id: tier-state, at: packages/grammar/scripts/lint/eslint-plugin.mts}
6447
+ - {kind: runtime, id: prop-budget, at: packages/grammar/scripts/lint/eslint-plugin.mts}
6448
+ editions: [lite, full]
6449
+ docs: [contexts/grammars/README.md#grammar-lint]
6450
+ templateNa: "A template ships no Grammar source."
6451
+ proves:
6452
+ - {path: packages/grammar/scripts/lint/eslint-plugin.mts, editions: [lite, full], codes: [FE_GRAMMAR_TIER_STATE, FE_GRAMMAR_PROP_BUDGET]}
6453
+ exemplifiedBy:
6454
+ - {path: packages/grammar/scripts/lint/eslint-plugin.mts, editions: [lite, full], codes: [FE_GRAMMAR_TIER_STATE, FE_GRAMMAR_PROP_BUDGET]}
6455
+ witness:
6456
+ - {path: packages/grammar/scripts/lint/eslint-plugin.mts, editions: [lite, full], codes: [FE_GRAMMAR_TIER_STATE, FE_GRAMMAR_PROP_BUDGET]}
6457
+ cases:
6458
+ - id: case-1
6459
+ date: "2026-11-02"
6460
+ source: owner
6461
+ quote: "The tier binding of the Grammar is a ladder; a leaf draws and a branch behaves."
6462
+ ruling: "State sits in branches; budgets keep a role from growing into two."
6463
+ - id: R363
6464
+ code: "FE_GRAMMAR_LITERAL"
6465
+ law: "A Grammar component holds no hardcoded colour, length, utility class or numeric style value (`no-literal-look`); its stylesheets read named roles and ramps."
6466
+ kinds: [lint]
6467
+ gates: [pre-commit, settle, land, ci]
6468
+ failureCodes: ["FE_GRAMMAR_LITERAL"]
6469
+ enforcers:
6470
+ - {kind: runtime, id: no-literal-look, at: packages/grammar/scripts/lint/eslint-plugin.mts}
6471
+ editions: [lite, full]
6472
+ docs: [contexts/grammars/README.md#grammar-lint]
6473
+ templateNa: "A template ships no Grammar source."
6474
+ proves:
6475
+ - {path: packages/grammar/scripts/lint/eslint-plugin.mts, editions: [lite, full], codes: [FE_GRAMMAR_LITERAL]}
6476
+ exemplifiedBy:
6477
+ - {path: packages/grammar/scripts/lint/eslint-plugin.mts, editions: [lite, full], codes: [FE_GRAMMAR_LITERAL]}
6478
+ witness:
6479
+ - {path: packages/grammar/scripts/lint/eslint-plugin.mts, editions: [lite, full], codes: [FE_GRAMMAR_LITERAL]}
6480
+ cases:
6481
+ - id: case-1
6482
+ date: "2026-11-02"
6483
+ source: owner
6484
+ quote: "A component names a role and the stylesheet gives it a value."
6485
+ ruling: "Literals live in the ramps."
6486
+ - id: R366
6487
+ code: "FE_LABEL_IN_GRID"
6488
+ law: "A SurfaceCard with a label repeated in a Grid kind=cards is a tile drawn with the wrong anatomy: a peer you recognise and open names itself inside (SurfaceCard kind=tile), and peers compared by a fact are one kind=list card."
6489
+ kinds: [lint]
6490
+ gates: [pre-commit, settle, land, ci]
6491
+ failureCodes: ["FE_LABEL_IN_GRID"]
6492
+ enforcers:
6493
+ - {kind: eslint-grammar-core, id: no-label-in-grid}
6494
+ editions: [lite, full]
6495
+ proves:
6496
+ - packages/eslint-grammar-core/src/surface-card.spec.ts
6497
+ exemplifiedBy:
6498
+ - {path: packages/eslint-grammar-core/src/surface-card.spec.ts, editions: [lite, full], codes: [FE_LABEL_IN_GRID]}
6499
+ witness:
6500
+ - {path: packages/eslint-grammar-core/src/surface-card.spec.ts, editions: [lite, full], codes: [FE_LABEL_IN_GRID]}
6501
+ - id: R367
6502
+ code: "FE_SWR_DEFAULT_ARRAY"
6503
+ law: "A loading state is drawn from the page's own reads: a hook folds a read to [] only while it also returns that read's isLoading, a slot takes its loading and error from the reads it draws and never from another slot, a background refresh (isValidating) never drives a loading flag or a status, a placeholder is not the ready data with its lists emptied, and an app draws no skeleton by hand (`no-hand-skeleton`): the Grammar components draw their loading structure from `isLoading`."
6504
+ kinds: [lint]
6505
+ gates: [pre-commit, settle, land, ci]
6506
+ failureCodes: ["FE_SWR_DEFAULT_ARRAY", "FE_FOREIGN_SLOT_STATUS", "FE_VALIDATING_AS_LOADING", "FE_PLACEHOLDER_OBJECT", "FE_HAND_SKELETON"]
6507
+ enforcers:
6508
+ - {kind: eslint-fe, id: no-swr-default-array}
6509
+ - {kind: eslint-fe, id: no-foreign-slot-status}
6510
+ - {kind: eslint-fe, id: no-validating-as-loading}
6511
+ - {kind: eslint-fe, id: no-placeholder-object}
6512
+ - {kind: eslint-fe, id: no-hand-skeleton}
6513
+ editions: [lite, full]
6514
+ docs: [contexts/ui/loading.md]
6515
+ templateNa: "A template draws no loading state of its own."
6516
+ proves:
6517
+ - {path: packages/eslint-canon-fe/src/skeleton-states.spec.ts, editions: [lite, full], codes: [FE_SWR_DEFAULT_ARRAY, FE_FOREIGN_SLOT_STATUS, FE_VALIDATING_AS_LOADING, FE_PLACEHOLDER_OBJECT, FE_HAND_SKELETON]}
6518
+ exemplifiedBy:
6519
+ - {path: packages/eslint-canon-fe/src/skeleton-states.spec.ts, editions: [lite, full], codes: [FE_SWR_DEFAULT_ARRAY, FE_FOREIGN_SLOT_STATUS, FE_VALIDATING_AS_LOADING, FE_PLACEHOLDER_OBJECT, FE_HAND_SKELETON]}
6520
+ witness:
6521
+ - {path: packages/eslint-canon-fe/src/skeleton-states.spec.ts, editions: [lite, full], codes: [FE_SWR_DEFAULT_ARRAY, FE_FOREIGN_SLOT_STATUS, FE_VALIDATING_AS_LOADING, FE_PLACEHOLDER_OBJECT, FE_HAND_SKELETON]}
6522
+ cases:
6523
+ - id: case-1
6524
+ date: "2026-11-01"
6525
+ source: owner
6526
+ quote: "The skeleton is the ready structure with its data missing; it is drawn from isLoading alone and from the reads the region shows."
6527
+ ruling: "Several reads feed one frame: loading is any read loading with no data; a key change reloads only the region keyed by it; a refresh keeps the content."