@starci/hfs 4.8.0 → 4.9.0

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.
Files changed (144) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/emit/operation-schemas.mjs +3 -0
  3. package/lint/bound-sys.cjs +2 -2
  4. package/package.json +1 -1
  5. package/runtime/engine/admission.mjs +1 -1
  6. package/runtime/engine/config.mjs +2 -2
  7. package/runtime/engine/db/machine.mjs +2 -3
  8. package/runtime/engine/invalid-config.mjs +1 -1
  9. package/runtime/knowledge/hfs/canon-pins.yaml +11 -10
  10. package/runtime/knowledge/hfs/rules.yaml +23 -0
  11. package/runtime/modules/kernel/failure-codes.yaml +10 -0
  12. package/runtime/scripts/guards/git-policy.mjs +2 -3
  13. package/runtime/scripts/hfs/rules/pipeline.mjs +5 -5
  14. package/runtime/scripts/lib/package-at.mjs +5 -6
  15. package/runtime/scripts/lib/roots.mjs +2 -2
  16. package/runtime/scripts/work/draw/draw-dna-findings.mjs +23 -12
  17. package/runtime/scripts/work/draw/draw-dna.mjs +14 -8
  18. package/scaffold/app.mjs +4 -4
  19. package/src/main.mjs +3 -3
  20. package/sync/index.mjs +14 -1
  21. package/sync/managed.mjs +3 -2
  22. package/templates/app/codegen-graphql.mjs.partial +4 -4
  23. package/templates/app/quality-config/sonar-project.properties +4 -2
  24. package/runtime/engine/canonical-json.mjs +0 -14
  25. package/runtime/engine/db/ledger-open.mjs +0 -38
  26. package/runtime/engine/db/ledger-paths.mjs +0 -87
  27. package/runtime/engine/db/ledger.mjs +0 -1068
  28. package/runtime/engine/db/provision-authority.mjs +0 -76
  29. package/runtime/engine/db/provision-operations.mjs +0 -146
  30. package/runtime/packages/grammar/scripts/build-stamp.mjs +0 -98
  31. package/runtime/scripts/agent/codex-app-server.mjs +0 -79
  32. package/runtime/scripts/agent/codex-mirror-source.mjs +0 -34
  33. package/runtime/scripts/agent/host-agents.mjs +0 -80
  34. package/runtime/scripts/agent/launch-trust-policy.mjs +0 -53
  35. package/runtime/scripts/agent/trust-launch.mjs +0 -191
  36. package/runtime/scripts/agent/trust.mjs +0 -523
  37. package/runtime/scripts/api/fs/temp-path.mjs +0 -8
  38. package/runtime/scripts/api/git/diff-names.mjs +0 -8
  39. package/runtime/scripts/api/git/head-time.mjs +0 -10
  40. package/runtime/scripts/api/git/index-lock.mjs +0 -78
  41. package/runtime/scripts/api/git/log.mjs +0 -5
  42. package/runtime/scripts/api/git/merge-tree.mjs +0 -5
  43. package/runtime/scripts/api/git/rev-list.mjs +0 -5
  44. package/runtime/scripts/api/git/rev-parse.mjs +0 -13
  45. package/runtime/scripts/api/git/status-query.mjs +0 -5
  46. package/runtime/scripts/api/git/worktree-list-query.mjs +0 -5
  47. package/runtime/scripts/api/node/spawn-node.mjs +0 -6
  48. package/runtime/scripts/api/npm/dist-tag.mjs +0 -8
  49. package/runtime/scripts/api/npm/lib.mjs +0 -32
  50. package/runtime/scripts/api/npm/pack-dry-run.mjs +0 -9
  51. package/runtime/scripts/api/npm/run-npm.mjs +0 -6
  52. package/runtime/scripts/api/npm/view.mjs +0 -30
  53. package/runtime/scripts/api/npm/whoami.mjs +0 -8
  54. package/runtime/scripts/api/process/hide-child-windows.mjs +0 -31
  55. package/runtime/scripts/api/process/kill-tree.mjs +0 -22
  56. package/runtime/scripts/api/process/lib.mjs +0 -125
  57. package/runtime/scripts/api/process/probe-guard-command.mjs +0 -74
  58. package/runtime/scripts/api/process/process-list.mjs +0 -28
  59. package/runtime/scripts/api/process/system-tool.mjs +0 -37
  60. package/runtime/scripts/gates/canon-digest.mjs +0 -81
  61. package/runtime/scripts/gates/canon-pins.mjs +0 -119
  62. package/runtime/scripts/gates/gate-input.mjs +0 -98
  63. package/runtime/scripts/gates/gate.mjs +0 -636
  64. package/runtime/scripts/gates/grammar-dist.mjs +0 -206
  65. package/runtime/scripts/gates/output.mjs +0 -40
  66. package/runtime/scripts/gates/runtime-package-selection.mjs +0 -27
  67. package/runtime/scripts/gates/test-world-run.mjs +0 -252
  68. package/runtime/scripts/gates/type-impact.mjs +0 -277
  69. package/runtime/scripts/gates/type-program.mjs +0 -113
  70. package/runtime/scripts/guards/assigned-command.mjs +0 -12
  71. package/runtime/scripts/guards/call-rights.mjs +0 -47
  72. package/runtime/scripts/guards/command-guard.mjs +0 -468
  73. package/runtime/scripts/guards/command-policy.mjs +0 -342
  74. package/runtime/scripts/guards/critic-reach.mjs +0 -82
  75. package/runtime/scripts/guards/deps-guard.mjs +0 -150
  76. package/runtime/scripts/guards/env-dump-verdict.mjs +0 -89
  77. package/runtime/scripts/guards/guards-root.mjs +0 -27
  78. package/runtime/scripts/guards/hook-install.mjs +0 -343
  79. package/runtime/scripts/guards/hook-verdict.mjs +0 -12
  80. package/runtime/scripts/guards/install-verdict.mjs +0 -41
  81. package/runtime/scripts/guards/kernel-seat.mjs +0 -63
  82. package/runtime/scripts/guards/launch-verdict.mjs +0 -74
  83. package/runtime/scripts/guards/op-starci.mjs +0 -16
  84. package/runtime/scripts/guards/op-write-scope.mjs +0 -27
  85. package/runtime/scripts/guards/orca-self-lifecycle.mjs +0 -39
  86. package/runtime/scripts/guards/process-kill-verdict.mjs +0 -106
  87. package/runtime/scripts/guards/protected-zone.mjs +0 -56
  88. package/runtime/scripts/guards/refusals.mjs +0 -27
  89. package/runtime/scripts/guards/rights.mjs +0 -268
  90. package/runtime/scripts/guards/seat-tools.mjs +0 -47
  91. package/runtime/scripts/guards/shell-commands.mjs +0 -328
  92. package/runtime/scripts/guards/supervisor-seat.mjs +0 -80
  93. package/runtime/scripts/guards/verdict-process.mjs +0 -81
  94. package/runtime/scripts/lib/app-data.mjs +0 -11
  95. package/runtime/scripts/lib/canon-binding-text.mjs +0 -129
  96. package/runtime/scripts/lib/check-format.mjs +0 -7
  97. package/runtime/scripts/lib/failure-code-reads.mjs +0 -100
  98. package/runtime/scripts/lib/failure-code-template-errors.mjs +0 -161
  99. package/runtime/scripts/lib/git-dir.mjs +0 -120
  100. package/runtime/scripts/lib/guard-command.mjs +0 -24
  101. package/runtime/scripts/lib/interrupt-cleanup.mjs +0 -38
  102. package/runtime/scripts/lib/json-formats.mjs +0 -34
  103. package/runtime/scripts/lib/managed-json.mjs +0 -51
  104. package/runtime/scripts/lib/menu-parts.mjs +0 -11
  105. package/runtime/scripts/lib/op-gate.mjs +0 -15
  106. package/runtime/scripts/lib/provision-control-failure.mjs +0 -32
  107. package/runtime/scripts/lib/release-version.mjs +0 -134
  108. package/runtime/scripts/lib/runtime-location.mjs +0 -21
  109. package/runtime/scripts/lib/runtime-package-inventory.mjs +0 -21
  110. package/runtime/scripts/lib/runtime-package-manifests.mjs +0 -84
  111. package/runtime/scripts/lib/runtime-publication-tags.mjs +0 -56
  112. package/runtime/scripts/lib/seat-env.mjs +0 -43
  113. package/runtime/scripts/lib/sonar-new-code.mjs +0 -58
  114. package/runtime/scripts/lib/source-package-imports.mjs +0 -111
  115. package/runtime/scripts/lib/tar-files.mjs +0 -39
  116. package/runtime/scripts/lib/uat-run-folder.mjs +0 -118
  117. package/runtime/scripts/lib/worktree-record.mjs +0 -14
  118. package/runtime/scripts/machine/ask-receipts.mjs +0 -113
  119. package/runtime/scripts/machine/evidence-store.mjs +0 -223
  120. package/runtime/scripts/machine/home.mjs +0 -216
  121. package/runtime/scripts/machine/host-lock.mjs +0 -184
  122. package/runtime/scripts/machine/lock-recovery.mjs +0 -55
  123. package/runtime/scripts/machine/roles-contract.mjs +0 -90
  124. package/runtime/scripts/machine/runtime-change.mjs +0 -20
  125. package/runtime/scripts/machine/workflow-tree.mjs +0 -122
  126. package/runtime/scripts/reconciler/checklist-items.mjs +0 -7
  127. package/runtime/scripts/reconciler/guard-row.mjs +0 -25
  128. package/runtime/scripts/work/brand/brand-colour.mjs +0 -125
  129. package/runtime/scripts/work/brand/brand-tokens.mjs +0 -167
  130. package/runtime/scripts/work/brand/brand-value-source.mjs +0 -106
  131. package/runtime/scripts/work/brand/brand.mjs +0 -892
  132. package/runtime/scripts/work/draw/draw-layer.mjs +0 -306
  133. package/runtime/scripts/work/draw/draw-rationale-page.mjs +0 -237
  134. package/runtime/scripts/work/draw/draw-rationale-ref.mjs +0 -14
  135. package/runtime/scripts/work/draw/draw-rationale.mjs +0 -353
  136. package/runtime/scripts/work/draw/draw-source.mjs +0 -412
  137. package/runtime/scripts/work/draw/draw-taste.mjs +0 -278
  138. package/runtime/scripts/work/draw/draw-typecheck.mjs +0 -72
  139. package/runtime/scripts/work/draw/rationale-findings.mjs +0 -205
  140. package/runtime/scripts/work/draw-grammar.mjs +0 -175
  141. package/runtime/scripts/work/draw-render-page.mjs +0 -188
  142. package/runtime/scripts/work/draw-render.mjs +0 -626
  143. package/runtime/scripts/work/png.mjs +0 -237
  144. package/runtime/scripts/work/render-tools.mjs +0 -64
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.9.0 - 2026-10-28
4
+
5
+ - Removed: 121 bundled runtime scripts that only served the legacy runtime and that no `starci app` verb, package entry or catalogued rule enforcer reaches: `scripts/agent/`, `scripts/reconciler/`, the legacy hook guards of `scripts/guards/` (command, seat, rights, install and launch verdicts), the op gate of `scripts/gates/` (`gate.mjs`, canon pins and digest, type impact), the drawing pipeline of `scripts/work/` other than the DNA judge (`draw-dna*`, `grammar-proposal`, `asset-slot`), the ledger of `engine/db/`, the machine helpers, and the `scripts/api` and `scripts/lib` helpers only they imported; with them the specs that exercised only that code. The `release-push-gate` and `hook-io` cases of `hook-input.spec.mjs` stay.
6
+ - Changed: `starci app` is carried by the harness CLI `starci-harness`, which runs this package in-process; `@starci/cli` is retired. A new app's root devDependencies name `starci-harness` instead of `@starci/cli`, its GraphQL codegen loads the input-bounds plugin from `starci-harness/input-bounds`, the runtime resolves an app's `starci` bin and its @starci/hfs from its installed `starci-harness` (`package-at.mjs`), and HFS_CI_MISSING_CANON accepts `npx starci-harness[@<version>] app lint`, the version being the `starci-harness` pin; the bundled canon pins replace the retired `@starci/cli` with `starci-harness` 1.1.0-alpha.1 (`source: cli/package.json`), the one command line a product installs for `starci app`, and follow the harness packages (Grammar family 0.14.0, hfs 4.9.0, canon-fe 9.3.0, canon-be 3.5.0).
7
+ - Changed: the rendered `sonar-project.properties` takes the jest preset's test patterns as tests: `sonar.tests` names every source folder and `sonar.test.inclusions` those patterns, which `sonar.exclusions` moves out of the sources (Sonar refuses a file indexed as both), beside the build and dependency folders; `supabase/types/**` is no longer excluded, so a lite app's generated row types are analysed. `sonar.coverage.exclusions` sits between the `starci:sonar-scope` markers `starci app sonar --write` writes, so sync and the harness's Sonar scope check agree on one file.
8
+
3
9
  ## 4.8.0 - 2026-10-27
4
10
 
5
11
  - Removed: the Heritage family from the bundled Grammar catalog.
@@ -101,6 +101,9 @@ export function operationSchemaReader({ ts, program, repoRoot }) {
101
101
  if (!resolved?.endsWith('.schema.ts')) throw new Error(`schema modules may import only zod and *.schema.ts, found ${specifier} in ${file}`);
102
102
  return load(resolved);
103
103
  };
104
+ // zod is the app's dependency, not the schema's code: it loads before the timed run, so the 1000 ms budget bounds only the
105
+ // schema module itself (a cold zod load inside it ran past the budget on a loaded machine).
106
+ for (const [, specifier] of compiled.matchAll(/require\("(zod(?:\/[^"]*)?)"\)/g)) requireApp(specifier);
104
107
  new vm.Script(compiled, { filename: file }).runInNewContext({ module, exports: module.exports, require: requireSchema }, { timeout: 1000 });
105
108
  return module.exports;
106
109
  }
@@ -4,8 +4,8 @@
4
4
  // projectService builds its server host from `tsserver.sys` (typescript/lib/tsserverlibrary) and exposes no host through
5
5
  // parserOptions, so without a bound a typed rule reads types from an enclosing repository's node_modules and judges the app
6
6
  // greener than its own install allows. Here `sys` of the app's own TypeScript is patched, in place and before ESLint loads
7
- // the parser, to answer only for paths inside the app root and TypeScript's own lib directory (the same bound the gate's
8
- // tsc programs use, scripts/gates/gate.mjs boundedSys). realpath is the identity, so an install junctioned inside the app
7
+ // the parser, to answer only for paths inside the app root and TypeScript's own lib directory (the same bound a typed
8
+ // tsc program of the app keeps). realpath is the identity, so an install junctioned inside the app
9
9
  // stays inside it. Nothing is patched when STARCI_LINT_BOUND is unset or TypeScript is not installed (nothing typed runs).
10
10
  'use strict'
11
11
  const path = require('node:path')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/hfs",
3
- "version": "4.8.0",
3
+ "version": "4.9.0",
4
4
  "description": "The StarCi app command implementation for scaffolding, linting, checking and synchronizing one product repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -187,7 +187,7 @@ export const AWAITING_OWNER='awaiting-owner';
187
187
  */
188
188
  export const AWAITING_OWNER_STATUS='awaiting_owner';
189
189
  export const RETRYABLE_JOB_STATUSES=Object.freeze(['failed',AWAITING_OWNER_STATUS]);
190
- /** Every jobs.status that holds nothing the runtime still needs (mirrors engine/db/ledger.mjs JOB_STATUSES.settled). */
190
+ /** Every jobs.status that holds nothing the runtime still needs. */
191
191
  export const SETTLED_JOB_LIST=Object.freeze(['succeeded','failed',AWAITING_OWNER_STATUS,'cancelled']);
192
192
  /** The tries of a unit that spent budget: every try but the ones that only waited on the owner. */
193
193
  export const spentTries=tries=>tries.filter(job=>job.status!==AWAITING_OWNER_STATUS).length;
@@ -288,11 +288,11 @@ const validateSupervisorBlock=(supervisor,profile)=>{
288
288
  const interval=supervisor?.pollIntervalMs,repos=supervisor?.repos,stall=supervisor?.stallMinutes;
289
289
  if(!plain(supervisor)||Object.keys(supervisor).some(key=>!CONFIG_KEY_TREE.supervisor.includes(key))||!(interval===null||interval===undefined||(Number.isInteger(interval)&&interval>=60000)))
290
290
  throw new Error('Invalid config.yaml: supervisor must be {mode?, pollIntervalMs?, repos?, stallMinutes?, kernel?, workers?, landGate?, frozenMinutes?} with an integer of at least 60000 ms, or null.');
291
- // mode: where the Supervisor role runs (scripts/machine/home.mjs supervisorMode) - chat (default: the owner's desktop
291
+ // mode: where the Supervisor role runs - chat (default: the owner's desktop
292
292
  // chat session owns channel 'main' and ticks itself) or kernel (the optional [Supervisor] Orca kernel, start-supervisor.mjs).
293
293
  if(!(supervisor.mode===undefined||supervisor.mode===null||['chat','kernel'].includes(supervisor.mode)))
294
294
  throw new Error('Invalid config.yaml: supervisor.mode must be chat or kernel, or null.');
295
- // The [Supervisor] kernel seat (scripts/machine/home.mjs supervisorSettings): kernel {agent?, model?, effort?}
295
+ // The [Supervisor] kernel seat: kernel {agent?, model?, effort?}
296
296
  // pins its agent (default: the kernel pin), workers {base?, max?} its adaptive [Worker] cap (0 to 10; the shipped default is 0 fix workers),
297
297
  // landGate {mode?: shared|exclusive, push?: boolean} the land gate (scripts/supervisor/land.mjs); push (default true, owner ruling push-main-after-scoped-check) lets `starci release push` send main to the remote after a green scoped check, false is the owner's lock on the remote.
298
298
  const seat=supervisor.kernel,workers=supervisor.workers,gate=supervisor.landGate;
@@ -64,8 +64,7 @@ export const CONTROLLERS = Object.freeze(['job', 'workflow', 'resource', 'host',
64
64
  // Paths
65
65
  // ---------------------------------------------------------------------------------------------------------------------
66
66
  /**
67
- * Overrides the per-host state base itself (machine.sqlite, projects/, archive/), the one seam starciLocalRoot and
68
- * engine/db/ledger.mjs (which re-exports starciLocalRoot for its own projectsRootFor) both read. Debug probes and
67
+ * Overrides the per-host state base itself (machine.sqlite, projects/, archive/), the one seam starciLocalRoot reads. Debug probes and
69
68
  * throwaway repos point this at a temp directory so they never touch the real
70
69
  * <runtime root>/.runtime and leak fake ledgers/workflows into it (2026-09-30 incident: probe-*, dbg-ask-*, dbg-env*
71
70
  * repos left six fake-worker ledgers in the live store). STARCI_PROJECTS_ROOT (ledger-db.mjs) and
@@ -138,7 +137,7 @@ function corruptIncident(file, error, details) {
138
137
 
139
138
  /**
140
139
  * The rev of the runtime this process runs, as its callers know it: '<HEAD committer time, ms, 13 digits>:<short sha>' of
141
- * the .claude checkout, which scripts/machine/home.mjs runtimeRevOf computes and the caller passes in (`rev`,
140
+ * the harness checkout, which the caller computes and passes in (`rev`,
142
141
  * `writerRev`, `sourceRev`). The db never spawns git: with no rev passed the default is STARCI_RUNTIME_REV, else
143
142
  * 'unknown'. The time prefix orders two revs, so a writer can refuse a store row written by a NEWER runtime (MB-15);
144
143
  * 'unknown' sorts before every real rev.
@@ -5,7 +5,7 @@ export const invalid=section=>message=>{throw new Error(`Invalid config.yaml: ${
5
5
 
6
6
  /** The host roots the owner may relocate (config.yaml `roots`): the archive root, the lanes root and the temp root. */
7
7
  export const ROOT_KEYS=Object.freeze(['archive','lanes','temp']);
8
- /** config.yaml `roots` - {archive?, lanes?, temp?}: absolute directories, or null; an absent key means <starciLocalRoot>/archive and the per-user lanes directory (scripts/machine/home.mjs lanesDefault). */
8
+ /** config.yaml `roots` - {archive?, lanes?, temp?}: absolute directories, or null; an absent key means <starciLocalRoot>/archive and the per-user lanes directory. */
9
9
  export function validateRoots(roots){
10
10
  if(roots===null)return;
11
11
  const bad=invalid('roots');
@@ -30,35 +30,35 @@ pins:
30
30
  source: packages/event-stream/package.json
31
31
  why: 'the one server-sent-events client of every front end (fe-stack event-stream, owner:event-stream-package): the transport client layer (modules/api/sse/clients) creates one instance for the app with the bearer token source and the stream operations follow on it; it carries Last-Event-ID resume, the capped doubling backoff, the heartbeat timeout, the single 401 renewal and the useSWRSubscription adapter, so no app keeps a hand-written reader.'
32
32
  '@starci/grammar':
33
- version: 0.13.0
33
+ version: 0.14.0
34
34
  group: starci
35
35
  install: registry
36
36
  side: fe
37
37
  source: packages/grammar/package.json
38
38
  why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
39
39
  '@starci/eslint-canon-be':
40
- version: 3.4.57
40
+ version: 3.5.0
41
41
  group: starci
42
42
  install: registry
43
43
  side: be
44
44
  source: packages/eslint-canon-be/package.json
45
45
  why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
46
46
  '@starci/eslint-canon-fe':
47
- version: 9.2.0
47
+ version: 9.3.0
48
48
  group: starci
49
49
  install: registry
50
50
  side: fe
51
51
  source: packages/eslint-canon-fe/package.json
52
52
  why: 'the front-end ESLint canon: `loadHfs(import.meta.url)` of fe/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the fe side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; the front end has no tests (FE_NO_TESTS R97 in hfs) and no-vietnamese-in-source (R91) applies.'
53
53
  '@starci/eslint-grammar-core':
54
- version: 0.13.0
54
+ version: 0.14.0
55
55
  group: starci
56
56
  install: registry
57
57
  side: fe
58
58
  source: packages/eslint-grammar-core/package.json
59
59
  why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
60
60
  '@starci/eslint-grammar-offset-pop':
61
- version: 0.13.0
61
+ version: 0.14.0
62
62
  group: starci
63
63
  install: registry
64
64
  side: fe
@@ -97,19 +97,20 @@ pins:
97
97
  side: be
98
98
  source: packages/test-world/package.json
99
99
  why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
100
- '@starci/cli':
101
- version: 1.7.47
100
+ 'starci-harness':
101
+ version: 1.1.0-alpha.1
102
102
  group: starci
103
103
  install: registry
104
104
  side: both
105
- why: 'the only StarCi command package; product repositories install it for starci app, while @starci/hfs remains its pinned transitive implementation.'
105
+ source: cli/package.json
106
+ why: 'the one StarCi command line (bins starci and starci-harness): a product repository installs it for starci app, which it runs in-process through its exact @starci/hfs dependency, and its codegen loads starci-harness/input-bounds.'
106
107
  '@starci/hfs':
107
- version: 4.8.0
108
+ version: 4.9.0
108
109
  group: starci
109
110
  install: registry
110
111
  side: both
111
112
  source: packages/hfs/package.json
112
- why: 'the transitive app implementation used by @starci/cli; it carries the generated runtime slice read by starci app commands.'
113
+ why: 'the app implementation starci-harness runs for starci app; it carries the generated runtime slice read by starci app commands.'
113
114
  # --- tooling
114
115
  typescript:
115
116
  version: 5.9.3
@@ -5664,3 +5664,26 @@ rules:
5664
5664
  source: owner
5665
5665
  quote: "The size of the buttons and controls is uneven; the teacher thinks height = 40px (h-10) should be fixed for every button, switch, input, tabs and so on, what do you think? (translated from Vietnamese)"
5666
5666
  ruling: "One 40px control height is the default of every standalone control (owner ruling control-height-40): Grammar draws it, an app omits size, sm is for a nested item or dense toolbar row, lg only for a landing hero call to action, and controls of one row share one size."
5667
+ - id: R322
5668
+ code: "FE_CHIP_LABEL_CASE"
5669
+ law: "The label of a status chip (a StatusDot with text, a Badge) starts with an uppercase letter, so every chip of an app reads in one vocabulary."
5670
+ kinds: [lint, codemod]
5671
+ gates: [pre-commit, settle, land, ci]
5672
+ failureCodes: ["FE_CHIP_LABEL_CASE"]
5673
+ enforcers:
5674
+ - {kind: eslint-grammar-core, id: chip-label-starts-uppercase}
5675
+ editions: [lite, full]
5676
+ docs: [knowledge/patterns/fe/index.yaml#FE-RULE-OWNERSHIP]
5677
+ templateNa: "A template states no chip label; the words are the app's."
5678
+ proves:
5679
+ - packages/eslint/grammar-core/chip-label.spec.mjs
5680
+ exemplifiedBy:
5681
+ - {path: packages/eslint/grammar-core/chip-label.spec.mjs, editions: [lite, full], codes: [FE_CHIP_LABEL_CASE]}
5682
+ witness:
5683
+ - {path: packages/eslint/grammar-core/chip-label.spec.mjs, editions: [lite, full], codes: [FE_CHIP_LABEL_CASE]}
5684
+ cases:
5685
+ - id: case-1
5686
+ date: "2026-10-27"
5687
+ source: owner
5688
+ quote: "A chip label starts uppercase."
5689
+ 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."
@@ -2284,6 +2284,16 @@ FE_CONSOLE_CALL:
2284
2284
  owner: op-retry
2285
2285
  kind: check-finding
2286
2286
 
2287
+ FE_CHIP_LABEL_CASE:
2288
+ title: "A status chip label starts with a lowercase letter"
2289
+ title_vi: "Nhãn chip trạng thái bắt đầu bằng chữ thường"
2290
+ meaning_vi: "Nhãn chữ của một StatusDot hoặc Badge tại <file> bắt đầu bằng chữ cái thường, nên các chip trong cùng một màn hình đọc thành hai lối viết."
2291
+ causes_vi:
2292
+ - "Viết nhãn chip như `running` thay vì `Running`."
2293
+ nextStep_vi: "Viết hoa chữ cái đầu của nhãn chip; luật tự sửa nhãn viết thẳng trong mã (quy định chip-label-uppercase)."
2294
+ owner: op-retry
2295
+ kind: check-finding
2296
+
2287
2297
  FE_CONTROL_HEIGHT:
2288
2298
  title: "A control picks a larger size or mixes sizes in one row"
2289
2299
  title_vi: "Điều khiển chọn cỡ lớn hơn hoặc trộn nhiều cỡ trong một hàng"
@@ -1,7 +1,6 @@
1
1
  // git-policy.mjs — which git commands an op worker may run in a checkout it
2
- // shares with other workflows. Pure: argv in, verdict out; scripts/guards/command-guard.mjs
3
- // (a PreToolUse hook) applies it to the agent's shell command before it runs, and the
4
- // reference-transaction hook git itself runs backs it (scripts/guards/hook-install.mjs).
2
+ // shares with other workflows. Pure: argv in, verdict out; a caller applies it to a
3
+ // shell command before it runs.
5
4
  //
6
5
  // Several workflows of one product ledger build in ONE checkout on ONE branch.
7
6
  // Their workers damaged each other with commands that are harmless alone:
@@ -1,7 +1,7 @@
1
1
  // pipeline.mjs - HFS_CI_MISSING_CANON (R13): CI runs the pinned `starci app lint`.
2
2
  // .github/workflows/ci.yml a `run:` step that runs the one lint entry: `starci app lint`,
3
- // `npx @starci/cli[@<version>] app lint`, or `npm run <script>` whose command runs `starci app lint`
4
- // (`npm run lint`, arguments after `--` allowed); a version named in the step is the @starci/cli pin of
3
+ // `npx starci-harness[@<version>] app lint`, or `npm run <script>` whose command runs `starci app lint`
4
+ // (`npm run lint`, arguments after `--` allowed); a version named in the step is the starci-harness pin of
5
5
  // canon-pins.yaml (an installed one is pinned by the pin check, R15)
6
6
  // (the push hook is no lint or typecheck step: it checks the release gate, scripts/hfs/runtime-rules/hook-shape.mjs keeps its shape)
7
7
  // A missing file is the slot manifest's finding (HFS_SLOT_REQUIRED_MISSING); a file that is present and lacks the step is this rule's.
@@ -11,10 +11,10 @@ import { isRuntimeExampleApp } from '../../lib/runtime-example.mjs';
11
11
 
12
12
  const CI_MISSING_CANON = 'HFS_CI_MISSING_CANON';
13
13
  const CI_FILE = '.github/workflows/ci.yml';
14
- const hfsPackage = '@starci/cli';
14
+ const hfsPackage = 'starci-harness';
15
15
  const RUN_PREFIX = /^\s*(?:-\s+)?run:/;
16
16
  const NPX_PREFIX = /^npx\s+(?:(?:--no-install|-y)\s+)?/;
17
- const LINT_COMMAND = /^(?:@starci\/cli(?:@(\S+))?|starci)\s+app\s+lint/;
17
+ const LINT_COMMAND = /^(?:starci-harness(?:@(\S+))?|starci)\s+app\s+lint/;
18
18
  const NPM_RUN_PREFIX = 'npm run ';
19
19
  const EXAMPLE_RUN_PREFIX = 'node node_modules/@starci/hfs/runtime/scripts/hfs/example-secrets.mjs --run . -- ';
20
20
  const SCRIPT_NAME = /^[\w:.-]+/;
@@ -57,7 +57,7 @@ function parseNpmRun(command) {
57
57
  return args !== null && !LINE_TERMINATOR.test(args) ? { script, args } : null;
58
58
  }
59
59
 
60
- /** { version } of a `starci app lint` command (`version` undefined when no @starci/cli version is named), else null. */
60
+ /** { version } of a `starci app lint` command (`version` undefined when no starci-harness version is named), else null. */
61
61
  function lintCommandOf(command) {
62
62
  const rest = command.replace(NPX_PREFIX, '');
63
63
  const match = LINT_COMMAND.exec(rest);
@@ -13,9 +13,9 @@ export const packageAt = (dir, name) => {
13
13
  /** This runtime's own `starci` bin (packages/cli is the only package that declares one). */
14
14
  const RUNTIME_STARCI_BIN = path.join(skillRoot, 'packages', 'cli', 'bin', 'starci.mjs');
15
15
 
16
- /** The `starci` bin of the @starci/cli that `dir` installs (a product runs its own pinned CLI), else this runtime's own. */
16
+ /** The `starci` bin of the starci-harness that `dir` installs (a product runs its own pinned CLI), else this runtime's own. */
17
17
  function starciBin(dir) {
18
- const packageFile = packageAt(dir, '@starci/cli');
18
+ const packageFile = packageAt(dir, 'starci-harness');
19
19
  if (packageFile) {
20
20
  try {
21
21
  const { bin } = JSON.parse(fs.readFileSync(packageFile, 'utf8'));
@@ -50,13 +50,12 @@ export const loadTypescript = (...dirs) => {
50
50
  };
51
51
 
52
52
  /**
53
- * The app's command line and the app implementation behind it: `bin` the `starci` bin of the app's installed @starci/cli, else
53
+ * The app's command line and the app implementation behind it: `bin` the `starci` bin of the app's installed starci-harness, else
54
54
  * this runtime's packages/cli/bin/starci.mjs (starciBin); `dir` the @starci/hfs that answers
55
- * `starci app` - the app's own install, else the one beside its @starci/cli, else this runtime's packages/hfs - whose runtime
56
- * slice the gate's base lint (scripts/gates/gate.mjs) and the READ digest (scripts/gates/read-digest.mjs) load in-process.
55
+ * `starci app` - the app's own install, else the one beside its starci-harness, else this runtime's packages/hfs.
57
56
  */
58
57
  export function hfsEntry(root) {
59
- const cli = packageAt(root, '@starci/cli');
58
+ const cli = packageAt(root, 'starci-harness');
60
59
  const manifest = packageAt(root, '@starci/hfs') ?? (cli && packageAt(path.dirname(cli), '@starci/hfs'));
61
60
  return { dir: manifest ? path.dirname(manifest) : path.join(skillRoot, 'packages', 'hfs'), bin: starciBin(root) };
62
61
  }
@@ -11,8 +11,8 @@
11
11
  // product trees treesInOrder the workflow tree first, then the product's main checkout
12
12
  // Work records workRecordPath the first tree that holds the record, else the main checkout's path
13
13
  // tool lookups toolSearchDirs the tree the work happens in first, the runtime's own install last
14
- // The workflow tree itself, a job's placement and the Critic directory are registry facts: scripts/machine/workflow-tree.mjs,
15
- // placement-rebound.mjs and the worktree registry resolve them, and a caller hands the result in as `tree`.
14
+ // The workflow tree itself, a job's placement and the Critic directory are registry facts: the worktree registry resolves
15
+ // them, and a caller hands the result in as `tree`.
16
16
  // The `root-adhoc` self-check (scripts/checks/check-root-adhoc.mjs, rule R240) refuses a new path built from the process working
17
17
  // directory or from the Work directory name outside this module.
18
18
  import fs from 'node:fs';
@@ -12,7 +12,7 @@ export function appendDnaFindings({ all, dna, proposals, label, assetRequests, t
12
12
  alertFindings(all, dna, rules, add, helpers);
13
13
  meterTrackFindings(all, rules, add, helpers);
14
14
  artworkFindings(all, assetRequests, add, helpers);
15
- badgeDotFindings(all, rules, add, helpers);
15
+ statusDotFindings(all, rules, add, helpers);
16
16
  return groupedFindings(groups, label);
17
17
  }
18
18
 
@@ -221,29 +221,40 @@ function artworkFindingFor(el, assetRequests, add, h) {
221
221
  if (assetRequests && !assetRequests.has(id)) add(h.DRAW_ASSET_SLOT_UNDECLARED, 'asset slot without a request', slotEl, `${h.ASSET_SLOT_ATTR}="${id}" has no entry in the drawing's asset-request.md`);
222
222
  }
223
223
 
224
- function badgeDotFindings(all, rules, add, h) {
225
- for (const el of all) badgeDotFindingFor(el, rules, add, h);
224
+ function statusDotFindings(all, rules, add, h) {
225
+ for (const el of all) statusDotFindingFor(el, rules, add, h);
226
226
  }
227
227
 
228
- function badgeDotFindingFor(el, rules, add, h) {
228
+ /** The nearest declaration of the dot-size token on the element or an ancestor, in px; null when none is declared. */
229
+ function statusDotTokenPx(el, rules, h) {
230
+ for (const node of [el, ...h.ancestorsOf(el)]) {
231
+ const px = h.declaredPx(node, h.STATUS_DOT_SIZE_PROPERTY, rules);
232
+ if (px != null) return px;
233
+ }
234
+ return null;
235
+ }
236
+
237
+ function statusDotFindingFor(el, rules, add, h) {
229
238
  if (h.insideSvg(el)) return;
230
239
  const part = (el.attrs[h.PART_ATTR] ?? '').trim();
240
+ const slot = (el.attrs['data-slot'] ?? '').trim();
231
241
  const cls = h.classesOf(el);
232
- const dotLike = /(^|-)dot$/.test(part) || cls.some((c) => h.DOT_CLASS.test(c));
242
+ const inDotComponent = h.inComponent(el, h.COMPONENTS_WITH_DOT);
243
+ if (inDotComponent && (h.STATUS_DOT_ANATOMY.test(part) || cls.some((c) => h.STATUS_DOT_ANATOMY.test(c)))) return;
244
+ const dotLike = /(^|-)dot(-mark)?$/.test(part) || cls.some((c) => h.DOT_CLASS.test(c));
233
245
  if (!dotLike) return;
234
- const dnaDot = ['badge-dot', 'dot'].includes(part) || cls.includes(h.BADGE_DOT_CLASS);
235
- const inBadge = h.inComponent(el, ['Badge']);
236
- if (!dnaDot || !inBadge) {
237
- add(h.DRAW_OFF_GRAMMAR_COMPONENT, 'hand-made status dot', el, `a status dot is DNA Badge isDot (data-grammar-part="badge-dot" / ${h.BADGE_DOT_CLASS} inside a Badge), never a hand-drawn dot`);
246
+ const dnaDot = [part, slot].includes(h.STATUS_DOT_MARK_PART) || cls.includes(h.STATUS_DOT_MARK_CLASS);
247
+ if (!dnaDot || !inDotComponent) {
248
+ add(h.DRAW_OFF_GRAMMAR_COMPONENT, 'hand-made status dot', el, `a status dot is the DNA StatusDot mark (data-grammar-part="${h.STATUS_DOT_MARK_PART}" / ${h.STATUS_DOT_MARK_CLASS} inside a StatusDot or a Badge isDot), never a hand-drawn dot`);
238
249
  return;
239
250
  }
240
251
  const inline = h.declsOf(el.attrs.style);
241
252
  const ruled = rules.filter((r) => h.selectorMatches(r.selector, el)).map((r) => r.decls);
242
253
  const ring = [inline, ...ruled].some((d) => ['box-shadow', 'outline', 'border'].some((key) => d[key] && !/^(none|0|0px)$/i.test(d[key].trim())))
243
254
  || cls.some((c) => /^(ring|shadow|outline)(-|$)/.test(c) && !/^(ring|shadow|outline)-none$/.test(c));
244
- if (ring) add(h.DRAW_OFF_GRAMMAR_COMPONENT, 'Badge dot with a halo', el, 'the Badge dot is a plain 6px solid circle in the tone colour: no box-shadow, ring, outline or border halo');
245
- const px = Math.max(h.declaredPx(el, 'width', rules) ?? 0, h.declaredPx(el, 'height', rules) ?? 0, Number(el.attrs.width) || 0, Number(el.attrs.height) || 0);
246
- if (px && Math.abs(px - h.BADGE_DOT_PX) > 0.5) add(h.DRAW_OFF_GRAMMAR_COMPONENT, 'Badge dot off its size', el, `the dot declares ${px}px: the Badge dot is ${h.BADGE_DOT_PX}px (<CircleFill width={6} />), no size variants`);
255
+ if (ring) add(h.DRAW_OFF_GRAMMAR_COMPONENT, 'status dot with a halo', el, `the status dot is a plain ${h.STATUS_DOT_PX}px solid circle in the tone colour: no box-shadow, ring, outline or border halo (the echo ring is the StatusDot's own)`);
256
+ const px = Math.max(h.declaredPx(el, 'width', rules) ?? 0, h.declaredPx(el, 'height', rules) ?? 0, Number(el.attrs.width) || 0, Number(el.attrs.height) || 0, statusDotTokenPx(el, rules, h) ?? 0);
257
+ if (px && Math.abs(px - h.STATUS_DOT_PX) > 0.5) add(h.DRAW_OFF_GRAMMAR_COMPONENT, 'status dot off its size', el, `the dot declares ${px}px: the status dot is ${h.STATUS_DOT_PX}px, read from ${h.STATUS_DOT_SIZE_PROPERTY}, no size variants`);
247
258
  }
248
259
 
249
260
  function groupedFindings(groups, label) {
@@ -17,9 +17,10 @@
17
17
  // inherits its parent's; an svg's inner shapes inherit the svg's); a component name DNA
18
18
  // does not publish; a part none of the enclosing components publishes; a closed prop
19
19
  // value outside its DNA values; a proposal with no entry in a grammar-proposal file;
20
- // a status dot that is not the DNA Badge isDot dot (grammar 0.5.3: HeroUI's
21
- // <CircleFill width={6} />, part badge-dot / class starci-core-badge-dot inside a Badge) -
22
- // a hand-made dot span, a dot with a box-shadow/ring/outline halo, or a dot not 6px;
20
+ // a status dot that is not the DNA StatusDot mark (grammar 0.14: class
21
+ // starci-core-status-dot-mark / part status-dot-mark inside a StatusDot or a Badge isDot,
22
+ // sized by --starci-core-status-dot-size, 6px) - a hand-made dot span, a dot with a
23
+ // box-shadow/ring/outline halo, or a dot (or a redefined size token) not 6px;
23
24
  // DRAW_NOTICE_NOT_ALERT a notice that is not DNA `Alert` with a tone: an Alert without a tone in the
24
25
  // PresentationState vocabulary, or a container (SurfaceCard, a bare div ...) posing as a
25
26
  // notice - role alert/status or aria-live, notice/callout/banner vocabulary in its
@@ -67,9 +68,14 @@ export { anatomyFindings } from './draw-dna-anatomy.mjs';
67
68
  export const DRAW_OFF_GRAMMAR_COMPONENT = 'DRAW_OFF_GRAMMAR_COMPONENT';
68
69
  export const DRAW_NOTICE_NOT_ALERT = 'DRAW_NOTICE_NOT_ALERT';
69
70
  export const DRAW_RATIO_NOT_METER = 'DRAW_RATIO_NOT_METER';
70
- /** Grammar 0.5.3 Badge isDot: the dot's class and its one size (HeroUI's <CircleFill width={6} />). */
71
- const BADGE_DOT_CLASS = 'starci-core-badge-dot';
72
- const BADGE_DOT_PX = 6;
71
+ /** Grammar 0.14 StatusDot (also behind Badge isDot): the dot's class, part, size custom property and its one value. */
72
+ const STATUS_DOT_MARK_CLASS = 'starci-core-status-dot-mark';
73
+ const STATUS_DOT_MARK_PART = 'status-dot-mark';
74
+ const STATUS_DOT_SIZE_PROPERTY = '--starci-core-status-dot-size';
75
+ const STATUS_DOT_PX = 6;
76
+ /** The StatusDot's own anatomy around the mark (root, chip, label): parts of the component, never a dot. */
77
+ const STATUS_DOT_ANATOMY = /^(starci-core-)?status-dot(-chip|-label)?$/;
78
+ const COMPONENTS_WITH_DOT = ['StatusDot', 'Badge'];
73
79
  const DOT_CLASS = /(?:^|[-_])(dot|status-dot|dot-indicator)(?:$|[-_])/i;
74
80
  /**
75
81
  * The grammar Alert's action Button variant for a PresentationState tone (@starci/grammar 0.5.3 Alert, after HeroUI v3's
@@ -425,8 +431,8 @@ function isArtwork(el) {
425
431
  * its asset-request.md requests (null: not judged).
426
432
  */
427
433
  const DNA_FINDING_HELPERS = {
428
- ACTION_COMPONENTS, ALERT_INDICATOR_MAX_PX, ASSET_SLOT_ATTR, BADGE_DOT_CLASS, BADGE_DOT_PX, BAR_CLASS, CONTAINERS,
429
- DOT_CLASS, DRAW_ALERT_ANATOMY, DRAW_ASSET_SLOT_UNDECLARED, DRAW_METER_TRACK, DRAW_NOTICE_NOT_ALERT, DRAW_OFF_GRAMMAR_COMPONENT, DRAW_RATIO_NOT_METER,
434
+ ACTION_COMPONENTS, ALERT_INDICATOR_MAX_PX, ASSET_SLOT_ATTR, BAR_CLASS, COMPONENTS_WITH_DOT, CONTAINERS,
435
+ DOT_CLASS, STATUS_DOT_ANATOMY, STATUS_DOT_MARK_CLASS, STATUS_DOT_MARK_PART, STATUS_DOT_PX, STATUS_DOT_SIZE_PROPERTY, DRAW_ALERT_ANATOMY, DRAW_ASSET_SLOT_UNDECLARED, DRAW_METER_TRACK, DRAW_NOTICE_NOT_ALERT, DRAW_OFF_GRAMMAR_COMPONENT, DRAW_RATIO_NOT_METER,
430
436
  METER_FULL_WIDTH_SHARE, METER_SEGMENTED_TRACK_PX, METER_SEGMENTS_PROPOSAL, METER_TRACK_PX, METER_SEGMENT_GAP_MAX_PX, NOTICE_CLASS, OUTCOME_STATES,
431
437
  PART_ATTR, PROPOSAL_ATTR, RATIO_RX, alertActionVariantFor, ancestorsOf, classesOf, componentNameOf, componentRootOf,
432
438
  declaredBackgroundsOf, declaredPx, declsOf, describe, dnaSegment, inComponent, insideSvg, isAction, isArtwork, kebab,
package/scaffold/app.mjs CHANGED
@@ -161,8 +161,8 @@ const STARTER_DEPENDENCIES = Object.freeze({
161
161
  'class-transformer': null, 'class-validator': null, 'reflect-metadata': null, rxjs: null, tslib: null, typeorm: null, zod: null,
162
162
  },
163
163
  devDependencies: {
164
- turbo: null, '@nestjs/testing': null, '@starci/cli': null, '@starci/eslint-canon-be': null, '@starci/eslint-canon-fe': null, '@starci/jest-preset': null,
165
- '@starci/prettier-config': null, '@starci/stylelint-canon': null, '@starci/test-world': null, '@starci/tsconfig': null, '@tailwindcss/postcss': null, '@types/express': null,
164
+ turbo: null, '@nestjs/testing': null, '@starci/eslint-canon-be': null, '@starci/eslint-canon-fe': null, '@starci/jest-preset': null,
165
+ '@starci/prettier-config': null, '@starci/stylelint-canon': null, '@starci/test-world': null, '@starci/tsconfig': null, 'starci-harness': null, '@tailwindcss/postcss': null, '@types/express': null,
166
166
  '@types/jest': null, '@types/node': null, '@types/react': null, '@types/react-dom': null, eslint: null, 'eslint-plugin-react-hooks': null,
167
167
  husky: null, jest: null, 'postcss-value-parser': null, prettier: null, stylelint: null, tailwindcss: null, 'ts-jest': null,
168
168
  'ts-node-dev': null, 'tsc-alias': null, 'tsconfig-paths': null, typescript: null,
@@ -182,8 +182,8 @@ const LITE_STARTER_DEPENDENCIES = Object.freeze({
182
182
  'reflect-metadata': null, rxjs: null, tslib: null, typeorm: null, zod: null,
183
183
  },
184
184
  devDependencies: {
185
- turbo: null, '@nestjs/testing': null, '@starci/eslint-canon-be': null, '@starci/eslint-canon-fe': null, '@starci/cli': null,
186
- '@starci/jest-preset': null, '@starci/prettier-config': null, '@starci/stylelint-canon': null, '@starci/tsconfig': null, '@tailwindcss/postcss': null,
185
+ turbo: null, '@nestjs/testing': null, '@starci/eslint-canon-be': null, '@starci/eslint-canon-fe': null,
186
+ '@starci/jest-preset': null, '@starci/prettier-config': null, '@starci/stylelint-canon': null, '@starci/tsconfig': null, 'starci-harness': null, '@tailwindcss/postcss': null,
187
187
  '@types/express': null, '@types/jest': null, '@types/node': null, '@types/react': null, '@types/react-dom': null,
188
188
  eslint: null, 'eslint-plugin-react-hooks': null, husky: null, jest: null, 'postcss-value-parser': null, prettier: null,
189
189
  stylelint: null, supabase: null, tailwindcss: null, 'ts-jest': null, 'ts-node-dev': null, 'tsc-alias': null,
package/src/main.mjs CHANGED
@@ -136,7 +136,7 @@ starci app hygiene [--cwd <dir>]
136
136
  starci app coverage merge --out <lcov> <lcov-or-dir>... [--cwd <dir>]
137
137
  `;
138
138
  const PER_CODE_LIMIT = 25;
139
- const VALUE_FLAGS = new Set(['--base', '--inject', '--into', '--event', '--from', '--service', '--connection', '--owner', '--failed', '--done', '--coverage-from', '--registry-visibility']);
139
+ const VALUE_FLAGS = new Set(['--base', '--inject', '--into', '--event', '--from', '--service', '--connection', '--owner', '--failed', '--done', '--coverage-from', '--registry-visibility', '--shapes', '--read', '--app']);
140
140
  /** Flags that may repeat: their values are collected in order. */
141
141
  const LIST_FLAGS = new Set(['--inject']);
142
142
  const BOOL_FLAGS = new Set(['--json', '--fast', '--fe', '--no-types', '--db-types', '--wiring']);
@@ -293,7 +293,7 @@ async function lintMain(argv, { cwd, stdout, presets, prettier, runLinter, check
293
293
 
294
294
  /**
295
295
  * The jest preset a new app renders its Sonar exclusions from: the copy this @starci/hfs ships (bundledPresets), the same version the
296
- * scaffold pins, so `npx @starci/cli app scaffold` works before any dependency of the app is installed.
296
+ * scaffold pins, so `npx starci-harness app scaffold` works before any dependency of the app is installed.
297
297
  */
298
298
  const scaffoldPresets = () => bundledPresets();
299
299
 
@@ -390,7 +390,7 @@ function newMain(opts, { cwd: repoRoot, stdout: out }) {
390
390
  function addMain(opts, { cwd: repoRoot, stdout: out }) {
391
391
  const [noun, name, ...extra] = opts.positional;
392
392
  if (!noun || !name || extra.length) throw new Error('starci app add takes `<noun> <name>` and the options of the noun');
393
- const { created, registered } = addKind({ repoRoot, noun, name, options: { event: opts.event, from: opts.from, service: opts.service, connection: opts.connection, owner: opts.owner, failed: opts.failed, done: opts.done, fe: opts.fe, noTypes: opts['no-types'] } });
393
+ const { created, registered } = addKind({ repoRoot, noun, name, options: { event: opts.event, from: opts.from, service: opts.service, connection: opts.connection, owner: opts.owner, failed: opts.failed, done: opts.done, fe: opts.fe, noTypes: opts['no-types'], shapes: opts.shapes, read: opts.read, app: opts.app } });
394
394
  for (const file of created) out(`created ${file}\n`);
395
395
  const kinds = registered.kinds.length ? `; kinds ${registered.kinds.join(', ')}` : '';
396
396
  out(`starci app add ${noun}: registered patterns ${registered.patterns.join(', ')}${kinds}\n`);
package/sync/index.mjs CHANGED
@@ -200,6 +200,18 @@ const LCOV_REPORT = 'be/coverage/lcov.info';
200
200
  */
201
201
  export const SONAR_CPD_EXCLUSIONS = Object.freeze(['**/messages/*.messages.ts', '**/messages/*.json']);
202
202
 
203
+ /**
204
+ * The Sonar scope of the jest preset's exclusions (presets.sonarExclusions): its file patterns are the tests, which
205
+ * `sonar.test.inclusions` takes and `sonar.exclusions` moves out of the sources (`sonar.tests` names every source folder, so the
206
+ * two sets stay disjoint and each test is analysed as a test, never dropped); its folder patterns (`/**`) and the front end's
207
+ * build and dependency folders are no source at all. Nothing else is excluded: a generated file is analysed like any other.
208
+ */
209
+ export function sonarScope(presets) {
210
+ const preset = String(presets?.sonarExclusions ?? '').split(',').map(glob => glob.trim()).filter(Boolean);
211
+ const tests = preset.filter(glob => !glob.endsWith('/**'));
212
+ return { tests, exclusions: [...new Set([...preset, '**/.next/**', '**/node_modules/**'])] };
213
+ }
214
+
203
215
  const SOURCE_FILE = /\.[cm]?ts$/;
204
216
  const SOURCE_SKIPPED = new Set(['node_modules', 'dist', 'coverage']);
205
217
 
@@ -364,7 +376,8 @@ export function variables(app, scope, presets, sonarKey, manifest = loadSlotMani
364
376
  nodeMajor: String(NODE_MAJOR),
365
377
  sonarKey: sonarKey ?? app.project,
366
378
  sonarHostLine: sonarHostLine(quality.sonar),
367
- sonarExclusions: [presets?.sonarExclusions, '**/.next/**', '**/node_modules/**', ...(lite ? ['supabase/types/**'] : [])].filter(Boolean).join(','),
379
+ sonarExclusions: sonarScope(presets).exclusions.join(','),
380
+ sonarTestInclusions: sonarScope(presets).tests.join(','),
368
381
  sonarSources: ['be/apps', 'be/src', 'fe/apps', ...(packages ? ['fe/packages'] : [])].join(','),
369
382
  lcovReport: LCOV_REPORT,
370
383
  cpdExclusions: SONAR_CPD_EXCLUSIONS.join(','),
package/sync/managed.mjs CHANGED
@@ -23,8 +23,9 @@
23
23
  // a file that states the coverage scope no longer states what the slot manifest derives (the `coverage` field of
24
24
  // knowledge/hfs/slots.yaml through scripts/hfs/coverage-scope.mjs): be/jest.config.js, codecov.yml, or the
25
25
  // `sonar.coverage.exclusions` line of sonar-project.properties. The scope is never edited by hand.
26
- // HFS_SONAR_CONFIG (R11) sonar-project.properties differs from its render (the render names no host URL, sources and tests that
27
- // do not overlap, the `sonar.exclusions` of the jest preset (a back end), the be lcov with the logic of be/src/modules as the coverage scope, the ESLint report and the
26
+ // HFS_SONAR_CONFIG (R11) sonar-project.properties differs from its render (the render names no host URL, the source folders as
27
+ // `sonar.tests` too, the jest preset's test patterns as `sonar.test.inclusions` moved out of the sources by
28
+ // `sonar.exclusions` beside the build and dependency folders (sync/index.mjs sonarScope), the be lcov with the logic of be/src/modules as the coverage scope, the ESLint report and the
28
29
  // HFS import files Sonar reads), or the stack declaration names a quality gate other than the one
29
30
  // gate of knowledge/sonar-gate.yaml (bundled in the runtime copy). One edit is one finding.
30
31
  // HFS_TS_STRICT (R22) the root tsconfig.json drift (either profile), named by flag (ts-strict.mjs) instead of by hash.
@@ -28,12 +28,12 @@ const writeFormBounds = (roots, source) => {
28
28
  if (schemas.length === 0 || operationRoots.length === 0) {
29
29
  process.stdout.write("codegen: no GraphQL contract under be/contracts yet\n")
30
30
  if (schemas.length === 0 && operationRoots.length) {
31
- const { emptyInputBoundsSource } = await import("@starci/cli/input-bounds")
31
+ const { emptyInputBoundsSource } = await import("starci-harness/input-bounds")
32
32
  writeFormBounds(operationRoots, emptyInputBoundsSource())
33
33
  }
34
34
  } else {
35
35
  const { buildSchema } = await import("graphql")
36
- const { assertCompatibleInputBounds } = await import("@starci/cli/input-bounds")
36
+ const { assertCompatibleInputBounds } = await import("starci-harness/input-bounds")
37
37
  assertCompatibleInputBounds(
38
38
  Object.fromEntries(schemas.map((file) => [file, buildSchema(fs.readFileSync(file, "utf8"))])),
39
39
  )
@@ -49,7 +49,7 @@ if (schemas.length === 0 || operationRoots.length === 0) {
49
49
  config: { useTypeImports: true, enumsAsTypes: true, avoidOptionals: true },
50
50
  },
51
51
  ],
52
- [`${root}/__generated__/input-bounds.ts`, { plugins: [{ "@starci/cli/input-bounds": {} }] }],
52
+ [`${root}/__generated__/input-bounds.ts`, { plugins: [{ "starci-harness/input-bounds": {} }] }],
53
53
  ]),
54
54
  )
55
55
  await generate(
@@ -80,7 +80,7 @@ const restRoots = frontendApps
80
80
  .filter((dir) => fs.existsSync(dir))
81
81
  .map(posix)
82
82
  if (restRoots.length) {
83
- const { openApiBoundsSource } = await import("@starci/cli/input-bounds")
83
+ const { openApiBoundsSource } = await import("starci-harness/input-bounds")
84
84
  const contracts = Object.fromEntries(
85
85
  services
86
86
  .map((service) => [service, path.join(CONTRACTS, service, "openapi.json")])
@@ -1,11 +1,13 @@
1
1
  {{> app/quality-config/sonar-base.properties}}
2
2
  {{sonarHostLine}}
3
- sonar.tests=be/apps,be/src
3
+ sonar.tests={{sonarSources}}
4
4
  sonar.exclusions={{sonarExclusions}}
5
5
  sonar.cpd.exclusions={{cpdExclusions}}
6
- sonar.test.inclusions=**/*.spec.ts
6
+ sonar.test.inclusions={{sonarTestInclusions}}
7
7
  sonar.typescript.tsconfigPaths={{tsconfigPaths}}
8
8
  sonar.externalIssuesReportPaths=reports/lint.sonar.json
9
9
  sonar.javascript.lcov.reportPaths={{lcovReport}}
10
+ # starci:sonar-scope begin (generated by `starci app sonar --write` from contexts/hfs/slots.yaml; do not edit)
10
11
  sonar.coverage.exclusions={{coverageExclusions}}
12
+ # starci:sonar-scope end
11
13
  sonar.javascript.node.maxspace=6144
@@ -1,14 +0,0 @@
1
- // canonical-json.mjs — the one canonical JSON the runtime digests structured values with: object keys
2
- // sorted, arrays in order, so two equal values always serialize to the same bytes. A leaf beside digest.mjs.
3
- import {byCodeUnit} from './by-code-unit.mjs';
4
- import {isPlainObject} from './plain-object.mjs';
5
-
6
- /** The canonical JSON text of `value`: keys sorted at every depth. */
7
- export function canonicalJSON(value) {
8
- if (Array.isArray(value)) return `[${value.map(canonicalJSON).join(',')}]`;
9
- if (isPlainObject(value)) {
10
- const members = Object.keys(value).sort(byCodeUnit).map(k => `${JSON.stringify(k)}:${canonicalJSON(value[k])}`);
11
- return `{${members.join(',')}}`;
12
- }
13
- return JSON.stringify(value);
14
- }