@starci/hfs 4.7.32 → 4.7.34

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 (473) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +13 -6
  3. package/emit/contracts.mjs +4 -3
  4. package/emit/form-bounds-reader.ts.partial +58 -0
  5. package/emit/form-bounds.mjs +155 -0
  6. package/emit/graphql-input-bounds.mjs +97 -0
  7. package/emit/input-bounds.mjs +44 -0
  8. package/emit/operation-schemas.mjs +137 -0
  9. package/emit/operations-worker.mjs +2 -2
  10. package/emit/operations.mjs +52 -16
  11. package/emit/schema-worker.mjs +17 -4
  12. package/emit/type-schema.mjs +17 -5
  13. package/package.json +9 -2
  14. package/release/gate.mjs +18 -23
  15. package/release/index.mjs +1 -1
  16. package/release/push.mjs +4 -5
  17. package/runtime/engine/admission.mjs +331 -0
  18. package/runtime/engine/canonical-json.mjs +14 -0
  19. package/runtime/engine/db/blob.mjs +380 -0
  20. package/runtime/engine/db/event-compact.mjs +73 -0
  21. package/runtime/engine/db/ledger-open.mjs +38 -0
  22. package/runtime/engine/db/ledger-paths.mjs +87 -0
  23. package/runtime/engine/db/ledger.mjs +1068 -0
  24. package/runtime/engine/db/machine-connection.mjs +150 -0
  25. package/runtime/engine/db/machine-open.mjs +60 -0
  26. package/runtime/engine/db/machine-schema.mjs +105 -0
  27. package/runtime/engine/db/machine.mjs +1317 -0
  28. package/runtime/engine/db/provider-reservations.mjs +127 -0
  29. package/runtime/engine/db/provision-authority.mjs +76 -0
  30. package/runtime/engine/db/provision-lock.mjs +29 -0
  31. package/runtime/engine/db/provision-operations.mjs +146 -0
  32. package/runtime/engine/db/ref-value.mjs +67 -0
  33. package/runtime/engine/db/schema/machine.sql +920 -0
  34. package/runtime/engine/db/schema/runtime.sql +1113 -0
  35. package/runtime/engine/refuse.mjs +11 -0
  36. package/runtime/knowledge/hfs/canon-pins.yaml +65 -9
  37. package/runtime/knowledge/hfs/design-truths.yaml +149 -0
  38. package/runtime/knowledge/hfs/fe-stack.yaml +23 -5
  39. package/runtime/knowledge/hfs/rules.yaml +269 -48
  40. package/runtime/knowledge/hfs/slots.yaml +113 -53
  41. package/runtime/knowledge/patterns/be/api.yaml +46 -20
  42. package/runtime/knowledge/patterns/be/event-bus.yaml +19 -12
  43. package/runtime/knowledge/patterns/be/idempotency.yaml +265 -0
  44. package/runtime/knowledge/patterns/be/jobs.yaml +17 -12
  45. package/runtime/knowledge/patterns/be/projections.yaml +2 -2
  46. package/runtime/knowledge/patterns/be/queues.yaml +57 -22
  47. package/runtime/knowledge/patterns/be/reactors.yaml +1 -1
  48. package/runtime/knowledge/patterns/be/realtime.yaml +326 -27
  49. package/runtime/knowledge/patterns/be/saga.yaml +2 -2
  50. package/runtime/knowledge/sonar-gate.yaml +1 -1
  51. package/runtime/modules/kernel/command-policy.yaml +249 -0
  52. package/runtime/modules/kernel/failure-codes.yaml +211 -52
  53. package/runtime/modules/kernel/hook-input.yaml +6 -0
  54. package/runtime/modules/kernel/protected-zone.yaml +81 -0
  55. package/runtime/modules/kernel/removed-vocabulary.yaml +62 -0
  56. package/runtime/modules/kernel/roles.yaml +405 -0
  57. package/runtime/modules/models/registry.yaml +3 -1
  58. package/runtime/modules/models/runtimes.yaml +2 -0
  59. package/runtime/modules/schemas/application-stacks.schema.yaml +10 -2
  60. package/runtime/packages/cli/src/catalog.generated.mjs +46 -59
  61. package/runtime/packages/grammar/scripts/build-stamp.mjs +98 -0
  62. package/runtime/scripts/agent/codex-app-server.mjs +79 -0
  63. package/runtime/scripts/agent/codex-mirror-source.mjs +34 -0
  64. package/runtime/scripts/agent/host-agents.mjs +80 -0
  65. package/runtime/scripts/agent/launch-trust-policy.mjs +53 -0
  66. package/runtime/scripts/agent/trust-launch.mjs +191 -0
  67. package/runtime/scripts/agent/trust.mjs +523 -0
  68. package/runtime/scripts/api/fs/rename-over.mjs +21 -0
  69. package/runtime/scripts/api/fs/temp-path.mjs +8 -0
  70. package/runtime/scripts/api/fs/write-json-file.mjs +10 -0
  71. package/runtime/scripts/api/git/diff-names.mjs +8 -0
  72. package/runtime/scripts/api/git/head-time.mjs +10 -0
  73. package/runtime/scripts/api/git/index-lock.mjs +78 -0
  74. package/runtime/scripts/api/git/is-ancestor.mjs +5 -0
  75. package/runtime/scripts/api/git/log.mjs +5 -0
  76. package/runtime/scripts/api/git/merge-base-query.mjs +5 -0
  77. package/runtime/scripts/api/git/merge-tree.mjs +5 -0
  78. package/runtime/scripts/api/git/rev-list.mjs +5 -0
  79. package/runtime/scripts/api/git/rev-parse.mjs +13 -0
  80. package/runtime/scripts/api/git/status-query.mjs +5 -0
  81. package/runtime/scripts/api/git/worktree-list-query.mjs +5 -0
  82. package/runtime/scripts/api/node/spawn-node.mjs +6 -0
  83. package/runtime/scripts/api/npm/dist-tag.mjs +8 -0
  84. package/runtime/scripts/api/npm/lib.mjs +32 -0
  85. package/runtime/scripts/api/npm/pack-dry-run.mjs +9 -0
  86. package/runtime/scripts/api/npm/run-npm.mjs +6 -0
  87. package/runtime/scripts/api/npm/view.mjs +30 -0
  88. package/runtime/scripts/api/npm/whoami.mjs +8 -0
  89. package/runtime/scripts/api/process/hide-child-windows.mjs +31 -0
  90. package/runtime/scripts/api/process/kill-tree.mjs +22 -0
  91. package/runtime/scripts/api/process/lib.mjs +125 -0
  92. package/runtime/scripts/api/process/probe-guard-command.mjs +74 -0
  93. package/runtime/scripts/api/process/process-list.mjs +28 -0
  94. package/runtime/scripts/api/process/system-tool.mjs +37 -0
  95. package/runtime/scripts/gates/canon-digest.mjs +81 -0
  96. package/runtime/scripts/gates/canon-pins.mjs +16 -0
  97. package/runtime/scripts/gates/commit-proof.mjs +53 -0
  98. package/runtime/scripts/gates/gate-input.mjs +98 -0
  99. package/runtime/scripts/gates/gate.mjs +669 -0
  100. package/runtime/scripts/gates/grammar-dist.mjs +206 -0
  101. package/runtime/scripts/gates/runtime-package-selection.mjs +27 -0
  102. package/runtime/scripts/gates/test-world-run.mjs +254 -0
  103. package/runtime/scripts/gates/type-impact.mjs +277 -0
  104. package/runtime/scripts/gates/type-program.mjs +113 -0
  105. package/runtime/scripts/guards/assigned-command.mjs +12 -0
  106. package/runtime/scripts/guards/call-rights.mjs +47 -0
  107. package/runtime/scripts/guards/command-guard.mjs +468 -0
  108. package/runtime/scripts/guards/command-policy.mjs +342 -0
  109. package/runtime/scripts/guards/critic-reach.mjs +82 -0
  110. package/runtime/scripts/guards/deps-guard.mjs +150 -0
  111. package/runtime/scripts/guards/env-dump-verdict.mjs +89 -0
  112. package/runtime/scripts/guards/git-pathspec.mjs +225 -0
  113. package/runtime/scripts/guards/git-policy.mjs +355 -0
  114. package/runtime/scripts/guards/guards-root.mjs +27 -0
  115. package/runtime/scripts/guards/hook-install.mjs +343 -0
  116. package/runtime/scripts/guards/hook-io.mjs +76 -0
  117. package/runtime/scripts/guards/hook-verdict.mjs +12 -0
  118. package/runtime/scripts/guards/install-verdict.mjs +41 -0
  119. package/runtime/scripts/guards/kernel-seat.mjs +63 -0
  120. package/runtime/scripts/guards/launch-verdict.mjs +74 -0
  121. package/runtime/scripts/guards/op-starci.mjs +16 -0
  122. package/runtime/scripts/guards/op-write-scope.mjs +27 -0
  123. package/runtime/scripts/guards/orca-self-lifecycle.mjs +39 -0
  124. package/runtime/scripts/guards/process-kill-verdict.mjs +106 -0
  125. package/runtime/scripts/guards/protected-zone.mjs +56 -0
  126. package/runtime/scripts/guards/refusals.mjs +27 -0
  127. package/runtime/scripts/guards/release-definition.mjs +185 -0
  128. package/runtime/scripts/guards/release-push-gate.mjs +72 -0
  129. package/runtime/scripts/guards/release-record.mjs +58 -0
  130. package/runtime/scripts/guards/release-suite-mode.mjs +15 -0
  131. package/runtime/scripts/guards/rights.mjs +268 -0
  132. package/runtime/scripts/guards/seat-tools.mjs +47 -0
  133. package/runtime/scripts/guards/shell-commands.mjs +328 -0
  134. package/runtime/scripts/guards/supervisor-seat.mjs +80 -0
  135. package/runtime/scripts/guards/verdict-process.mjs +81 -0
  136. package/runtime/scripts/hfs/architecture/dead-exports.mjs +10 -10
  137. package/runtime/scripts/hfs/architecture/function-spec-providers.mjs +1 -1
  138. package/runtime/scripts/hfs/architecture/operation-contract-roots.mjs +53 -0
  139. package/runtime/scripts/hfs/architecture/reachability.mjs +1 -1
  140. package/runtime/scripts/hfs/architecture/sql-owner.mjs +17 -6
  141. package/runtime/scripts/hfs/architecture/sql-token-forms.mjs +105 -0
  142. package/runtime/scripts/hfs/architecture/sql-tokens.mjs +38 -52
  143. package/runtime/scripts/hfs/architecture/supabase-keys.mjs +261 -0
  144. package/runtime/scripts/hfs/architecture/transport-owner.mjs +49 -3
  145. package/runtime/scripts/hfs/architecture/typescript.mjs +1 -1
  146. package/runtime/scripts/hfs/check.mjs +6 -4
  147. package/runtime/scripts/hfs/coverage-scope.mjs +28 -1
  148. package/runtime/scripts/hfs/db-restamp-verb.mjs +56 -16
  149. package/runtime/scripts/hfs/declaration-shape.mjs +4 -4
  150. package/runtime/scripts/hfs/declaration-slots.mjs +14 -3
  151. package/runtime/scripts/hfs/manifest-shape.mjs +10 -6
  152. package/runtime/scripts/hfs/rule-params-shape.mjs +18 -6
  153. package/runtime/scripts/hfs/rules/a15-findings.mjs +4 -1
  154. package/runtime/scripts/hfs/rules/bypass-markers.mjs +22 -7
  155. package/runtime/scripts/hfs/rules/database-migrations.mjs +69 -14
  156. package/runtime/scripts/hfs/rules/database-queue-sources.mjs +9 -7
  157. package/runtime/scripts/hfs/rules/database-queues.mjs +68 -18
  158. package/runtime/scripts/hfs/rules/edition.mjs +56 -12
  159. package/runtime/scripts/hfs/rules/fe-contract-documents.mjs +1 -10
  160. package/runtime/scripts/hfs/rules/fe-stack.mjs +12 -7
  161. package/runtime/scripts/hfs/rules/lite-proof-lane.mjs +1 -1
  162. package/runtime/scripts/hfs/rules/stacks-lite-backing.mjs +75 -9
  163. package/runtime/scripts/hfs/rules/stacks-runtime.mjs +1 -1
  164. package/runtime/scripts/hfs/rules/stacks-swarm.mjs +15 -4
  165. package/runtime/scripts/hfs/rules/text-integrity.mjs +73 -0
  166. package/runtime/scripts/hfs/runtime-rules/hook-shape.mjs +74 -0
  167. package/runtime/scripts/hfs/runtime-rules/release-notes.mjs +44 -0
  168. package/runtime/scripts/hfs/sealed-members.mjs +3 -3
  169. package/runtime/scripts/hfs/slot-side-problems.mjs +3 -3
  170. package/runtime/scripts/hfs/slots.mjs +2 -1
  171. package/runtime/scripts/hfs/stack-deploy-config.mjs +22 -5
  172. package/runtime/scripts/hfs/stacks-gate.mjs +28 -7
  173. package/runtime/scripts/hfs/view.mjs +2 -1
  174. package/runtime/scripts/lib/app-data.mjs +11 -0
  175. package/runtime/scripts/lib/bypass-markers.mjs +272 -75
  176. package/runtime/scripts/lib/check-format.mjs +7 -0
  177. package/runtime/scripts/lib/cli-arg.mjs +120 -0
  178. package/runtime/scripts/lib/css-rules.mjs +220 -0
  179. package/runtime/scripts/lib/dom-tree.mjs +4 -0
  180. package/runtime/scripts/lib/escape.mjs +16 -0
  181. package/runtime/scripts/lib/event-items.mjs +22 -0
  182. package/runtime/scripts/lib/failure-code-template-errors.mjs +161 -0
  183. package/runtime/scripts/lib/git-dir.mjs +120 -0
  184. package/runtime/scripts/lib/grammar-vendor-parity.mjs +377 -0
  185. package/runtime/scripts/lib/guard-command.mjs +24 -0
  186. package/runtime/scripts/lib/hook-limits.mjs +5 -0
  187. package/runtime/scripts/lib/interrupt-cleanup.mjs +38 -0
  188. package/runtime/scripts/lib/js-lex.mjs +200 -0
  189. package/runtime/scripts/lib/json-formats.mjs +0 -1
  190. package/runtime/scripts/lib/language.mjs +94 -1
  191. package/runtime/scripts/lib/loosening-budgets.mjs +44 -0
  192. package/runtime/scripts/lib/loosening-config.mjs +361 -0
  193. package/runtime/scripts/lib/loosening-state.mjs +223 -0
  194. package/runtime/scripts/lib/menu-parts.mjs +11 -0
  195. package/runtime/scripts/lib/normalize.mjs +25 -0
  196. package/runtime/scripts/lib/op-gate.mjs +15 -0
  197. package/runtime/scripts/lib/redact.mjs +208 -0
  198. package/runtime/scripts/lib/runtime-location.mjs +21 -0
  199. package/runtime/scripts/lib/runtime-package-inventory.mjs +21 -0
  200. package/runtime/scripts/lib/runtime-package-manifests.mjs +84 -0
  201. package/runtime/scripts/lib/runtime-publication-tags.mjs +99 -0
  202. package/runtime/scripts/lib/seat-env.mjs +43 -0
  203. package/runtime/scripts/lib/secret-patterns.mjs +58 -9
  204. package/runtime/scripts/lib/shell-source.mjs +4 -0
  205. package/runtime/scripts/lib/source-phrases.mjs +34 -0
  206. package/runtime/scripts/lib/sqlite.mjs +21 -0
  207. package/runtime/scripts/lib/swarm-stack.mjs +2 -1
  208. package/runtime/scripts/lib/tar-files.mjs +39 -0
  209. package/runtime/scripts/lib/ts-analysis.mjs +10 -0
  210. package/runtime/scripts/lib/worktree-exclude.mjs +35 -0
  211. package/runtime/scripts/lib/worktree-record.mjs +14 -0
  212. package/runtime/scripts/machine/artifact-hold.mjs +52 -0
  213. package/runtime/scripts/machine/ask-receipts.mjs +113 -0
  214. package/runtime/scripts/machine/evidence-store.mjs +223 -0
  215. package/runtime/scripts/machine/home.mjs +216 -0
  216. package/runtime/scripts/machine/host-lock.mjs +184 -0
  217. package/runtime/scripts/machine/lock-recovery.mjs +55 -0
  218. package/runtime/scripts/machine/roles-contract.mjs +90 -0
  219. package/runtime/scripts/machine/runtime-change.mjs +20 -0
  220. package/runtime/scripts/machine/workflow-tree.mjs +122 -0
  221. package/runtime/scripts/reconciler/checklist-items.mjs +7 -0
  222. package/runtime/scripts/reconciler/guard-row.mjs +25 -0
  223. package/runtime/scripts/work/asset-slot.mjs +284 -0
  224. package/runtime/scripts/work/brand/brand-colour.mjs +125 -0
  225. package/runtime/scripts/work/brand/brand-tokens.mjs +167 -0
  226. package/runtime/scripts/work/brand/brand-value-source.mjs +106 -0
  227. package/runtime/scripts/work/brand/brand.mjs +892 -0
  228. package/runtime/scripts/work/draw/draw-dna-anatomy.mjs +60 -0
  229. package/runtime/scripts/work/draw/draw-dna-findings.mjs +256 -0
  230. package/runtime/scripts/work/draw/draw-dna-selector.mjs +38 -0
  231. package/runtime/scripts/work/draw/draw-dna.mjs +483 -0
  232. package/runtime/scripts/work/draw/draw-layer.mjs +305 -0
  233. package/runtime/scripts/work/draw/draw-rationale-page.mjs +237 -0
  234. package/runtime/scripts/work/draw/draw-rationale-ref.mjs +14 -0
  235. package/runtime/scripts/work/draw/draw-rationale.mjs +353 -0
  236. package/runtime/scripts/work/draw/draw-source.mjs +412 -0
  237. package/runtime/scripts/work/draw/draw-taste.mjs +278 -0
  238. package/runtime/scripts/work/draw/draw-typecheck.mjs +72 -0
  239. package/runtime/scripts/work/draw/rationale-findings.mjs +205 -0
  240. package/runtime/scripts/work/draw-grammar.mjs +175 -0
  241. package/runtime/scripts/work/draw-render-page.mjs +188 -0
  242. package/runtime/scripts/work/draw-render.mjs +626 -0
  243. package/runtime/scripts/work/grammar-proposal.mjs +279 -0
  244. package/runtime/scripts/work/png.mjs +237 -0
  245. package/runtime/scripts/work/render-tools.mjs +64 -0
  246. package/runtime/scripts/work/work-io.mjs +119 -0
  247. package/scaffold/add-inbox-lite.mjs +2 -2
  248. package/scaffold/add-plan.mjs +40 -13
  249. package/scaffold/add-queue-lite.mjs +372 -0
  250. package/scaffold/add.mjs +5 -2
  251. package/scaffold/app.mjs +1 -2
  252. package/scaffold/edition-gate.mjs +11 -7
  253. package/scaffold/lite-exports.mjs +10 -0
  254. package/scaffold/pattern-file-slots.mjs +33 -0
  255. package/scaffold/test-world.mjs +1 -1
  256. package/scaffold/yaml-block-edit.mjs +117 -0
  257. package/src/main.mjs +5 -4
  258. package/stack/deploy.mjs +7 -3
  259. package/stack/post-deploy.mjs +48 -0
  260. package/sync/index.mjs +10 -0
  261. package/templates/app/ci-workflows/github/workflows/stack-deploy.yml +1 -1
  262. package/templates/app/ci-workflows-lite/github/workflows/stack-deploy.yml +1 -1
  263. package/templates/app/codegen-graphql.mjs.partial +59 -12
  264. package/templates/app/hooks/husky/pre-commit +2 -2
  265. package/templates/app/hooks/husky/pre-push +10 -3
  266. package/templates/app/package-scripts/redis-dev.json +3 -0
  267. package/templates/app/package-scripts-lite/package.json +1 -0
  268. package/templates/app/skeleton/.starcistacks/application-stacks.yaml +36 -8
  269. package/templates/app/skeleton/.starcistacks/dev/README.md +1 -1
  270. package/templates/app/skeleton/.starcistacks/production/README.md +10 -9
  271. package/templates/app/skeleton/.starcistacks/production/infra/swarm/postgres-init.sh +21 -0
  272. package/templates/app/skeleton/.starcistacks/production/infra/swarm/recovery/restore-proof.md +1 -1
  273. package/templates/app/skeleton/.starcistacks/production/infra/swarm/releases/images.lock.yaml +1 -0
  274. package/templates/app/skeleton/.starcistacks/production/infra/swarm/stack.yaml +47 -5
  275. package/templates/app/skeleton/.starcistacks/production/runtime/env/KEYS.md +5 -3
  276. package/templates/app/skeleton/README.md +2 -0
  277. package/templates/app/skeleton-lite/.starcistacks/application-stacks.yaml +5 -0
  278. package/templates/app/skeleton-lite/.starcistacks/dev/README.md +2 -2
  279. package/templates/app/skeleton-lite/.starcistacks/production/README.md +1 -1
  280. package/templates/app/skeleton-lite/README.md +1 -1
  281. package/templates/be/inbox/platform/client-operation-outcomes.sql.tpl +18 -0
  282. package/templates/be/inbox/platform/event-bus/errors/event-bus.error.ts.tpl +16 -0
  283. package/templates/be/inbox/platform/event-bus/event-bus.contracts.ts.tpl +10 -0
  284. package/templates/be/inbox/platform/event-bus/event-bus.port.ts.tpl +1 -1
  285. package/templates/be/inbox/platform/event-bus/event-bus.service.spec.ts.tpl +15 -3
  286. package/templates/be/inbox/platform/event-bus/event-bus.service.ts.tpl +11 -3
  287. package/templates/be/inbox/platform/event-bus/index.ts.tpl +2 -0
  288. package/templates/be/inbox/platform/event-bus/messages/event-bus.messages.ts.tpl +7 -0
  289. package/templates/be/inbox/platform/event-bus/persistence/event-bus.sql.ts.tpl +2 -2
  290. package/templates/be/inbox/platform/idempotency/errors/idempotency.error.ts.tpl +19 -0
  291. package/templates/be/inbox/platform/idempotency/index.ts.tpl +2 -0
  292. package/templates/be/inbox/platform/idempotency/messages/idempotency.messages.ts.tpl +13 -0
  293. package/templates/be/inbox/platform/inbox/client-operation.policy.spec.ts.tpl +32 -0
  294. package/templates/be/inbox/platform/inbox/client-operation.policy.ts.tpl +17 -0
  295. package/templates/be/inbox/platform/inbox/errors/inbox.error.ts.tpl +22 -0
  296. package/templates/be/inbox/platform/inbox/inbox.port.ts.tpl +21 -0
  297. package/templates/be/inbox/platform/inbox/inbox.service.spec.ts.tpl +334 -11
  298. package/templates/be/inbox/platform/inbox/inbox.service.ts.tpl +55 -4
  299. package/templates/be/inbox/platform/inbox/index.ts.tpl +2 -0
  300. package/templates/be/inbox/platform/inbox/messages/inbox.messages.ts.tpl +15 -0
  301. package/templates/be/inbox/platform/inbox/persistence/inbox.rows.ts.tpl +33 -0
  302. package/templates/be/inbox/platform/inbox/persistence/inbox.sql.ts.tpl +26 -0
  303. package/templates/be/inbox/platform/inbox/request-fingerprint.policy.spec.ts.tpl +76 -0
  304. package/templates/be/inbox/platform/inbox/request-fingerprint.policy.ts.tpl +36 -0
  305. package/templates/be/inbox/platform/migration.sql.tpl +1 -0
  306. package/templates/be/inbox/service.spec.ts.tpl +4 -4
  307. package/templates/be/inbox/service.ts.tpl +3 -1
  308. package/templates/be/inbox/webhook-door.spec.ts.tpl +3 -2
  309. package/templates/be/inbox/webhook-door.ts.tpl +3 -2
  310. package/templates/be/patterns/event-bus/platform/errors/event-bus.error.ts.tpl +3 -0
  311. package/templates/be/patterns/event-bus/platform/event-bus.contracts.ts.tpl +10 -0
  312. package/templates/be/patterns/event-bus/platform/event-bus.port.ts.tpl +2 -2
  313. package/templates/be/patterns/event-bus/platform/event-bus.service.spec.ts.tpl +16 -3
  314. package/templates/be/patterns/event-bus/platform/event-bus.service.ts.tpl +11 -3
  315. package/templates/be/patterns/event-bus/platform/event-envelope.policy.spec.ts.tpl +139 -50
  316. package/templates/be/patterns/event-bus/platform/event-envelope.policy.ts.tpl +25 -2
  317. package/templates/be/patterns/event-bus/platform/event-relay.service.spec.ts.tpl +139 -78
  318. package/templates/be/patterns/event-bus/platform/event-relay.service.ts.tpl +10 -6
  319. package/templates/be/patterns/event-bus/platform/event-runner.service.spec.ts.tpl +262 -159
  320. package/templates/be/patterns/event-bus/platform/event-runner.service.ts.tpl +32 -5
  321. package/templates/be/patterns/event-bus/platform/messages/event-bus.messages.ts.tpl +2 -0
  322. package/templates/be/patterns/event-bus/platform/persistence/entities/event-outbox.entity.ts.tpl +5 -1
  323. package/templates/be/patterns/event-bus/platform/persistence/event-bus.rows.ts.tpl +2 -0
  324. package/templates/be/patterns/event-bus/platform/persistence/event-bus.sql.ts.tpl +4 -4
  325. package/templates/be/patterns/event-bus/platform/persistence/migrations/1789800009000-create-event-outbox.ts.tpl +1 -0
  326. package/templates/be/patterns/idempotency/platform/idempotency/errors/idempotency.error.ts.tpl +19 -0
  327. package/templates/be/patterns/idempotency/platform/idempotency/index.ts.tpl +2 -0
  328. package/templates/be/patterns/idempotency/platform/idempotency/messages/idempotency.messages.ts.tpl +13 -0
  329. package/templates/be/patterns/idempotency/platform/inbox/client-operation.policy.spec.ts.tpl +32 -0
  330. package/templates/be/patterns/idempotency/platform/inbox/client-operation.policy.ts.tpl +17 -0
  331. package/templates/be/patterns/idempotency/platform/inbox/client-outcome-backfill.client.spec.ts.tpl +66 -0
  332. package/templates/be/patterns/idempotency/platform/inbox/client-outcome-backfill.client.ts.tpl +24 -0
  333. package/templates/be/patterns/idempotency/platform/inbox/delivery-claim-backfill.client.spec.ts.tpl +60 -0
  334. package/templates/be/patterns/idempotency/platform/inbox/delivery-claim-backfill.client.ts.tpl +12 -0
  335. package/templates/be/patterns/idempotency/platform/inbox/delivery-claim-release.client.spec.ts.tpl +49 -0
  336. package/templates/be/patterns/idempotency/platform/inbox/delivery-claim-release.client.ts.tpl +12 -0
  337. package/templates/be/patterns/idempotency/platform/inbox/effectful.decorators.ts.tpl +7 -0
  338. package/templates/be/patterns/idempotency/platform/inbox/errors/inbox.error.ts.tpl +22 -0
  339. package/templates/be/patterns/idempotency/platform/inbox/inbox.decorators.ts.tpl +17 -0
  340. package/templates/be/patterns/idempotency/platform/inbox/inbox.module-definition.ts.tpl +7 -0
  341. package/templates/be/patterns/idempotency/platform/inbox/inbox.module.ts.tpl +28 -0
  342. package/templates/be/patterns/idempotency/platform/inbox/inbox.options.ts.tpl +7 -0
  343. package/templates/be/patterns/idempotency/platform/inbox/inbox.port.ts.tpl +44 -0
  344. package/templates/be/patterns/idempotency/platform/inbox/inbox.service.spec.ts.tpl +388 -0
  345. package/templates/be/patterns/idempotency/platform/inbox/inbox.service.ts.tpl +77 -0
  346. package/templates/be/patterns/idempotency/platform/inbox/index.ts.tpl +10 -0
  347. package/templates/be/patterns/idempotency/platform/inbox/messages/inbox.messages.ts.tpl +15 -0
  348. package/templates/be/patterns/idempotency/platform/inbox/persistence/connection.ts.tpl +9 -0
  349. package/templates/be/patterns/idempotency/platform/inbox/persistence/entities/inbox-claim.entity.ts.tpl +25 -0
  350. package/templates/be/patterns/idempotency/platform/inbox/persistence/inbox.rows.ts.tpl +33 -0
  351. package/templates/be/patterns/idempotency/platform/inbox/persistence/inbox.sql.ts.tpl +39 -0
  352. package/templates/be/patterns/idempotency/platform/inbox/persistence/migrations/1789800005000-create-inbox-claims.ts.tpl +21 -0
  353. package/templates/be/patterns/idempotency/platform/inbox/persistence/migrations/1792800000000-client-operation-outcomes.ts.tpl +21 -0
  354. package/templates/be/patterns/idempotency/platform/inbox/request-fingerprint.policy.spec.ts.tpl +76 -0
  355. package/templates/be/patterns/idempotency/platform/inbox/request-fingerprint.policy.ts.tpl +36 -0
  356. package/templates/be/patterns/jobs/platform/fenced.processor.spec.ts.tpl +1 -0
  357. package/templates/be/patterns/jobs/platform/job-claim.service.spec.ts.tpl +4 -3
  358. package/templates/be/patterns/jobs/platform/job-claim.service.ts.tpl +2 -0
  359. package/templates/be/patterns/jobs/platform/job-runner.service.spec.ts.tpl +20 -2
  360. package/templates/be/patterns/jobs/platform/job-runner.service.ts.tpl +1 -0
  361. package/templates/be/patterns/jobs/platform/jobs.contracts.ts.tpl +4 -0
  362. package/templates/be/patterns/jobs/platform-lite/jobs.index.ts.tpl +10 -0
  363. package/templates/be/patterns/jobs/platform-lite/jobs.sql.tpl +44 -0
  364. package/templates/be/patterns/jobs/platform-lite/persistence.jobs.sql.ts.tpl +33 -0
  365. package/templates/be/patterns/queues/platform/bullmq-queue-transport.client.spec.ts.tpl +203 -18
  366. package/templates/be/patterns/queues/platform/bullmq-queue-transport.client.ts.tpl +78 -22
  367. package/templates/be/patterns/queues/platform/errors/queue.error.ts.tpl +19 -0
  368. package/templates/be/patterns/queues/platform/messages/queue.messages.ts.tpl +13 -0
  369. package/templates/be/patterns/queues/platform/persistence.migration.ts.tpl +1 -0
  370. package/templates/be/patterns/queues/platform/persistence.queue-outbox.entity.ts.tpl +4 -0
  371. package/templates/be/patterns/queues/platform/persistence.queue.rows.ts.tpl +2 -0
  372. package/templates/be/patterns/queues/platform/persistence.queue.sql.ts.tpl +4 -4
  373. package/templates/be/patterns/queues/platform/queue-outbox.service.spec.ts.tpl +14 -2
  374. package/templates/be/patterns/queues/platform/queue-outbox.service.ts.tpl +5 -2
  375. package/templates/be/patterns/queues/platform/queue-relay.service.spec.ts.tpl +72 -74
  376. package/templates/be/patterns/queues/platform/queue-relay.service.ts.tpl +1 -1
  377. package/templates/be/patterns/queues/platform/queue-transport.port.ts.tpl +23 -8
  378. package/templates/be/patterns/queues/platform/queue-worker.service.spec.ts.tpl +29 -8
  379. package/templates/be/patterns/queues/platform/queue-worker.service.ts.tpl +7 -3
  380. package/templates/be/patterns/queues/platform/queue.contracts.ts.tpl +5 -0
  381. package/templates/be/patterns/queues/platform/queue.index.ts.tpl +2 -0
  382. package/templates/be/patterns/queues/platform/queue.log-events.ts.tpl +4 -0
  383. package/templates/be/patterns/queues/platform/queue.module.ts.tpl +2 -1
  384. package/templates/be/patterns/queues/platform/queue.port.ts.tpl +1 -1
  385. package/templates/be/patterns/queues/platform-lite/bullmq-queue-transport.client.spec.ts.tpl +417 -0
  386. package/templates/be/patterns/queues/platform-lite/bullmq-queue-transport.client.ts.tpl +172 -0
  387. package/templates/be/patterns/queues/platform-lite/persistence.queue.sql.ts.tpl +12 -0
  388. package/templates/be/patterns/queues/platform-lite/queue-outbox.sql.tpl +32 -0
  389. package/templates/be/patterns/queues/platform-lite/queue-relay.service.spec.ts.tpl +148 -0
  390. package/templates/be/patterns/queues/platform-lite/queue-relay.service.ts.tpl +51 -0
  391. package/templates/be/patterns/queues/platform-lite/queue-transport.port.ts.tpl +163 -0
  392. package/templates/be/patterns/queues/platform-lite/queue.config.ts.tpl +17 -0
  393. package/templates/be/patterns/queues/platform-lite/queue.error.ts.tpl +25 -0
  394. package/templates/be/patterns/queues/platform-lite/queue.index.ts.tpl +8 -0
  395. package/templates/be/patterns/queues/platform-lite/queue.messages.ts.tpl +21 -0
  396. package/templates/be/patterns/queues/platform-lite/queue.module.ts.tpl +74 -0
  397. package/templates/be/patterns/queues/platform-lite/queue.options.ts.tpl +38 -0
  398. package/templates/be/patterns/queues/queue.queue.ts.tpl +2 -2
  399. package/templates/be/patterns/reactors/application.contracts.ts.tpl +2 -0
  400. package/templates/be/patterns/reactors/consumer.ts.tpl +5 -1
  401. package/templates/be/platform/graphql/graphql.contracts.ts +2 -1
  402. package/templates/be/platform/graphql/localize-errors.mapper.spec.ts +1 -1
  403. package/templates/be/skeleton/apps/__app__/src/compose/platform.ts +6 -1
  404. package/templates/be/skeleton/apps/__app__/src/main.ts +7 -4
  405. package/templates/be/skeleton/apps/cli/src/compose/platform.ts +4 -0
  406. package/templates/be/skeleton/apps/cli/src/main.ts +7 -4
  407. package/templates/be/skeleton/src/modules/platform/database/index.ts +1 -1
  408. package/templates/be/skeleton/src/modules/platform/http/errors/http.error.ts +22 -0
  409. package/templates/be/skeleton/src/modules/platform/http/fetch-http-client.client.spec.ts +235 -0
  410. package/templates/be/skeleton/src/modules/platform/http/fetch-http-client.client.ts +85 -0
  411. package/templates/be/skeleton/src/modules/platform/http/graphql-call.mapper.spec.ts +92 -0
  412. package/templates/be/skeleton/src/modules/platform/http/graphql-call.mapper.ts +52 -0
  413. package/templates/be/skeleton/src/modules/platform/http/http.decorators.ts +9 -0
  414. package/templates/be/skeleton/src/modules/platform/http/http.module-definition.ts +7 -0
  415. package/templates/be/skeleton/src/modules/platform/http/http.module.ts +19 -0
  416. package/templates/be/skeleton/src/modules/platform/http/http.options.ts +2 -0
  417. package/templates/be/skeleton/src/modules/platform/http/http.port.ts +40 -0
  418. package/templates/be/skeleton/src/modules/platform/http/index.ts +7 -0
  419. package/templates/be/skeleton/src/modules/platform/http/messages/http.messages.ts +15 -0
  420. package/templates/be/skeleton/src/modules/platform/ids/ids.decorators.ts +9 -0
  421. package/templates/be/skeleton/src/modules/platform/ids/ids.module-definition.ts +7 -0
  422. package/templates/be/skeleton/src/modules/platform/ids/ids.module.ts +19 -0
  423. package/templates/be/skeleton/src/modules/platform/ids/ids.options.ts +2 -0
  424. package/templates/be/skeleton/src/modules/platform/ids/ids.port.ts +5 -0
  425. package/templates/be/skeleton/src/modules/platform/ids/index.ts +4 -0
  426. package/templates/be/skeleton/src/modules/platform/ids/system-ids.service.spec.ts +15 -0
  427. package/templates/be/skeleton/src/modules/platform/ids/system-ids.service.ts +10 -0
  428. package/templates/be/skeleton/src/modules/platform/logging/correlation-request.policy.spec.ts +59 -0
  429. package/templates/be/skeleton/src/modules/platform/logging/correlation-request.policy.ts +21 -0
  430. package/templates/be/skeleton/src/modules/platform/logging/correlation.contracts.ts +16 -0
  431. package/templates/be/skeleton/src/modules/platform/logging/correlation.policy.spec.ts +150 -0
  432. package/templates/be/skeleton/src/modules/platform/logging/correlation.policy.ts +42 -0
  433. package/templates/be/skeleton/src/modules/platform/logging/correlation.port.ts +15 -0
  434. package/templates/be/skeleton/src/modules/platform/logging/correlation.service.spec.ts +23 -0
  435. package/templates/be/skeleton/src/modules/platform/logging/correlation.service.ts +28 -0
  436. package/templates/be/skeleton/src/modules/platform/logging/index.ts +14 -1
  437. package/templates/be/skeleton/src/modules/platform/logging/json-logger.service.spec.ts +39 -6
  438. package/templates/be/skeleton/src/modules/platform/logging/json-logger.service.ts +15 -3
  439. package/templates/be/skeleton/src/modules/platform/logging/logging.decorators.ts +17 -2
  440. package/templates/be/skeleton/src/modules/platform/logging/logging.log-events.ts +13 -1
  441. package/templates/be/skeleton/src/modules/platform/logging/logging.module.ts +13 -3
  442. package/templates/be/skeleton/src/modules/platform/logging/nest-logger.service.spec.ts +69 -0
  443. package/templates/be/skeleton/src/modules/platform/logging/nest-logger.service.ts +48 -0
  444. package/templates/be/skeleton/src/modules/platform/primitives/index.ts +1 -0
  445. package/templates/be/skeleton/src/modules/platform/primitives/record.policy.spec.ts +12 -0
  446. package/templates/be/skeleton/src/modules/platform/primitives/record.policy.ts +3 -0
  447. package/templates/be/skeleton-lite/apps/api/src/compose/platform.ts +6 -1
  448. package/templates/be/skeleton-lite/apps/cli/src/compose/platform.ts +4 -0
  449. package/templates/be/skeleton-lite/src/modules/platform/database/index.ts +1 -0
  450. package/templates/be/skeleton-lite/src/modules/platform/logging/index.ts +14 -1
  451. package/templates/be/skeleton-lite/src/modules/platform/logging/logging.log-events.ts +12 -0
  452. package/templates/be/skeleton-lite/src/modules/platform/primitives/index.ts +2 -0
  453. package/templates/be/test-world/world/test-apps.options.ts.tpl +2 -0
  454. package/templates/be/test-world/world/test-world.config.ts.tpl +1 -0
  455. package/upgrade/check.mjs +12 -135
  456. package/upgrade/file-state.mjs +1 -16
  457. package/upgrade/index.mjs +34 -361
  458. package/runtime/scripts/lib/check-code-loosening.mjs +0 -128
  459. package/runtime/scripts/lib/gate-loosening.mjs +0 -292
  460. package/templates/app/upgrade-full/.starcistacks/application-stacks.yaml +0 -89
  461. package/templates/app/upgrade-full/.starcistacks/dev/README.md +0 -16
  462. package/templates/app/upgrade-full/.starcistacks/dev/infra/compose/api.yaml +0 -13
  463. package/templates/app/upgrade-full/.starcistacks/dev/infra/compose/compose.yaml +0 -3
  464. package/templates/app/upgrade-full/.starcistacks/dev/infra/compose/postgres.yaml +0 -12
  465. package/templates/app/upgrade-full/.starcistacks/dev/infra/metadata.json +0 -7
  466. package/templates/be/skeleton-lite/apps/api/src/main.ts +0 -26
  467. package/templates/be/upgrade-full/apps/cli/src/app.module.ts +0 -12
  468. package/templates/be/upgrade-full/apps/cli/src/cli.env.ts +0 -7
  469. package/templates/be/upgrade-full/apps/cli/src/compose/cli.ts +0 -5
  470. package/templates/be/upgrade-full/apps/cli/src/compose/platform.ts +0 -9
  471. package/templates/be/upgrade-full/apps/cli/src/main.ts +0 -29
  472. package/templates/be/upgrade-full/src/features/cli/cli.module.ts +0 -7
  473. package/templates/be/upgrade-full/src/features/cli/migrate/subs/run.cli.ts +0 -23
@@ -914,7 +914,7 @@ BE_KIND_ISOLATION:
914
914
  BE_LITE_PROOF_LANE_MISSING:
915
915
  title: "A lite back end declares a pattern without an integration proof lane"
916
916
  title_vi: "Back end lite khai báo pattern nhưng thiếu nhánh kiểm thử integration"
917
- meaning_vi: "Ứng dụng lite khai báo event-bus, queue, webhooks, realtime, fenced-job, projection hoặc saga nhưng không có spec integration để chứng minh hành vi của pattern."
917
+ meaning_vi: "Ứng dụng lite khai báo event-bus, queue, webhooks, realtime, fenced-job, projection, saga hoặc idempotency nhưng không có spec integration để chứng minh hành vi của pattern."
918
918
  causes_vi:
919
919
  - "Vi phạm luật R284: chỉ có unit spec, spec e2e hoặc contract, hoặc chưa có spec dưới src/tests/integration."
920
920
  nextStep_vi: "Thêm spec integration dưới src/tests/integration với test chạy được mang tiêu đề `<pattern>/<kịch bản>: ...` cho từng kịch bản bắt buộc của pattern đã khai báo."
@@ -1024,16 +1024,29 @@ BE_MODULE_SHAPE:
1024
1024
  owner: op-retry
1025
1025
  kind: check-finding
1026
1026
 
1027
+ BE_MUTATION_IDEMPOTENT:
1028
+ title: "Effectful client command lacks transaction-owned idempotency"
1029
+ title_vi: "Lệnh có tác dụng phụ thiếu khóa chống lặp trong giao dịch"
1030
+ meaning_vi: "Lệnh được đánh dấu Effectful thiếu idempotencyKey bắt buộc, đầu vào không kiểm tra giới hạn khóa, hoặc đường gọi từ handler đến miền không trả về Inbox.runClient trong giao dịch EntityManager của miền."
1031
+ causes_vi:
1032
+ - "Không khai báo pattern idempotency nên thiếu kiểm chứng kịch bản chống lặp"
1033
+ - "Khóa tùy chọn hoặc không được kiểm tra ở cửa vào"
1034
+ - "Dịch vụ gọi runClient ngoài giao dịch hoặc truyền manager dùng chung"
1035
+ - "Handler bỏ khóa khi chuyển yêu cầu vào miền"
1036
+ nextStep_vi: "Khai báo pattern idempotency, giữ khóa bắt buộc đã được kiểm tra, chuyển nguyên khóa vào miền, trả về giao dịch miền và runClient với manager của callback; không tắt luật."
1037
+ owner: op-retry
1038
+ kind: check-finding
1039
+
1027
1040
  BE_OPERATION_CONTRACT:
1028
1041
  title: "A versioned operation has no typed contract"
1029
1042
  title_vi: "Thao tác có phiên bản không có hợp đồng kiểu"
1030
- meaning_vi: "Mỗi thao tác `<tên>@<phiên bản>` của một app được khai báo đúng một lần trong bảng thao tác có kiểu `apps/<app>/src/operations.ts` (`OperationContract<Input, Output, RefusalCode>` đăng ký bằng `defineOperations`). Bộ kiểm tra thấy đầu vào hoặc đầu ra là `any`, `unknown`, `Record<string, unknown>`, kiểu generic chưa gán, hàm hoặc `Date`; mã từ chối không phải hợp các chuỗi literal đóng; hoặc route phục vụ bảng không nhận `OperationRequest<Table>` và trả `Promise<OperationReply<Table>>` của cùng một bảng, hoặc body của route chưa gắn `OperationValidationService` nên pipe toàn cục không có lớp nào để kiểm."
1043
+ meaning_vi: "Mỗi thao tác `<tên>@<phiên bản>` của một app được khai báo đúng một lần trong bảng thao tác có kiểu `apps/<app>/src/operations.ts` (`OperationContract<Input, Output, RefusalCode>` đăng ký bằng `defineOperations`), với schema zod có chặn trên cho đầu vào và đầu ra, xuất từ tệp `*.schema.ts` của chính chủ sở hữu (R304 và R305). Bộ kiểm tra thấy một mục thiếu schema có tên, hoặc kiểu suy ra là `any`, `unknown`, `Record<string, unknown>`, kiểu generic chưa gán, hàm hoặc `Date`; mã từ chối không phải hợp các chuỗi literal đóng; hoặc route phục vụ bảng không nhận `OperationRequest<Table>` và trả `Promise<OperationReply<Table>>` của cùng một bảng, hoặc body của route chưa gắn `OperationValidationPolicy` dựng từ đúng bảng đó nên pipe toàn cục không có lớp nào để kiểm."
1031
1044
  causes_vi:
1032
1045
  - "Đầu vào hoặc kết quả của thao tác khai báo là `unknown` nên client phải tự gõ kiểu tay"
1033
1046
  - "Mã từ chối khai báo là `string` thay vì hợp các literal như `\"DENIED\" | \"INVALID\"`"
1034
1047
  - "Route nhận `@Body() body: unknown` hoặc chỉ dùng một nửa `OperationRequest` / `OperationReply`"
1035
- - "Body của route chỉ gõ bằng `OperationRequest<Table>` mà không có `@Body(new OperationValidationService(RequestClass))`, nên không ai kiểm giá trị lúc chạy"
1036
- nextStep_vi: "Khai báo kiểu có tên, đóng cho đầu vào và đầu ra của từng thao tác, liệt kê mã từ chối bằng hợp literal, và cho route nhận `@Body(new OperationValidationService(RequestClass)) request: OperationRequest<typeof OPERATIONS>` và trả `Promise<OperationReply<typeof OPERATIONS>>`; chạy `starci app emit` để sinh `contracts/<app>/openapi.json`. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra và mục BE-OPERATIONS-1; không thêm ngoại lệ, không tắt luật."
1048
+ - "Body của route chỉ gõ bằng `OperationRequest<Table>` mà không có `@Body(new OperationValidationPolicy(OPERATIONS))` của cùng bảng, nên không ai kiểm giá trị lúc chạy"
1049
+ nextStep_vi: "Khai báo schema zod có tên và có chặn trên cho đầu vào và đầu ra của từng thao tác trong tệp `*.schema.ts`, liệt kê mã từ chối bằng hợp literal, và cho route nhận `@Body(new OperationValidationPolicy(OPERATIONS)) request: OperationRequest<typeof OPERATIONS>` và trả `Promise<OperationReply<typeof OPERATIONS>>`; chạy `starci app emit` để sinh `contracts/<app>/openapi.json`. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra và mục BE-OPERATIONS-1; không thêm ngoại lệ, không tắt luật."
1037
1050
  owner: op-retry
1038
1051
  kind: check-finding
1039
1052
 
@@ -1654,6 +1667,17 @@ BE_UNNAMED_DATA_ACCESS:
1654
1667
  owner: op-retry
1655
1668
  kind: check-finding
1656
1669
 
1670
+ BE_UPLOAD_BUFFERED:
1671
+ title: "File upload buffering belongs in object storage"
1672
+ title_vi: "Tệp tải lên phải đi thẳng đến kho đối tượng"
1673
+ meaning_vi: "API nhập decorator hoặc middleware nhận tệp multipart thay vì chỉ cấp yêu cầu lưu trữ có chữ ký. Tệp phải đi từ trình duyệt đến kho đối tượng; API xác thực người dùng và khóa đối tượng rồi cấp quyền ngắn hạn với giới hạn loại nội dung và kích thước do nhà cung cấp thực thi."
1674
+ causes_vi:
1675
+ - "Dùng UploadedFile, UploadedFiles hoặc interceptor Multer trong API"
1676
+ - "Nhập thư viện nhận tệp multipart để đệm tệp qua API"
1677
+ nextStep_vi: "Dùng thao tác GraphQL để cấp yêu cầu lưu trữ có chữ ký, ràng buộc người dùng, khóa, thời hạn, loại nội dung và số byte; trình duyệt gửi trực tiếp đến kho."
1678
+ owner: op-retry
1679
+ kind: check-finding
1680
+
1657
1681
  BE_USER_COPY_LITERAL:
1658
1682
  title: "User-facing copy written in source"
1659
1683
  title_vi: "Chữ hiển thị cho người dùng viết thẳng trong mã nguồn"
@@ -1840,12 +1864,13 @@ DB_CONFIG_POLICY:
1840
1864
  kind: check-finding
1841
1865
 
1842
1866
  DB_CRON_OWNED:
1843
- title: "A uniquely owned migration cron job only enqueues to a declared queue"
1867
+ title: "A uniquely owned migration cron job only enqueues through the queue outbox"
1844
1868
  title_vi: "Lịch pg_cron thiếu chủ sở hữu hoặc thực hiện nghiệp vụ"
1845
- meaning_vi: "Tên lịch bị trùng, đích hàng đợi hoặc hàm tick không tồn tại, lệnh thực hiện DML nghiệp vụ hay HTTP, hoặc cùng tick còn được lập lịch ở ứng dụng."
1869
+ meaning_vi: "Tên lịch bị trùng, hằng hàng đợi hoặc hàm tick không tồn tại, lệnh thực hiện DML nghiệp vụ hay HTTP thay vì chỉ chèn một dòng của hằng hàng đợi vào bảng outbox của ruleParams.db.queueOutbox (chỉ các cột đã khai báo), lịch đang chạy vẫn gọi pgmq.send, hoặc cùng tick còn được lập lịch ở ứng dụng."
1846
1870
  causes_vi:
1847
- - "Vi phạm R258: pg_cron chỉ đưa việc vào hàng đợi, mỗi tick có đúng một nơi lập lịch và được hủy lịch khi loại bỏ."
1848
- nextStep_vi: "Đặt lịch trong migration với tên duy nhất, dùng pgmq.send hoặc một hàm *_tick chỉ enqueue, bỏ lịch trùng và gọi cron.unschedule khi xóa tick."
1871
+ - "Vi phạm R258: pg_cron chỉ đưa việc vào hàng đợi qua outbox, mỗi tick có đúng một nơi lập lịch và được hủy lịch khi loại bỏ."
1872
+ - "Lịch đang chạy (hoặc tick hiện tại của nó) vẫn gửi bằng pgmq.send; pgmq.send chỉ hợp lệ trong thân gốc của lịch cũ."
1873
+ nextStep_vi: "Đặt lịch trong migration với tên duy nhất, chèn đúng một dòng của hằng hàng đợi vào outbox hàng đợi (trực tiếp hoặc qua một hàm *_tick chỉ làm việc đó), bỏ lịch trùng và gọi cron.unschedule khi xóa tick."
1849
1874
  owner: op-retry
1850
1875
  kind: check-finding
1851
1876
 
@@ -1920,12 +1945,14 @@ DB_MIGRATION_SHAPE:
1920
1945
  kind: check-finding
1921
1946
 
1922
1947
  DB_PGMQ_DECLARED:
1923
- title: "Queue constants, migration-created pgmq queues and queue grants must agree"
1924
- title_vi: "Khai báo hàng đợi pgmq lệch migration"
1925
- meaning_vi: "Hằng hàng đợi không có pgmq.create trong migration đang hoạt động, hàng đợi đã tạo không có hằng khai báo, hoặc quyền trên đối tượng pgmq vượt vai trò ứng dụng."
1948
+ title: "A queue constant keeps a pgmq queue, a pgmq queue has no event-bus owner, or a pgmq object is declared or granted unsafely"
1949
+ title_vi: "Hằng hàng đợi còn hàng đợi pgmq, hàng đợi pgmq không có chủ event-bus, hoặc đối tượng pgmq khai báo hay cấp quyền sai"
1950
+ meaning_vi: "Hàng đợi là BullMQ trên Redis (ruling:R212/case-10), nhưng các migration đang hoạt động vẫn để lại một hàng đợi pgmq trùng tên một hằng hàng đợi trong modules/queues, hoặc một hàng đợi pgmq không được hằng literal *_TOPIC_QUEUE nào trong platform/event-bus đặt tên (hay một hằng như vậy không có hàng đợi pgmq); hoặc pgmq.create không có tên literal trong migration, tên hằng không phải literal, hay quyền trên đối tượng pgmq vượt vai trò ứng dụng."
1926
1951
  causes_vi:
1927
- - "Vi phạm R258: mã nguồn, migration và quyền truy cập không khai báo cùng hàng đợi."
1928
- nextStep_vi: "Đối chiếu hằng hàng đợi với pgmq.create và chỉ cấp quyền trên q_<queue>, a_<queue> cho vai trò ứng dụng."
1952
+ - "Vi phạm R258: hàng đợi của app vẫn chạy trên Supabase Queues (pgmq) thay vì BullMQ trên Redis."
1953
+ - "Một hàng đợi pgmq bị bỏ lại hoặc đổi tên mà không có chủ event-bus."
1954
+ - "Migration, mã nguồn hoặc quyền truy cập khai báo đối tượng pgmq ngoài migration tĩnh hoặc cho vai trò khác vai trò ứng dụng."
1955
+ nextStep_vi: "Chuyển hàng đợi sang BullMQ trên Redis đã khai báo, rồi xóa hàng đợi pgmq bằng pgmq.drop_queue trong một migration mới; hàng đợi topic của event bus được đặt tên bằng một hằng literal *_TOPIC_QUEUE trong platform/event-bus; chỉ cấp quyền trên q_<queue>, a_<queue> cho vai trò ứng dụng."
1929
1956
  owner: op-retry
1930
1957
  kind: check-finding
1931
1958
 
@@ -2097,6 +2124,26 @@ FE_APP_ISOLATION:
2097
2124
  owner: op-retry
2098
2125
  kind: check-finding
2099
2126
 
2127
+ FE_APP_SHELL_BOTTOM_TABS:
2128
+ title: "The application shell has a bottom tab bar"
2129
+ title_vi: "Khung ứng dụng có thanh tab dưới"
2130
+ meaning_vi: "Khung ứng dụng tại <file> đặt điều hướng trong thanh tab dưới thay vì Sidebar drawer."
2131
+ causes_vi:
2132
+ - "Cấu trúc shell không theo canon ứng dụng."
2133
+ nextStep_vi: "Dùng hàng mở drawer bên dưới navbar và Sidebar presentation=\"drawer\"."
2134
+ owner: op-retry
2135
+ kind: check-finding
2136
+
2137
+ FE_APP_SHELL_FRAME:
2138
+ title: "The application frame is not a fixed WorkspaceShell"
2139
+ title_vi: "Khung ứng dụng không dùng WorkspaceShell cố định"
2140
+ meaning_vi: "Khung ứng dụng tại <file> không giao bố cục và cuộn cho WorkspaceShell."
2141
+ causes_vi:
2142
+ - "Cấu trúc shell không theo canon ứng dụng."
2143
+ nextStep_vi: "Ghép khung ứng dụng bằng WorkspaceShell viewport=\"fixed\"."
2144
+ owner: op-retry
2145
+ kind: check-finding
2146
+
2100
2147
  FE_BLOCK_PRODUCT_HOOK_DEFINITION:
2101
2148
  title: "Block defines a product hook"
2102
2149
  title_vi: "Khối giao diện tự định nghĩa hook sản phẩm"
@@ -2424,6 +2471,17 @@ FE_LIST_KEY:
2424
2471
  owner: op-retry
2425
2472
  kind: check-finding
2426
2473
 
2474
+ FE_LIST_PANEL_PADDING:
2475
+ title: "Panel list wrapper stacks horizontal content padding"
2476
+ title_vi: "Phần tử bọc danh sách trong panel cộng dồn padding ngang"
2477
+ meaning_vi: "Ứng dụng thêm px-*, ps-* hoặc pe-* vào phần tử bọc ListBox của Grammar hoặc nhãn nhóm, khiến nội dung lệch khỏi mép panel."
2478
+ causes_vi:
2479
+ - "Bọc ListBox bằng phần tử có padding ngang"
2480
+ - "Thêm padding ngang quanh nhãn nhóm của danh sách"
2481
+ nextStep_vi: "Bỏ padding của phần tử bọc và dùng ListBox inset=\"panel\" để các hàng và nhãn nhóm thẳng mép nội dung của panel."
2482
+ owner: "op-retry"
2483
+ kind: "check-finding"
2484
+
2427
2485
  FE_NATIVE_FORM_CONTROL:
2428
2486
  title: "No raw form controls, native images or raw structural tags in product tiers; the grammar renders them"
2429
2487
  title_vi: "Control form thô"
@@ -2444,6 +2502,47 @@ FE_NATIVE_IMAGE:
2444
2502
  owner: op-retry
2445
2503
  kind: check-finding
2446
2504
 
2505
+ FE_NAVBAR_CLUSTER:
2506
+ title: "The navbar right cluster has the wrong kinds or order"
2507
+ title_vi: "Cụm bên phải navbar sai loại hoặc thứ tự"
2508
+ meaning_vi: "Cụm navbar tại <file> không giữ thứ tự ngôn ngữ, giao diện, thông báo và tài khoản."
2509
+ causes_vi:
2510
+ - "Cấu trúc shell không theo canon ứng dụng."
2511
+ nextStep_vi: "Ghép IconButton ngôn ngữ, Switch giao diện, IconButton chuông và AvatarButton theo đúng thứ tự."
2512
+ owner: op-retry
2513
+ kind: check-finding
2514
+
2515
+ FE_NAVBAR_CONTROL_SIZE:
2516
+ title: "A navbar control does not use the control size"
2517
+ title_vi: "Điều khiển navbar không dùng cỡ control"
2518
+ meaning_vi: "Điều khiển trong navbar tại <file> không khai báo cùng cỡ control của Grammar."
2519
+ causes_vi:
2520
+ - "Cấu trúc shell không theo canon ứng dụng."
2521
+ nextStep_vi: "Đặt size=\"control\" trên từng điều khiển trong thanh."
2522
+ owner: op-retry
2523
+ kind: check-finding
2524
+
2525
+ FE_NAVBAR_CREATE:
2526
+ title: "A create action is placed in the navbar"
2527
+ title_vi: "Thao tác tạo mới nằm trong navbar"
2528
+ meaning_vi: "Navbar tại <file> chứa thao tác tạo mới thuộc nội dung trang."
2529
+ causes_vi:
2530
+ - "Cấu trúc shell không theo canon ứng dụng."
2531
+ nextStep_vi: "Đưa thao tác tạo mới về trang sở hữu nó."
2532
+ owner: op-retry
2533
+ kind: check-finding
2534
+
2535
+ FE_NESTED_VARIANT:
2536
+ title: "Nested control or surface paint bypasses Grammar ownership"
2537
+ title_vi: "Trường lồng hoặc nền surface vượt quyền sở hữu của Grammar"
2538
+ meaning_vi: "Trường bên trong surface Grammar ép variant primary, hoặc ứng dụng tự tô nền bằng bg-surface thay vì dùng composition của Grammar."
2539
+ causes_vi:
2540
+ - "Truyền variant primary cho trường bên trong một surface"
2541
+ - "Thêm lớp bg-surface vào phần tử do ứng dụng dựng"
2542
+ nextStep_vi: "Dùng surface của Grammar và bỏ variant của trường lồng bên trong để Grammar tự cấp secondary."
2543
+ owner: "op-retry"
2544
+ kind: "check-finding"
2545
+
2447
2546
  FE_NEXT_CONVENTIONS:
2448
2547
  title: "A Next convention of HFS is broken"
2449
2548
  title_vi: "Vi phạm quy ước Next của HFS"
@@ -2757,22 +2856,22 @@ FE_STACK_CORE_MISSING:
2757
2856
  kind: check-finding
2758
2857
 
2759
2858
  FE_STACK_FORBIDDEN:
2760
- title: "A front end depends on or imports a package that knowledge/hfs/fe-stack.yaml forbids"
2761
- title_vi: "Front end dùng thư viện bị fe-stack cấm"
2762
- meaning_vi: "`<path>` khai báo phụ thuộc hoặc import `<package>`, thư viện nằm trong `forbids` của concern `<concern>` trong knowledge/hfs/fe-stack.yaml; mỗi concern chỉ có một thư viện chuẩn."
2859
+ title: "A front end declares or imports a package or scoped package family forbidden by the stack"
2860
+ title_vi: "Front end dùng thư viện hoặc họ package bị fe-stack cấm"
2861
+ meaning_vi: "`<path>` khai báo hoặc import `<package>` thuộc `forbids` của concern `<concern>` trong knowledge/hfs/fe-stack.yaml; danh sách có thể cấm cả họ package theo scope."
2763
2862
  causes_vi:
2764
- - "Vi phạm luật R244: front end dùng đúng thư viện chuẩn của từng concern trong fe-stack.yaml (phiên bản ở canon-pins.yaml), không cài thư viện thay thế bên cạnh."
2765
- nextStep_vi: "Gỡ `<package>` khỏi package.json và thay import bằng thư viện chuẩn của concern đó; nếu cần một concern mới, thêm nó vào fe-stack.yaml và canon-pins.yaml trước."
2863
+ - "Vi phạm R244: app dùng thư viện thay thế hoặc tự import phụ thuộc do Grammar sở hữu, như @dicebear/*."
2864
+ nextStep_vi: "Gỡ dependency và import bị cấm, dùng thư viện chuẩn của concern. Với @dicebear/*, truyền id định danh qua prop seed trên Grammar Avatar, AvatarButton hoặc từng thành viên AvatarGroup; Grammar giữ các dependency DiceBear và vẽ avatar."
2766
2865
  owner: op-retry
2767
2866
  kind: check-finding
2768
2867
 
2769
2868
  FE_STACK_UNLISTED:
2770
- title: "A front-end dependency is absent from the stack catalog"
2771
- title_vi: "Thư viện front end chưa được khai báo trong danh mục"
2772
- meaning_vi: "Một package.json của front end khai báo thư viện không có trong knowledge/hfs/fe-stack.yaml và không có ngoại lệ fe.extraPackages kèm lý do trong hfs.json."
2869
+ title: "A direct front-end dependency is absent from the stack catalog"
2870
+ title_vi: "Phụ thuộc trực tiếp của front end chưa có trong danh mục"
2871
+ meaning_vi: "Manifest của workspace front end khai báo trực tiếp thư viện không có trong knowledge/hfs/fe-stack.yaml và không có fe.extraPackages kèm lý do trong hfs.json. Phụ thuộc runtime được package Grammar đã có trong danh mục mang theo không phải khai báo của app và không gây mã lỗi này."
2773
2872
  causes_vi:
2774
- - "Thêm thư viện ngoài danh mục mà chưa ghi rõ tên và lý do sử dụng."
2775
- nextStep_vi: "Dùng thư viện chuẩn của concern hoặc khai báo tên và lý do cụ thể trong fe.extraPackages của hfs.json."
2873
+ - "Thêm phụ thuộc trực tiếp ngoài danh mục mà chưa ghi rõ tên và lý do sử dụng."
2874
+ nextStep_vi: "Dùng thư viện chuẩn hoặc khai báo tên và lý do trong fe.extraPackages. Dependency bị cấm vẫn gây FE_STACK_FORBIDDEN; với @dicebear/*, dùng prop seed trên Grammar Avatar, AvatarButton hoặc thành viên AvatarGroup và gỡ dependency trực tiếp."
2776
2875
  owner: op-retry
2777
2876
  kind: check-finding
2778
2877
 
@@ -2813,6 +2912,17 @@ FE_STYLE_TOKEN_ONLY:
2813
2912
  owner: other-op:interface.implement
2814
2913
  kind: check-finding
2815
2914
 
2915
+ FE_SUBSCRIPTION_NO_SNAPSHOT:
2916
+ title: "A subscription hook does not revalidate its snapshot when the stream opens"
2917
+ title_vi: "Hook đăng ký không đọc lại ảnh chụp trạng thái khi luồng mở"
2918
+ meaning_vi: "Tệp <file> gọi operation luồng (SSE hoặc GraphQL subscription) mà không truyền onOpen để đọc lại truy vấn trạng thái; luồng chỉ mang thay đổi, không mang trạng thái, nên màn hình lỡ các thay đổi trong lúc mất kết nối."
2919
+ causes_vi:
2920
+ - "Lời gọi operation luồng không có onOpen"
2921
+ - "onOpen rỗng nên truy vấn trạng thái không được đọc lại"
2922
+ nextStep_vi: "Truyền onOpen: () => void mutate(<khóa truy vấn trạng thái>) cho operation luồng trong hook useSubscribe."
2923
+ owner: op-retry
2924
+ kind: check-finding
2925
+
2816
2926
  FE_SUPABASE_CLIENT_OWNER:
2817
2927
  title: "A front-end Supabase import or call is outside `fe.modules.auth`, or reaches past the auth API"
2818
2928
  title_vi: "Supabase phía front end ngoài modules/auth hoặc dùng ngoài API auth"
@@ -3067,6 +3177,28 @@ HFS_AUDIT_STEP_MISSING:
3067
3177
  owner: op-retry
3068
3178
  kind: check-finding
3069
3179
 
3180
+ HFS_BACKING_UNDECLARED:
3181
+ title: "A lite app uses undeclared Redis or full-only Qdrant instead of Supabase pgvector"
3182
+ title_vi: "App lite dùng Redis chưa khai báo hoặc Qdrant chỉ thuộc full thay cho Supabase pgvector"
3183
+ meaning_vi: "package.json có client Redis hoặc hfs.json khai pattern cần Redis (queue, fenced-job) nhưng sides.be.backing chưa khai redis, hoặc app lite dùng client Qdrant. Lite chỉ cho phép khai redis; vector nằm trong Supabase pgvector (owner:lite-vector-is-pgvector). Full giữ Qdrant khi được khai báo."
3184
+ causes_vi:
3185
+ - "Thêm client Redis mà chưa khai redis, hoặc thêm client Qdrant vào lite dù có khai báo"
3186
+ - "Khai pattern queue hoặc fenced-job mà chưa khai báo redis"
3187
+ nextStep_vi: "Khai redis cho năng lực cần nó hoặc gỡ client hay pattern; thay Qdrant bằng Supabase pgvector trong lite. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra; không cần ai can thiệp thêm."
3188
+ owner: op-retry
3189
+ kind: check-finding
3190
+
3191
+ HFS_BACKING_UNUSED:
3192
+ title: "A lite app declares Redis without a consuming client"
3193
+ title_vi: "App lite khai Redis nhưng không có client sử dụng"
3194
+ meaning_vi: "hfs.json sides.be.backing của lite khai redis nhưng package.json không có client Redis, nên stack sẽ chạy dịch vụ không có người dùng. Lite chỉ cho phép khai redis; vector dùng Supabase pgvector (owner:lite-vector-is-pgvector)."
3195
+ causes_vi:
3196
+ - "Năng lực cần dịch vụ đã bị gỡ nhưng khai báo vẫn còn"
3197
+ - "Khai báo dịch vụ trước khi thêm thư viện client"
3198
+ nextStep_vi: "Gỡ dịch vụ khỏi sides.be.backing, hoặc thêm năng lực và thư viện client cần nó. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra; không cần ai can thiệp thêm."
3199
+ owner: op-retry
3200
+ kind: check-finding
3201
+
3070
3202
  HFS_BYPASS_MARKER:
3071
3203
  title: "A product repository holds no bypass of a check"
3072
3204
  title_vi: "Kho có đoạn bỏ qua một bước kiểm tra"
@@ -3388,7 +3520,7 @@ HFS_EDITION_FORBIDDEN_PRESENT:
3388
3520
  - "package.json còn script test*, typecheck:tests hoặc dependency jest/vitest/playwright"
3389
3521
  - "Tệp cấu hình công cụ kiểm thử không ô nào cấm riêng vẫn nằm trong cây"
3390
3522
  - "hfs.json khai ứng dụng worker, một pattern sự kiện hoặc một loại trigger mà lite đã bỏ"
3391
- nextStep_vi: "Xoá phần thuộc ấn bản full (không có gì thay thế trong lite), hoặc nâng kho lên edition full khi nội dung này là thật. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra; không cần ai can thiệp thêm."
3523
+ nextStep_vi: "Xoá phần thuộc ấn bản full (không có gì thay thế trong lite). Ấn bản được chọn một lần lúc scaffold và không có lối nâng lite lên full: khi sản phẩm cần nội dung này, dựng một ứng dụng full mới rồi chuyển mã sản phẩm sang. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra; không cần ai can thiệp thêm."
3392
3524
  owner: op-retry
3393
3525
  kind: check-finding
3394
3526
 
@@ -3398,6 +3530,7 @@ HFS_EDITION_INVALID:
3398
3530
  meaning_vi: "Trường edition của hfs.json chỉ nhận một giá trị thuộc danh sách editions của bảng kê ô (full, lite); vắng mặt nghĩa là full. Một giá trị khác là lỗi khai báo, kiểm tra bị từ chối."
3399
3531
  causes_vi:
3400
3532
  - "hfs.json ghi edition với giá trị ngoài full/lite (gõ sai, hoặc một ấn bản bảng kê không biết)"
3533
+ - "`starci app check --edition <ấn bản>` hoặc `starci app upgrade --edition <ấn bản>` chọn ấn bản khác với ấn bản hfs.json khai: ấn bản cố định từ lúc scaffold"
3401
3534
  nextStep_vi: "Sửa edition thành một giá trị trong danh sách editions của bảng kê, hoặc bỏ trường để về full. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra; không cần ai can thiệp thêm."
3402
3535
  owner: op-retry
3403
3536
  kind: check-finding
@@ -3546,7 +3679,7 @@ HFS_HOST_CRON:
3546
3679
  meaning_vi: "Tệp triển khai hoặc script tại <path> khai báo crontab, cron.d, systemd timer, @reboot hoặc at; lịch chạy phải do ứng dụng sở hữu."
3547
3680
  causes_vi:
3548
3681
  - "Vi phạm R250: cài lịch chạy ngoài scheduler của ứng dụng hoặc replicated-job đã khai báo."
3549
- nextStep_vi: "Chuyển tác vụ sang scheduler của back end, pgmq/pg_cron hoặc replicated-job đã khai báo và gọi lệnh CLI của ứng dụng."
3682
+ nextStep_vi: "Chuyển tác vụ sang scheduler hàng đợi của back end, một tick pg_cron enqueue qua outbox hàng đợi hoặc replicated-job đã khai báo và gọi lệnh CLI của ứng dụng."
3550
3683
  owner: op-retry
3551
3684
  kind: check-finding
3552
3685
 
@@ -4139,12 +4272,13 @@ HFS_STACKS_IN_SIDE:
4139
4272
  kind: check-finding
4140
4273
 
4141
4274
  HFS_STACKS_SHAPE:
4142
- title: "`.starcistacks` has the standard shape and the host Sonar owner"
4143
- title_vi: "Hình dạng .starcistacks sai"
4144
- meaning_vi: "`.starcistacks` có `<path>` ngoài hình dạng chuẩn (danh sách allows của slot app.starcistacks, gồm cả infra/metadata.json) (hoặc còn trỏ `.stacks`)."
4275
+ title: "`.starcistacks` violates the edition layout or Docker deployment requirements"
4276
+ title_vi: "Hình dạng hoặc runtime .starcistacks sai"
4277
+ meaning_vi: "Cây .starcistacks không khớp slot app.starcistacks, hoặc khai báo và mô hình Docker không nhất quán. Mọi dependency trong dev phải có container Docker Linux; Supabase dùng CLI cục bộ. Trong production, app và dependency dùng Swarm, trừ Supabase là dịch vụ hosted. Chỉ Supabase được khai trong backing; dependency khác phải là component Docker."
4145
4278
  causes_vi:
4146
- - "Vi phạm luật R10: `.starcistacks/<env>/` chỉ có `README.md`, `environment.json`, `infra/{compose,k8s,terraform}`, `runtime/{config,env}`, `secrets/`, `seeds/`; khối sonar là `owner: host` trỏ `.claude/ext/sonar`; không còn gốc `.stacks`."
4147
- nextStep_vi: "Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra (nợ hàng loạt có codemod của HFS); không cần ai can thiệp thêm."
4279
+ - "Vi phạm R10 về cây theo edition, Sonar thuộc host hoặc runtime Swarm."
4280
+ - "Dependency đã chọn thiếu container trong mô hình, khai platform Windows hoặc dùng backing hosted khác Supabase (owner:dev-docker-prod-swarm)."
4281
+ nextStep_vi: "Sửa cây theo slot app.starcistacks và khai dependency dưới components với bằng chứng Docker Linux; giữ Supabase CLI trong dev và hosted trong production. App có thể chạy native trong profile dev đã khai báo; dependency vẫn nằm trong Docker. Op vừa tạo ra bản này sẽ được chạy lại để sửa theo lời nhắn của bộ kiểm tra."
4148
4282
  owner: op-retry
4149
4283
  kind: check-finding
4150
4284
 
@@ -4155,7 +4289,18 @@ HFS_STARCIWORK_LITE_FORBIDDEN:
4155
4289
  causes_vi:
4156
4290
  - "Ứng dụng lite còn index.yaml, shell/, features/, _resources/, uat hoặc br trong .starciwork"
4157
4291
  - "Có tệp khác nằm ngoài workspace.yaml, brand/ và .gitignore trong Work của lite"
4158
- nextStep_vi: "Giữ nguyên workspace.yaml, brand/** và .gitignore, chuyển nội dung khác ra khỏi .starciwork hoặc nâng ứng dụng lên edition full nếu cần các bản ghi đó, rồi chạy lại kiểm tra."
4292
+ nextStep_vi: "Giữ nguyên workspace.yaml, brand/** và .gitignore, chuyển nội dung khác ra khỏi .starciwork (lite không lên full được: khi cần các bản ghi đó, dựng một ứng dụng full mới), rồi chạy lại kiểm tra."
4293
+ owner: op-retry
4294
+ kind: check-finding
4295
+
4296
+ HFS_TEXT_CORRUPT:
4297
+ title: "A Vietnamese message catalog lost its diacritics"
4298
+ title_vi: "Danh mục thông điệp tiếng Việt bị mất dấu"
4299
+ meaning_vi: "Một tệp thông điệp (messages.ts hoặc vi.json) không phải UTF-8 hợp lệ, hoặc chuỗi tiếng Việt có dấu hỏi chấm hay ký tự thay thế U+FFFD ở chỗ lẽ ra là chữ có dấu."
4300
+ causes_vi:
4301
+ - "Tệp được ghi lại qua một đường ống hoặc lệnh shell không giữ UTF-8."
4302
+ - "Biên tập bằng công cụ chuyển mã làm mất chữ có dấu."
4303
+ nextStep_vi: "Viết lại chuỗi tiếng Việt bằng trình soạn thảo hoặc Node theo UTF-8 tại đường dẫn và dòng được báo; không dùng đường ống shell."
4159
4304
  owner: op-retry
4160
4305
  kind: check-finding
4161
4306
 
@@ -4744,17 +4889,6 @@ RT_FACT_FALSE:
4744
4889
  owner: supervisor
4745
4890
  kind: check-finding
4746
4891
 
4747
- RT_GATE_LOOSENING:
4748
- title: "A change loosens a gate"
4749
- title_vi: "Một thay đổi nới lỏng cổng kiểm"
4750
- meaning_vi: "Bỏ một kiểm tra khỏi danh sách của cổng, hạ ngưỡng, thêm một mục vào allowlist, xoá hoặc làm yếu một spec cùng lúc với mã sản phẩm luôn bị chặn; không có phê duyệt nào cho nới lỏng đi qua, kể cả của chủ (owner ruling loosening-always-red, 2026-10-22)."
4751
- causes_vi:
4752
- - "Một lane gỡ kiểm tra hoặc hạ ngưỡng để cho workflow chạy qua"
4753
- - "Một spec bị xoá hoặc bớt khẳng định trong cùng thay đổi với mã sản phẩm"
4754
- nextStep_vi: "Khôi phục mọi cổng được liệt kê rồi land lại; không có đường duyệt cho nới lỏng."
4755
- owner: owner
4756
- kind: check-finding
4757
-
4758
4892
  RT_GENERATED_BLOCK_STALE:
4759
4893
  title: "A generated README block or derived field differs from its source"
4760
4894
  title_vi: "Khối README sinh tự động khác nguồn của nó"
@@ -4823,6 +4957,18 @@ RT_IDENTIFIER_UNDECLARED:
4823
4957
  owner: supervisor
4824
4958
  kind: check-finding
4825
4959
 
4960
+ RT_LOOSENING_STATE:
4961
+ title: "The tree holds a loosened gate"
4962
+ title_vi: "Cây mã đang giữ một cổng kiểm bị nới lỏng"
4963
+ meaning_vi: "Cây mã hiện tại có một cách bỏ qua kiểm tra (chú thích tắt luật, bỏ qua kiểu hoặc độ phủ, test bị bỏ qua hoặc chỉ chạy một phần, lỗi bị nuốt trong script hay workflow), một mục ignore hoặc exclude mà canon không sinh ra và bảng design-truths không cho phép, một ngưỡng bị hạ, một công tắc nới lỏng, một luật bị tắt, hoặc một tệp ngoại lệ không có trong bảng. Kiểm tra đọc trạng thái cây, không đọc lịch sử; không có phê duyệt nào cho nới lỏng đi qua, kể cả của chủ (owner ruling loosening-always-red)."
4964
+ causes_vi:
4965
+ - "Một lane thêm chú thích tắt luật, bỏ qua test hoặc nuốt lỗi để workflow chạy qua"
4966
+ - "Một mục ignore, exclude hoặc ngưỡng độ phủ bị sửa tay thay vì sinh từ canon"
4967
+ - "Một tệp allowlist, approval hoặc baseline được thêm mà bảng design-truths không liệt kê"
4968
+ nextStep_vi: "Sửa nguyên nhân để kiểm tra được thỏa rồi xoá phần nới lỏng; một ngoại lệ có thật chỉ vào được knowledge/hfs/design-truths.yaml bằng quyết định của chủ."
4969
+ owner: owner
4970
+ kind: check-finding
4971
+
4826
4972
  RT_NODE_MODULES_LINK:
4827
4973
  title: "node_modules linked instead of installed"
4828
4974
  title_vi: "node_modules được liên kết thay vì cài đặt"
@@ -5175,13 +5321,26 @@ STACKS_INGRESS_UNKNOWN:
5175
5321
  owner: op-retry
5176
5322
  kind: check-finding
5177
5323
 
5324
+ STACKS_LITE_REDIS_PERSISTENCE:
5325
+ title: "The declared lite Redis is not one persisted, non-evicting stack service"
5326
+ title_vi: "Redis đã khai báo của lite không phải một dịch vụ duy nhất có AOF và không evict"
5327
+ meaning_vi: "hfs.json sides.be.backing khai báo redis nhưng stack lite không chạy đúng một dịch vụ Redis; hoặc dịch vụ Redis không chạy với --appendonly yes, không mount một named volume ghi được tại /data, hay đặt --maxmemory-policy khác noeviction. Job của hàng đợi nằm trong Redis nên khởi động lại hoặc evict sẽ làm mất chúng."
5328
+ causes_vi:
5329
+ - "Vi phạm R276 (ruling:R212/case-10): Redis đã khai báo không được render trong stack, hoặc được render nhiều lần."
5330
+ - "Lệnh redis-server thiếu --appendonly yes, hoặc đặt maxmemory-policy evict khóa (allkeys-lru, volatile-ttl...)."
5331
+ - "Dịch vụ Redis không mount named volume vào /data, hoặc mount chỉ đọc, hoặc volume không được định nghĩa trong mô hình."
5332
+ nextStep_vi: "Render đúng một dịch vụ Redis, chạy redis-server với --appendonly yes, giữ maxmemory-policy noeviction (mặc định; khóa cache đặt TTL) và mount một named volume ghi được tại /data, khai báo volume đó trong mô hình và trong components.redis.volumes."
5333
+ owner: op-retry
5334
+ kind: check-finding
5335
+
5178
5336
  STACKS_LITE_SELFHOSTED_DB:
5179
- title: "A lite deployment runs a self-hosted backing database"
5180
- title_vi: "Triển khai lite đang chạy cơ sở dữ liệu tự quản"
5181
- meaning_vi: "Tập component hoặc mô hình triển khai của lite chứa image PostgreSQL, Redis hoặc MongoDB thay vì backing Supabase được quản lý."
5337
+ title: "A lite deployment runs PostgreSQL, MongoDB, Qdrant or undeclared Redis"
5338
+ title_vi: "Triển khai lite chạy PostgreSQL, MongoDB, Qdrant hoặc Redis chưa khai báo"
5339
+ meaning_vi: "Tập component hoặc mô hình triển khai của lite chứa image PostgreSQL, MongoDB hoặc Qdrant, dù có khai báo, hoặc chứa Redis chưa khai trong sides.be.backing. Lite dùng Supabase được quản lý và pgvector cho vector; full giữ Qdrant khi được khai báo (owner:lite-vector-is-pgvector)."
5182
5340
  causes_vi:
5183
- - "Vi phạm R276: topology lite thêm máy chủ dữ liệu mà chuẩn chỉ dành cho backing được quản lý."
5184
- nextStep_vi: "Gỡ image backing tự quản khỏi triển khai lite; dùng Supabase cho ứng dụng và SQLite trên volume được khai báo cho sidecar phù hợp."
5341
+ - "Vi phạm R276: topology lite thêm máy chủ dữ liệu mà chuẩn dành cho Supabase được quản lý."
5342
+ - "Stack lite chạy Qdrant, hoặc chạy Redis khi chưa khai dịch vụ cho năng lực cần nó."
5343
+ nextStep_vi: "Gỡ image Postgres, Mongo hoặc Qdrant; dùng Supabase pgvector cho vector và SQLite trên volume được khai báo cho sidecar. Với Redis, khai redis trong sides.be.backing cho năng lực cần nó hoặc gỡ dịch vụ khỏi stack."
5185
5344
  owner: op-retry
5186
5345
  kind: check-finding
5187
5346
 
@@ -5216,12 +5375,12 @@ STACKS_PORT_PUBLISHED:
5216
5375
  kind: check-finding
5217
5376
 
5218
5377
  STACKS_REALTIME_SCALED:
5219
- title: "A lite realtime API does not pin one replica"
5220
- title_vi: "API Realtime của lite chưa ghim đúng một replica"
5221
- meaning_vi: "App API của lite có composition chứa feature be.feature.realtime.* nhưng dịch vụ Swarm chạy nhiều replica hoặc không ghim deploy.replicas: 1."
5378
+ title: "A realtime API with several replicas runs the in-process hub"
5379
+ title_vi: "API Realtime nhiều replica đang chạy hub trong tiến trình"
5380
+ meaning_vi: "App API có composition chứa feature be.feature.realtime.* và dịch vụ Swarm chạy nhiều hơn một replica, nhưng REALTIME_HUB không chọn hub dùng chung (postgres hoặc redis) hoặc không được khai báo. Hub memory chỉ phục vụ một tiến trình nên tin đẩy ở replica này không tới client đang nghe ở replica khác."
5222
5381
  causes_vi:
5223
- - "Vi phạm R266: Realtime của lite chưa có topology chia sẻ trạng thái để phục vụ nhiều replica an toàn."
5224
- nextStep_vi: "Ghim deploy.replicas: 1 cho API Realtime của lite trong mô hình Swarm; giới hạn này không áp dụng cho bản full."
5382
+ - "Vi phạm R266: deploy.replicas lớn hơn 1 nhưng hub realtime là hub memory của bản chạy một replica và của test."
5383
+ nextStep_vi: "Khai báo REALTIME_HUB=postgres trong environment của API (hoặc redis), hoặc ghim deploy.replicas: 1 khi chỉ chạy một replica; xem BE-REALTIME-7 trong knowledge/patterns/be/realtime.yaml."
5225
5384
  owner: op-retry
5226
5385
  kind: check-finding
5227
5386
 
@@ -0,0 +1,6 @@
1
+ minInputWindowMs: 5000
2
+ maxBytes: 1048576
3
+ outputTimeoutMs: 1000
4
+ verdictTimeoutMs: 20000
5
+ teardownTimeoutMs: 1000
6
+ hookTimeoutSeconds: 30
@@ -0,0 +1,81 @@
1
+ # protected-zone.yaml - the PROTECTED ZONE of the runtime (one declaration, data only, no schema stamp).
2
+ # The PROTECTED ZONE of the runtime (rule R224 RIGHTS_PROTECTED_ZONE; the three change paths of the source process).
3
+ # This file is the ONE declaration: scripts/guards/protected-zone.mjs reads it, the command guard enforces it, and every
4
+ # document cites the rule id, never a copy of the list.
5
+ #
6
+ # Path 1 (the owner edits .claude by prompt) may change anything here. Path 2 (the supervisor self-upgrading .claude: the
7
+ # supervisor seat and its [Worker] jobs) may not edit a zone path or a catalog entry listed below; it files an owner
8
+ # proposal instead. Path 3 (an op working on an app) never writes inside the runtime checkout at all (R224,
9
+ # RIGHTS_OP_RUNTIME_WRITE): it records a lesson or an upgrade request.
10
+ #
11
+ # paths are repository-relative globs of a runtime checkout (any worktree of it); a trailing /** covers a subtree.
12
+ zones:
13
+ - id: guard-and-rights
14
+ why: the command guard and the role rights it enforces
15
+ paths:
16
+ - scripts/guards/**
17
+ - scripts/lib/hook-limits.mjs
18
+ - modules/kernel/protected-zone.yaml
19
+ - modules/kernel/command-policy.yaml
20
+ - modules/kernel/hook-input.yaml
21
+ - scripts/hfs/runtime-rules/rights-policy.mjs
22
+ - id: release-and-hooks
23
+ why: the release cut, the push path and the git hooks every app and the runtime inherit
24
+ paths:
25
+ - scripts/supervisor/release-cut.mjs
26
+ - scripts/supervisor/push-git.mjs
27
+ - scripts/supervisor/push-mains.mjs
28
+ - scripts/supervisor/release-l4.mjs
29
+ - scripts/hfs/runtime-rules/release-notes.mjs
30
+ - scripts/hfs/runtime-rules/hook-shape.mjs
31
+ - packages/hfs/templates/app/hooks/**
32
+ - id: ci-triggers
33
+ why: which events start CI in the runtime, its examples and every scaffolded app
34
+ paths:
35
+ - .github/workflows/**
36
+ - packages/hfs/templates/app/ci-workflows/**
37
+ - scripts/hfs/runtime-rules/git-triggers.mjs
38
+ - examples/*/.github/workflows/**
39
+ - id: test-policy
40
+ why: the real tests of the runtime (the package clean-test and the scaffold e2e, owner ruling no-runtime-specs) and the specs.* switches decide how much is tested and when
41
+ paths:
42
+ - scripts/gates/runtime-tests.mjs
43
+ - scripts/gates/scaffold-e2e.mjs
44
+ - e2e/**
45
+ - config.example.yaml
46
+ - config.yaml
47
+ - id: host-lock
48
+ why: the one lock that serialises heavy runs on the host
49
+ paths:
50
+ - scripts/machine/host-lock.mjs
51
+ - id: permissions
52
+ why: the supervisor's own permission, hook and model settings
53
+ paths:
54
+ - .claude/settings.json
55
+ - .claude/settings.local.json
56
+ - .codex/**
57
+ - .devin/**
58
+ # Catalog entries that enforce the zone. The files are shared with ordinary upgrades, so only an edit that names one of
59
+ # these ids or codes is refused (the Edit tool's old and new text are read; a shell write to the file is refused outright).
60
+ catalogEntries:
61
+ - file: knowledge/hfs/rules.yaml
62
+ ids: [R221, R222, R223, R224, R225]
63
+ codes: [CI_TRIGGERS_RELEASE_ONLY, RELEASE_NOTES, RIGHTS_ROLE_DENIED, RIGHTS_PROTECTED_ZONE, RT_HOOK_SHAPE]
64
+ - file: modules/kernel/failure-codes.yaml
65
+ ids: []
66
+ codes:
67
+ - RIGHTS_GIT_PUSH
68
+ - RIGHTS_GIT_TAG
69
+ - RIGHTS_GIT_SYNC
70
+ - RIGHTS_RAW_TOOL
71
+ - RIGHTS_GIT_COMMIT
72
+ - RIGHTS_NPM_PUBLISH
73
+ - RIGHTS_SUITE_RUN
74
+ - RIGHTS_NPM_CI_UNLOCKED
75
+ - RIGHTS_RELEASE_CUT
76
+ - RIGHTS_PROTECTED_ZONE
77
+ - RIGHTS_OP_RUNTIME_WRITE
78
+ - RIGHTS_PUSH_NOT_RELEASE
79
+ - RT_HOOK_SHAPE
80
+ - CI_TRIGGERS_RELEASE_ONLY
81
+ - RELEASE_NOTES
@@ -8,6 +8,27 @@
8
8
  # a word to scan for).
9
9
  kinds: [config-key, bias-field, verb, flag, code, vocabulary, file]
10
10
  removed:
11
+ - id: cut-seam-command
12
+ kind: flag
13
+ name: cut-seam --command
14
+ match: 'cut-seam[^\n]*--command\b'
15
+ use: 'cut-seam --reconcile reads the commands and selection from --checks-file'
16
+ since: 1.0.0-alpha.31
17
+ - id: cut-set-closing-check
18
+ kind: vocabulary
19
+ name: closingCheck
20
+ use: 'modules/kernel/check-policy.yaml#regression owns integration checks after job merges; closingOrdinal identifies only the final open ordinal'
21
+ since: 1.0.0-alpha.31
22
+ - id: verb-guard-input
23
+ kind: verb
24
+ name: starci guard input
25
+ use: 'the reference-transaction hook reads prepared ref updates directly in its shell loop'
26
+ since: 1.0.0-alpha.31
27
+ - id: hook-input-timeout-ms
28
+ kind: config-key
29
+ name: hook-input.timeoutMs
30
+ use: 'modules/kernel/hook-input.yaml declares the input window as minInputWindowMs'
31
+ since: 1.0.0-alpha.31
11
32
  - id: bias-require
12
33
  kind: bias-field
13
34
  name: require
@@ -339,3 +360,44 @@ removed:
339
360
  use: 'the runtime has no specs of its own (owner ruling no-runtime-specs); specs.unit and specs.e2e switch the product workflow tests'
340
361
  since: 1.0.0-alpha.19
341
362
  match: '\bspecs\.harness\b'
363
+ - id: file-supabase-queues-topic
364
+ kind: file
365
+ name: supabase-queues.yaml
366
+ use: 'the queue is BullMQ on Redis in both editions (ruling:R212/case-10): knowledge/patterns/be/queues.yaml owns the adapter, and each pattern topic''s liteAdapter says what lite uses with and without its declared backing service'
367
+ since: 1.0.0-alpha.31
368
+ match: '(?<![\w-])supabase-queues(?:\.yaml)?\b'
369
+ - id: code-rt-gate-loosening
370
+ kind: code
371
+ name: RT_GATE_LOOSENING
372
+ use: 'the tree is judged as it stands, never by its history: RT_LOOSENING_STATE (the loosening-state self-check) with the design-truths manifest knowledge/hfs/design-truths.yaml'
373
+ since: 1.0.0-alpha.31
374
+ - id: vocabulary-gate-loosening
375
+ kind: vocabulary
376
+ name: gate-loosening
377
+ use: 'the diff-based detector and its table are gone: the loosening-state self-check (scripts/checks/check-loosening-state.mjs) reads the tree as it stands against knowledge/hfs/design-truths.yaml'
378
+ since: 1.0.0-alpha.31
379
+ match: 'gate-loosening|gateLoosening|loosensReleased|looseningsOf|check-code-loosening'
380
+ - id: verb-runtime-benchmark-snapshot
381
+ kind: verb
382
+ name: starci runtime benchmark-snapshot
383
+ use: 'routing evidence is read live from the ledgers: `starci machine op-metrics --by op` and the ledger view v_model_scorecard (modules/models/registry.yaml costPolicy)'
384
+ since: 1.0.0-alpha.31
385
+ match: '(?<![\w-])benchmark-snapshot(?![\w-])'
386
+ - id: vocab-benchmark-scorecard
387
+ kind: vocabulary
388
+ name: the benchmark/ model-pool scorecard
389
+ use: 'routing evidence is read live from the ledgers: `starci machine op-metrics --by op` and the ledger view v_model_scorecard (modules/models/registry.yaml costPolicy)'
390
+ since: 1.0.0-alpha.31
391
+ match: '(?<![\w./-])benchmark/(?:README\.md|expectations\.yaml|snapshots\b|findings\b)|benchmark-expectations@1'
392
+ - id: slot-runtime-benchmark
393
+ kind: vocabulary
394
+ name: runtime.benchmark
395
+ use: 'the runtime tree has no benchmark slot; routing evidence is read live from the ledgers (modules/models/registry.yaml costPolicy)'
396
+ since: 1.0.0-alpha.31
397
+ match: '\bruntime\.benchmark\b'
398
+ - id: config-release-tagmatchesversion
399
+ kind: config-key
400
+ name: release.tagMatchesVersion
401
+ use: 'the release tag is always <release.tagPrefix><package.json version>; delete the key'
402
+ since: 1.0.0-alpha.31
403
+ match: '\btagMatchesVersion\b'