@starci/eslint-grammar-offset-pop 0.21.13 → 0.21.15

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.21.15 - 2026-11-03
4
+
5
+ - Changed: requires `@starci/eslint-grammar-core` 0.21.15; the runtime copies carry the new pins.
6
+ - Added: `offsetPopGrammarPackagesConfig`: the inherited family rules over the front-end subpaths of the root workspace packages.
7
+ - Changed: the runtime copy of the slot manifest carries the slots `app.packages`, `app.module-registry` and `app.packages-lint`.
8
+
9
+ ## 0.21.14 - 2026-11-03
10
+
11
+ - Changed: requires `@starci/eslint-grammar-core` 0.21.14; the runtime copies carry the `@starci/auth` rows.
12
+
3
13
  ## 0.21.13
4
14
 
5
15
  - Changed: Align the Grammar family and its exact core dependency.
@@ -213,7 +223,6 @@ Follows the Grammar 0.21.0.
213
223
 
214
224
  - Changed: the peer moves to the 0.15.11 cohort; the bundled slot manifest 3.9.0 replaces the lite `app.supabase*` slots with `app.db` (`db/migrations`, `db/migrations/archive`, `db/seed.sql`, the managed `db/bootstrap.sql`), `be.integrations.supabase` with `be.integrations.passport` and `be.integrations.object-storage`, removes `fe.route.callback`, sets lite `schemaAuthority: sql`, gives lite TypeORM entities in `be.persistence`, adds `ruleParams.be.dbFunctions`, and moves the S3 SDKs to `integrations/object-storage` and the identity libraries to `integrations/passport` in `infraOwners` (`@supabase/*`, `minio` and `bcrypt` nowhere); the bundled rule catalog retires R216, R217, R219, R254 and R287 and adds R328-R334; the bundled canon pins name hfs 4.10.0, eslint-canon-be 3.7.0, eslint-canon-fe 9.5.0 and the Grammar family 0.15.11, pin `@nestjs/passport` 11.0.5 (CommonJS on the Nest 11 line), `passport` 0.7.0, `passport-google-oauth20` 2.0.0, `passport-local` 1.0.0, `bcryptjs` 3.0.3 and their types (tokens are signed and verified with `jose`; `@nestjs/jwt` stays allowed in `integrations/passport` but unpinned), and drop `@supabase/ssr`, `@supabase/supabase-js` and the `supabase` CLI. No rule changed.
215
225
 
216
-
217
226
  ## 0.15.10 - 2026-10-29
218
227
 
219
228
  - Changed: `@starci/eslint-grammar-core` 0.15.10 is the peer dependency; the bundled slot manifest gives the model libraries their owners in `ruleParams.be.infraOwners` (`@starci/ai-router` to `integrations/ai-gateway`, `@langchain/*` to `integrations/ai`; `openai`, `langchain`, `@langchain/langgraph`, `@langchain/community` and the provider SDKs nowhere) and lists R326 and R327 on `be.integrations`; the bundled canon pins name hfs 4.9.11, eslint-canon-be 3.6.8, eslint-canon-fe 9.4.9, the Grammar family 0.15.10 (grammar, eslint-grammar-core, eslint-grammar-offset-pop), and pin `@langchain/core` 1.3.1 and `@langchain/openai` 1.8.0. No rule changed.
@@ -271,7 +280,6 @@ Follows the Grammar 0.21.0.
271
280
  - Changed: versioned together with Grammar 0.13.0; `@starci/eslint-grammar-core` 0.13.0 is a peer dependency, installed by the app beside this package. Offset Pop is unchanged and refuses `core`.
272
281
  - Changed: the package lives in github.com/starci183/starci-harness under `packages/` and publishes from there; its bundled `runtime/` is committed source, edited in place (no generator, no `prepack`/`pretest` hook).
273
282
 
274
-
275
283
  ## 0.12.14 - 2026-10-27
276
284
 
277
285
  - Fixed: the bundled runtime copy now carries the static import closure of its slot view, so the slot modules it imports are present.
package/dist/config.d.ts CHANGED
@@ -8,3 +8,12 @@ import { coreGrammarConfig } from "@starci/eslint-grammar-core";
8
8
  export declare const offsetPopGrammarConfig: ({ hfs }: {
9
9
  hfs: Parameters<typeof coreGrammarConfig>[0]["hfs"];
10
10
  }) => ReturnType<typeof coreGrammarConfig>;
11
+ /**
12
+ * The same family rules for the front-end subpaths of an app's root workspace packages (`packages/<pkg>/src/workbench/**` and `src/public/**`).
13
+ *
14
+ * @param input - The package view of the app root from the universal canon's loadPackagesHfs.
15
+ * @returns Family rules at error under the shared starci-grammar namespace, over the package subpaths.
16
+ */
17
+ export declare const offsetPopGrammarPackagesConfig: ({ hfs }: {
18
+ hfs: Parameters<typeof coreGrammarConfig>[0]["hfs"];
19
+ }) => ReturnType<typeof coreGrammarConfig>;
package/dist/config.js CHANGED
@@ -1,4 +1,4 @@
1
- import { coreGrammarConfig } from "@starci/eslint-grammar-core";
1
+ import { coreGrammarConfig, coreGrammarPackagesConfig } from "@starci/eslint-grammar-core";
2
2
  /**
3
3
  * Attach the inherited Common API laws for a front end selecting Offset Pop.
4
4
  *
@@ -6,3 +6,10 @@ import { coreGrammarConfig } from "@starci/eslint-grammar-core";
6
6
  * @returns Family rules at error under the shared starci-grammar namespace.
7
7
  */
8
8
  export const offsetPopGrammarConfig = ({ hfs }) => coreGrammarConfig({ hfs, family: "offset-pop" });
9
+ /**
10
+ * The same family rules for the front-end subpaths of an app's root workspace packages (`packages/<pkg>/src/workbench/**` and `src/public/**`).
11
+ *
12
+ * @param input - The package view of the app root from the universal canon's loadPackagesHfs.
13
+ * @returns Family rules at error under the shared starci-grammar namespace, over the package subpaths.
14
+ */
15
+ export const offsetPopGrammarPackagesConfig = ({ hfs }) => coreGrammarPackagesConfig({ hfs, family: "offset-pop" });
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Offset Pop inherits the Common component checks from the exact matching Grammar lint release. */
2
2
  export { default, rules, recommended, ruleOwners, lawOwners, ruleDeclarations, why, } from "@starci/eslint-grammar-core";
3
- export { offsetPopGrammarConfig } from "./config.js";
3
+ export { offsetPopGrammarConfig, offsetPopGrammarPackagesConfig } from "./config.js";
4
4
  export { crossFileInputs } from "@starci/eslint-grammar-core";
5
5
  export type { CrossFileInput } from "@starci/eslint-grammar-core";
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /** Offset Pop inherits the Common component checks from the exact matching Grammar lint release. */
2
2
  export { default, rules, recommended, ruleOwners, lawOwners, ruleDeclarations, why, } from "@starci/eslint-grammar-core";
3
- export { offsetPopGrammarConfig } from "./config.js";
3
+ export { offsetPopGrammarConfig, offsetPopGrammarPackagesConfig } from "./config.js";
4
4
  // Offset Pop runs the Common rules of the matching Grammar lint release, so it reads the disk exactly where that release declares it does.
5
5
  export { crossFileInputs } from "@starci/eslint-grammar-core";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-grammar-offset-pop",
3
- "version": "0.21.13",
3
+ "version": "0.21.15",
4
4
  "description": "Offset Pop Grammar lint: the inherited Common component contract over its own visual family.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -44,7 +44,7 @@
44
44
  "peerDependencies": {
45
45
  "eslint": ">=9",
46
46
  "typescript": ">=5.9",
47
- "@starci/eslint-grammar-core": "0.21.13"
47
+ "@starci/eslint-grammar-core": "0.21.15"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@starci/eslint-canon-fe": "file:../eslint-canon-fe",
@@ -17,6 +17,7 @@
17
17
  "modules/models/runtimes.yaml",
18
18
  "modules/models/tiers.yaml",
19
19
  "scripts/hfs/allows.mjs",
20
+ "scripts/hfs/architecture/root-packages.mjs",
20
21
  "scripts/hfs/declaration-shape.mjs",
21
22
  "scripts/hfs/declaration-slots.mjs",
22
23
  "scripts/hfs/edition-slots.mjs",
@@ -30,43 +30,57 @@ pins:
30
30
  side: fe
31
31
  source: packages/event-stream/package.json
32
32
  why: 'the one server-sent-events client of every front end (fe-stack event-stream, owner:event-stream-package): the transport client layer (modules/api/sse/clients) creates one instance for the app with the bearer token source and the stream operations follow on it; it carries Last-Event-ID resume, the capped doubling backoff, the heartbeat timeout, the single 401 renewal and the useSWRSubscription adapter, so no app keeps a hand-written reader.'
33
+ '@starci/next-data':
34
+ version: 0.1.0
35
+ group: starci
36
+ install: registry
37
+ side: fe
38
+ source: packages/next-data/package.json
39
+ why: 'the SWR data helpers of every front end (fe-stack data, owner:next-data-package): pollingRestart, the viewer and tenant key helpers, viewerSwrConfig and the viewer cache; each operation hook stays in the app and the package holds no component.'
33
40
  '@starci/grammar':
34
- version: 0.21.13
41
+ version: 0.21.15
35
42
  group: starci
36
43
  install: registry
37
44
  side: fe
38
45
  source: packages/grammar/package.json
39
46
  why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
47
+ '@starci/next-i18n':
48
+ version: 0.1.0
49
+ group: starci
50
+ install: registry
51
+ side: fe
52
+ source: packages/next-i18n/package.json
53
+ why: 'the next-intl stack of every front end (fe-stack i18n, owner:next-i18n-package): defineI18n over the locales of the app, the locale-negotiating proxy, the locale-aware navigation, the request config that loads the catalogs of the app and the locale read of the [locale] layout; the app keeps its message catalogs and writes none of the stack.'
40
54
  '@starci/eslint-canon-be':
41
- version: 3.12.0
55
+ version: 3.14.0
42
56
  group: starci
43
57
  install: registry
44
58
  side: be
45
59
  source: packages/eslint-canon-be/package.json
46
60
  why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
47
61
  '@starci/eslint-canon-fe':
48
- version: 9.10.0
62
+ version: 9.12.0
49
63
  group: starci
50
64
  install: registry
51
65
  side: fe
52
66
  source: packages/eslint-canon-fe/package.json
53
67
  why: 'the front-end ESLint canon: `loadHfs(import.meta.url)` of fe/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the fe side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; the front end has no tests (FE_NO_TESTS R97 in hfs) and no-vietnamese-in-source (R91) applies.'
54
68
  '@starci/eslint-grammar-core':
55
- version: 0.21.13
69
+ version: 0.21.15
56
70
  group: starci
57
71
  install: registry
58
72
  side: fe
59
73
  source: packages/eslint-grammar-core/package.json
60
74
  why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
61
75
  '@starci/eslint-grammar-offset-pop':
62
- version: 0.21.13
76
+ version: 0.21.15
63
77
  group: starci
64
78
  install: registry
65
79
  side: fe
66
80
  source: packages/eslint-grammar-offset-pop/package.json
67
81
  why: 'the Offset Pop Grammar component API lint, versioned with @starci/grammar; its shared component contract comes from the StarCi family lint without copying rules.'
68
82
  '@starci/stylelint-canon':
69
- version: 2.5.1
83
+ version: 2.6.0
70
84
  group: starci
71
85
  install: registry
72
86
  side: fe
@@ -85,7 +99,7 @@ pins:
85
99
  side: both
86
100
  source: packages/prettier-config/package.json
87
101
  '@starci/jest-preset':
88
- version: 2.6.0
102
+ version: 2.6.2
89
103
  group: starci
90
104
  install: registry
91
105
  side: be
@@ -105,8 +119,43 @@ pins:
105
119
  side: be
106
120
  source: packages/ai-router/package.json
107
121
  why: 'the AI pool router of a back end: a NestJS module that routes OpenAI-compatible chat, stream and embeddings calls across keys, models and providers, with @starci/ai-router/testing for its specs; @starci/jest-preset compiles it as an ESM-only dependency.'
122
+ '@starci/nest-kit':
123
+ version: 0.1.0
124
+ group: starci
125
+ install: registry
126
+ side: be
127
+ source: packages/nest-kit/package.json
128
+ why: 'the module definition of every back-end module: defineConfigurableModule and defineCapabilityModule return the module base class, the options token and the options types with their types stated, so a <x>.module-definition.ts is one call that the lint on stated export types (R368) and the duplicate-code check (R21) both accept; @starci/jest-preset compiles it as an ESM-only dependency.'
129
+ '@starci/auth':
130
+ version: 0.2.0
131
+ group: starci
132
+ install: registry
133
+ side: both
134
+ source: packages/auth/package.json
135
+ why: 'the lite sign-in: the NestJS module (EdDSA access tokens with a multi-key JWKS, passwords, Google OAuth with state and PKCE, rotating refresh sessions, the sign-in budget, the refresh cookie), the front-end client and its React bindings, the door contracts and test doubles; the one importer of the identity libraries, reached by a back end only through integrations/passport; @starci/jest-preset compiles it as an ESM-only dependency.'
136
+ '@starci/auth-oidc':
137
+ version: 0.1.0
138
+ group: starci
139
+ install: registry
140
+ side: both
141
+ source: packages/auth-oidc/package.json
142
+ why: 'the full sign-in: the OIDC client of the identity provider (Keycloak) behind the PrincipalVerifier of @starci/auth, so guards do not change between editions: the NestJS module (issuer discovery, the JWKS with caching and rotation, algorithm-pinned token checks, role mapping, the authorization code flow with PKCE and nonce), the front-end client (PKCE redirect, one shared refresh, tokens in memory) and the fake issuer for tests; the one importer of jose in a full app, reached by a back end only through integrations/keycloak; @starci/jest-preset compiles it as an ESM-only dependency.'
143
+ '@starci/object-storage':
144
+ version: 0.1.0
145
+ group: starci
146
+ install: registry
147
+ side: be
148
+ source: packages/object-storage/package.json
149
+ why: 'object storage of a back end: a NestJS module and the ObjectStorage port over S3-compatible storage (presigned PUT and GET that sign the content type and size, head, get, put, list, delete, bucket setup, size and content-type limits, coded errors), with @starci/object-storage/testing for its specs; the only importer of @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner (R331).'
150
+ '@starci/mail':
151
+ version: 0.1.0
152
+ group: starci
153
+ install: registry
154
+ side: be
155
+ source: packages/mail/package.json
156
+ why: 'outgoing mail of a back end: a NestJS module and the Mailer port over SMTP (connect, greeting, socket and total timeouts, STARTTLS required by default, recipient, message and attachment checks, a shared SMTP target policy, coded errors, typed escaping render helpers returning { subject, text, html }), with @starci/mail/testing for its specs; the only importer of nodemailer (R90).'
108
157
  '@starci/hfs':
109
- version: 5.1.0
158
+ version: 5.3.0
110
159
  group: starci
111
160
  install: registry
112
161
  side: both
@@ -543,12 +592,17 @@ pins:
543
592
  version: 3.1150.0
544
593
  group: framework
545
594
  side: be
546
- why: 'the S3 transport of integrations/object-storage, the one ObjectStorage adapter of both editions (MinIO, S3, Spaces); 3.1150.0 is the release of 2026-10-12, chosen over newer ones that had not aged two weeks.'
595
+ why: 'the S3 transport inside @starci/object-storage, the one ObjectStorage adapter of both editions (MinIO, S3, Spaces), which depends on it at exactly this version and which no app file imports; 3.1150.0 is the release of 2026-10-12, chosen over newer ones that had not aged two weeks.'
547
596
  '@aws-sdk/s3-request-presigner':
548
597
  version: 3.1150.0
549
598
  group: framework
550
599
  side: be
551
- why: 'signs the presigned PUT and GET of integrations/object-storage locally, the same release as client-s3.'
600
+ why: 'signs the presigned PUT and GET inside @starci/object-storage locally, the same release as client-s3; no app file imports it.'
601
+ nodemailer:
602
+ version: 10.1.7
603
+ group: framework
604
+ side: be
605
+ why: 'the SMTP client inside @starci/mail, which depends on it at exactly this version and which no app file imports; 10.1.7 is the release of 2026-10-18, chosen over newer ones that had not aged two weeks.'
552
606
  '@apollo/server':
553
607
  version: 5.5.1
554
608
  group: framework
@@ -649,7 +703,7 @@ pins:
649
703
  version: 6.2.12
650
704
  group: framework
651
705
  side: be
652
- why: signs the app's own ES256 access tokens and verifies them against its own key set (createLocalJWKSet) in integrations/passport.
706
+ why: signs the app's own access tokens and verifies them against its own key set inside @starci/auth, and verifies the identity provider's tokens against its JWKS inside @starci/auth-oidc; no app file imports it.
653
707
  class-transformer:
654
708
  version: 0.5.1
655
709
  group: framework
@@ -236,17 +236,29 @@ ruleParams:
236
236
  "node:https": [platform/http]
237
237
  http: [platform/http]
238
238
  https: [platform/http]
239
- "@aws-sdk/client-s3": [integrations/object-storage] # the ObjectStorage port: one S3 adapter for MinIO, S3 and Spaces (R331)
240
- "@aws-sdk/s3-request-presigner": [integrations/object-storage]
241
- minio: [] # storage goes through the S3 client of integrations/object-storage
239
+ "@aws-sdk/client-s3": [] # the S3 client is a dependency of @starci/object-storage, imported by no app file (R331)
240
+ "@aws-sdk/s3-request-presigner": []
241
+ "@starci/object-storage": [integrations/object-storage] # the ObjectStorage port: one S3 adapter for MinIO, S3 and Spaces (R331)
242
+ minio: [] # storage goes through @starci/object-storage
243
+ nodemailer: [] # the SMTP client is a dependency of @starci/mail alone; no app file imports it
244
+ "@starci/mail": [integrations/mail] # outgoing mail: the Mailer port, parsed and registered by its one glue
242
245
  "@supabase": [] # no Supabase client in a back end
243
- "@nestjs/passport": [integrations/passport] # the identity libraries (R328)
244
- passport: [integrations/passport]
245
- passport-google-oauth20: [integrations/passport]
246
- passport-local: [integrations/passport]
247
- "@nestjs/jwt": [integrations/passport]
248
- jose: [integrations/passport]
249
- bcryptjs: [integrations/passport]
246
+ "@nestjs/passport": [] # the identity libraries are @starci/auth's dependencies, never an app's (R328)
247
+ passport: []
248
+ passport-google-oauth20: []
249
+ passport-local: []
250
+ "@nestjs/jwt": []
251
+ jose: []
252
+ bcryptjs: []
253
+ jsonwebtoken: [] # no other JWT or OIDC client library in a back end: the tokens of an identity provider are verified by @starci/auth-oidc (R328)
254
+ jwks-rsa: []
255
+ jwt-decode: []
256
+ passport-jwt: []
257
+ openid-client: []
258
+ "@starci/auth": [integrations/passport] # the lite sign-in package: its server entry is reached only through integrations/passport (R328)
259
+ "@starci/auth/testing": [integrations/passport] # its test doubles, for the glue's specs
260
+ "@starci/auth-oidc": [integrations/keycloak] # the full sign-in package (jose is its dependency, imported by no app file): its server entry is reached only through integrations/keycloak (R328)
261
+ "@starci/auth-oidc/testing": [integrations/keycloak] # its fake issuer, for the glue's specs
250
262
  bcrypt: []
251
263
  cache-manager: [integrations/cache, integrations/redis]
252
264
  "@nestjs/cache-manager": [integrations/cache, integrations/redis] # the CACHE_MANAGER token: caching goes through the cache capability
@@ -460,6 +472,14 @@ ruleParams:
460
472
  - {name: public.event_bus_bury, reason: "platform/event-bus (add webhook, lite): the move of an exhausted or malformed message to its consumer's dead-letter queue"}
461
473
  - {name: public.event_bus_dead_letters, reason: "platform/event-bus (add webhook, lite): the operator read of a consumer's dead-letter queue"}
462
474
  - {name: public.event_bus_requeue, reason: "platform/event-bus (add webhook, lite): the operator requeue of one dead letter"}
475
+ - {name: public.be_auth_user_by_email, reason: "domain/identity (lite sign-in): the account of an exact sign-in address with its bcrypt hash, through the account-doors definer of the baseline"}
476
+ - {name: public.be_auth_user_by_id, reason: "domain/identity (lite sign-in): the standing of one account by id (a refresh), through the account-doors definer"}
477
+ - {name: public.be_auth_user_by_google, reason: "domain/identity (lite sign-in): the account a Google subject is linked to, through the account-doors definer"}
478
+ - {name: public.be_auth_create_user, reason: "domain/identity (lite sign-in): the account a first Google sign-in creates, through the account-doors definer"}
479
+ - {name: public.be_auth_link_google, reason: "domain/identity (lite sign-in): the link of a Google subject to an account, through the account-doors definer"}
480
+ - {name: public.be_auth_touch_user, reason: "domain/identity (lite sign-in): the sign-in record of an account and its profile keys, through the account-doors definer"}
481
+ - {name: public.be_auth_confirm_user, reason: "domain/identity (lite sign-in): the confirmation stamp of a mailbox whose link was spent, through the account-doors definer"}
482
+ - {name: public.be_auth_set_password, reason: "domain/identity (lite sign-in): the new password hash of a spent reset link (and the mailbox it proved), through the account-doors definer"}
463
483
  # R334 (lite): the only `.query(` outside platform/database's composer and the test world is the pass-through of a file listed here
464
484
  # (or in hfs.json sides.be.sqlPassThrough), whose SQL text is not the app's own. Paths are relative to the side folder.
465
485
  sqlPassThrough:
@@ -587,13 +607,24 @@ slots:
587
607
  - id: app.tool-config-local
588
608
  since: 3.1.0
589
609
  profiles: [app]
590
- path: "{tsconfig.json,.eslintrc,.eslintrc.*,.eslintignore,eslint.config.*,.stylelintrc,.stylelintrc.*,.stylelintignore,stylelint.config.*,.prettierrc.*,prettier.config.*,jest.config.*,lint-staged.config.*,.lintstagedrc*}"
610
+ path: "{tsconfig.json,.eslintrc,.eslintrc.*,.eslintignore,eslint.config.js,eslint.config.cjs,eslint.config.ts,eslint.config.mts,eslint.config.cts,.stylelintrc,.stylelintrc.*,.stylelintignore,stylelint.config.*,.prettierrc.*,prettier.config.*,jest.config.*,lint-staged.config.*,.lintstagedrc*}"
591
611
  presence: forbidden
592
612
  tracked: external
593
613
  tier: none
594
614
  tests: none
595
- goesTo: "nowhere at the app root: each side holds exactly its managed tool configuration (be.tool-config, fe.tool-config) and the root only the formatter (app.format-config)"
615
+ goesTo: "nowhere at the app root: each side holds exactly its managed tool configuration (be.tool-config, fe.tool-config) and the root only the formatter (app.format-config) and the eslint config of its root packages (app.packages-lint)"
596
616
  rules: [HFS_TOOL_CONFIG_LOCAL]
617
+ - id: app.packages-lint
618
+ since: 3.17.0
619
+ profiles: [app]
620
+ # The one eslint config at the app root: `starci app sync` renders it when the app has root workspace packages (app.packages), and it lints their
621
+ # source by subpath (the back-end canon, the front-end canon and the Grammar family each over their own subpaths). No other tool config lives here.
622
+ path: eslint.config.mjs
623
+ presence: optional
624
+ tracked: tracked
625
+ tier: none
626
+ tests: none
627
+ rules: [HFS_MANAGED_FILE_DRIFT]
597
628
  - id: app.quality-config
598
629
  since: 3.1.0
599
630
  profiles: [app]
@@ -825,6 +856,31 @@ slots:
825
856
  rules: [HFS_PLAINTEXT_SECRET, HFS_SCRIPT_ONE_OFF, BE_SPEC_PLACEMENT, HFS_REPO_LOCAL_CHECK]
826
857
  exemplifiedBy:
827
858
  - {path: packages/hfs/src/hfs-slot-ownership.spec.mjs, editions: [lite, full]}
859
+ - id: app.packages
860
+ since: 3.17.0
861
+ profiles: [app]
862
+ editionWhy: Lite and full share the slot; a product's agent SDK and its agent modules are workspace packages in both.
863
+ # A workspace package of the app ROOT (packages/agent-sdk, packages/module-<name>): first-party source that both sides import through its
864
+ # package entry points and never past them (ARCH_INTERNAL_IMPORT_OUTSIDE), linted by the root eslint config by subpath.
865
+ path: "packages/{agent-sdk,module-<name>}/"
866
+ presence: optional
867
+ tracked: tracked
868
+ tier: none
869
+ requires: [package.json, tsconfig.json, src/index.ts]
870
+ tests: unit-beside
871
+ rules: [HFS_UNUSED_EXPORT]
872
+ - id: app.module-registry
873
+ since: 3.17.0
874
+ profiles: [app]
875
+ editionWhy: Lite and full share the slot; the registry lists the module packages of the app.
876
+ path: packages/modules/
877
+ presence: optional
878
+ tracked: tracked
879
+ tier: none
880
+ requires: [package.json, src/index.ts]
881
+ allows: [package.json, tsconfig.json, tsconfig.build.json, src/index.ts, src/template/index.ts, src/manifest/index.ts]
882
+ tests: none
883
+ rules: [HFS_MANAGED_FILE_DRIFT]
828
884
  - id: app.sides
829
885
  since: 3.1.0
830
886
  profiles: [app]
@@ -1978,40 +2034,110 @@ slots:
1978
2034
  editions: [lite]
1979
2035
  exemplifiedBy:
1980
2036
  - packages/hfs/templates/be/skeleton-lite/src/modules/integrations/passport/
1981
- # The one owner of the lite identity libraries (ruleParams.be.infraOwners: @nestjs/passport, passport, passport-google-oauth20,
1982
- # passport-local, @nestjs/jwt, jose, bcryptjs): the Google OAuth 2.0 strategy (state and PKCE), the local email and password
1983
- # strategy (bcrypt), the app's own asymmetric access tokens and their JWKS, and the rotating refresh cookie. domain/identity
1984
- # verifies a token through this integration's verifier and builds the principal (contexts/code/be/api-auth.md).
2037
+ # The glue of @starci/auth, the lite sign-in package (Google OAuth with state and PKCE, email and password, EdDSA access tokens with
2038
+ # their JWKS, rotating refresh sessions): the one importer of the package (ruleParams.be.infraOwners), which owns the identity
2039
+ # libraries (@nestjs/passport, passport, passport-google-oauth20, passport-local, @nestjs/jwt, jose, bcryptjs) that no app imports.
2040
+ # It parses the typed options, builds the verifier and names the injectors; domain/identity verifies a token through the kit and
2041
+ # builds the principal (contexts/code/be/api-auth.md).
1985
2042
  path: "src/modules/integrations/passport/"
1986
2043
  presence: required
1987
2044
  tracked: tracked
1988
2045
  tier: integrations
1989
2046
  owner: true
1990
- 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
1991
- allows: [index.ts, passport.config.ts, passport.options.ts, passport.decorators.ts, passport.tokens.ts, passport.password.ts, passport.cookie.ts, strategies/, errors/]
1992
- logic: [passport.tokens.ts, passport.password.ts, passport.cookie.ts] # JWT sign and verify over the own JWKS, bcrypt, the refresh cookie: measured at 100 per file
2047
+ requires: [index.ts, passport.config.ts, passport.options.ts, passport.decorators.ts, passport.kit.ts, passport.registration.ts] # Secrets, no defaults (R44); options and named injectors (R83); the kit and the module over @starci/auth
2048
+ allows: [index.ts, passport.config.ts, passport.options.ts, passport.decorators.ts, passport.kit.ts, passport.registration.ts, errors/]
2049
+ logic: [passport.kit.ts] # the verifier mapping over the package: measured at 100 per file
1993
2050
  tests: unit-beside
1994
2051
  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]
1995
2052
  coverage: required
1996
2053
  since: 3.9.0
2054
+ - id: be.identity.sign-in
2055
+ since: 3.16.0
2056
+ profiles: [be]
2057
+ editions: [lite]
2058
+ editionWhy: "lite signs people in with the package @starci/auth, so its sign-in glue is rendered, not written (owner ruling auth-package); full uses its identity provider."
2059
+ # The identity capability's sign-in glue over @starci/auth: the entities of the session, attempt, refresh-token and email-token tables, the account doors over auth.users and auth.identities, the stores the package asks for (sessions, accounts, rate counter), the authenticator and the service the doors call, with their specs. `starci app sync` renders them; a hand edit is drift.
2060
+ path: "{src/modules/domain/identity/account-directory.service.spec.ts,src/modules/domain/identity/account-directory.service.ts,src/modules/domain/identity/authenticator.service.spec.ts,src/modules/domain/identity/authenticator.service.ts,src/modules/domain/identity/identity-email.log-events.ts,src/modules/domain/identity/identity-email.service.spec.ts,src/modules/domain/identity/identity-email.service.ts,src/modules/domain/identity/identity-sign-in.log-events.ts,src/modules/domain/identity/persistence/account-doors.port.ts,src/modules/domain/identity/persistence/entities/identity-attempt.entity.ts,src/modules/domain/identity/persistence/entities/identity-email-token.entity.ts,src/modules/domain/identity/persistence/entities/identity-refresh-token.entity.ts,src/modules/domain/identity/persistence/entities/identity-session.entity.ts,src/modules/domain/identity/persistence/entities/index.ts,src/modules/domain/identity/rate-counter.service.spec.ts,src/modules/domain/identity/rate-counter.service.ts,src/modules/domain/identity/session-store.service.spec.ts,src/modules/domain/identity/session-store.service.ts,src/modules/domain/identity/sign-in.service.spec.ts,src/modules/domain/identity/sign-in.service.ts,src/tests/fixtures/builders/identity.builder.ts}"
2061
+ presence: optional
2062
+ tracked: tracked
2063
+ tier: inherit
2064
+ tests: unit-beside
2065
+ coverage: none
2066
+ managedBy: auth-lite
2067
+ managedOnly: true # lists files sync renders; the slot owning the path judges them
2068
+ rules: [HFS_MANAGED_FILE_DRIFT]
2069
+ - id: be.feature.auth
2070
+ since: 3.16.0
2071
+ profiles: [be]
2072
+ editions: [lite]
2073
+ editionWhy: "lite signs people in with the package @starci/auth, so its sign-in glue is rendered, not written (owner ruling auth-package); full uses its identity provider."
2074
+ # The auth feature: the REST doors under /auth (login, refresh, session, logout, Google start and callback, jwks) over IdentitySignInService, one command or query and handler per door.
2075
+ path: "{src/features/api/auth/application/auth.contracts.ts,src/features/api/auth/application/confirm.command.ts,src/features/api/auth/application/confirm.handler.ts,src/features/api/auth/application/forgot.command.ts,src/features/api/auth/application/forgot.handler.ts,src/features/api/auth/application/get-jwks.handler.ts,src/features/api/auth/application/get-jwks.query.ts,src/features/api/auth/application/google-begin.command.ts,src/features/api/auth/application/google-begin.handler.ts,src/features/api/auth/application/google-complete.command.ts,src/features/api/auth/application/google-complete.handler.ts,src/features/api/auth/application/login.command.ts,src/features/api/auth/application/login.handler.ts,src/features/api/auth/application/logout.command.ts,src/features/api/auth/application/logout.handler.ts,src/features/api/auth/application/refresh.command.ts,src/features/api/auth/application/refresh.handler.ts,src/features/api/auth/application/resend.command.ts,src/features/api/auth/application/resend.handler.ts,src/features/api/auth/application/reset.command.ts,src/features/api/auth/application/reset.handler.ts,src/features/api/auth/application/session.command.ts,src/features/api/auth/application/session.handler.ts,src/features/api/auth/application/signup.command.ts,src/features/api/auth/application/signup.handler.ts,src/features/api/auth/auth.module-definition.ts,src/features/api/auth/auth.module.ts,src/features/api/auth/auth.options.ts,src/features/api/auth/index.ts,src/features/api/auth/transport/http/auth-http.module-definition.ts,src/features/api/auth/transport/http/auth-http.module.ts,src/features/api/auth/transport/http/auth-http.options.ts,src/features/api/auth/transport/http/auth.controller.ts,src/features/api/auth/transport/http/dto/forgot.request.ts,src/features/api/auth/transport/http/dto/google-start.request.ts,src/features/api/auth/transport/http/dto/login.request.ts,src/features/api/auth/transport/http/dto/resend.request.ts,src/features/api/auth/transport/http/dto/reset.request.ts,src/features/api/auth/transport/http/dto/signup.request.ts,src/features/api/auth/transport/http/dto/token.request.ts}"
2076
+ presence: optional
2077
+ tracked: tracked
2078
+ tier: inherit
2079
+ tests: none
2080
+ coverage: none
2081
+ managedBy: auth-lite
2082
+ managedOnly: true # lists files sync renders; the slot owning the path judges them
2083
+ rules: [HFS_MANAGED_FILE_DRIFT]
2084
+ - id: be.integrations.mail
2085
+ profiles: [be]
2086
+ editions: [lite]
2087
+ exemplifiedBy:
2088
+ - packages/hfs/templates/be/skeleton-lite/src/modules/integrations/mail/
2089
+ # The glue of @starci/mail, the owner of the SMTP client (nodemailer): this folder parses the settings (the server, the sender and the
2090
+ # link lifetimes of the confirmation and reset mails), registers the module and names the injectors; no app file imports nodemailer,
2091
+ # and no other module imports the package. The words and layout of each mail belong to the domain that sends it.
2092
+ path: "src/modules/integrations/mail/"
2093
+ presence: required
2094
+ tracked: tracked
2095
+ tier: integrations
2096
+ owner: true
2097
+ requires: [index.ts, mail.config.ts, mail.options.ts, mail.decorators.ts, mail.module-definition.ts, mail.module.ts]
2098
+ allows: [index.ts, mail.config.ts, mail.options.ts, mail.decorators.ts, mail.module-definition.ts, mail.module.ts, errors/]
2099
+ tests: unit-beside
2100
+ rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INFRA_OWNER]
2101
+ coverage: required
2102
+ since: 5.3.0
1997
2103
  - id: be.integrations.object-storage
1998
2104
  profiles: [be]
1999
2105
  exemplifiedBy:
2000
2106
  - packages/hfs/templates/be/skeleton-lite/src/modules/integrations/object-storage/
2001
- # The one owner of the S3 client (@aws-sdk/client-s3 and @aws-sdk/s3-request-presigner) over S3-compatible storage (MinIO in
2002
- # lite): the ObjectStorage port with presigned PUT and GET; no other module imports an S3 SDK or minio.
2107
+ # The glue of @starci/object-storage, the owner of the S3 client (@aws-sdk/client-s3 and @aws-sdk/s3-request-presigner) over
2108
+ # S3-compatible storage (MinIO in lite): this folder keeps the bucket, parses the settings and registers the module; no app
2109
+ # file imports an S3 SDK or minio, and no other module imports the package.
2003
2110
  path: "src/modules/integrations/object-storage/"
2004
2111
  presence: optional
2005
2112
  litePresence: required
2006
2113
  tracked: tracked
2007
2114
  tier: integrations
2008
2115
  owner: true
2009
- requires: [index.ts, object-storage.config.ts, object-storage.options.ts, object-storage.decorators.ts, object-storage.client.ts]
2010
- allows: [index.ts, object-storage.module.ts, object-storage.module-definition.ts, object-storage.config.ts, object-storage.options.ts, object-storage.decorators.ts, object-storage.client.ts, errors/]
2116
+ requires: [index.ts, object-storage.config.ts, object-storage.options.ts, object-storage.decorators.ts, object-storage.module-definition.ts, object-storage.module.ts]
2117
+ allows: [index.ts, object-storage.config.ts, object-storage.options.ts, object-storage.decorators.ts, object-storage.module-definition.ts, object-storage.module.ts, errors/]
2011
2118
  tests: unit-beside
2012
2119
  rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INFRA_OWNER, BE_STORAGE_OWNER]
2013
2120
  coverage: required
2014
2121
  since: 3.9.0
2122
+ - id: be.integrations.keycloak
2123
+ profiles: [be]
2124
+ editions: [full]
2125
+ # The glue of @starci/auth-oidc, the OIDC client of the full edition's identity provider (Keycloak): discovery, the provider's JWKS,
2126
+ # algorithm-pinned token checks and the authorization code flow with PKCE and nonce behind the PrincipalVerifier of @starci/auth.
2127
+ # This folder parses the typed options, hands the package the app's bounded HTTP client and clock, and names the injectors;
2128
+ # no app file imports jose, and no other module imports the package (ruleParams.be.infraOwners).
2129
+ path: "src/modules/integrations/keycloak/"
2130
+ presence: optional
2131
+ tracked: tracked
2132
+ tier: integrations
2133
+ owner: true
2134
+ requires: [index.ts, keycloak.config.ts, keycloak.options.ts, keycloak.decorators.ts, keycloak.registration.ts]
2135
+ allows: [index.ts, keycloak.config.ts, keycloak.options.ts, keycloak.decorators.ts, keycloak.registration.ts, errors/, messages/]
2136
+ tests: unit-beside
2137
+ rules: [BE_TIER_DIRECTION, BE_ERROR_HOME, BE_SECRET_DEFAULT, BE_INFRA_OWNER, BE_AUTH_PASSPORT_OWNER, BE_INTEGRATION_SPEC_MISSING]
2138
+ coverage: required
2139
+ since: 3.17.0
2140
+
2015
2141
 
2016
2142
  # ----- BE: tests (owner test layout 2026-09-30). Unit specs are <name>.service.spec.ts beside their service and nothing else; everything else
2017
2143
  # lives under src/tests/, one folder per kind, and the folder and the file suffix always agree (a file whose suffix does
@@ -2485,9 +2611,9 @@ slots:
2485
2611
  presence: required
2486
2612
  tracked: tracked
2487
2613
  tier: foundation
2488
- # The app's routing, request config and catalogs, or its adapter to the shared i18n factory. A single app
2489
- # owns createNavigation in fe.modules.routes, keeping this public entry safe for its proxy. Shared stacks
2490
- # belong to fe.package.i18n and expose a routing-only proxy entry separately from navigation.
2614
+ # The app's description of its languages (defineI18n of @starci/next-i18n), its request config and catalogs, or its adapter to the
2615
+ # shared i18n workspace package. A single app builds its navigation (createI18nNavigation) in fe.modules.routes, keeping this
2616
+ # public entry safe for its proxy. A description shared by several apps belongs to fe.package.i18n.
2491
2617
  requires: [index.ts]
2492
2618
  tests: none
2493
2619
  rules: [FE_I18N_PLACEMENT, FE_I18N_CATALOG]
@@ -2541,7 +2667,7 @@ slots:
2541
2667
  profiles: [fe]
2542
2668
  # The identity-provider client (fe-stack auth, FE-AUTH): the session, the access token the Apollo link attaches and the
2543
2669
  # 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
2544
- # the back end's httpOnly cookie and the access token in memory (ruling:lite-self-hosted-postgres-passport-minio).
2670
+ # the back end's httpOnly cookie and the access token in the memory of the one @starci/auth client (ruling:lite-self-hosted-postgres-passport-minio).
2545
2671
  path: "apps/<app>/src/modules/auth/"
2546
2672
  presence: optional
2547
2673
  tracked: tracked
@@ -2551,6 +2677,20 @@ slots:
2551
2677
  tests: none
2552
2678
  since: 3.0.0
2553
2679
  rules: [FE_STACK_FORBIDDEN]
2680
+ - id: fe.modules.auth.client
2681
+ since: 3.16.0
2682
+ profiles: [fe]
2683
+ editions: [lite]
2684
+ editionWhy: "lite signs people in with the package @starci/auth, so its auth client is rendered, not written (owner ruling auth-package); full wires its identity provider."
2685
+ # The AuthClient every edition shares, implemented by one @starci/auth/client instance over the app's own back-end auth doors.
2686
+ path: "apps/web/src/modules/auth/{client.ts,email-doors.ts,index.ts}"
2687
+ presence: optional
2688
+ tracked: tracked
2689
+ tier: inherit
2690
+ tests: none
2691
+ managedBy: auth-lite
2692
+ managedOnly: true # lists files sync renders; the slot owning the path judges them
2693
+ rules: [HFS_MANAGED_FILE_DRIFT]
2554
2694
  - id: fe.modules.toast
2555
2695
  profiles: [fe]
2556
2696
  # Mutation feedback (fe-stack toast, FE-TOAST): the HeroUI toast wrapper, showGraphQLToast over a GraphQLResponse and the
@@ -2625,7 +2765,7 @@ slots:
2625
2765
  owner: true
2626
2766
  requires: [package.json, src/index.ts, tsconfig.json]
2627
2767
  tests: none
2628
- why: the next-intl stack (routing, navigation, request config) written once, exported as the createAppI18n factory every app calls
2768
+ why: the product's languages (defineI18n of @starci/next-i18n) written once and composed into the createAppI18n factory every app calls; the next-intl stack itself is the package's
2629
2769
  rules: [FE_I18N_PLACEMENT, FE_PACKAGE_SHAPE, HFS_UNUSED_EXPORT]
2630
2770
 
2631
2771
  # Checks that read this manifest (all ship from .claude; none keeps its own path list)
@@ -0,0 +1,78 @@
1
+ // root-packages.mjs - the workspace packages of an app ROOT (packages/agent-sdk, packages/module-<name>, the managed packages/modules).
2
+ // They lie outside both side folders and belong to no side; both sides import them by package name, through their package entry points
3
+ // (the `exports` of the manifest), so the import graph reads them as first-party packages and the back-end canon never reads them as
4
+ // a third-party library. The app root's one package.json lists them in `workspaces`; the patterns that start with a side folder
5
+ // (`fe/apps/*`) are that side's own workspaces and are not read here.
6
+ import fs from 'node:fs';
7
+ import path from 'node:path';
8
+ import { readJsonFile as readJson } from '../../lib/json.mjs';
9
+ import { byCodeUnit } from '../../lib/list.mjs';
10
+ import { isInside } from '../../lib/walk.mjs';
11
+ import { slash } from '../../lib/path-key.mjs';
12
+ /** The slots whose directories at the app root are first-party packages of the app (agent SDK, module packages, the managed registry). */
13
+ export const ROOT_PACKAGE_SLOTS = new Set(['app.packages', 'app.module-registry']);
14
+ const SIDE_PREFIX = /^(?:be|fe)\//;
15
+ /** A workspace pattern this reader expands (a literal path, or `*` as a whole segment); the others are judged by the workspace rules. */
16
+ const expandablePattern = (written) => !path.isAbsolute(written) && written.split('/').every(segment => segment !== '..' && (!segment.includes('*') || segment === '*'));
17
+ function expandSegment(base, segment) {
18
+ if (segment !== '*')
19
+ return [path.join(base, segment)];
20
+ if (!fs.existsSync(base) || !fs.lstatSync(base).isDirectory())
21
+ return [];
22
+ return fs.readdirSync(base, { withFileTypes: true }).filter(item => item.isDirectory()).sort((a, b) => byCodeUnit(a.name, b.name)).map(item => path.join(base, item.name));
23
+ }
24
+ /** A package folder with a regular package.json (a link is not one). */
25
+ export function packageDirectory(absolute) {
26
+ try {
27
+ if (!fs.lstatSync(absolute).isDirectory())
28
+ return false;
29
+ const manifest = fs.lstatSync(path.join(absolute, 'package.json'));
30
+ return manifest.isFile() && !manifest.isSymbolicLink();
31
+ }
32
+ catch {
33
+ return false;
34
+ }
35
+ }
36
+ /** The folders the `workspaces` of the app root's package.json name that no side owns, as absolute paths in code-unit order. */
37
+ export function rootWorkspaceDirectories(packageRoot) {
38
+ const manifest = readJson(path.join(packageRoot, 'package.json'));
39
+ const declared = manifest?.workspaces;
40
+ const patterns = Array.isArray(declared) ? declared : declared?.packages;
41
+ const found = new Set();
42
+ for (const pattern of Array.isArray(patterns) ? patterns : []) {
43
+ if (typeof pattern !== 'string' || !pattern.trim())
44
+ continue;
45
+ const written = slash(pattern.trim()).replace(/^\.\//, '');
46
+ if (SIDE_PREFIX.test(written) || !expandablePattern(written))
47
+ continue;
48
+ let bases = [packageRoot];
49
+ for (const segment of written.split('/'))
50
+ bases = bases.flatMap(base => expandSegment(base, segment));
51
+ for (const base of bases)
52
+ found.add(path.resolve(base));
53
+ }
54
+ return [...found].sort(byCodeUnit);
55
+ }
56
+ /**
57
+ * The record of one package folder of the app root, or null when it is no named package inside the app root.
58
+ * `canonical` is the file-identity function of the caller (the real path), so a record agrees with the files the graph reads.
59
+ */
60
+ export function rootPackageRecord(packageRoot, directory, canonical) {
61
+ if (!packageDirectory(directory) || !isInside(packageRoot, directory))
62
+ return null;
63
+ const manifest = readJson(path.join(directory, 'package.json'));
64
+ const name = manifest?.['name'];
65
+ if (manifest === null || typeof name !== 'string' || !name)
66
+ return null;
67
+ return { root: canonical(directory), relative: slash(path.relative(packageRoot, directory)), name, exports: manifest['exports'], manifest, workspace: true, app: false };
68
+ }
69
+ /** The names of the workspace packages of the app root: what the back-end canon must not read as third-party libraries. */
70
+ export function rootPackageNames(packageRoot) {
71
+ const names = new Set();
72
+ for (const directory of rootWorkspaceDirectories(packageRoot)) {
73
+ const record = rootPackageRecord(packageRoot, directory, (file) => file);
74
+ if (record !== null)
75
+ names.add(record.name);
76
+ }
77
+ return names;
78
+ }
@@ -121,7 +121,7 @@ export const MANIFEST_KINDS = [APP_KIND, RUNTIME_KIND];
121
121
  export const manifestKind = (m) => (isPlainObject(m) && m.kind !== undefined ? m.kind : APP_KIND);
122
122
  const strList = (v) => stringList(v);
123
123
 
124
- const APP_SLOT_KEYS = ['id', 'profiles', 'path', 'presence', 'tracked', 'tier', 'tests', 'owner', 'appKind', 'minInstances', 'requiredWhen', 'requiredInstances', 'requires', 'pattern', 'trigger', 'allows', 'forbids', 'layers', 'kinds', 'roles', 'composedBy', 'budget', 'managedBy', 'liteManagedBy', 'rules', 'goesTo', 'why', 'since', 'perConnection', 'parent', 'editions', 'editionWhy', 'litePresence', 'lite', 'provider', 'coverage', 'entries', 'outcomeHome', 'templateNa', 'exemplifiedBy', 'role', 'importedBy', 'logic'];
124
+ const APP_SLOT_KEYS = ['id', 'profiles', 'path', 'presence', 'tracked', 'tier', 'tests', 'owner', 'appKind', 'minInstances', 'requiredWhen', 'requiredInstances', 'requires', 'pattern', 'trigger', 'allows', 'forbids', 'layers', 'kinds', 'roles', 'composedBy', 'budget', 'managedBy', 'liteManagedBy', 'rules', 'goesTo', 'why', 'since', 'perConnection', 'parent', 'editions', 'editionWhy', 'litePresence', 'lite', 'provider', 'coverage', 'entries', 'outcomeHome', 'templateNa', 'exemplifiedBy', 'role', 'importedBy', 'logic', 'managedOnly'];
125
125
  /** The roles a file slot may play that a rule reads (`role`): the entity registry of persistence.md BE-PERSISTENCE-3 (architecture/entity-registry.mjs). */
126
126
  const SLOT_ROLES = ['entity-registry'];
127
127
  /** The fields a slot's `lite` overlay may hold: the same keys it would carry in the slot body, resolved under edition lite. */
@@ -232,7 +232,7 @@ export function readRepoDeclaration(manifest, repoRoot) {
232
232
  function createScopeResolver(manifest, repo) {
233
233
  const profile = repo.profile;
234
234
  const edition = repo.edition ?? 'full';
235
- const slots = manifest.slots.filter((s) => s.profiles.includes(profile) && slotInEdition(manifest, s, edition)).map((s) => effectiveSlot(s, profile, edition));
235
+ const slots = manifest.slots.filter((s) => s.managedOnly !== true && s.profiles.includes(profile) && slotInEdition(manifest, s, edition)).map((s) => effectiveSlot(s, profile, edition));
236
236
  const scope = { manifest, repo, profile, slots, byId: new Map(slots.map((s) => [s.id, s])), variants: slots.flatMap(variantsOf), appKind: new Map(repo.apps.map((a) => [a.name, a.kind])) };
237
237
  const classifyPath = (input) => classifyIn(scope, input);
238
238
  /** tracked | ignored | external for the slot owning `p`, or null when no slot owns it. */
@@ -5,6 +5,7 @@
5
5
  import path from 'node:path';
6
6
  import { allowsFile } from './allows.mjs';
7
7
  import { openHfs } from './slots.mjs';
8
+ import { ROOT_PACKAGE_SLOTS } from './architecture/root-packages.mjs';
8
9
  const posix = (p) => String(p).replaceAll('\\', '/');
9
10
  const isAbsoluteAny = (text) => path.isAbsolute(text) || /^[A-Za-z]:\//.test(text);
10
11
  /**
@@ -69,3 +70,70 @@ export const openHfsView = ({ runtimeRoot, repoRoot }) => hfsView(openHfs({ root
69
70
  * @returns {object} The frozen view.
70
71
  */
71
72
  export const declaredHfsView = ({ runtimeRoot, declaration, repoRoot, side }) => hfsView(openHfs({ root: runtimeRoot, declaration, side }), repoRoot);
73
+ /**
74
+ * The view of the root workspace packages of an app (`packages/<pkg>/src/**`, slots app.packages and app.module-registry), as the lint of one
75
+ * side sees them: the rule parameters, the apps and the Grammar of `side` (a package is judged by the laws of the side whose subpath a file
76
+ * sits in), and the paths of the APP ROOT (`repoRoot` is the app root, not a side folder). The slots answer for the root paths; a file of a
77
+ * package is of the tier `package` and has no owner: the owner laws (one `index.ts` per owner root) are the module folders', a package's public
78
+ * surface being the `exports` of its manifest.
79
+ *
80
+ * @param {object} opened - The result of `openHfs` for the app root (profile app, both sides resolved).
81
+ * @param {string} repoRoot - The absolute app root.
82
+ * @param {string} side - `be` or `fe`: the side whose laws the file is judged by.
83
+ * @returns {object} The frozen view: the profile of the side over the paths of the app root.
84
+ */
85
+ function packagesView(opened, repoRoot, side) {
86
+ const scope = opened.sides?.[side];
87
+ const sideRepo = opened.repo.sides?.[side];
88
+ if (scope === undefined || sideRepo === undefined)
89
+ throw new Error('the view of the root packages needs the declaration of an app with both sides');
90
+ const rel = (file) => {
91
+ const text = posix(file);
92
+ return isAbsoluteAny(text) ? posix(path.relative(repoRoot, file)) : text.replace(/^\.\//, '');
93
+ };
94
+ const cache = new Map();
95
+ const classify = (file) => {
96
+ const key = rel(file);
97
+ if (!cache.has(key))
98
+ cache.set(key, opened.classifyPath(key));
99
+ return cache.get(key);
100
+ };
101
+ const packageOf = (file) => {
102
+ const slot = classify(file).slot;
103
+ const relative = rel(file);
104
+ return slot !== undefined && ROOT_PACKAGE_SLOTS.has(slot) ? relative.split('/').slice(0, 2).join('/') : null;
105
+ };
106
+ return Object.freeze({
107
+ repoRoot,
108
+ profile: side,
109
+ side,
110
+ edition: opened.repo.edition ?? 'full',
111
+ ...(sideRepo.grammar === undefined ? {} : { grammar: sideRepo.grammar }),
112
+ apps: sideRepo.apps,
113
+ connections: sideRepo.connections,
114
+ patterns: Object.freeze([...(sideRepo.patterns ?? [])]),
115
+ ruleParams: scope.ruleParams(),
116
+ relative: rel,
117
+ classify,
118
+ slotOf: (file) => classify(file).slot ?? null,
119
+ tierOf: (file) => (packageOf(file) === null ? null : 'package'),
120
+ // A package is no owner of the module laws (one index.ts at the owner root): its public surface is the `exports` of its manifest, so no file of it has an owner.
121
+ ownerOf: () => null,
122
+ allows: (file) => allowsFile(opened, rel(file)),
123
+ slot: (id) => opened.slot(id),
124
+ });
125
+ }
126
+ /**
127
+ * The view of the root packages of the app at `repoRoot` (the app root, where the root `eslint.config.mjs` lives), for the laws of `side`.
128
+ *
129
+ * @param {{ runtimeRoot: string, repoRoot: string, side: string }} input - Where the manifest copy lives, the app root, and the side whose laws apply.
130
+ * @returns {object} The frozen view.
131
+ */
132
+ export const openPackagesHfsView = ({ runtimeRoot, repoRoot, side }) => packagesView(openHfs({ root: runtimeRoot, repoRoot }), repoRoot, side);
133
+ /**
134
+ * The view of the root packages of an in-memory app declaration (rule tests): no file is read except the manifest.
135
+ *
136
+ * @param {{ runtimeRoot: string, declaration: object, repoRoot: string, side: string }} input - Manifest root, the app hfs.json object, the app root and the side.
137
+ * @returns {object} The frozen view.
138
+ */
139
+ export const declaredPackagesHfsView = ({ runtimeRoot, declaration, repoRoot, side }) => packagesView(openHfs({ root: runtimeRoot, declaration }), repoRoot, side);