@starci/hfs 4.9.11 → 4.10.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 (219) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +7 -9
  3. package/db/backup-receipt.mjs +10 -47
  4. package/db/drift.mjs +1 -1
  5. package/db/dump.mjs +11 -10
  6. package/db/entity-list.mjs +1 -1
  7. package/db/migrate.mjs +83 -259
  8. package/db/new.mjs +46 -0
  9. package/db/post-cutover.mjs +13 -17
  10. package/db/postgres.mjs +80 -0
  11. package/emit/contracts.mjs +5 -9
  12. package/package.json +1 -1
  13. package/release/gate.mjs +3 -15
  14. package/runtime/knowledge/hfs/canon-pins.yaml +44 -24
  15. package/runtime/knowledge/hfs/design-truths.yaml +1 -1
  16. package/runtime/knowledge/hfs/fe-stack.yaml +4 -11
  17. package/runtime/knowledge/hfs/rules.yaml +177 -155
  18. package/runtime/knowledge/hfs/slots.yaml +164 -172
  19. package/runtime/knowledge/patterns/be/event-bus.yaml +3 -3
  20. package/runtime/knowledge/patterns/be/idempotency.yaml +3 -3
  21. package/runtime/knowledge/patterns/be/jobs.yaml +4 -4
  22. package/runtime/knowledge/patterns/be/projections.yaml +7 -5
  23. package/runtime/knowledge/patterns/be/queues.yaml +8 -8
  24. package/runtime/knowledge/patterns/be/reactors.yaml +2 -2
  25. package/runtime/knowledge/patterns/be/realtime.yaml +6 -6
  26. package/runtime/knowledge/patterns/be/saga.yaml +3 -3
  27. package/runtime/knowledge/patterns/be/webhooks.yaml +1 -1
  28. package/runtime/modules/kernel/command-policy.yaml +1 -1
  29. package/runtime/modules/kernel/failure-codes.yaml +65 -115
  30. package/runtime/modules/schemas/application-stacks.schema.yaml +5 -5
  31. package/runtime/scripts/hfs/architecture/canon-clones.mjs +1 -1
  32. package/runtime/scripts/hfs/architecture/{supabase-be.mjs → identity.mjs} +45 -15
  33. package/runtime/scripts/hfs/architecture/index.mjs +2 -3
  34. package/runtime/scripts/hfs/architecture/{supabase-ast.mjs → jwt-ast.mjs} +2 -103
  35. package/runtime/scripts/hfs/architecture/register-once.mjs +1 -1
  36. package/runtime/scripts/hfs/architecture/schema-owner.mjs +29 -4
  37. package/runtime/scripts/hfs/architecture/server-action.mjs +3 -4
  38. package/runtime/scripts/hfs/architecture/side-boundary.mjs +1 -1
  39. package/runtime/scripts/hfs/architecture/{supabase-keys.mjs → sql-keys.mjs} +1 -1
  40. package/runtime/scripts/hfs/architecture/sql-owner.mjs +25 -27
  41. package/runtime/scripts/hfs/architecture/transport-owner.mjs +7 -3
  42. package/runtime/scripts/hfs/check.mjs +6 -6
  43. package/runtime/scripts/hfs/coverage-scope.mjs +1 -1
  44. package/runtime/scripts/hfs/db-baseline-verb.mjs +48 -30
  45. package/runtime/scripts/hfs/db-plan-verb.mjs +17 -106
  46. package/runtime/scripts/hfs/db-restamp-verb.mjs +11 -10
  47. package/runtime/scripts/hfs/declaration-shape.mjs +15 -18
  48. package/runtime/scripts/hfs/manifest-shape.mjs +4 -4
  49. package/runtime/scripts/hfs/rule-params-shape.mjs +4 -1
  50. package/runtime/scripts/hfs/rules/a15-findings.mjs +1 -1
  51. package/runtime/scripts/hfs/rules/cli.mjs +1 -1
  52. package/runtime/scripts/hfs/rules/database-access.mjs +8 -74
  53. package/runtime/scripts/hfs/rules/database-baseline.mjs +3 -3
  54. package/runtime/scripts/hfs/rules/database-config.mjs +6 -214
  55. package/runtime/scripts/hfs/rules/database-constants.mjs +8 -10
  56. package/runtime/scripts/hfs/rules/database-migrations.mjs +3 -3
  57. package/runtime/scripts/hfs/rules/database-queues.mjs +4 -5
  58. package/runtime/scripts/hfs/rules/database-sql.mjs +1 -1
  59. package/runtime/scripts/hfs/rules/database.mjs +36 -39
  60. package/runtime/scripts/hfs/rules/edition.mjs +1 -1
  61. package/runtime/scripts/hfs/rules/{supabase-secrets.mjs → lite-secrets.mjs} +6 -6
  62. package/runtime/scripts/hfs/rules/script-hygiene.mjs +1 -10
  63. package/runtime/scripts/hfs/rules/stacks-lite-backing.mjs +5 -4
  64. package/runtime/scripts/hfs/rules/stacks-release.mjs +3 -2
  65. package/runtime/scripts/hfs/rules/stacks-runtime.mjs +2 -2
  66. package/runtime/scripts/hfs/rules/stacks.mjs +1 -1
  67. package/runtime/scripts/hfs/slot-app-view.mjs +1 -1
  68. package/runtime/scripts/hfs/slots.mjs +8 -2
  69. package/runtime/scripts/hfs/sql/pg-parse.mjs +2 -2
  70. package/runtime/scripts/lib/secret-patterns.mjs +2 -2
  71. package/runtime/scripts/lib/swarm-stack.mjs +7 -4
  72. package/scaffold/add-app.mjs +2 -10
  73. package/scaffold/add-cli-lite.mjs +6 -6
  74. package/scaffold/add-compose.mjs +1 -1
  75. package/scaffold/add-inbox-lite.mjs +4 -8
  76. package/scaffold/add-plan.mjs +1 -1
  77. package/scaffold/add-queue-lite.mjs +16 -24
  78. package/scaffold/add-table.mjs +34 -26
  79. package/scaffold/add.mjs +2 -2
  80. package/scaffold/app.mjs +19 -86
  81. package/scaffold/lite-exports.mjs +1 -1
  82. package/src/main.mjs +19 -20
  83. package/stack/target-binding.mjs +0 -60
  84. package/stack/urgent-floor.mjs +2 -2
  85. package/sync/index.mjs +32 -8
  86. package/templates/app/ci-workflows-lite/github/workflows/ci.yml +1 -17
  87. package/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml +6 -8
  88. package/templates/app/codegen-lite/scripts/codegen.mjs +2 -39
  89. package/templates/app/db-bootstrap/db/bootstrap.sql +139 -0
  90. package/templates/app/gitignore-lite +0 -3
  91. package/templates/app/package-scripts/db.json +9 -0
  92. package/templates/app/package-scripts/package.json +0 -1
  93. package/templates/app/package-scripts-lite/package.json +1 -1
  94. package/templates/app/skeleton/.starcistacks/dev/README.md +1 -1
  95. package/templates/app/skeleton/.starcistacks/production/README.md +1 -1
  96. package/templates/app/skeleton/README.md +1 -1
  97. package/templates/app/skeleton-lite/.starcistacks/application-stacks.yaml +84 -19
  98. package/templates/app/skeleton-lite/.starcistacks/dev/README.md +5 -5
  99. package/templates/app/skeleton-lite/.starcistacks/dev/environment.json +1 -1
  100. package/templates/app/skeleton-lite/.starcistacks/dev/infra/swarm/recovery/restore-proof.md +1 -1
  101. package/templates/app/skeleton-lite/.starcistacks/dev/infra/swarm/stack.yaml +69 -6
  102. package/templates/app/skeleton-lite/.starcistacks/dev/runtime/env/KEYS.md +18 -7
  103. package/templates/app/skeleton-lite/.starcistacks/production/README.md +6 -6
  104. package/templates/app/skeleton-lite/.starcistacks/production/environment.json +1 -1
  105. package/templates/app/skeleton-lite/.starcistacks/production/infra/swarm/recovery/restore-proof.md +2 -2
  106. package/templates/app/skeleton-lite/.starcistacks/production/infra/swarm/stack.yaml +69 -6
  107. package/templates/app/skeleton-lite/.starcistacks/production/runtime/env/KEYS.md +17 -9
  108. package/templates/app/skeleton-lite/README.md +11 -11
  109. package/templates/app/skeleton-lite/{supabase → db}/migrations/__timestamp___baseline.sql +21 -1
  110. package/templates/app/tool-config-lite/prettierignore +0 -1
  111. package/templates/be/inbox/database-client.spec.ts.tpl +9 -5
  112. package/templates/be/inbox/database-client.ts.tpl +13 -4
  113. package/templates/be/inbox/platform/client-operation-outcomes.sql.tpl +47 -0
  114. package/templates/be/inbox/platform/event-bus/event-bus.service.spec.ts.tpl +3 -1
  115. package/templates/be/inbox/platform/event-bus/event-bus.service.ts.tpl +2 -2
  116. package/templates/be/inbox/platform/inbox/inbox.service.spec.ts.tpl +6 -1
  117. package/templates/be/inbox/platform/inbox/inbox.service.ts.tpl +39 -7
  118. package/templates/be/inbox/platform/migration.sql.tpl +22 -0
  119. package/templates/be/inbox/service.spec.ts.tpl +2 -2
  120. package/templates/be/inbox/service.ts.tpl +1 -2
  121. package/templates/be/patterns/jobs/platform-lite/job-claim.service.spec.ts.tpl +156 -0
  122. package/templates/be/patterns/jobs/platform-lite/job-claim.service.ts.tpl +114 -0
  123. package/templates/be/patterns/jobs/platform-lite/jobs.sql.tpl +51 -0
  124. package/templates/be/patterns/queues/platform-lite/queue-outbox.service.spec.ts.tpl +62 -0
  125. package/templates/be/patterns/queues/platform-lite/queue-outbox.service.ts.tpl +20 -0
  126. package/templates/be/patterns/queues/platform-lite/queue-outbox.sql.tpl +35 -0
  127. package/templates/be/patterns/queues/platform-lite/queue-relay.service.spec.ts.tpl +4 -1
  128. package/templates/be/patterns/queues/platform-lite/queue-relay.service.ts.tpl +16 -5
  129. package/templates/be/patterns/realtime/channel.gateway.spec.ts.tpl +8 -8
  130. package/templates/be/patterns/realtime/channel.websocket.module.ts.tpl +3 -3
  131. package/templates/be/patterns/realtime/channel.websocket.options.ts.tpl +2 -2
  132. package/templates/be/skeleton-lite/apps/api/Dockerfile +0 -1
  133. package/templates/be/skeleton-lite/apps/api/src/api.env.ts +9 -5
  134. package/templates/be/skeleton-lite/apps/api/src/api.options.ts +7 -4
  135. package/templates/be/skeleton-lite/apps/api/src/app.module.ts +4 -4
  136. package/templates/be/skeleton-lite/apps/api/src/compose/domain.ts +3 -3
  137. package/templates/be/skeleton-lite/apps/api/src/compose/integrations.ts +9 -13
  138. package/templates/be/skeleton-lite/apps/api/src/compose/platform.ts +4 -2
  139. package/templates/be/skeleton-lite/apps/cli/src/cli.env.ts +2 -2
  140. package/templates/be/skeleton-lite/apps/cli/src/compose/platform.ts +3 -2
  141. package/templates/be/skeleton-lite/src/modules/domain/identity/auth.guard.spec.ts +4 -4
  142. package/templates/be/skeleton-lite/src/modules/domain/identity/auth.guard.ts +3 -3
  143. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.contracts.ts +1 -1
  144. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.decorators.ts +6 -6
  145. package/templates/be/skeleton-lite/src/modules/domain/identity/identity.options.ts +3 -3
  146. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/index.ts +4 -0
  147. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/object-storage.client.spec.ts +22 -0
  148. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/object-storage.client.ts +25 -0
  149. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/object-storage.config.ts +12 -0
  150. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/object-storage.decorators.ts +9 -0
  151. package/templates/be/skeleton-lite/src/modules/integrations/object-storage/object-storage.options.ts +35 -0
  152. package/templates/be/skeleton-lite/src/modules/integrations/passport/errors/passport.error.ts +22 -0
  153. package/templates/be/skeleton-lite/src/modules/integrations/passport/index.ts +12 -0
  154. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.config.ts +23 -0
  155. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.cookie.ts +29 -0
  156. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.decorators.ts +22 -0
  157. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.options.ts +63 -0
  158. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.password.ts +11 -0
  159. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.tokens.spec.ts +32 -0
  160. package/templates/be/skeleton-lite/src/modules/integrations/passport/passport.tokens.ts +69 -0
  161. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/google.strategy.ts +37 -0
  162. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/local.strategy.ts +36 -0
  163. package/templates/be/skeleton-lite/src/modules/integrations/passport/strategies/oauth-state.store.ts +59 -0
  164. package/templates/be/skeleton-lite/src/modules/platform/database/database.functions.ts +24 -0
  165. package/templates/be/skeleton-lite/src/modules/platform/database/database.module.ts +2 -1
  166. package/templates/be/skeleton-lite/src/modules/platform/database/database.options.ts +4 -2
  167. package/templates/be/skeleton-lite/src/modules/platform/database/database.sql.ts +19 -6
  168. package/templates/be/skeleton-lite/src/modules/platform/database/entities.ts +6 -0
  169. package/templates/be/skeleton-lite/src/modules/platform/database/index.ts +1 -0
  170. package/templates/be/skeleton-lite/src/modules/platform/database/migration-runner.service.ts +1 -1
  171. package/templates/be/skeleton-lite/src/modules/platform/database/primary.config.ts +2 -2
  172. package/templates/be/skeleton-lite/src/modules/platform/database/seed-runner.service.ts +2 -2
  173. package/templates/be/skeleton-lite/src/tests/fixtures/builders/api.builder.ts +18 -5
  174. package/templates/be/skeleton-lite/src/tests/fixtures/builders/cli.builder.ts +1 -1
  175. package/templates/be/table/entities.index.ts.tpl +4 -0
  176. package/templates/be/table/entity.ts.tpl +21 -0
  177. package/templates/be/table/index.ts.tpl +1 -0
  178. package/templates/be/table/module.ts.tpl +1 -1
  179. package/templates/be/table/service.api.ts.tpl +10 -11
  180. package/templates/be/table/service.ts.tpl +5 -6
  181. package/templates/fe/skeleton-lite/apps/__app__/src/modules/auth/auth-door.ts +30 -0
  182. package/templates/fe/skeleton-lite/apps/__app__/src/modules/auth/client.ts +46 -14
  183. package/templates/fe/skeleton-lite/apps/__app__/src/modules/auth/token-store.ts +31 -0
  184. package/templates/fe/skeleton-lite/apps/web/src/modules/config/index.ts +2 -5
  185. package/db/local-migrate.mjs +0 -194
  186. package/db/reset.mjs +0 -125
  187. package/emit/db-types.mjs +0 -271
  188. package/runtime/scripts/api/supabase/database-dump.mjs +0 -5
  189. package/runtime/scripts/api/supabase/database-push.mjs +0 -5
  190. package/runtime/scripts/api/supabase/database-query.mjs +0 -5
  191. package/runtime/scripts/api/supabase/lib.mjs +0 -55
  192. package/runtime/scripts/api/supabase/migration-repair.mjs +0 -5
  193. package/runtime/scripts/hfs/architecture/supabase-tables.mjs +0 -50
  194. package/runtime/scripts/hfs/architecture/supabase.mjs +0 -226
  195. package/scaffold/supabase-ports.mjs +0 -26
  196. package/templates/app/package-scripts/supabase.json +0 -7
  197. package/templates/app/skeleton-lite/supabase/config.toml +0 -48
  198. package/templates/be/inbox/platform/event-bus/persistence/event-bus.sql.ts.tpl +0 -5
  199. package/templates/be/inbox/platform/inbox/persistence/inbox.rows.ts.tpl +0 -33
  200. package/templates/be/inbox/platform/inbox/persistence/inbox.sql.ts.tpl +0 -33
  201. package/templates/be/inbox/sql.ts.tpl +0 -16
  202. package/templates/be/patterns/jobs/platform-lite/persistence.jobs.sql.ts.tpl +0 -33
  203. package/templates/be/patterns/queues/platform-lite/persistence.queue.sql.ts.tpl +0 -12
  204. package/templates/be/skeleton-lite/src/modules/integrations/supabase/errors/supabase.error.ts +0 -16
  205. package/templates/be/skeleton-lite/src/modules/integrations/supabase/index.ts +0 -6
  206. package/templates/be/skeleton-lite/src/modules/integrations/supabase/supabase.client.spec.ts +0 -27
  207. package/templates/be/skeleton-lite/src/modules/integrations/supabase/supabase.client.ts +0 -24
  208. package/templates/be/skeleton-lite/src/modules/integrations/supabase/supabase.config.ts +0 -8
  209. package/templates/be/skeleton-lite/src/modules/integrations/supabase/supabase.decorators.ts +0 -17
  210. package/templates/be/skeleton-lite/src/modules/integrations/supabase/supabase.jwks.ts +0 -32
  211. package/templates/be/skeleton-lite/src/modules/integrations/supabase/supabase.options.ts +0 -24
  212. package/templates/be/table/rows.ts.tpl +0 -4
  213. package/templates/be/table/sql.api.ts.tpl +0 -7
  214. package/templates/be/table/sql.ts.tpl +0 -4
  215. package/templates/fe/auth/supabase-client.ts.tpl +0 -38
  216. package/templates/fe/skeleton/apps/__app__/src/app/auth/callback/route.ts +0 -11
  217. package/templates/fe/skeleton/apps/__app__/src/modules/auth/pkce-client.ts +0 -18
  218. package/templates/fe/skeleton/apps/__app__/src/modules/auth/server.ts +0 -19
  219. /package/templates/app/skeleton-lite/{supabase → db}/seed.sql +0 -0
@@ -7,7 +7,7 @@
7
7
  # catalog READ this file through scripts/hfs/slots.mjs; none of them hardcodes a path.
8
8
  # Shape: modules/schemas/hfs-slots.schema.yaml. The repository side is hfs.json: modules/schemas/hfs-repo.schema.yaml.
9
9
  schema: starci/hfs-slots@3
10
- version: 3.8.0
10
+ version: 3.9.0
11
11
 
12
12
  versioning:
13
13
  # MAJOR.MINOR.PATCH of this manifest. A repository pins only the MAJOR in hfs.json ("hfs": 3).
@@ -38,6 +38,9 @@ versioning:
38
38
  # or environment reads (BE_APP_OPTIONS_COMPOSITION). Secrets use EnvSource.secret(): <NAME>_FILE first, plain <NAME> only
39
39
  # when the file key is absent; .starcistacks owns custody. Capability <capability>.config.ts roles stay unchanged.
40
40
  # 3.3.0 is a minor (alpha.16): it ADDS the optional app.ci-stack-deploy slot, the managed workflow of the starci app stack verbs.
41
+ # 3.9.0 (ruling:lite-self-hosted-postgres-passport-minio, 2026-10-29) is a major for lite and changes no full slot but the S3 owner's
42
+ # folder: lite leaves Supabase. The app.supabase* and be.integrations.supabase slots and fe.route.callback are removed; app.db (db/, its
43
+ # migrations, archive, seed and managed bootstrap), be.integrations.passport and be.integrations.object-storage are added; lite's schemaAuthority is sql.
41
44
  # 3.4.0 is a minor (alpha.25): it ADDS the opt-in be.contract.mcp-tools slot, the committed MCP tool-catalog snapshot of an app.
42
45
  # 3.5.0 is a minor (alpha.27): it ADDS the opt-in app.browser-config slot, the managed browser/tsconfig.json that type-checks the browser
43
46
  # journey (enabled with app.browser by `browser: true`).
@@ -106,34 +109,34 @@ versioning:
106
109
  # requiredInstances, why), each shaped as the same field in the slot body; every other field is the edition's.
107
110
  # `why` under lite names the adapter behind the slot's ports (pgmq, Postgres locks, in-process socket.io).
108
111
  # `tests` is never overlaid: a lite slot owes exactly the unit specs its full slot owes.
109
- # provider the hfs.json connections[].provider that enables this opt-in slot (supabase); never an app kind.
112
+ # provider the hfs.json connections[].provider that enables this opt-in slot (postgres); never an app kind.
110
113
  # since the manifest version that introduced the slot.
111
114
  presenceValues: [required, optional, opt-in, forbidden]
112
115
  trackedValues: [tracked, ignored, external]
113
116
  testValues: [unit-beside, e2e, none]
114
117
 
115
118
  # The editions a repository declares in hfs.json `edition` (absent means full). ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite IS
116
- # the full architecture with Supabase backing services - the same monorepo, slots, CQRS shape and patterns (queue,
119
+ # the full architecture on its own self-hosted PostgreSQL (ruling:lite-self-hosted-postgres-passport-minio) - the same monorepo, slots, CQRS shape and patterns (queue,
117
120
  # event bus, saga, reactors, projection, realtime, webhooks, fenced job), declared in hfs.json the same way, and the same unit
118
121
  # specs (unitRoles, logicRoles, 100 per file, @starci/jest-preset doubles, builders). What differs is ADAPTERS and DELIVERY
119
- # (ruling:R212/case-10): schema authority in supabase/migrations, the queue port on BullMQ over the Redis hfs.json
122
+ # (ruling:R212/case-10): schema authority in db/migrations, the queue port on BullMQ over the Redis hfs.json
120
123
  # sides.be.backing declares (as in full, fed by the Postgres outbox), event-bus ports on pgmq-backed topics or in-process
121
124
  # delivery, cache and locks on Postgres or the declared Redis, schedules on pg_cron (+ pg_net) enqueueing through the queue
122
- # outbox, storage and auth on Supabase. Realtime uses SSE or the socket.io gateway
125
+ # outbox, storage on S3-compatible MinIO (integrations/object-storage) and auth through integrations/passport. Realtime uses SSE or the socket.io gateway
123
126
  # in the api process, which scales horizontally and stateless (memory hub for one replica or tests; the Redis hub and @socket.io/redis-adapter when Redis is declared, else the Postgres hub and @socket.io/postgres-adapter, for N replicas; websocket only, no sticky sessions). Integration and provider sandbox contract specs are optional;
124
127
  # declared patterns owe their integration proofs (R284). Lite has no e2e world. Production uses declared docker-swarm under
125
- # .starcistacks/production/infra/swarm/ (owner ruling 2026-10-14); lite runs no self-hosted database, and runs only the backing
126
- # services sides.be.backing declares. The front end is full's (R97).
128
+ # .starcistacks/production/infra/swarm/ (owner ruling 2026-10-14); lite runs its PostgreSQL as the db service of its
129
+ # stack and only the backing services sides.be.backing declares. The front end is full's (R97).
127
130
  # Lite is this same manifest filtered: a slot whose `editions` lacks lite does not exist for a lite app, `litePresence` replaces
128
131
  # presence and a `lite` map replaces the fields it names. The edition is chosen once at scaffold; there is no upgrade
129
132
  # or downgrade between lite and full. Lite contracts are allowed (owner decision 2026-10-14).
130
133
  editions: [full, lite]
131
134
 
132
135
  # The two sides of an app: the folder of each is its profile name (be/, fe/). `reads` lists the only paths of the OTHER side a side
133
- # may read (hfs.json sides.<side>.reads names a subset), or a tree an app-root slot owns (supabase/types/); nothing else crosses sides.
136
+ # may read (hfs.json sides.<side>.reads names a subset), or a tree an app-root slot owns; nothing else crosses sides.
134
137
  sides:
135
- be: {reads: [supabase/types/]} # the generated Database types of a Supabase connection (server code types its PostgREST calls)
136
- fe: {reads: [be/contracts/, supabase/types/]} # be/contracts/: the committed contract snapshots, the input of the front end's codegen; supabase/types/: the same generated types
138
+ be: {reads: []}
139
+ fe: {reads: [be/contracts/]} # be/contracts/: the committed contract snapshots, the input of the front end's codegen
137
140
 
138
141
  # The trigger kinds of the back end's features: what starts the work of a feature. A feature slot names its kind in `trigger`; no kind imports another
139
142
  # (BE_KIND_ISOLATION), every cross-kind call is an event on the bus, and only be/apps/* compose features.
@@ -196,9 +199,9 @@ crossApp: apps never import each other; shared code is a packages/<pkg> slot.
196
199
  ruleParams:
197
200
  db:
198
201
  # R259: btree_gist supplies UUID equality for the booking interval exclusion constraint.
199
- # R259: unaccent is a first-party Supabase extension used by Vietnamese-content search functions.
202
+ # R259: unaccent ships in the supabase/postgres image of the db service, used by Vietnamese-content search functions.
200
203
  extensions: [pgmq, pg_cron, pgcrypto, pg_trgm, vector, uuid-ossp, pg_net, supabase_vault, unaccent, btree_gist]
201
- # R258 DB_CRON_OWNED: THE queue outbox of a Supabase schema (the relay hands its unsent rows to BullMQ, ruling:R212/case-10). A pg_cron
204
+ # R258 DB_CRON_OWNED: THE queue outbox of a lite schema (the relay hands its unsent rows to BullMQ, ruling:R212/case-10). A pg_cron
202
205
  # job enqueues only by inserting one row into this table, writing only these columns, one of which is `queue`.
203
206
  queueOutbox: {table: public.queue, columns: [queue, payload, created_at, correlation_id]}
204
207
  common:
@@ -222,8 +225,18 @@ ruleParams:
222
225
  "node:https": [platform/http]
223
226
  http: [platform/http]
224
227
  https: [platform/http]
225
- "@aws-sdk/client-s3": [integrations/object-storage] # the ObjectStorage port: one S3 adapter for MinIO, S3, Spaces and Supabase Storage
228
+ "@aws-sdk/client-s3": [integrations/object-storage] # the ObjectStorage port: one S3 adapter for MinIO, S3 and Spaces (R331)
226
229
  "@aws-sdk/s3-request-presigner": [integrations/object-storage]
230
+ minio: [] # storage goes through the S3 client of integrations/object-storage
231
+ "@supabase": [] # no Supabase client in a back end
232
+ "@nestjs/passport": [integrations/passport] # the identity libraries (R328)
233
+ passport: [integrations/passport]
234
+ passport-google-oauth20: [integrations/passport]
235
+ passport-local: [integrations/passport]
236
+ "@nestjs/jwt": [integrations/passport]
237
+ jose: [integrations/passport]
238
+ bcryptjs: [integrations/passport]
239
+ bcrypt: []
227
240
  cache-manager: [integrations/cache, integrations/redis]
228
241
  "@nestjs/cache-manager": [integrations/cache, integrations/redis] # the CACHE_MANAGER token: caching goes through the cache capability
229
242
  redis: [integrations/cache, integrations/redis]
@@ -395,21 +408,41 @@ ruleParams:
395
408
  # end may declare in hfs.json sides.be.backing. `clients` are the libraries that consume the service: one of them as a dependency
396
409
  # is its consumer, and under lite none of them may be a dependency while the service is undeclared. `patterns` are the declared
397
410
  # patterns that need the service. `images` are the image repositories (the last path segment) a stack runs it from.
398
- # `editions` limits admission: owner:lite-vector-is-pgvector keeps vector search on Supabase pgvector in lite.
411
+ # `editions` limits admission: owner:lite-vector-is-pgvector keeps vector search on pgvector in lite.
399
412
  backing:
400
413
  redis: {clients: [bullmq, "@nestjs/bullmq", bull, "@nestjs/bull", ioredis, redis, "@keyv/redis", cache-manager-redis-yet, cache-manager-ioredis-yet, "@socket.io/redis-adapter"], patterns: [queue, fenced-job], images: [redis, redis-stack, redis-stack-server]}
401
414
  qdrant: {clients: ["@qdrant/js-client-rest", "@qdrant/qdrant-js"], patterns: [], images: [qdrant], editions: [full]}
402
415
  # Edition lite (ruleParams(manifest, 'be', 'lite') merges these keys over the base; a map merges one level deep): the schema
403
- # authority is the Supabase migration tree (supabase/migrations/*.sql, forward-only), so a lite back end holds no TypeORM
416
+ # authority is the SQL migration tree (db/migrations/*.sql, forward-only), so a lite back end holds no TypeORM
404
417
  # migration or entity under be/ (R34/R35 read schemaAuthority; be.persistence's lite overlay allows neither). The unit roles,
405
418
  # logic roles and spec doubles are full's (owner ruling 2026-10-12 (owner:lite-production-swarm), with the Work boundary amended by ruling:R212/case-4). infraOwners: full's owners,
406
419
  # bullmq in platform/queue and ioredis/redis in integrations/cache and integrations/redis (ruling:R212/case-10: the queue is
407
420
  # Redis in both editions; a backing library is legal only when hfs.json sides.be.backing declares its service, which
408
- # HFS_BACKING_UNDECLARED checks), except Kafka, which is owned nowhere (platform/event-bus runs Supabase Queues (pgmq) through
421
+ # HFS_BACKING_UNDECLARED checks), except Kafka, which is owned nowhere (platform/event-bus runs pgmq queues through
409
422
  # the shared EntityManager); realtime is the same socket.io gateway as full, run inside the api process, scaled horizontally and stateless (hub redis when
410
423
  # Redis is declared, else hub postgres with @socket.io/postgres-adapter; no sticky sessions).
424
+ # R334: the database functions code may call through platform/database's callDbFunction, advisoryXactLock and notify helpers,
425
+ # each {name, reason}; the canon lists the pg built-ins it uses itself, and an app adds its own in hfs.json sides.be.dbFunctions.
426
+ dbFunctions:
427
+ - {name: pg_advisory_xact_lock, reason: "advisoryXactLock: a transaction-scoped lock TypeORM has no API for"}
428
+ - {name: hashtextextended, reason: "advisoryXactLock: the 64-bit key of a text lock name"}
429
+ - {name: pg_notify, reason: "notify: LISTEN/NOTIFY of the Postgres realtime hub"}
430
+ - {name: to_regproc, reason: "callDbFunction: whether an optional database function exists"}
431
+ - {name: job_claim, reason: "platform/jobs (add job, lite): the fenced claim upsert of jobs.sql"}
432
+ - {name: job_advance, reason: "platform/jobs (add job, lite): the token-guarded step write of jobs.sql"}
433
+ - {name: job_complete, reason: "platform/jobs (add job, lite): the token-guarded completion of jobs.sql"}
434
+ - {name: job_fail, reason: "platform/jobs (add job, lite): the token-guarded failure of jobs.sql"}
435
+ - {name: queue_write, reason: "platform/queue (add queue, lite): the outbox insert of queue-outbox.sql"}
436
+ - {name: queue_waiting, reason: "platform/queue (add queue, lite): the relay read FOR UPDATE SKIP LOCKED of queue-outbox.sql"}
437
+ - {name: queue_mark_sent, reason: "platform/queue (add queue, lite): the relay mark of queue-outbox.sql"}
438
+ - {name: inbox_claim_event, reason: "platform/inbox (add webhook, lite): the conflict-safe delivery claim"}
439
+ - {name: inbox_claim_client, reason: "platform/inbox (add webhook, lite): the client claim upsert returning its committed outcome"}
440
+ - {name: inbox_save_client_outcome, reason: "platform/inbox (add webhook, lite): the saved client outcome"}
441
+ - {name: inbox_sweep_clients, reason: "platform/inbox (add webhook, lite): the bounded retention sweep FOR UPDATE SKIP LOCKED"}
442
+ - {name: event_bus_write, reason: "platform/event-bus (add webhook, lite): the typed envelope insert of the outbox"}
443
+
411
444
  lite:
412
- schemaAuthority: supabase
445
+ schemaAuthority: sql
413
446
  infraOwners:
414
447
  kafkajs: []
415
448
  "@qdrant/js-client-rest": []
@@ -439,7 +472,7 @@ slots:
439
472
  - id: app.package-manifest
440
473
  since: 3.1.0
441
474
  profiles: [app]
442
- editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite manages Supabase and wiring scripts; full also manages e2e and stack test scripts. Both may run optional contracts."
475
+ editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite manages its database and wiring scripts; full also manages e2e and stack test scripts. Both may run optional contracts."
443
476
  # The one package.json of the app, at the app root: be's dependencies and every tool, and every script; npm workspaces are
444
477
  # exactly fe/apps/* and fe/packages/* (HFS_MONO_WORKSPACES), each with its own package.json. be has no package.json of its own.
445
478
  path: package.json
@@ -508,7 +541,7 @@ slots:
508
541
  - id: app.format-config
509
542
  since: 3.1.0
510
543
  profiles: [app]
511
- editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite additionally ignores Supabase-generated row types when formatting; full has its TypeORM schema authority."
544
+ editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite additionally ignores the generated database row types when formatting; full has its TypeORM schema authority."
512
545
  # The one formatter configuration of the app (prettier walks up from every file of both sides to it): .prettierrc names
513
546
  # @starci/prettier-config, .prettierignore is the template.
514
547
  path: "{.prettierrc,.prettierignore}"
@@ -517,7 +550,7 @@ slots:
517
550
  tier: none
518
551
  tests: none
519
552
  managedBy: tool-config
520
- liteManagedBy: tool-config-lite # the same files plus the generated supabase/types, which the Supabase CLI writes unformatted
553
+ liteManagedBy: tool-config-lite # the same files as full
521
554
  rules: [HFS_MANAGED_FILE_DRIFT, HFS_TOOL_CONFIG_LOCAL]
522
555
  - id: app.tool-config-optional
523
556
  since: 3.1.0
@@ -560,7 +593,7 @@ slots:
560
593
  - id: app.ci
561
594
  since: 3.1.0
562
595
  profiles: [app]
563
- editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite CI proves boot through R272 wiring and checks Supabase artifacts; full also provides its e2e lane."
596
+ editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite CI proves boot through R272 wiring and checks its database artifacts; full also provides its e2e lane."
564
597
  path: ".github/workflows/ci.yml"
565
598
  presence: required
566
599
  tracked: tracked
@@ -585,7 +618,7 @@ slots:
585
618
  - id: app.ci-images
586
619
  since: 3.1.0
587
620
  profiles: [app]
588
- editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite renders its Supabase-backed image workflow; full renders images for its separately deployed services."
621
+ editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite renders its image workflow; full renders images for its separately deployed services."
589
622
  # Builds every image of the app (one matrix entry per declared app, path-filtered), never pushes: rendered by starci app sync.
590
623
  path: ".github/workflows/images.yml"
591
624
  presence: required
@@ -600,7 +633,7 @@ slots:
600
633
  exemplifiedBy:
601
634
  - packages/hfs/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml
602
635
  - {path: packages/hfs/src/hfs-release-provenance.spec.mjs, edition: full}
603
- editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite manages its Supabase database deploy workflow; full owns an optional provider-specific workflow."
636
+ editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite manages its database deploy workflow; full owns an optional provider-specific workflow."
604
637
  # The database deploy workflow: workflow_dispatch only (like app.ci-e2e); starci app sync renders it under the managed ci group.
605
638
  path: ".github/workflows/db-deploy.yml"
606
639
  presence: optional
@@ -638,7 +671,7 @@ slots:
638
671
  since: 3.1.0
639
672
  profiles: [app]
640
673
  # Production delivery tooling for the app's own processes: compose files, Caddyfile, *.env.example and ops shell scripts.
641
- # Lite still keeps its backing services on Supabase and its encrypted custody in app.starcistacks; R06 scans every file here.
674
+ # Lite keeps its encrypted custody in app.starcistacks; R06 scans every file here.
642
675
  path: "deploy/"
643
676
  presence: optional
644
677
  tracked: tracked
@@ -722,7 +755,7 @@ slots:
722
755
  profiles: [app]
723
756
  exemplifiedBy:
724
757
  - {path: packages/hfs/templates/app/skeleton/scripts/codegen.mjs, edition: full}
725
- editionWhy: "Lite manages its Supabase codegen script; full owns operational scripts through the generic path (ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4))."
758
+ editionWhy: "Lite manages its database-types codegen script; full owns operational scripts through the generic path (ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4))."
726
759
  # The app's operational scripts only (`*.mjs`, `*.cjs`, `*.ps1`, `*.sh`), or nothing: an empty folder is `scripts/.gitkeep`, which
727
760
  # `starci app scaffold` writes. A spec or a test (BE_SPEC_PLACEMENT, FE_NO_TESTS), a check or lint source (`check-*`, `eslint-local-rules*`,
728
761
  # a local eslint plugin: HFS_REPO_LOCAL_CHECK) and anything that re-implements a canon check is not an operational script and has no place here.
@@ -807,7 +840,7 @@ slots:
807
840
  - id: app.starcistacks
808
841
  since: 3.1.0
809
842
  profiles: [app]
810
- editionWhy: "owner:lite-production-swarm: lite requires declared docker-swarm production with Supabase backing; owner:dev-docker-prod-swarm keeps dependencies in Docker Linux containers in dev and the app and dependencies on Swarm in prod except hosted Supabase."
843
+ editionWhy: "owner:lite-production-swarm: lite requires declared docker-swarm production with its PostgreSQL as a stack service; owner:dev-docker-prod-swarm keeps dependencies in Docker Linux containers in dev and the app and dependencies on Swarm in prod."
811
844
  exemplifiedBy:
812
845
  - {path: packages/hfs/templates/app/skeleton/.starcistacks/, edition: full}
813
846
  - {path: packages/hfs/templates/app/skeleton-lite/.starcistacks/, edition: lite}
@@ -822,7 +855,7 @@ slots:
822
855
  "<env>/runtime/{config,env}/**", "<env>/runtime/env/KEYS.md", "<env>/secrets/<slug>.enc", "<env>/secrets/.gitkeep", "<env>/seeds/**"]
823
856
  forbids: ["<env>/runtime/files/**", "**/*.enc outside <env>/secrets/", DESIGN.md, deployment.json, "k8s/ at root"]
824
857
  # Owner ruling 2026-10-14: lite declares docker-swarm production, app runtime config, sealed custody and seed data.
825
- # Supabase supplies the database and broker; production has no Compose or host cron.
858
+ # The db service supplies the database and broker (pgmq, pg_cron); production has no Compose or host cron.
826
859
  lite:
827
860
  requires: [application-stacks.yaml]
828
861
  allows: [application-stacks.yaml, "<env>/README.md", "<env>/environment.json", "<env>/infra/swarm/**", "<env>/infra/metadata.json",
@@ -885,122 +918,78 @@ slots:
885
918
  goesTo: ".starcistacks/<env>/secrets/<slug>.enc (at the app root); decrypted values only in memory or under %LOCALAPPDATA%/StarCi/secrets/<project>/<env>/ via *_FILE"
886
919
  rules: [HFS_PLAINTEXT_SECRET]
887
920
 
888
- # ----- app root: the Supabase project of an app whose connection declares provider: supabase (every lite app) -------
889
- - id: app.supabase
890
- profiles: [app]
891
- exemplifiedBy:
892
- - packages/hfs/templates/app/skeleton-lite/supabase/
893
- - {path: packages/hfs/src/hfs-database-access.spec.mjs, edition: full}
894
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): Supabase is required in lite; full enables it only through a declared connection."
895
- # The one Supabase project directory, at the app root beside be/, fe/ and .starcistacks (never under a side).
896
- path: "supabase/"
897
- presence: opt-in # enabled by a connection with provider: supabase; required under edition lite
898
- provider: supabase
899
- litePresence: required
900
- tracked: tracked
901
- tier: none
902
- tests: none
903
- since: 2.1.0
904
- - id: app.supabase.config
921
+ # ----- app root: the database of a lite app (ruling:lite-self-hosted-postgres-passport-minio): a self-hosted PostgreSQL in the app's
922
+ # stack (the `db` service, image supabase/postgres for pg_cron, pg_net, pgmq, vector, unaccent and pgcrypto), migrated by
923
+ # `starci app db migrate --url-env <NAME>`. A full app keeps its TypeORM migrations under be/ and has no such folder.
924
+ - id: app.db
905
925
  profiles: [app]
926
+ editions: [lite]
906
927
  exemplifiedBy:
907
- - packages/hfs/templates/app/skeleton-lite/supabase/config.toml
908
- - {path: packages/hfs/src/db-config-policy.spec.mjs, edition: full}
909
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite requires Supabase configuration; full requires it only when Supabase is declared."
910
- # The project configuration: auth keys are env(NAME) references, never literals (L08 judges its policy keys).
911
- path: "supabase/config.toml"
912
- presence: opt-in
913
- provider: supabase
914
- litePresence: required
928
+ - packages/hfs/templates/app/skeleton-lite/db/
929
+ # The one database directory, at the app root beside be/, fe/ and .starcistacks (never under a side).
930
+ path: "db/"
931
+ presence: required
915
932
  tracked: tracked
916
933
  tier: none
917
934
  tests: none
918
- since: 2.1.0
919
- - id: app.supabase.migrations
935
+ since: 3.9.0
936
+ - id: app.db.migrations
920
937
  profiles: [app]
938
+ editions: [lite]
921
939
  exemplifiedBy:
922
- - packages/hfs/templates/app/skeleton-lite/supabase/migrations/__timestamp___baseline.sql
923
- - {path: packages/hfs/src/db-migration-shape.spec.mjs, edition: full}
924
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite uses Supabase schema authority and requires a migration; full opts into that provider."
925
- # The schema authority of an app on Supabase: forward-only SQL migrations named <timestamp14>_<kebab-name>.sql,
926
- # one file per change, immutable once on origin/main (L02-L08 judge them).
927
- path: "supabase/migrations/<stamp>_<name>.sql"
928
- presence: opt-in
929
- provider: supabase
930
- litePresence: required
931
- lite: {minInstances: 1}
940
+ - packages/hfs/templates/app/skeleton-lite/db/migrations/__timestamp___baseline.sql
941
+ - {path: packages/hfs/src/db-migration-shape.spec.mjs, edition: lite}
942
+ # The schema authority of a lite app: forward-only SQL migrations named <timestamp14>_<kebab-name>.sql, one file per change,
943
+ # immutable once on origin/main, applied in order by `starci app db migrate` and recorded in the history table.
944
+ path: "db/migrations/<stamp>_<name>.sql"
945
+ presence: required
946
+ minInstances: 1
932
947
  tracked: tracked
933
948
  tier: none
934
949
  tests: none
935
- since: 2.1.0
936
- - id: app.supabase.migrations.archive
950
+ since: 3.9.0
951
+ rules: [DB_MIGRATION_SHAPE, LITE_DB_MIGRATION]
952
+ - id: app.db.migrations.archive
937
953
  profiles: [app]
938
- # The migrations an existing app retired at its cutover (owner ruling 2026-10-13, migration baseline policy): the live schema is
939
- # dumped into ONE baseline migration written to the current standard, marked applied on production without a re-run, and the
940
- # older files move here. The Supabase CLI applies only supabase/migrations/<stamp>_<name>.sql, never this folder, and no
941
- # migration rule (L02-L08) judges it; new migrations append after the baseline.
942
- path: "supabase/migrations/_archive/"
943
- presence: opt-in
944
- provider: supabase
954
+ editions: [lite]
955
+ # The migrations an app retired at a baseline cutover: the live schema is dumped into ONE baseline migration, marked applied
956
+ # without a re-run, and the older files move here. `starci app db migrate` never applies this folder and no migration rule judges it.
957
+ path: "db/migrations/archive/"
958
+ presence: optional
945
959
  tracked: tracked
946
960
  tier: none
947
961
  tests: none
948
- since: 3.0.0
949
- - id: app.supabase.seed
962
+ since: 3.9.0
963
+ - id: app.db.seed
950
964
  profiles: [app]
951
- path: "supabase/seed.sql"
965
+ editions: [lite]
966
+ path: "db/seed.sql"
952
967
  presence: optional # synthetic dev data only; a lite app seeds nothing it cannot regenerate
953
968
  tracked: tracked
954
969
  tier: none
955
970
  tests: none
956
- since: 2.1.0
957
- - id: app.supabase.types
958
- profiles: [app]
959
- templateNa: "Database row types are generated from the app's Supabase schema by contract:emit; a hand-authored scaffold template would invent the schema contract."
960
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite requires generated Supabase row types; full enables them with the provider."
961
- # The generated Database types (database.types.ts) contract:emit writes from the migrations; both sides read it
962
- # (sides.<side>.reads supabase/types/); drift against regeneration is L09.
963
- path: "supabase/types/database.types.ts"
964
- presence: opt-in
965
- provider: supabase
966
- litePresence: required
967
- tracked: tracked
968
- tier: none
969
- tests: none
970
- since: 2.1.0
971
- exemplifiedBy:
972
- - {path: packages/hfs/src/db-types-returned-collector.spec.mjs, edition: full}
973
- - id: app.supabase.templates
971
+ since: 3.9.0
972
+ - id: app.db.bootstrap
974
973
  profiles: [app]
975
- path: "supabase/templates/*.html"
976
- presence: optional # the auth e-mail templates Supabase serves
974
+ editions: [lite]
975
+ # The managed pre-migration bootstrap (templates/app/db-bootstrap): the auth, storage and extensions schemas, auth.users with the
976
+ # GoTrue column set, auth.uid/role/jwt stubs, the NOLOGIN browser roles and the realtime publication, so migrations written for a
977
+ # hosted Supabase apply to the self-hosted db service. `starci app db migrate` applies it before the first migration of an empty database.
978
+ path: "db/bootstrap.sql"
979
+ presence: required
977
980
  tracked: tracked
981
+ managedBy: db-bootstrap
978
982
  tier: none
979
983
  tests: none
980
- since: 2.1.0
981
- - id: app.supabase.local-state
982
- profiles: [app]
983
- path: "supabase/{.temp,.branches}/"
984
- presence: optional
985
- tracked: ignored # the local CLI's working state: exists, never committed
986
- tier: none
987
- tests: none
988
- since: 2.1.0
989
- - id: app.supabase.functions
990
- profiles: [app]
991
- path: "supabase/functions/"
992
- presence: forbidden # a Deno runtime is a second language runtime outside the lint canon and the slot machine (lite v1)
993
- tracked: external
994
- tier: none
995
- tests: none
996
- goesTo: "a be feature: webhooks/<provider> for a third-party callback, api for an endpoint, a job of a queue (BullMQ on the declared Redis, its tick enqueued through the queue outbox) or a cli command on a schedule (pg_cron / pg_net)"
997
- since: 2.1.0
984
+ since: 3.9.0
985
+ rules: [HFS_MANAGED_FILE_DRIFT]
986
+
998
987
 
999
988
  # ----- side root (both sides): what a standalone repository root holds, less the app-root files ----------
1000
989
  - id: repo.side-root-forbidden
1001
990
  since: 3.1.0
1002
991
  profiles: [be, fe]
1003
- path: "{package.json,package-lock.json,hfs.json,README.md,.gitignore,.gitattributes,.husky/,.github/,.starciwork/,.starcistacks/,supabase/,.sops.yaml,sonar-project.properties,codecov.yml,.prettierrc,.prettierignore,scripts/}"
992
+ path: "{package.json,package-lock.json,hfs.json,README.md,.gitignore,.gitattributes,.husky/,.github/,.starciwork/,.starcistacks/,db/,.sops.yaml,sonar-project.properties,codecov.yml,.prettierrc,.prettierignore,scripts/}"
1004
993
  presence: forbidden
1005
994
  tracked: external
1006
995
  tier: none
@@ -1280,8 +1269,8 @@ slots:
1280
1269
  - {path: packages/hfs/src/mcp-tools-snapshot.spec.mjs, editions: [lite, full]}
1281
1270
 
1282
1271
  # ----- BE: apps (one slot per app kind; a new kind = a new slot, minor bump) ---------------------------
1283
- # The files of every app (owner ruling 2026-10-14, R245 and R246, since 3.1.0), each with a line budget that
1284
- # BE_APP_COMPOSITION_BUDGET holds absolutely (not a ratchet):
1272
+ # The files of every app (owner ruling 2026-10-14, R245 and R246, since 3.1.0), each with a line budget (lines excluding
1273
+ # import declarations, multi-line imports included) that BE_APP_COMPOSITION_BUDGET holds absolutely (not a ratchet):
1285
1274
  # main.ts the entry: builds EnvSource once, imports and calls read<App>Env from <app>.env.ts, builds options and boots.
1286
1275
  # <app>.env.ts exports interface <App>Env and read<App>Env(env: EnvSource): <App>Env (for example ApiEnv/readApiEnv);
1287
1276
  # fail-fast environment parsing only, via EnvSource and unchanged capability parse helpers; no localhost
@@ -1331,7 +1320,7 @@ slots:
1331
1320
  - id: be.app.cli
1332
1321
  since: 3.1.0
1333
1322
  profiles: [be]
1334
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): Supabase CLI owns lite migrations; a lite cli app is optional for declared operator commands."
1323
+ editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): `starci app db migrate` owns lite migrations; a lite cli app is optional for declared operator commands."
1335
1324
  # The ONE app of every one-off action (migrate, seed, sync, backup, any operator command): be/apps/cli, on nest-commander.
1336
1325
  # main.ts boots with CommandFactory.run (BE_CLI_BOOTSTRAP); app.module.ts composes the platform and the cli feature root
1337
1326
  # (src/features/cli/cli.module.ts); cli.env.ts exports CliEnv and readCliEnv(env: EnvSource): CliEnv, and cli.options.ts carries the env-derived values,
@@ -1341,7 +1330,7 @@ slots:
1341
1330
  path: "apps/<app>/src/"
1342
1331
  appKind: cli
1343
1332
  presence: opt-in
1344
- litePresence: optional # lite: schema migration is the Supabase CLI's job; a cli app exists only when the app declares one
1333
+ litePresence: optional # lite: schema migration is `starci app db migrate`'s job; a cli app exists only when the app declares one
1345
1334
  tracked: tracked
1346
1335
  tier: app
1347
1336
  owner: true
@@ -1692,7 +1681,7 @@ slots:
1692
1681
  - id: be.persistence
1693
1682
  since: 3.1.0
1694
1683
  profiles: [be]
1695
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): Supabase migrations own lite tables, with SQL and row types here; full keeps TypeORM entities and migrations here."
1684
+ editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): db/migrations own lite tables and both editions map them with TypeORM entities here (ruling:lite-persistence-typeorm-entities); full also keeps its TypeORM migrations here."
1696
1685
  path: "src/modules/{domain,platform,projections}/<capability>/persistence/"
1697
1686
  # R178: the platform capabilities whose tables exist on EVERY connection that uses them (the event-bus outbox, the inbox of every service, the job table); their arrays may be
1698
1687
  # registered on several declared connections. Any other capability registers its arrays on exactly one (BE_SCHEMA_OWNER).
@@ -1703,15 +1692,17 @@ slots:
1703
1692
  requires: [connection.ts] # the capability's <c>Entities / <c>Migrations arrays (the owner index re-exports the two arrays by name); no CONNECTION alias: the connection is the one the apps register the arrays on
1704
1693
  allows: ["entities/<table>.entity.ts", "migrations/<epochMs13>-<kebab-name>.ts", "<name>.sql.ts", "<name>.rows.ts", connection.ts]
1705
1694
  forbids: [index.ts, "<name>.repository.ts"]
1706
- # Lite keeps the shared-EntityManager persistence (raw SqlText + rows types over the generated Database row types) but the
1707
- # schema authority is supabase/migrations (ruleParams.be.lite.schemaAuthority): no TypeORM entity and no be migration.
1695
+ # Lite maps its tables with the same TypeORM entities as full (ruling:lite-persistence-typeorm-entities): each capability's
1696
+ # persistence/entities/<table>.entity.ts and an entities/index.ts exporting its <c>Entities array, which platform/database
1697
+ # lists by name; the schema authority stays db/migrations (ruleParams.be.lite.schemaAuthority), so no be migration and no
1698
+ # raw SQL file (R334 BE_PERSISTENCE_NO_RAW_SQL).
1708
1699
  lite:
1709
- requires: [] # no TypeORM arrays to re-export: the persistence of a lite capability is its sql and rows files
1710
- allows: ["<name>.sql.ts", "<name>.rows.ts", connection.ts]
1711
- forbids: [index.ts, "<name>.repository.ts", entities/, migrations/]
1700
+ requires: []
1701
+ allows: ["entities/<table>.entity.ts", entities/index.ts, connection.ts]
1702
+ forbids: [index.ts, "<name>.repository.ts", migrations/, "<name>.sql.ts", "<name>.rows.ts"]
1712
1703
  tests: none
1713
1704
  coverage: none
1714
- rules: [BE_SCHEMA_OWNER, BE_SCHEMA_AUTHORITY, BE_SQL_OUTSIDE_PERSISTENCE, BE_SQL_TABLE_OWNER, BE_SQL_RETURNING_SHAPE, BE_CONTEXT_COUPLING, BE_CONTEXT_PLATFORM_TABLES]
1705
+ rules: [BE_SCHEMA_OWNER, BE_SCHEMA_AUTHORITY, BE_SQL_OUTSIDE_PERSISTENCE, BE_PERSISTENCE_NO_RAW_SQL, BE_SQL_TABLE_OWNER, BE_SQL_RETURNING_SHAPE, BE_CONTEXT_COUPLING, BE_CONTEXT_PLATFORM_TABLES]
1715
1706
  - id: be.platform
1716
1707
  since: 3.1.0
1717
1708
  profiles: [be]
@@ -1762,7 +1753,7 @@ slots:
1762
1753
  owner: true
1763
1754
  lite:
1764
1755
  why: >-
1765
- the same EventPublisher and EventConsumer ports on Supabase Queues (pgmq): the outbox relay sends each committed row to the
1756
+ the same EventPublisher and EventConsumer ports on pgmq queues: the outbox relay sends each committed row to the
1766
1757
  pgmq queue of every consumer group of its topic through the shared EntityManager, a consumer reads with a visibility
1767
1758
  timeout, retries by letting it lapse and archives the message on dead letter (read_ct over the budget); a single api may
1768
1759
  deliver in process. No Kafka (knowledge/patterns/be/event-bus.yaml liteAdapter)
@@ -1776,7 +1767,7 @@ slots:
1776
1767
  - id: be.platform.queue
1777
1768
  since: 3.1.0
1778
1769
  profiles: [be]
1779
- editionWhy: "ruling:R212/case-10: both editions implement the queue ports with BullMQ on Redis; lite declares its Redis in hfs.json sides.be.backing and keeps the outbox table in a supabase migration."
1770
+ editionWhy: "ruling:R212/case-10: both editions implement the queue ports with BullMQ on Redis; lite declares its Redis in hfs.json sides.be.backing and keeps the outbox table in a db migration."
1780
1771
  path: "src/modules/platform/queue/"
1781
1772
  presence: opt-in
1782
1773
  pattern: queue # the ONE BullMQ owner: the outbox relay into queues (jobId = outbox id) and job schedulers (knowledge/patterns/be/queues.yaml)
@@ -1787,7 +1778,7 @@ slots:
1787
1778
  why: >-
1788
1779
  the same QueueOutbox and QueueWorkerRegistry ports and full's BullMQ adapter on the declared Redis (backing: [redis]): the
1789
1780
  relay adds each committed outbox row with the outbox id as the job id, workers retry with exponential backoff and keep a
1790
- job that exhausts its attempts as failed (the dead letter); the outbox table comes from a supabase migration, and a
1781
+ job that exhausts its attempts as failed (the dead letter); the outbox table comes from a db migration, and a
1791
1782
  schedule is a BullMQ job scheduler or a pg_cron tick that inserts one outbox row (knowledge/patterns/be/queues.yaml liteAdapter)
1792
1783
  requires: [index.ts, queue.module.ts, queue.port.ts, queue.contracts.ts, queue-outbox.service.ts, queue-outbox.service.spec.ts]
1793
1784
  tests: unit-beside
@@ -1881,7 +1872,7 @@ slots:
1881
1872
  - id: be.platform.jobs
1882
1873
  since: 3.1.0
1883
1874
  profiles: [be]
1884
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite persists fenced claims in Supabase migrations and dispatches through the BullMQ queue on its declared Redis (ruling:R212/case-10); full uses TypeORM schema authority and the same queue adapter."
1875
+ editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite persists fenced claims in db migrations and dispatches through the BullMQ queue on its declared Redis (ruling:R212/case-10); full uses TypeORM schema authority and the same queue adapter."
1885
1876
  path: "src/modules/platform/jobs/"
1886
1877
  presence: opt-in
1887
1878
  pattern: fenced-job # the ONE fencing primitive: the job entity, the claim that bumps the token, guarded writes (knowledge/patterns/be/jobs.yaml)
@@ -1896,7 +1887,7 @@ slots:
1896
1887
  - id: be.projections
1897
1888
  since: 3.1.0
1898
1889
  profiles: [be]
1899
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite projection tables live in Supabase migrations; full keeps the TypeORM projection entity beside its projection."
1890
+ editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite projection tables live in db migrations; full keeps the TypeORM projection entity beside its projection."
1900
1891
  path: "src/modules/projections/<name>/"
1901
1892
  presence: opt-in
1902
1893
  pattern: projection # a read model: only its projection writes its table; recompute is idempotent and replayable; readers use get*
@@ -1905,7 +1896,7 @@ slots:
1905
1896
  owner: true
1906
1897
  requires: [index.ts, "<name>.module.ts", "<name>.projection.ts", "<name>.projection-entity.ts"]
1907
1898
  allows: [index.ts, "<name>.module.ts", "<name>.module-definition.ts", "<name>.options.ts", "<name>.projection.ts", "<name>.projection-entity.ts", "<name>.contracts.ts", persistence/]
1908
- lite: # the read model's table is a supabase migration with its rows type (lite's schema authority): no TypeORM projection entity
1899
+ lite: # the read model's table is a db migration (lite's schema authority) mapped by its entity under persistence/entities/ (R334)
1909
1900
  requires: [index.ts, "<name>.module.ts", "<name>.projection.ts"]
1910
1901
  allows: [index.ts, "<name>.module.ts", "<name>.module-definition.ts", "<name>.options.ts", "<name>.projection.ts", "<name>.contracts.ts", persistence/]
1911
1902
  tests: unit-beside # a measured slot: <name>.projection.spec.ts beside its projection is legal (the file owes 100 per file; a spec of its own is optional)
@@ -1938,28 +1929,44 @@ slots:
1938
1929
  why: a self-hosted ML model client is an integration; weights and datasets are never in git, and a language model is called through the ai-router gateway by the integrations/ai LangChain client (BE-AI-1, BE-AI-3)
1939
1930
  rules: [BE_TIER_DIRECTION, BE_INFRA_OWNER, BE_INTEGRATION_SPEC_MISSING]
1940
1931
 
1941
- - id: be.integrations.supabase
1932
+ - id: be.integrations.passport
1942
1933
  profiles: [be]
1934
+ editions: [lite]
1943
1935
  exemplifiedBy:
1944
- - packages/hfs/templates/be/skeleton-lite/src/modules/integrations/supabase/
1945
- - {path: packages/hfs/src/be-supabase-jwt-verified.spec.mjs, edition: full}
1946
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite requires the Supabase Auth and Storage integration; full opts in through a connection."
1947
- # The only be import of @supabase/* (L10): the Auth admin and Storage admin client, plus the JWKS-based verification of
1948
- # the Supabase access token the guard chain reads (L16). The connection itself is ordinary Postgres (the shared
1949
- # EntityManager of the declared connection); what lives here are the service calls no database role covers.
1950
- path: "src/modules/integrations/supabase/"
1951
- presence: opt-in # enabled by a connection with provider: supabase; required under edition lite
1952
- provider: supabase
1936
+ - packages/hfs/templates/be/skeleton-lite/src/modules/integrations/passport/
1937
+ # The one owner of the lite identity libraries (ruleParams.be.infraOwners: @nestjs/passport, passport, passport-google-oauth20,
1938
+ # passport-local, @nestjs/jwt, jose, bcryptjs): the Google OAuth 2.0 strategy (state and PKCE), the local email and password
1939
+ # strategy (bcrypt), the app's own asymmetric access tokens and their JWKS, and the rotating refresh cookie. domain/identity
1940
+ # verifies a token through this integration's verifier and builds the principal (contexts/code/be/api-auth.md).
1941
+ path: "src/modules/integrations/passport/"
1942
+ presence: required
1943
+ tracked: tracked
1944
+ tier: integrations
1945
+ owner: true
1946
+ requires: [index.ts, passport.config.ts, passport.options.ts, passport.decorators.ts, passport.tokens.ts, passport.password.ts, passport.cookie.ts] # Secrets, no defaults (R44); options and named injectors (R83); tokens and JWKS; bcrypt; the refresh cookie
1947
+ allows: [index.ts, passport.config.ts, passport.options.ts, passport.decorators.ts, passport.tokens.ts, passport.password.ts, passport.cookie.ts, strategies/, errors/]
1948
+ tests: unit-beside
1949
+ rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INFRA_OWNER, BE_AUTH_PASSPORT_OWNER, BE_AUTH_JWT_OWN_JWKS, BE_AUTH_REFRESH_COOKIE]
1950
+ coverage: required
1951
+ since: 3.9.0
1952
+ - id: be.integrations.object-storage
1953
+ profiles: [be]
1954
+ exemplifiedBy:
1955
+ - packages/hfs/templates/be/skeleton-lite/src/modules/integrations/object-storage/
1956
+ # The one owner of the S3 client (@aws-sdk/client-s3 and @aws-sdk/s3-request-presigner) over S3-compatible storage (MinIO in
1957
+ # lite): the ObjectStorage port with presigned PUT and GET; no other module imports an S3 SDK or minio.
1958
+ path: "src/modules/integrations/object-storage/"
1959
+ presence: optional
1953
1960
  litePresence: required
1954
1961
  tracked: tracked
1955
1962
  tier: integrations
1956
1963
  owner: true
1957
- requires: [index.ts, supabase.config.ts, supabase.options.ts, supabase.decorators.ts, supabase.client.ts, supabase.jwks.ts] # Secrets, no defaults (R44); the options and the named injector (R83); the admin client; the token verification
1958
- allows: [index.ts, supabase.config.ts, supabase.options.ts, supabase.decorators.ts, supabase.client.ts, supabase.jwks.ts, errors/]
1964
+ requires: [index.ts, storage.config.ts, storage.options.ts, storage.decorators.ts, storage.client.ts]
1965
+ allows: [index.ts, storage.config.ts, storage.options.ts, storage.decorators.ts, storage.client.ts, errors/]
1959
1966
  tests: unit-beside
1960
- rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT]
1967
+ rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INFRA_OWNER, BE_STORAGE_OWNER]
1961
1968
  coverage: required
1962
- since: 2.1.0
1969
+ since: 3.9.0
1963
1970
 
1964
1971
  # ----- BE: tests (owner test layout 2026-09-30). Unit specs are <name>.service.spec.ts beside their service and nothing else; everything else
1965
1972
  # lives under src/tests/, one folder per kind, and the folder and the file suffix always agree (a file whose suffix does
@@ -1967,15 +1974,15 @@ slots:
1967
1974
  - id: be.tests.world
1968
1975
  since: 3.1.0
1969
1976
  profiles: [be]
1970
- editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite integration proofs use the local Supabase stack and network fakes; full also boots apps and self-hosted services."
1977
+ editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite integration proofs use the local db service and network fakes; full also boots apps and self-hosted services."
1971
1978
  path: "src/tests/world/"
1972
1979
  presence: optional
1973
1980
  tracked: tracked
1974
1981
  tier: e2e
1975
1982
  lite:
1976
1983
  why: >-
1977
- the world of the optional integration specs of a lite app: global-setup.ts connects to the local Supabase CLI stack
1978
- (`starci supabase start`, with the migrations applied by the local stack) and starts no container, no toxiproxy and no stack of its
1984
+ the world of the optional integration specs of a lite app: global-setup.ts connects to the local db service
1985
+ (`npm run db:start`, with the migrations applied by `npm run db:push`) and starts no container, no toxiproxy and no stack of its
1979
1986
  own; use-test-world.ts exports useTestWorld({ modules: [...] }) -> world.db.<connection> (the shared EntityManager) and
1980
1987
  world.fake.<provider> (a network-edge fake of an external SaaS). There is no world.apps (no e2e) and no world.infra
1981
1988
  (no self-hosted service to cut)
@@ -2044,7 +2051,7 @@ slots:
2044
2051
  - id: be.tests.integration
2045
2052
  since: 3.1.0
2046
2053
  profiles: [be]
2047
- editionWhy: "Lite integration specs use the local Supabase CLI stack without containers or toxiproxy (ruling:R212/case-1, amended by ruling:R212/case-2 (owner:lite-production-swarm) and ruling:R212/case-4, with contracts allowed by owner:lite-contract-specs); R284 requires declared-pattern proofs there. Full additionally proves infrastructure outages through its world (R112)."
2054
+ editionWhy: "Lite integration specs use the local db service without containers or toxiproxy (ruling:R212/case-1, amended by ruling:R212/case-2 (owner:lite-production-swarm) and ruling:R212/case-4, with contracts allowed by owner:lite-contract-specs); R284 requires declared-pattern proofs there. Full additionally proves infrastructure outages through its world (R112)."
2048
2055
  path: "src/tests/integration/<capability>/*.integration-spec.ts"
2049
2056
  presence: optional
2050
2057
  tracked: tracked
@@ -2053,8 +2060,8 @@ slots:
2053
2060
  coverage: none
2054
2061
  lite:
2055
2062
  why: >-
2056
- optional under lite: one capability module through useTestWorld({ modules }) against the local Supabase CLI stack
2057
- (`starci supabase start`), run by test:integration; no container, no toxiproxy and no outage through the world (R112 is full's)
2063
+ optional under lite: one capability module through useTestWorld({ modules }) against the local db service
2064
+ (`npm run db:start`), run by test:integration; no container, no toxiproxy and no outage through the world (R112 is full's)
2058
2065
  why: one capability module through useTestWorld({ modules }), no HTTP door of ours (SQL, transactions, concurrency, inbox claims on the real database; and every integration client, `<capability>` being its provider folder, against our real infra, a real peer app or the library fake at the network edge, with its success, its ErrorCode refusal mapping and an outage through the world, R112); run by test:integration
2059
2066
  rules: [BE_TEST_TOPOLOGY, BE_INTEGRATION_SPEC_MISSING]
2060
2067
  - id: be.tests.e2e
@@ -2067,7 +2074,7 @@ slots:
2067
2074
  tracked: tracked
2068
2075
  tier: e2e
2069
2076
  tests: e2e
2070
- goesTo: "the full edition: a lite app has no e2e world; its logic is proven by unit specs and its database by optional integration specs on `starci supabase start`"
2077
+ goesTo: "the full edition: a lite app has no e2e world; its logic is proven by unit specs and its database by optional integration specs on `npm run db:start`"
2071
2078
  coverage: none
2072
2079
  why: flow e2e through useTestWorld({ apps }); external services are the world's network fakes; run by test:e2e
2073
2080
  rules: [HFS_CI_E2E_AUTOMATIC, BE_TEST_TOPOLOGY, BE_E2E_FLOW]
@@ -2126,7 +2133,7 @@ slots:
2126
2133
  tracked: tracked
2127
2134
  tier: route
2128
2135
  # ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4) (lite = full): routes are thin and the front end serves no API - health/live is the one
2129
- # route handler of this slot, the Supabase auth callback is fe.route.callback, and no file holds a Server Action
2136
+ # route handler of this slot, the OAuth callback is a back-end door, and no file holds a Server Action
2130
2137
  # (FE_ROUTE_HANDLER_FORBIDDEN, FE_SERVER_ACTION_FORBIDDEN).
2131
2138
  allows: ["[locale]/**/{page,layout,template,loading,error,not-found,default}.tsx", "[locale]/providers.tsx",
2132
2139
  global-error.tsx, page.tsx, # the root page.tsx only redirects (FE_ROUTE_FILES_THIN)
@@ -2157,20 +2164,6 @@ slots:
2157
2164
  tests: none
2158
2165
  goesTo: "apps/<app>/src/proxy.ts: Next >= 16 reads proxy.ts and refuses middleware.ts"
2159
2166
  rules: [FE_NEXT_CONVENTIONS]
2160
- - id: fe.route.callback
2161
- profiles: [fe]
2162
- # The auth callback of a Supabase session (the PKCE code exchange), kept only when the auth flow truly needs a server exchange
2163
- # (prefer the client-side PKCE exchange in fe.modules.auth): the one non-health route handler of an app with a Supabase
2164
- # connection; an app without one has no route handler in fe/ (L15).
2165
- path: "apps/<app>/src/app/auth/callback/route.ts"
2166
- presence: opt-in
2167
- provider: supabase
2168
- tracked: tracked
2169
- tier: route
2170
- tests: none
2171
- since: 2.1.0
2172
- rules: [FE_ROUTE_HANDLER_FORBIDDEN, FE_CALLBACK_SHAPE, FE_SUPABASE_CLIENT_OWNER, FE_SERVICE_ROLE_FORBIDDEN]
2173
-
2174
2167
  - id: fe.feature
2175
2168
  since: 3.1.0
2176
2169
  profiles: [fe]
@@ -2502,18 +2495,17 @@ slots:
2502
2495
  - id: fe.modules.auth
2503
2496
  profiles: [fe]
2504
2497
  # The identity-provider client (fe-stack auth, FE-AUTH): the session, the access token the Apollo link attaches and the
2505
- # sign-in/sign-out calls. With a Supabase connection it is the ONLY fe importer of @supabase/supabase-js and uses its auth API
2506
- # only; Supabase on the front end never reads or writes data (owner ruling 2026-10-13).
2498
+ # sign-in/sign-out calls. It talks only to the app's own back-end auth doors and holds no credential: the refresh token lives in
2499
+ # the back end's httpOnly cookie and the access token in memory (ruling:lite-self-hosted-postgres-passport-minio).
2507
2500
  path: "apps/<app>/src/modules/auth/"
2508
2501
  presence: optional
2509
2502
  tracked: tracked
2510
2503
  tier: modules
2511
2504
  owner: true
2512
2505
  requires: [index.ts]
2513
- entries: [server.ts] # the server-only PKCE exchange API used by the opted-in callback route
2514
2506
  tests: none
2515
2507
  since: 3.0.0
2516
- rules: [FE_SUPABASE_CLIENT_OWNER, FE_SERVICE_ROLE_FORBIDDEN]
2508
+ rules: [FE_STACK_FORBIDDEN]
2517
2509
  - id: fe.modules.toast
2518
2510
  profiles: [fe]
2519
2511
  # Mutation feedback (fe-stack toast, FE-TOAST): the HeroUI toast wrapper, showGraphQLToast over a GraphQLResponse and the