@starci/eslint-canon-be 3.6.0 → 3.6.2

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
+ ## 3.6.2 - 2026-10-28
4
+
5
+ - Changed: the bundled canon pins follow release E (Grammar family 0.15.2, hfs 4.9.3, canon-fe 9.4.2, canon-be 3.6.2, ai-router 0.3.0) and pin no `starci-harness`: an app's CLI is the version of the CLI that runs @starci/hfs. No rule changed.
6
+
7
+ ## 3.6.1 - 2026-10-28
8
+
9
+ - Fixed: the published declarations of `loadHfs` and `starciBeConfig` name the emitted `dist/lib/hfs-view.d.ts`, not the untyped `runtime/scripts/hfs/view.mjs`, so a consumer's typed lint of the managed `be/eslint.config.mjs` no longer reads an error type (`no-unsafe-assignment` at 3:33). The view's shapes live in `src/lib/hfs-view.ts`; the runtime functions are read through `#runtime/*`. Spec: `src/published-declarations.spec.ts`.
10
+ - Changed: the bundled runtime's `repo-identity.mjs` names a repository by its origin remote (hfs 4.9.2).
11
+ - Changed: the bundled canon pins follow release D (Grammar family 0.15.1, hfs 4.9.2, canon-fe 9.4.1, canon-be 3.6.1, starci-harness 1.1.0-alpha.2), so an app installs the released versions without pin drift.
12
+
3
13
  ## 3.6.0 - 2026-10-28
4
14
 
5
15
  - Changed: the package is TypeScript built to JavaScript. Source and specs live in `src/*.ts` (strict, no `any`, no
package/README.md CHANGED
@@ -148,7 +148,9 @@ The package is TypeScript: `src/*.ts` (one module per law, `src/lib/` for the sh
148
148
  source) builds with `tsc -p tsconfig.build.json` into `dist/`, which is what `exports` and `files` publish, with `runtime/`.
149
149
  `npm run typecheck` checks source and specs strictly (no `any`); `npm test` runs the specs straight from the TypeScript
150
150
  (`node --test`, Node strips the types), so a spec needs no build. The bundled `runtime/` is untyped JavaScript; the parts
151
- this package imports are declared in `src/types/runtime/*.d.ts`. `fixtures/` is spec data and stays JavaScript with
151
+ this package imports are declared in `src/types/runtime/`, and the HFS view is imported through `#runtime/*` with its shapes
152
+ in `src/lib/hfs-view.ts`, which is emitted, so the published declarations of `loadHfs` and `starciBeConfig` name no
153
+ untyped runtime file. `fixtures/` is spec data and stays JavaScript with
152
154
  `.d.mts` contracts, because the front-end canon and the Grammar lint families import its helpers by path.
153
155
 
154
156
  ## HFS rules and their why codes
@@ -0,0 +1,127 @@
1
+ /**
2
+ * The shapes of the HFS view `runtime/scripts/hfs/view.mjs` builds (a bundled copy of @starci/hfs's runtime, untyped JavaScript):
3
+ * the frozen object a lint factory puts in `settings.starci.hfs` and every path-scoped rule reads. The shapes are the slot
4
+ * manifest's (`runtime/knowledge/hfs/slots.yaml`) as this package reads them; this module is emitted, so the published
5
+ * declarations of `loadHfs` and `starciBeConfig` name a declared type.
6
+ */
7
+ /** One app of a side (`hfs.json` sides.<side>.apps). */
8
+ export interface HfsApp {
9
+ readonly name: string;
10
+ readonly kind: string;
11
+ }
12
+ /** One declared database connection (`hfs.json` sides.be.connections). */
13
+ export interface HfsConnection {
14
+ readonly name: string;
15
+ readonly envPrefix: string;
16
+ readonly owner?: string;
17
+ readonly isolation?: string;
18
+ }
19
+ /** Where a path sits: its slot, root and bindings, or a status naming why no slot owns it. */
20
+ export interface HfsClassification {
21
+ readonly path: string;
22
+ readonly status: string;
23
+ readonly slot?: string;
24
+ readonly root?: string;
25
+ readonly bindings?: Readonly<Record<string, string>>;
26
+ readonly kind?: string;
27
+ readonly role?: string;
28
+ readonly presence?: string;
29
+ readonly goesTo?: string;
30
+ readonly code?: string;
31
+ /** For a path no slot owns: the slot it sits nearest to. */
32
+ readonly nearest?: {
33
+ readonly slot?: string;
34
+ } | null;
35
+ }
36
+ /** What the slot that owns a file says about it (its `allows` list). */
37
+ export interface HfsAllowsVerdict {
38
+ readonly slot: string;
39
+ readonly root: string;
40
+ readonly relative: string;
41
+ readonly allowed: boolean;
42
+ readonly entry?: string;
43
+ readonly forbiddenBy?: string;
44
+ readonly allows: readonly string[];
45
+ }
46
+ /** A slot definition of the manifest, by the fields the rules read. */
47
+ export interface HfsSlot {
48
+ readonly id: string;
49
+ readonly tier?: string;
50
+ readonly budget?: Readonly<Record<string, number>>;
51
+ readonly trigger?: string;
52
+ readonly coverage?: string;
53
+ readonly allows?: readonly string[];
54
+ }
55
+ /** A unit-tested role (`ruleParams.be.unitRoles`). */
56
+ export interface HfsUnitRole {
57
+ readonly role: string;
58
+ readonly spec: string;
59
+ readonly slot?: string;
60
+ readonly exempt?: readonly string[];
61
+ }
62
+ /** A parameter-name rule (`ruleParams.be.paramNames`). */
63
+ export type HfsParamName = {
64
+ readonly type: string;
65
+ readonly typeSuffix?: undefined;
66
+ readonly names: readonly string[];
67
+ readonly nameSuffix?: string;
68
+ } | {
69
+ readonly type?: undefined;
70
+ readonly typeSuffix: string;
71
+ readonly names: readonly string[];
72
+ readonly nameSuffix?: string;
73
+ };
74
+ /** A spec double (`ruleParams.be.specDoubles.doubles`). */
75
+ export interface HfsSpecDouble {
76
+ readonly token: string;
77
+ readonly double: string;
78
+ readonly forms: readonly string[];
79
+ }
80
+ /** The rule parameters of the be profile (`ruleParams.common` merged with `ruleParams.be`), by the keys the rules read. */
81
+ export interface HfsRuleParams {
82
+ readonly functionLines?: number;
83
+ readonly fileLines: {
84
+ readonly soft: number;
85
+ readonly hardGrowth: boolean;
86
+ };
87
+ readonly infraOwners: Readonly<Record<string, readonly string[]>>;
88
+ readonly eventBus: {
89
+ readonly imports: Readonly<Record<string, readonly string[]>>;
90
+ readonly classes: Readonly<Record<string, readonly string[]>>;
91
+ };
92
+ readonly specDoubles: {
93
+ readonly kit: string;
94
+ readonly doubles: readonly HfsSpecDouble[];
95
+ };
96
+ readonly paramNames: readonly HfsParamName[];
97
+ readonly unitRoles?: readonly HfsUnitRole[];
98
+ readonly logicRoles?: readonly string[];
99
+ readonly valueRoles?: readonly string[];
100
+ readonly thinRoles?: readonly string[];
101
+ }
102
+ /** The frozen view of one side of an app. */
103
+ export interface HfsView {
104
+ readonly repoRoot: string;
105
+ readonly profile: string;
106
+ readonly side: string | null;
107
+ readonly edition: string;
108
+ readonly grammar?: string;
109
+ readonly apps: readonly HfsApp[];
110
+ readonly connections?: readonly HfsConnection[];
111
+ readonly patterns: readonly string[];
112
+ readonly ruleParams: HfsRuleParams;
113
+ /** The repository-relative, forward-slash form of a linted filename. */
114
+ relative(file: string): string;
115
+ /** The classification of a file. */
116
+ classify(file: string): HfsClassification;
117
+ /** The slot id that owns a file, or null. */
118
+ slotOf(file: string): string | null;
119
+ /** The tier of a file, or null. */
120
+ tierOf(file: string): string | null;
121
+ /** The owner root of a file, or null. */
122
+ ownerOf(file: string): string | null;
123
+ /** What the owning slot's `allows` says about a file, or null when it names none. */
124
+ allows(file: string): HfsAllowsVerdict | null;
125
+ /** A slot definition by id. */
126
+ slot(id: string): HfsSlot | undefined;
127
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/lib/hfs.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { type HfsView } from "../../runtime/scripts/hfs/view.mjs";
1
+ import type { HfsView } from "./hfs-view.js";
2
2
  import type { Context } from "./rule.js";
3
- export type { HfsAllowsVerdict, HfsApp, HfsClassification, HfsConnection, HfsParamName, HfsRuleParams, HfsSlot, HfsSpecDouble, HfsUnitRole, HfsView, } from "../../runtime/scripts/hfs/view.mjs";
3
+ export type { HfsAllowsVerdict, HfsApp, HfsClassification, HfsConnection, HfsParamName, HfsRuleParams, HfsSlot, HfsSpecDouble, HfsUnitRole, HfsView, } from "./hfs-view.js";
4
4
  /**
5
5
  * The HFS view of the side whose `eslint.config.mjs` (in be/) calls this.
6
6
  *
package/dist/lib/hfs.js CHANGED
@@ -13,7 +13,7 @@
13
13
  */
14
14
  import { dirname } from "node:path";
15
15
  import { fileURLToPath } from "node:url";
16
- import { declaredHfsView, openHfsView } from "../../runtime/scripts/hfs/view.mjs";
16
+ import { declaredHfsView, openHfsView } from "#runtime/scripts/hfs/view.mjs";
17
17
  import { RUNTIME_ROOT as RUNTIME } from "./runtime-root.js";
18
18
  /**
19
19
  * The HFS view of the side whose `eslint.config.mjs` (in be/) calls this.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-canon-be",
3
- "version": "3.6.0",
3
+ "version": "3.6.2",
4
4
  "description": "The StarCi back-end lint canon: every rule its laws publish, gathered as one flat-config plugin.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -21,6 +21,12 @@
21
21
  "default": "./dist/index.js"
22
22
  }
23
23
  },
24
+ "imports": {
25
+ "#runtime/*": {
26
+ "types": "./src/types/runtime/*",
27
+ "default": "./runtime/*"
28
+ }
29
+ },
24
30
  "main": "./dist/index.js",
25
31
  "files": [
26
32
  "LICENSE",
@@ -1,7 +1,8 @@
1
1
  schema: starci/canon-pins@1
2
2
  purpose: >-
3
3
  The exact version of every shared dependency in the StarCi family, including package-owned runtime dependencies. One version per dependency for the whole
4
- family. Raising a version is a change to this file first (with the package bump when it is a @starci package),
4
+ family. The command line itself is not pinned here: an app's starci-harness is the version of the CLI that runs @starci/hfs to
5
+ judge or scaffold it (scripts/hfs/canon-pins.mjs), since that CLI depends on this package exactly. Raising a version is a change to this file first (with the package bump when it is a @starci package),
5
6
  then the repositories' own upgrade lane (each sets the exact version and reinstalls; nothing else installs a @starci package). Read on 2026-09-29 from the packages under
6
7
  .claude/packages and from the installed node_modules of the six product repositories; where they disagreed the
7
8
  newest version installed in more than one repository won, and the runtime's own version won for @starci packages.
@@ -30,35 +31,35 @@ pins:
30
31
  source: packages/event-stream/package.json
31
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.'
32
33
  '@starci/grammar':
33
- version: 0.15.0
34
+ version: 0.15.2
34
35
  group: starci
35
36
  install: registry
36
37
  side: fe
37
38
  source: packages/grammar/package.json
38
39
  why: 'the grammar front ends read: the brand layer sets `--font-sans` and `--font-mono` and the grammar reads them; it carries the Input tel kind, the copyable and read-only Input, the IconButton disclosure props and count badge, ChatBubble, FillViewport, Textarea mentions and Enter-to-send, the leading PrimaryRailLayout rail, the plate-less Image, ListRow, the soft Alert, Progress steps, the floating primary IconButton, FlowGraph, the STATE-8 loading views and the bordered selectable TagGroup chips. The runtime source version wins for a @starci package.'
39
40
  '@starci/eslint-canon-be':
40
- version: 3.6.0
41
+ version: 3.6.2
41
42
  group: starci
42
43
  install: registry
43
44
  side: be
44
45
  source: packages/eslint-canon-be/package.json
45
46
  why: 'the back-end ESLint canon: `loadHfs(import.meta.url)` of be/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the be side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; `starciBeConfig({ hfs: loadHfs(import.meta.url) })` is the typed factory and the BE-CONVENTION laws are its rules.'
46
47
  '@starci/eslint-canon-fe':
47
- version: 9.4.0
48
+ version: 9.4.2
48
49
  group: starci
49
50
  install: registry
50
51
  side: fe
51
52
  source: packages/eslint-canon-fe/package.json
52
53
  why: 'the front-end ESLint canon: `loadHfs(import.meta.url)` of fe/eslint.config.mjs finds the app-root hfs.json (kind app) and gives every linted file the view of the fe side, and the project graph is built per side; its bundled runtime copies (slots, canon-pins, failure codes, the architecture machine) put .starcistacks and .sops.yaml at the app root; the front end has no tests (FE_NO_TESTS R97 in hfs) and no-vietnamese-in-source (R91) applies.'
53
54
  '@starci/eslint-grammar-core':
54
- version: 0.15.0
55
+ version: 0.15.2
55
56
  group: starci
56
57
  install: registry
57
58
  side: fe
58
59
  source: packages/eslint-grammar-core/package.json
59
60
  why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
60
61
  '@starci/eslint-grammar-offset-pop':
61
- version: 0.15.0
62
+ version: 0.15.2
62
63
  group: starci
63
64
  install: registry
64
65
  side: fe
@@ -98,21 +99,14 @@ pins:
98
99
  source: packages/test-world/package.json
99
100
  why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
100
101
  '@starci/ai-router':
101
- version: 0.2.1
102
+ version: 0.3.0
102
103
  group: starci
103
104
  install: registry
104
105
  side: be
105
106
  source: packages/ai-router/package.json
106
107
  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.'
107
- 'starci-harness':
108
- version: 1.1.0-alpha.1
109
- group: starci
110
- install: registry
111
- side: both
112
- source: cli/package.json
113
- why: 'the one StarCi command line (bins starci and starci-harness): a product repository installs it for starci app, which it runs in-process through its exact @starci/hfs dependency, and its codegen loads starci-harness/input-bounds.'
114
108
  '@starci/hfs':
115
- version: 4.9.1
109
+ version: 4.9.3
116
110
  group: starci
117
111
  install: registry
118
112
  side: both
@@ -42,13 +42,13 @@ function askGit(root) {
42
42
  }
43
43
 
44
44
  /**
45
- * The product repository name: the main checkout's folder name (so a worktree and its main checkout agree), else the
46
- * origin remote's name, else package.json name outside Git, else the folder name. A folder inside a larger repository
47
- * (a nested product, an example) is named by its own folder.
45
+ * The product repository name: the origin remote's repository name (one name for every clone and worktree, whatever
46
+ * folder holds it), else the main checkout's folder name (so a worktree and its main checkout agree), else package.json
47
+ * name outside Git, else the folder name. A folder inside a larger repository (a nested product, an example) is named by
48
+ * its own folder.
48
49
  */
49
50
  export function repositoryName(root) {
50
51
  const { inWorkTree, repositoryRoot, home } = identityOf(root);
51
- if (home) return path.basename(home);
52
52
  if (repositoryRoot) {
53
53
  try {
54
54
  const remote = trimTrailingSlashes(git(gitRemote, root, ['get-url', 'origin'])).replace(GIT_SUFFIX, '');
@@ -56,6 +56,7 @@ export function repositoryName(root) {
56
56
  if (name) return name;
57
57
  } catch { /* No origin remote. */ }
58
58
  }
59
+ if (home) return path.basename(home);
59
60
  if (inWorkTree && !repositoryRoot) return path.basename(root);
60
61
  try {
61
62
  const pkg = JSON.parse(fs.readFileSync(path.join(root, 'package.json'), 'utf8'));