@starci/eslint-canon-fe 9.4.7 → 9.5.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.
- package/CHANGELOG.md +15 -0
- package/dist/fe-stack.d.ts +3 -3
- package/dist/fe-stack.js +3 -9
- package/dist/index.js +0 -2
- package/dist/lib/scope.d.ts +8 -0
- package/dist/lib/scope.js +10 -0
- package/dist/lib/why.js +2 -2
- package/dist/shape-slot.d.ts +2 -2
- package/dist/transport.d.ts +1 -1
- package/dist/transport.js +29 -7
- package/package.json +1 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +54 -24
- package/runtime/knowledge/hfs/fe-stack.yaml +4 -11
- package/runtime/knowledge/hfs/slots.yaml +185 -174
- package/runtime/scripts/hfs/architecture/canon-clones.mjs +1 -1
- package/runtime/scripts/hfs/architecture/{supabase-be.mjs → identity.mjs} +45 -15
- package/runtime/scripts/hfs/architecture/index.mjs +2 -3
- package/runtime/scripts/hfs/architecture/{supabase-ast.mjs → jwt-ast.mjs} +2 -103
- package/runtime/scripts/hfs/architecture/register-once.mjs +1 -1
- package/runtime/scripts/hfs/architecture/schema-owner.mjs +29 -4
- package/runtime/scripts/hfs/architecture/server-action.mjs +3 -4
- package/runtime/scripts/hfs/architecture/side-boundary.mjs +1 -1
- package/runtime/scripts/hfs/architecture/{supabase-keys.mjs → sql-keys.mjs} +1 -1
- package/runtime/scripts/hfs/architecture/sql-owner.mjs +25 -27
- package/runtime/scripts/hfs/architecture/transport-owner.mjs +7 -3
- package/runtime/scripts/hfs/declaration-shape.mjs +15 -18
- package/runtime/scripts/hfs/manifest-shape.mjs +4 -4
- package/runtime/scripts/hfs/rule-params-shape.mjs +4 -1
- package/runtime/scripts/hfs/rules/database-constants.mjs +8 -10
- package/runtime/scripts/hfs/rules/database-migrations.mjs +3 -3
- package/runtime/scripts/hfs/slot-app-view.mjs +1 -1
- package/runtime/scripts/hfs/slots.mjs +8 -2
- package/runtime/scripts/lib/secret-patterns.mjs +2 -2
- package/dist/callback-shape.d.ts +0 -7
- package/dist/callback-shape.js +0 -396
- package/dist/lib/pure-owner-helper.d.ts +0 -10
- package/dist/lib/pure-owner-helper.js +0 -156
- package/runtime/scripts/hfs/architecture/supabase-tables.mjs +0 -50
- package/runtime/scripts/hfs/architecture/supabase.mjs +0 -226
|
@@ -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.
|
|
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`).
|
|
@@ -102,34 +105,34 @@ versioning:
|
|
|
102
105
|
# requiredInstances, why), each shaped as the same field in the slot body; every other field is the edition's.
|
|
103
106
|
# `why` under lite names the adapter behind the slot's ports (pgmq, Postgres locks, in-process socket.io).
|
|
104
107
|
# `tests` is never overlaid: a lite slot owes exactly the unit specs its full slot owes.
|
|
105
|
-
# provider the hfs.json connections[].provider that enables this opt-in slot (
|
|
108
|
+
# provider the hfs.json connections[].provider that enables this opt-in slot (postgres); never an app kind.
|
|
106
109
|
# since the manifest version that introduced the slot.
|
|
107
110
|
presenceValues: [required, optional, opt-in, forbidden]
|
|
108
111
|
trackedValues: [tracked, ignored, external]
|
|
109
112
|
testValues: [unit-beside, e2e, none]
|
|
110
113
|
|
|
111
114
|
# 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
|
|
112
|
-
# the full architecture
|
|
115
|
+
# 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,
|
|
113
116
|
# event bus, saga, reactors, projection, realtime, webhooks, fenced job), declared in hfs.json the same way, and the same unit
|
|
114
117
|
# specs (unitRoles, logicRoles, 100 per file, @starci/jest-preset doubles, builders). What differs is ADAPTERS and DELIVERY
|
|
115
|
-
# (ruling:R212/case-10): schema authority in
|
|
118
|
+
# (ruling:R212/case-10): schema authority in db/migrations, the queue port on BullMQ over the Redis hfs.json
|
|
116
119
|
# sides.be.backing declares (as in full, fed by the Postgres outbox), event-bus ports on pgmq-backed topics or in-process
|
|
117
120
|
# delivery, cache and locks on Postgres or the declared Redis, schedules on pg_cron (+ pg_net) enqueueing through the queue
|
|
118
|
-
# outbox, storage and auth
|
|
121
|
+
# outbox, storage on S3-compatible MinIO (integrations/object-storage) and auth through integrations/passport. Realtime uses SSE or the socket.io gateway
|
|
119
122
|
# 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;
|
|
120
123
|
# declared patterns owe their integration proofs (R284). Lite has no e2e world. Production uses declared docker-swarm under
|
|
121
|
-
# .starcistacks/production/infra/swarm/ (owner ruling 2026-10-14); lite runs
|
|
122
|
-
# services sides.be.backing declares. The front end is full's (R97).
|
|
124
|
+
# .starcistacks/production/infra/swarm/ (owner ruling 2026-10-14); lite runs its PostgreSQL as the db service of its
|
|
125
|
+
# stack and only the backing services sides.be.backing declares. The front end is full's (R97).
|
|
123
126
|
# Lite is this same manifest filtered: a slot whose `editions` lacks lite does not exist for a lite app, `litePresence` replaces
|
|
124
127
|
# presence and a `lite` map replaces the fields it names. The edition is chosen once at scaffold; there is no upgrade
|
|
125
128
|
# or downgrade between lite and full. Lite contracts are allowed (owner decision 2026-10-14).
|
|
126
129
|
editions: [full, lite]
|
|
127
130
|
|
|
128
131
|
# 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
|
|
129
|
-
# may read (hfs.json sides.<side>.reads names a subset), or a tree an app-root slot owns
|
|
132
|
+
# may read (hfs.json sides.<side>.reads names a subset), or a tree an app-root slot owns; nothing else crosses sides.
|
|
130
133
|
sides:
|
|
131
|
-
be: {reads: [
|
|
132
|
-
fe: {reads: [be/contracts
|
|
134
|
+
be: {reads: []}
|
|
135
|
+
fe: {reads: [be/contracts/]} # be/contracts/: the committed contract snapshots, the input of the front end's codegen
|
|
133
136
|
|
|
134
137
|
# 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
|
|
135
138
|
# (BE_KIND_ISOLATION), every cross-kind call is an event on the bus, and only be/apps/* compose features.
|
|
@@ -192,9 +195,9 @@ crossApp: apps never import each other; shared code is a packages/<pkg> slot.
|
|
|
192
195
|
ruleParams:
|
|
193
196
|
db:
|
|
194
197
|
# R259: btree_gist supplies UUID equality for the booking interval exclusion constraint.
|
|
195
|
-
# R259: unaccent
|
|
198
|
+
# R259: unaccent ships in the supabase/postgres image of the db service, used by Vietnamese-content search functions.
|
|
196
199
|
extensions: [pgmq, pg_cron, pgcrypto, pg_trgm, vector, uuid-ossp, pg_net, supabase_vault, unaccent, btree_gist]
|
|
197
|
-
# R258 DB_CRON_OWNED: THE queue outbox of a
|
|
200
|
+
# 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
|
|
198
201
|
# job enqueues only by inserting one row into this table, writing only these columns, one of which is `queue`.
|
|
199
202
|
queueOutbox: {table: public.queue, columns: [queue, payload, created_at, correlation_id]}
|
|
200
203
|
common:
|
|
@@ -218,8 +221,18 @@ ruleParams:
|
|
|
218
221
|
"node:https": [platform/http]
|
|
219
222
|
http: [platform/http]
|
|
220
223
|
https: [platform/http]
|
|
221
|
-
"@aws-sdk/client-s3": [integrations/object-storage] # the ObjectStorage port: one S3 adapter for MinIO, S3
|
|
224
|
+
"@aws-sdk/client-s3": [integrations/object-storage] # the ObjectStorage port: one S3 adapter for MinIO, S3 and Spaces (R331)
|
|
222
225
|
"@aws-sdk/s3-request-presigner": [integrations/object-storage]
|
|
226
|
+
minio: [] # storage goes through the S3 client of integrations/object-storage
|
|
227
|
+
"@supabase": [] # no Supabase client in a back end
|
|
228
|
+
"@nestjs/passport": [integrations/passport] # the identity libraries (R328)
|
|
229
|
+
passport: [integrations/passport]
|
|
230
|
+
passport-google-oauth20: [integrations/passport]
|
|
231
|
+
passport-local: [integrations/passport]
|
|
232
|
+
"@nestjs/jwt": [integrations/passport]
|
|
233
|
+
jose: [integrations/passport]
|
|
234
|
+
bcryptjs: [integrations/passport]
|
|
235
|
+
bcrypt: []
|
|
223
236
|
cache-manager: [integrations/cache, integrations/redis]
|
|
224
237
|
"@nestjs/cache-manager": [integrations/cache, integrations/redis] # the CACHE_MANAGER token: caching goes through the cache capability
|
|
225
238
|
redis: [integrations/cache, integrations/redis]
|
|
@@ -254,6 +267,25 @@ ruleParams:
|
|
|
254
267
|
"@socket.io/postgres-adapter": [platform/realtime] # the stateless socket.io adapter of a scaled lite back end without Redis
|
|
255
268
|
"@socket.io/redis-adapter": [platform/realtime] # the sharded socket.io adapter of a scaled back end on the declared Redis
|
|
256
269
|
pg: [platform/realtime] # the LISTEN connection of the Postgres hub; every other query goes through TypeORM
|
|
270
|
+
# BE-AI-1, BE-AI-3: every model call goes through the ai-router gateway. Its custody owner registers @starci/ai-router with the
|
|
271
|
+
# provider keys; the one LangChain integration owns @langchain/*; no provider SDK, openai client or agent framework is imported.
|
|
272
|
+
"@starci/ai-router": [integrations/ai-gateway]
|
|
273
|
+
"@starci/ai-router/testing": [integrations/ai-gateway, integrations/ai] # the fake provider a spec of either side boots the gateway with
|
|
274
|
+
"@langchain": [integrations/ai] # a scope key: every @langchain/* package
|
|
275
|
+
"@langchain/langgraph": [] # an agent loop runs in the agent runtime, never in code
|
|
276
|
+
"@langchain/community": [] # retrieval reads the app's own persistence through its owner
|
|
277
|
+
langchain: [] # createAgent is an agent loop
|
|
278
|
+
openai: [] # code calls models through @langchain/openai
|
|
279
|
+
"@anthropic-ai/sdk": []
|
|
280
|
+
"@google/genai": []
|
|
281
|
+
"@google/generative-ai": []
|
|
282
|
+
"@mistralai/mistralai": []
|
|
283
|
+
"@openrouter/ai-sdk-provider": []
|
|
284
|
+
"@ai-sdk": []
|
|
285
|
+
ai: []
|
|
286
|
+
cohere-ai: []
|
|
287
|
+
groq-sdk: []
|
|
288
|
+
ollama: []
|
|
257
289
|
# R87 BE_CQRS_SHAPE no-event-bus: the in-process event vocabulary the rule refuses. `imports` maps a module
|
|
258
290
|
# specifier to the member names that are an in-process event; `[]` flags the package itself (its emitter packages
|
|
259
291
|
# are the `[]` owners of infraOwners above). `classes` maps a module specifier to the class names that are an
|
|
@@ -372,21 +404,41 @@ ruleParams:
|
|
|
372
404
|
# end may declare in hfs.json sides.be.backing. `clients` are the libraries that consume the service: one of them as a dependency
|
|
373
405
|
# is its consumer, and under lite none of them may be a dependency while the service is undeclared. `patterns` are the declared
|
|
374
406
|
# patterns that need the service. `images` are the image repositories (the last path segment) a stack runs it from.
|
|
375
|
-
# `editions` limits admission: owner:lite-vector-is-pgvector keeps vector search on
|
|
407
|
+
# `editions` limits admission: owner:lite-vector-is-pgvector keeps vector search on pgvector in lite.
|
|
376
408
|
backing:
|
|
377
409
|
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]}
|
|
378
410
|
qdrant: {clients: ["@qdrant/js-client-rest", "@qdrant/qdrant-js"], patterns: [], images: [qdrant], editions: [full]}
|
|
379
411
|
# Edition lite (ruleParams(manifest, 'be', 'lite') merges these keys over the base; a map merges one level deep): the schema
|
|
380
|
-
# authority is the
|
|
412
|
+
# authority is the SQL migration tree (db/migrations/*.sql, forward-only), so a lite back end holds no TypeORM
|
|
381
413
|
# migration or entity under be/ (R34/R35 read schemaAuthority; be.persistence's lite overlay allows neither). The unit roles,
|
|
382
414
|
# 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,
|
|
383
415
|
# bullmq in platform/queue and ioredis/redis in integrations/cache and integrations/redis (ruling:R212/case-10: the queue is
|
|
384
416
|
# Redis in both editions; a backing library is legal only when hfs.json sides.be.backing declares its service, which
|
|
385
|
-
# HFS_BACKING_UNDECLARED checks), except Kafka, which is owned nowhere (platform/event-bus runs
|
|
417
|
+
# HFS_BACKING_UNDECLARED checks), except Kafka, which is owned nowhere (platform/event-bus runs pgmq queues through
|
|
386
418
|
# the shared EntityManager); realtime is the same socket.io gateway as full, run inside the api process, scaled horizontally and stateless (hub redis when
|
|
387
419
|
# Redis is declared, else hub postgres with @socket.io/postgres-adapter; no sticky sessions).
|
|
420
|
+
# R334: the database functions code may call through platform/database's callDbFunction, advisoryXactLock and notify helpers,
|
|
421
|
+
# 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.
|
|
422
|
+
dbFunctions:
|
|
423
|
+
- {name: pg_advisory_xact_lock, reason: "advisoryXactLock: a transaction-scoped lock TypeORM has no API for"}
|
|
424
|
+
- {name: hashtextextended, reason: "advisoryXactLock: the 64-bit key of a text lock name"}
|
|
425
|
+
- {name: pg_notify, reason: "notify: LISTEN/NOTIFY of the Postgres realtime hub"}
|
|
426
|
+
- {name: to_regproc, reason: "callDbFunction: whether an optional database function exists"}
|
|
427
|
+
- {name: job_claim, reason: "platform/jobs (add job, lite): the fenced claim upsert of jobs.sql"}
|
|
428
|
+
- {name: job_advance, reason: "platform/jobs (add job, lite): the token-guarded step write of jobs.sql"}
|
|
429
|
+
- {name: job_complete, reason: "platform/jobs (add job, lite): the token-guarded completion of jobs.sql"}
|
|
430
|
+
- {name: job_fail, reason: "platform/jobs (add job, lite): the token-guarded failure of jobs.sql"}
|
|
431
|
+
- {name: queue_write, reason: "platform/queue (add queue, lite): the outbox insert of queue-outbox.sql"}
|
|
432
|
+
- {name: queue_waiting, reason: "platform/queue (add queue, lite): the relay read FOR UPDATE SKIP LOCKED of queue-outbox.sql"}
|
|
433
|
+
- {name: queue_mark_sent, reason: "platform/queue (add queue, lite): the relay mark of queue-outbox.sql"}
|
|
434
|
+
- {name: inbox_claim_event, reason: "platform/inbox (add webhook, lite): the conflict-safe delivery claim"}
|
|
435
|
+
- {name: inbox_claim_client, reason: "platform/inbox (add webhook, lite): the client claim upsert returning its committed outcome"}
|
|
436
|
+
- {name: inbox_save_client_outcome, reason: "platform/inbox (add webhook, lite): the saved client outcome"}
|
|
437
|
+
- {name: inbox_sweep_clients, reason: "platform/inbox (add webhook, lite): the bounded retention sweep FOR UPDATE SKIP LOCKED"}
|
|
438
|
+
- {name: event_bus_write, reason: "platform/event-bus (add webhook, lite): the typed envelope insert of the outbox"}
|
|
439
|
+
|
|
388
440
|
lite:
|
|
389
|
-
schemaAuthority:
|
|
441
|
+
schemaAuthority: sql
|
|
390
442
|
infraOwners:
|
|
391
443
|
kafkajs: []
|
|
392
444
|
"@qdrant/js-client-rest": []
|
|
@@ -416,7 +468,7 @@ slots:
|
|
|
416
468
|
- id: app.package-manifest
|
|
417
469
|
since: 3.1.0
|
|
418
470
|
profiles: [app]
|
|
419
|
-
editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite manages
|
|
471
|
+
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."
|
|
420
472
|
# The one package.json of the app, at the app root: be's dependencies and every tool, and every script; npm workspaces are
|
|
421
473
|
# exactly fe/apps/* and fe/packages/* (HFS_MONO_WORKSPACES), each with its own package.json. be has no package.json of its own.
|
|
422
474
|
path: package.json
|
|
@@ -485,7 +537,7 @@ slots:
|
|
|
485
537
|
- id: app.format-config
|
|
486
538
|
since: 3.1.0
|
|
487
539
|
profiles: [app]
|
|
488
|
-
editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite additionally ignores
|
|
540
|
+
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."
|
|
489
541
|
# The one formatter configuration of the app (prettier walks up from every file of both sides to it): .prettierrc names
|
|
490
542
|
# @starci/prettier-config, .prettierignore is the template.
|
|
491
543
|
path: "{.prettierrc,.prettierignore}"
|
|
@@ -494,7 +546,7 @@ slots:
|
|
|
494
546
|
tier: none
|
|
495
547
|
tests: none
|
|
496
548
|
managedBy: tool-config
|
|
497
|
-
liteManagedBy: tool-config-lite # the same files
|
|
549
|
+
liteManagedBy: tool-config-lite # the same files as full
|
|
498
550
|
rules: [HFS_MANAGED_FILE_DRIFT, HFS_TOOL_CONFIG_LOCAL]
|
|
499
551
|
- id: app.tool-config-optional
|
|
500
552
|
since: 3.1.0
|
|
@@ -537,7 +589,7 @@ slots:
|
|
|
537
589
|
- id: app.ci
|
|
538
590
|
since: 3.1.0
|
|
539
591
|
profiles: [app]
|
|
540
|
-
editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite CI proves boot through R272 wiring and checks
|
|
592
|
+
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."
|
|
541
593
|
path: ".github/workflows/ci.yml"
|
|
542
594
|
presence: required
|
|
543
595
|
tracked: tracked
|
|
@@ -562,7 +614,7 @@ slots:
|
|
|
562
614
|
- id: app.ci-images
|
|
563
615
|
since: 3.1.0
|
|
564
616
|
profiles: [app]
|
|
565
|
-
editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite renders its
|
|
617
|
+
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."
|
|
566
618
|
# Builds every image of the app (one matrix entry per declared app, path-filtered), never pushes: rendered by starci app sync.
|
|
567
619
|
path: ".github/workflows/images.yml"
|
|
568
620
|
presence: required
|
|
@@ -577,7 +629,7 @@ slots:
|
|
|
577
629
|
exemplifiedBy:
|
|
578
630
|
- packages/hfs/templates/app/ci-workflows-lite/github/workflows/db-deploy.yml
|
|
579
631
|
- {path: packages/hfs/src/hfs-release-provenance.spec.mjs, edition: full}
|
|
580
|
-
editionWhy: "ruling:R212/case-2 (with the Work boundary amended by ruling:R212/case-4): lite manages its
|
|
632
|
+
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."
|
|
581
633
|
# The database deploy workflow: workflow_dispatch only (like app.ci-e2e); starci app sync renders it under the managed ci group.
|
|
582
634
|
path: ".github/workflows/db-deploy.yml"
|
|
583
635
|
presence: optional
|
|
@@ -615,7 +667,7 @@ slots:
|
|
|
615
667
|
since: 3.1.0
|
|
616
668
|
profiles: [app]
|
|
617
669
|
# Production delivery tooling for the app's own processes: compose files, Caddyfile, *.env.example and ops shell scripts.
|
|
618
|
-
# Lite
|
|
670
|
+
# Lite keeps its encrypted custody in app.starcistacks; R06 scans every file here.
|
|
619
671
|
path: "deploy/"
|
|
620
672
|
presence: optional
|
|
621
673
|
tracked: tracked
|
|
@@ -699,7 +751,7 @@ slots:
|
|
|
699
751
|
profiles: [app]
|
|
700
752
|
exemplifiedBy:
|
|
701
753
|
- {path: packages/hfs/templates/app/skeleton/scripts/codegen.mjs, edition: full}
|
|
702
|
-
editionWhy: "Lite manages its
|
|
754
|
+
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))."
|
|
703
755
|
# The app's operational scripts only (`*.mjs`, `*.cjs`, `*.ps1`, `*.sh`), or nothing: an empty folder is `scripts/.gitkeep`, which
|
|
704
756
|
# `starci app scaffold` writes. A spec or a test (BE_SPEC_PLACEMENT, FE_NO_TESTS), a check or lint source (`check-*`, `eslint-local-rules*`,
|
|
705
757
|
# 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.
|
|
@@ -784,7 +836,7 @@ slots:
|
|
|
784
836
|
- id: app.starcistacks
|
|
785
837
|
since: 3.1.0
|
|
786
838
|
profiles: [app]
|
|
787
|
-
editionWhy: "owner:lite-production-swarm: lite requires declared docker-swarm production with
|
|
839
|
+
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."
|
|
788
840
|
exemplifiedBy:
|
|
789
841
|
- {path: packages/hfs/templates/app/skeleton/.starcistacks/, edition: full}
|
|
790
842
|
- {path: packages/hfs/templates/app/skeleton-lite/.starcistacks/, edition: lite}
|
|
@@ -799,7 +851,7 @@ slots:
|
|
|
799
851
|
"<env>/runtime/{config,env}/**", "<env>/runtime/env/KEYS.md", "<env>/secrets/<slug>.enc", "<env>/secrets/.gitkeep", "<env>/seeds/**"]
|
|
800
852
|
forbids: ["<env>/runtime/files/**", "**/*.enc outside <env>/secrets/", DESIGN.md, deployment.json, "k8s/ at root"]
|
|
801
853
|
# Owner ruling 2026-10-14: lite declares docker-swarm production, app runtime config, sealed custody and seed data.
|
|
802
|
-
#
|
|
854
|
+
# The db service supplies the database and broker (pgmq, pg_cron); production has no Compose or host cron.
|
|
803
855
|
lite:
|
|
804
856
|
requires: [application-stacks.yaml]
|
|
805
857
|
allows: [application-stacks.yaml, "<env>/README.md", "<env>/environment.json", "<env>/infra/swarm/**", "<env>/infra/metadata.json",
|
|
@@ -862,122 +914,78 @@ slots:
|
|
|
862
914
|
goesTo: ".starcistacks/<env>/secrets/<slug>.enc (at the app root); decrypted values only in memory or under %LOCALAPPDATA%/StarCi/secrets/<project>/<env>/ via *_FILE"
|
|
863
915
|
rules: [HFS_PLAINTEXT_SECRET]
|
|
864
916
|
|
|
865
|
-
# ----- app root: the
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
- packages/hfs/templates/app/skeleton-lite/supabase/
|
|
870
|
-
- {path: packages/hfs/src/hfs-database-access.spec.mjs, edition: full}
|
|
871
|
-
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."
|
|
872
|
-
# The one Supabase project directory, at the app root beside be/, fe/ and .starcistacks (never under a side).
|
|
873
|
-
path: "supabase/"
|
|
874
|
-
presence: opt-in # enabled by a connection with provider: supabase; required under edition lite
|
|
875
|
-
provider: supabase
|
|
876
|
-
litePresence: required
|
|
877
|
-
tracked: tracked
|
|
878
|
-
tier: none
|
|
879
|
-
tests: none
|
|
880
|
-
since: 2.1.0
|
|
881
|
-
- id: app.supabase.config
|
|
917
|
+
# ----- app root: the database of a lite app (ruling:lite-self-hosted-postgres-passport-minio): a self-hosted PostgreSQL in the app's
|
|
918
|
+
# stack (the `db` service, image supabase/postgres for pg_cron, pg_net, pgmq, vector, unaccent and pgcrypto), migrated by
|
|
919
|
+
# `starci app db migrate --url-env <NAME>`. A full app keeps its TypeORM migrations under be/ and has no such folder.
|
|
920
|
+
- id: app.db
|
|
882
921
|
profiles: [app]
|
|
922
|
+
editions: [lite]
|
|
883
923
|
exemplifiedBy:
|
|
884
|
-
- packages/hfs/templates/app/skeleton-lite/
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
path: "supabase/config.toml"
|
|
889
|
-
presence: opt-in
|
|
890
|
-
provider: supabase
|
|
891
|
-
litePresence: required
|
|
924
|
+
- packages/hfs/templates/app/skeleton-lite/db/
|
|
925
|
+
# The one database directory, at the app root beside be/, fe/ and .starcistacks (never under a side).
|
|
926
|
+
path: "db/"
|
|
927
|
+
presence: required
|
|
892
928
|
tracked: tracked
|
|
893
929
|
tier: none
|
|
894
930
|
tests: none
|
|
895
|
-
since:
|
|
896
|
-
- id: app.
|
|
931
|
+
since: 3.9.0
|
|
932
|
+
- id: app.db.migrations
|
|
897
933
|
profiles: [app]
|
|
934
|
+
editions: [lite]
|
|
898
935
|
exemplifiedBy:
|
|
899
|
-
- packages/hfs/templates/app/skeleton-lite/
|
|
900
|
-
- {path: packages/hfs/src/db-migration-shape.spec.mjs, edition:
|
|
901
|
-
|
|
902
|
-
#
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
provider: supabase
|
|
907
|
-
litePresence: required
|
|
908
|
-
lite: {minInstances: 1}
|
|
936
|
+
- packages/hfs/templates/app/skeleton-lite/db/migrations/__timestamp___baseline.sql
|
|
937
|
+
- {path: packages/hfs/src/db-migration-shape.spec.mjs, edition: lite}
|
|
938
|
+
# The schema authority of a lite app: forward-only SQL migrations named <timestamp14>_<kebab-name>.sql, one file per change,
|
|
939
|
+
# immutable once on origin/main, applied in order by `starci app db migrate` and recorded in the history table.
|
|
940
|
+
path: "db/migrations/<stamp>_<name>.sql"
|
|
941
|
+
presence: required
|
|
942
|
+
minInstances: 1
|
|
909
943
|
tracked: tracked
|
|
910
944
|
tier: none
|
|
911
945
|
tests: none
|
|
912
|
-
since:
|
|
913
|
-
|
|
946
|
+
since: 3.9.0
|
|
947
|
+
rules: [DB_MIGRATION_SHAPE, LITE_DB_MIGRATION]
|
|
948
|
+
- id: app.db.migrations.archive
|
|
914
949
|
profiles: [app]
|
|
915
|
-
|
|
916
|
-
#
|
|
917
|
-
# older files move here.
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
presence: opt-in
|
|
921
|
-
provider: supabase
|
|
950
|
+
editions: [lite]
|
|
951
|
+
# The migrations an app retired at a baseline cutover: the live schema is dumped into ONE baseline migration, marked applied
|
|
952
|
+
# without a re-run, and the older files move here. `starci app db migrate` never applies this folder and no migration rule judges it.
|
|
953
|
+
path: "db/migrations/archive/"
|
|
954
|
+
presence: optional
|
|
922
955
|
tracked: tracked
|
|
923
956
|
tier: none
|
|
924
957
|
tests: none
|
|
925
|
-
since: 3.
|
|
926
|
-
- id: app.
|
|
958
|
+
since: 3.9.0
|
|
959
|
+
- id: app.db.seed
|
|
927
960
|
profiles: [app]
|
|
928
|
-
|
|
961
|
+
editions: [lite]
|
|
962
|
+
path: "db/seed.sql"
|
|
929
963
|
presence: optional # synthetic dev data only; a lite app seeds nothing it cannot regenerate
|
|
930
964
|
tracked: tracked
|
|
931
965
|
tier: none
|
|
932
966
|
tests: none
|
|
933
|
-
since:
|
|
934
|
-
- id: app.
|
|
935
|
-
profiles: [app]
|
|
936
|
-
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."
|
|
937
|
-
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."
|
|
938
|
-
# The generated Database types (database.types.ts) contract:emit writes from the migrations; both sides read it
|
|
939
|
-
# (sides.<side>.reads supabase/types/); drift against regeneration is L09.
|
|
940
|
-
path: "supabase/types/database.types.ts"
|
|
941
|
-
presence: opt-in
|
|
942
|
-
provider: supabase
|
|
943
|
-
litePresence: required
|
|
944
|
-
tracked: tracked
|
|
945
|
-
tier: none
|
|
946
|
-
tests: none
|
|
947
|
-
since: 2.1.0
|
|
948
|
-
exemplifiedBy:
|
|
949
|
-
- {path: packages/hfs/src/db-types-returned-collector.spec.mjs, edition: full}
|
|
950
|
-
- id: app.supabase.templates
|
|
967
|
+
since: 3.9.0
|
|
968
|
+
- id: app.db.bootstrap
|
|
951
969
|
profiles: [app]
|
|
952
|
-
|
|
953
|
-
|
|
970
|
+
editions: [lite]
|
|
971
|
+
# The managed pre-migration bootstrap (templates/app/db-bootstrap): the auth, storage and extensions schemas, auth.users with the
|
|
972
|
+
# GoTrue column set, auth.uid/role/jwt stubs, the NOLOGIN browser roles and the realtime publication, so migrations written for a
|
|
973
|
+
# hosted Supabase apply to the self-hosted db service. `starci app db migrate` applies it before the first migration of an empty database.
|
|
974
|
+
path: "db/bootstrap.sql"
|
|
975
|
+
presence: required
|
|
954
976
|
tracked: tracked
|
|
977
|
+
managedBy: db-bootstrap
|
|
955
978
|
tier: none
|
|
956
979
|
tests: none
|
|
957
|
-
since:
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
path: "supabase/{.temp,.branches}/"
|
|
961
|
-
presence: optional
|
|
962
|
-
tracked: ignored # the local CLI's working state: exists, never committed
|
|
963
|
-
tier: none
|
|
964
|
-
tests: none
|
|
965
|
-
since: 2.1.0
|
|
966
|
-
- id: app.supabase.functions
|
|
967
|
-
profiles: [app]
|
|
968
|
-
path: "supabase/functions/"
|
|
969
|
-
presence: forbidden # a Deno runtime is a second language runtime outside the lint canon and the slot machine (lite v1)
|
|
970
|
-
tracked: external
|
|
971
|
-
tier: none
|
|
972
|
-
tests: none
|
|
973
|
-
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)"
|
|
974
|
-
since: 2.1.0
|
|
980
|
+
since: 3.9.0
|
|
981
|
+
rules: [HFS_MANAGED_FILE_DRIFT]
|
|
982
|
+
|
|
975
983
|
|
|
976
984
|
# ----- side root (both sides): what a standalone repository root holds, less the app-root files ----------
|
|
977
985
|
- id: repo.side-root-forbidden
|
|
978
986
|
since: 3.1.0
|
|
979
987
|
profiles: [be, fe]
|
|
980
|
-
path: "{package.json,package-lock.json,hfs.json,README.md,.gitignore,.gitattributes,.husky/,.github/,.starciwork/,.starcistacks/,
|
|
988
|
+
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/}"
|
|
981
989
|
presence: forbidden
|
|
982
990
|
tracked: external
|
|
983
991
|
tier: none
|
|
@@ -1247,8 +1255,8 @@ slots:
|
|
|
1247
1255
|
- {path: packages/hfs/src/mcp-tools-snapshot.spec.mjs, editions: [lite, full]}
|
|
1248
1256
|
|
|
1249
1257
|
# ----- BE: apps (one slot per app kind; a new kind = a new slot, minor bump) ---------------------------
|
|
1250
|
-
# The files of every app (owner ruling 2026-10-14, R245 and R246, since 3.1.0), each with a line budget
|
|
1251
|
-
# BE_APP_COMPOSITION_BUDGET holds absolutely (not a ratchet):
|
|
1258
|
+
# The files of every app (owner ruling 2026-10-14, R245 and R246, since 3.1.0), each with a line budget (lines excluding
|
|
1259
|
+
# import declarations, multi-line imports included) that BE_APP_COMPOSITION_BUDGET holds absolutely (not a ratchet):
|
|
1252
1260
|
# main.ts the entry: builds EnvSource once, imports and calls read<App>Env from <app>.env.ts, builds options and boots.
|
|
1253
1261
|
# <app>.env.ts exports interface <App>Env and read<App>Env(env: EnvSource): <App>Env (for example ApiEnv/readApiEnv);
|
|
1254
1262
|
# fail-fast environment parsing only, via EnvSource and unchanged capability parse helpers; no localhost
|
|
@@ -1298,7 +1306,7 @@ slots:
|
|
|
1298
1306
|
- id: be.app.cli
|
|
1299
1307
|
since: 3.1.0
|
|
1300
1308
|
profiles: [be]
|
|
1301
|
-
editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4):
|
|
1309
|
+
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."
|
|
1302
1310
|
# The ONE app of every one-off action (migrate, seed, sync, backup, any operator command): be/apps/cli, on nest-commander.
|
|
1303
1311
|
# main.ts boots with CommandFactory.run (BE_CLI_BOOTSTRAP); app.module.ts composes the platform and the cli feature root
|
|
1304
1312
|
# (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,
|
|
@@ -1308,7 +1316,7 @@ slots:
|
|
|
1308
1316
|
path: "apps/<app>/src/"
|
|
1309
1317
|
appKind: cli
|
|
1310
1318
|
presence: opt-in
|
|
1311
|
-
litePresence: optional # lite: schema migration is
|
|
1319
|
+
litePresence: optional # lite: schema migration is `starci app db migrate`'s job; a cli app exists only when the app declares one
|
|
1312
1320
|
tracked: tracked
|
|
1313
1321
|
tier: app
|
|
1314
1322
|
owner: true
|
|
@@ -1659,7 +1667,7 @@ slots:
|
|
|
1659
1667
|
- id: be.persistence
|
|
1660
1668
|
since: 3.1.0
|
|
1661
1669
|
profiles: [be]
|
|
1662
|
-
editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4):
|
|
1670
|
+
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."
|
|
1663
1671
|
path: "src/modules/{domain,platform,projections}/<capability>/persistence/"
|
|
1664
1672
|
# 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
|
|
1665
1673
|
# registered on several declared connections. Any other capability registers its arrays on exactly one (BE_SCHEMA_OWNER).
|
|
@@ -1670,15 +1678,17 @@ slots:
|
|
|
1670
1678
|
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
|
|
1671
1679
|
allows: ["entities/<table>.entity.ts", "migrations/<epochMs13>-<kebab-name>.ts", "<name>.sql.ts", "<name>.rows.ts", connection.ts]
|
|
1672
1680
|
forbids: [index.ts, "<name>.repository.ts"]
|
|
1673
|
-
# Lite
|
|
1674
|
-
#
|
|
1681
|
+
# Lite maps its tables with the same TypeORM entities as full (ruling:lite-persistence-typeorm-entities): each capability's
|
|
1682
|
+
# persistence/entities/<table>.entity.ts and an entities/index.ts exporting its <c>Entities array, which platform/database
|
|
1683
|
+
# lists by name; the schema authority stays db/migrations (ruleParams.be.lite.schemaAuthority), so no be migration and no
|
|
1684
|
+
# raw SQL file (R334 BE_PERSISTENCE_NO_RAW_SQL).
|
|
1675
1685
|
lite:
|
|
1676
|
-
requires: []
|
|
1677
|
-
allows: ["
|
|
1678
|
-
forbids: [index.ts, "<name>.repository.ts",
|
|
1686
|
+
requires: []
|
|
1687
|
+
allows: ["entities/<table>.entity.ts", entities/index.ts, connection.ts]
|
|
1688
|
+
forbids: [index.ts, "<name>.repository.ts", migrations/, "<name>.sql.ts", "<name>.rows.ts"]
|
|
1679
1689
|
tests: none
|
|
1680
1690
|
coverage: none
|
|
1681
|
-
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]
|
|
1691
|
+
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]
|
|
1682
1692
|
- id: be.platform
|
|
1683
1693
|
since: 3.1.0
|
|
1684
1694
|
profiles: [be]
|
|
@@ -1729,7 +1739,7 @@ slots:
|
|
|
1729
1739
|
owner: true
|
|
1730
1740
|
lite:
|
|
1731
1741
|
why: >-
|
|
1732
|
-
the same EventPublisher and EventConsumer ports on
|
|
1742
|
+
the same EventPublisher and EventConsumer ports on pgmq queues: the outbox relay sends each committed row to the
|
|
1733
1743
|
pgmq queue of every consumer group of its topic through the shared EntityManager, a consumer reads with a visibility
|
|
1734
1744
|
timeout, retries by letting it lapse and archives the message on dead letter (read_ct over the budget); a single api may
|
|
1735
1745
|
deliver in process. No Kafka (knowledge/patterns/be/event-bus.yaml liteAdapter)
|
|
@@ -1743,7 +1753,7 @@ slots:
|
|
|
1743
1753
|
- id: be.platform.queue
|
|
1744
1754
|
since: 3.1.0
|
|
1745
1755
|
profiles: [be]
|
|
1746
|
-
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
|
|
1756
|
+
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."
|
|
1747
1757
|
path: "src/modules/platform/queue/"
|
|
1748
1758
|
presence: opt-in
|
|
1749
1759
|
pattern: queue # the ONE BullMQ owner: the outbox relay into queues (jobId = outbox id) and job schedulers (knowledge/patterns/be/queues.yaml)
|
|
@@ -1754,7 +1764,7 @@ slots:
|
|
|
1754
1764
|
why: >-
|
|
1755
1765
|
the same QueueOutbox and QueueWorkerRegistry ports and full's BullMQ adapter on the declared Redis (backing: [redis]): the
|
|
1756
1766
|
relay adds each committed outbox row with the outbox id as the job id, workers retry with exponential backoff and keep a
|
|
1757
|
-
job that exhausts its attempts as failed (the dead letter); the outbox table comes from a
|
|
1767
|
+
job that exhausts its attempts as failed (the dead letter); the outbox table comes from a db migration, and a
|
|
1758
1768
|
schedule is a BullMQ job scheduler or a pg_cron tick that inserts one outbox row (knowledge/patterns/be/queues.yaml liteAdapter)
|
|
1759
1769
|
requires: [index.ts, queue.module.ts, queue.port.ts, queue.contracts.ts, queue-outbox.service.ts, queue-outbox.service.spec.ts]
|
|
1760
1770
|
tests: unit-beside
|
|
@@ -1848,7 +1858,7 @@ slots:
|
|
|
1848
1858
|
- id: be.platform.jobs
|
|
1849
1859
|
since: 3.1.0
|
|
1850
1860
|
profiles: [be]
|
|
1851
|
-
editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite persists fenced claims in
|
|
1861
|
+
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."
|
|
1852
1862
|
path: "src/modules/platform/jobs/"
|
|
1853
1863
|
presence: opt-in
|
|
1854
1864
|
pattern: fenced-job # the ONE fencing primitive: the job entity, the claim that bumps the token, guarded writes (knowledge/patterns/be/jobs.yaml)
|
|
@@ -1863,7 +1873,7 @@ slots:
|
|
|
1863
1873
|
- id: be.projections
|
|
1864
1874
|
since: 3.1.0
|
|
1865
1875
|
profiles: [be]
|
|
1866
|
-
editionWhy: "ruling:R212/case-2 (owner:lite-production-swarm) (with the Work boundary amended by ruling:R212/case-4): lite projection tables live in
|
|
1876
|
+
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."
|
|
1867
1877
|
path: "src/modules/projections/<name>/"
|
|
1868
1878
|
presence: opt-in
|
|
1869
1879
|
pattern: projection # a read model: only its projection writes its table; recompute is idempotent and replayable; readers use get*
|
|
@@ -1872,7 +1882,7 @@ slots:
|
|
|
1872
1882
|
owner: true
|
|
1873
1883
|
requires: [index.ts, "<name>.module.ts", "<name>.projection.ts", "<name>.projection-entity.ts"]
|
|
1874
1884
|
allows: [index.ts, "<name>.module.ts", "<name>.module-definition.ts", "<name>.options.ts", "<name>.projection.ts", "<name>.projection-entity.ts", "<name>.contracts.ts", persistence/]
|
|
1875
|
-
lite: # the read model's table is a
|
|
1885
|
+
lite: # the read model's table is a db migration (lite's schema authority) mapped by its entity under persistence/entities/ (R334)
|
|
1876
1886
|
requires: [index.ts, "<name>.module.ts", "<name>.projection.ts"]
|
|
1877
1887
|
allows: [index.ts, "<name>.module.ts", "<name>.module-definition.ts", "<name>.options.ts", "<name>.projection.ts", "<name>.contracts.ts", persistence/]
|
|
1878
1888
|
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)
|
|
@@ -1892,7 +1902,7 @@ slots:
|
|
|
1892
1902
|
tests: unit-beside # <name>.service.spec.ts beside each <name>.service.ts; plus src/tests/integration/<provider>/ (R112)
|
|
1893
1903
|
coverage: required
|
|
1894
1904
|
budget: {indexExports: 80} # a provider's port surface includes clients, config, options, tokens and errors
|
|
1895
|
-
rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INTEGRATION_SPEC_MISSING]
|
|
1905
|
+
rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INTEGRATION_SPEC_MISSING, BE_AI_KEY_CUSTODY, BE_AI_GATEWAY_CLIENT]
|
|
1896
1906
|
- id: be.integrations.model
|
|
1897
1907
|
since: 3.1.0
|
|
1898
1908
|
profiles: [be]
|
|
@@ -1902,31 +1912,47 @@ slots:
|
|
|
1902
1912
|
tier: integrations
|
|
1903
1913
|
tests: none
|
|
1904
1914
|
coverage: required
|
|
1905
|
-
why:
|
|
1915
|
+
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)
|
|
1906
1916
|
rules: [BE_TIER_DIRECTION, BE_INFRA_OWNER, BE_INTEGRATION_SPEC_MISSING]
|
|
1907
1917
|
|
|
1908
|
-
- id: be.integrations.
|
|
1918
|
+
- id: be.integrations.passport
|
|
1909
1919
|
profiles: [be]
|
|
1920
|
+
editions: [lite]
|
|
1910
1921
|
exemplifiedBy:
|
|
1911
|
-
- packages/hfs/templates/be/skeleton-lite/src/modules/integrations/
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
#
|
|
1915
|
-
#
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1922
|
+
- packages/hfs/templates/be/skeleton-lite/src/modules/integrations/passport/
|
|
1923
|
+
# The one owner of the lite identity libraries (ruleParams.be.infraOwners: @nestjs/passport, passport, passport-google-oauth20,
|
|
1924
|
+
# passport-local, @nestjs/jwt, jose, bcryptjs): the Google OAuth 2.0 strategy (state and PKCE), the local email and password
|
|
1925
|
+
# strategy (bcrypt), the app's own asymmetric access tokens and their JWKS, and the rotating refresh cookie. domain/identity
|
|
1926
|
+
# verifies a token through this integration's verifier and builds the principal (contexts/code/be/api-auth.md).
|
|
1927
|
+
path: "src/modules/integrations/passport/"
|
|
1928
|
+
presence: required
|
|
1929
|
+
tracked: tracked
|
|
1930
|
+
tier: integrations
|
|
1931
|
+
owner: true
|
|
1932
|
+
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
|
|
1933
|
+
allows: [index.ts, passport.config.ts, passport.options.ts, passport.decorators.ts, passport.tokens.ts, passport.password.ts, passport.cookie.ts, strategies/, errors/]
|
|
1934
|
+
tests: unit-beside
|
|
1935
|
+
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]
|
|
1936
|
+
coverage: required
|
|
1937
|
+
since: 3.9.0
|
|
1938
|
+
- id: be.integrations.object-storage
|
|
1939
|
+
profiles: [be]
|
|
1940
|
+
exemplifiedBy:
|
|
1941
|
+
- packages/hfs/templates/be/skeleton-lite/src/modules/integrations/object-storage/
|
|
1942
|
+
# The one owner of the S3 client (@aws-sdk/client-s3 and @aws-sdk/s3-request-presigner) over S3-compatible storage (MinIO in
|
|
1943
|
+
# lite): the ObjectStorage port with presigned PUT and GET; no other module imports an S3 SDK or minio.
|
|
1944
|
+
path: "src/modules/integrations/object-storage/"
|
|
1945
|
+
presence: optional
|
|
1920
1946
|
litePresence: required
|
|
1921
1947
|
tracked: tracked
|
|
1922
1948
|
tier: integrations
|
|
1923
1949
|
owner: true
|
|
1924
|
-
requires: [index.ts,
|
|
1925
|
-
allows: [index.ts,
|
|
1950
|
+
requires: [index.ts, storage.config.ts, storage.options.ts, storage.decorators.ts, storage.client.ts]
|
|
1951
|
+
allows: [index.ts, storage.config.ts, storage.options.ts, storage.decorators.ts, storage.client.ts, errors/]
|
|
1926
1952
|
tests: unit-beside
|
|
1927
|
-
rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT]
|
|
1953
|
+
rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INFRA_OWNER, BE_STORAGE_OWNER]
|
|
1928
1954
|
coverage: required
|
|
1929
|
-
since:
|
|
1955
|
+
since: 3.9.0
|
|
1930
1956
|
|
|
1931
1957
|
# ----- BE: tests (owner test layout 2026-09-30). Unit specs are <name>.service.spec.ts beside their service and nothing else; everything else
|
|
1932
1958
|
# lives under src/tests/, one folder per kind, and the folder and the file suffix always agree (a file whose suffix does
|
|
@@ -1934,15 +1960,15 @@ slots:
|
|
|
1934
1960
|
- id: be.tests.world
|
|
1935
1961
|
since: 3.1.0
|
|
1936
1962
|
profiles: [be]
|
|
1937
|
-
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
|
|
1963
|
+
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."
|
|
1938
1964
|
path: "src/tests/world/"
|
|
1939
1965
|
presence: optional
|
|
1940
1966
|
tracked: tracked
|
|
1941
1967
|
tier: e2e
|
|
1942
1968
|
lite:
|
|
1943
1969
|
why: >-
|
|
1944
|
-
the world of the optional integration specs of a lite app: global-setup.ts connects to the local
|
|
1945
|
-
(`
|
|
1970
|
+
the world of the optional integration specs of a lite app: global-setup.ts connects to the local db service
|
|
1971
|
+
(`npm run db:start`, with the migrations applied by `npm run db:push`) and starts no container, no toxiproxy and no stack of its
|
|
1946
1972
|
own; use-test-world.ts exports useTestWorld({ modules: [...] }) -> world.db.<connection> (the shared EntityManager) and
|
|
1947
1973
|
world.fake.<provider> (a network-edge fake of an external SaaS). There is no world.apps (no e2e) and no world.infra
|
|
1948
1974
|
(no self-hosted service to cut)
|
|
@@ -2011,7 +2037,7 @@ slots:
|
|
|
2011
2037
|
- id: be.tests.integration
|
|
2012
2038
|
since: 3.1.0
|
|
2013
2039
|
profiles: [be]
|
|
2014
|
-
editionWhy: "Lite integration specs use the local
|
|
2040
|
+
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)."
|
|
2015
2041
|
path: "src/tests/integration/<capability>/*.integration-spec.ts"
|
|
2016
2042
|
presence: optional
|
|
2017
2043
|
tracked: tracked
|
|
@@ -2020,8 +2046,8 @@ slots:
|
|
|
2020
2046
|
coverage: none
|
|
2021
2047
|
lite:
|
|
2022
2048
|
why: >-
|
|
2023
|
-
optional under lite: one capability module through useTestWorld({ modules }) against the local
|
|
2024
|
-
(`
|
|
2049
|
+
optional under lite: one capability module through useTestWorld({ modules }) against the local db service
|
|
2050
|
+
(`npm run db:start`), run by test:integration; no container, no toxiproxy and no outage through the world (R112 is full's)
|
|
2025
2051
|
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
|
|
2026
2052
|
rules: [BE_TEST_TOPOLOGY, BE_INTEGRATION_SPEC_MISSING]
|
|
2027
2053
|
- id: be.tests.e2e
|
|
@@ -2034,7 +2060,7 @@ slots:
|
|
|
2034
2060
|
tracked: tracked
|
|
2035
2061
|
tier: e2e
|
|
2036
2062
|
tests: e2e
|
|
2037
|
-
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 `
|
|
2063
|
+
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`"
|
|
2038
2064
|
coverage: none
|
|
2039
2065
|
why: flow e2e through useTestWorld({ apps }); external services are the world's network fakes; run by test:e2e
|
|
2040
2066
|
rules: [HFS_CI_E2E_AUTOMATIC, BE_TEST_TOPOLOGY, BE_E2E_FLOW]
|
|
@@ -2093,7 +2119,7 @@ slots:
|
|
|
2093
2119
|
tracked: tracked
|
|
2094
2120
|
tier: route
|
|
2095
2121
|
# 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
|
|
2096
|
-
# route handler of this slot, the
|
|
2122
|
+
# route handler of this slot, the OAuth callback is a back-end door, and no file holds a Server Action
|
|
2097
2123
|
# (FE_ROUTE_HANDLER_FORBIDDEN, FE_SERVER_ACTION_FORBIDDEN).
|
|
2098
2124
|
allows: ["[locale]/**/{page,layout,template,loading,error,not-found,default}.tsx", "[locale]/providers.tsx",
|
|
2099
2125
|
global-error.tsx, page.tsx, # the root page.tsx only redirects (FE_ROUTE_FILES_THIN)
|
|
@@ -2124,20 +2150,6 @@ slots:
|
|
|
2124
2150
|
tests: none
|
|
2125
2151
|
goesTo: "apps/<app>/src/proxy.ts: Next >= 16 reads proxy.ts and refuses middleware.ts"
|
|
2126
2152
|
rules: [FE_NEXT_CONVENTIONS]
|
|
2127
|
-
- id: fe.route.callback
|
|
2128
|
-
profiles: [fe]
|
|
2129
|
-
# The auth callback of a Supabase session (the PKCE code exchange), kept only when the auth flow truly needs a server exchange
|
|
2130
|
-
# (prefer the client-side PKCE exchange in fe.modules.auth): the one non-health route handler of an app with a Supabase
|
|
2131
|
-
# connection; an app without one has no route handler in fe/ (L15).
|
|
2132
|
-
path: "apps/<app>/src/app/auth/callback/route.ts"
|
|
2133
|
-
presence: opt-in
|
|
2134
|
-
provider: supabase
|
|
2135
|
-
tracked: tracked
|
|
2136
|
-
tier: route
|
|
2137
|
-
tests: none
|
|
2138
|
-
since: 2.1.0
|
|
2139
|
-
rules: [FE_ROUTE_HANDLER_FORBIDDEN, FE_CALLBACK_SHAPE, FE_SUPABASE_CLIENT_OWNER, FE_SERVICE_ROLE_FORBIDDEN]
|
|
2140
|
-
|
|
2141
2153
|
- id: fe.feature
|
|
2142
2154
|
since: 3.1.0
|
|
2143
2155
|
profiles: [fe]
|
|
@@ -2469,18 +2481,17 @@ slots:
|
|
|
2469
2481
|
- id: fe.modules.auth
|
|
2470
2482
|
profiles: [fe]
|
|
2471
2483
|
# The identity-provider client (fe-stack auth, FE-AUTH): the session, the access token the Apollo link attaches and the
|
|
2472
|
-
# sign-in/sign-out calls.
|
|
2473
|
-
#
|
|
2484
|
+
# 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
|
|
2485
|
+
# the back end's httpOnly cookie and the access token in memory (ruling:lite-self-hosted-postgres-passport-minio).
|
|
2474
2486
|
path: "apps/<app>/src/modules/auth/"
|
|
2475
2487
|
presence: optional
|
|
2476
2488
|
tracked: tracked
|
|
2477
2489
|
tier: modules
|
|
2478
2490
|
owner: true
|
|
2479
2491
|
requires: [index.ts]
|
|
2480
|
-
entries: [server.ts] # the server-only PKCE exchange API used by the opted-in callback route
|
|
2481
2492
|
tests: none
|
|
2482
2493
|
since: 3.0.0
|
|
2483
|
-
rules: [
|
|
2494
|
+
rules: [FE_STACK_FORBIDDEN]
|
|
2484
2495
|
- id: fe.modules.toast
|
|
2485
2496
|
profiles: [fe]
|
|
2486
2497
|
# Mutation feedback (fe-stack toast, FE-TOAST): the HeroUI toast wrapper, showGraphQLToast over a GraphQLResponse and the
|