@starci/eslint-canon-be 3.11.18 → 3.11.19

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,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.11.19
4
+
5
+ - Changed: Carry the bundled runtime of @starci/hfs 5.0.8 (the rule texts name `app check`, the read-set helper of the rule memo) and its canon pins; the comments name `app check` for the removed lint verb.
6
+
3
7
  ## 3.11.18
4
8
 
5
9
  - Changed: Refresh aligned canonical package pins.
package/dist/index.js CHANGED
@@ -218,6 +218,6 @@ for (const entry of [
218
218
  Object.assign(rules, entry.rules);
219
219
  Object.assign(recommended, entry.recommended);
220
220
  }
221
- // The result cache of `starci app lint` (contexts/project/check-cache.md) reads these two declarations of the installed canon.
221
+ // The result cache of `starci app check --gate lint` (contexts/project/check-cache.md) reads these two declarations of the installed canon.
222
222
  export { crossFileInputs } from "./lib/cross-file-inputs.js";
223
223
  export { projectGraph } from "./project-graph.js";
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The files a rule of this canon reads that ESLint's own import graph does not carry.
3
3
  *
4
- * The result cache of `starci app lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
4
+ * The result cache of `starci app check --gate lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
5
5
  * changed. A rule that reads another file by path, with `fs` (a sibling, a directory listing, a manifest, a module file it follows by hand),
6
6
  * has an input the import graph cannot see, so the rule declares it here and the cache dirties the files that depend on it:
7
7
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * The files a rule of this canon reads that ESLint's own import graph does not carry.
3
3
  *
4
- * The result cache of `starci app lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
4
+ * The result cache of `starci app check --gate lint` (contexts/project/check-cache.md, ESLint) re-lints a file when it or a file it reaches through imports
5
5
  * changed. A rule that reads another file by path, with `fs` (a sibling, a directory listing, a manifest, a module file it follows by hand),
6
6
  * has an input the import graph cannot see, so the rule declares it here and the cache dirties the files that depend on it:
7
7
  *
@@ -23,7 +23,7 @@ export interface ProjectGraphSnapshot {
23
23
  /**
24
24
  * The findings every project-graph rule of this canon reports, per file, from one fresh build of the side's graph.
25
25
  *
26
- * The result cache of `starci app lint` calls this once for a side whose files changed and compares each file's findings with the recorded
26
+ * The result cache of `starci app check --gate lint` calls this once for a side whose files changed and compares each file's findings with the recorded
27
27
  * ones: a file whose graph findings differ is linted again by ESLint itself, so ESLint stays the only emitter of each message. It is the very
28
28
  * graph the rules read (same machine, same manifest, same filter), never a second judge.
29
29
  *
@@ -23,7 +23,7 @@ export const recommended = Object.fromEntries(mine.map((e) => [`starci-be/${e.id
23
23
  /**
24
24
  * The findings every project-graph rule of this canon reports, per file, from one fresh build of the side's graph.
25
25
  *
26
- * The result cache of `starci app lint` calls this once for a side whose files changed and compares each file's findings with the recorded
26
+ * The result cache of `starci app check --gate lint` calls this once for a side whose files changed and compares each file's findings with the recorded
27
27
  * ones: a file whose graph findings differ is linted again by ESLint itself, so ESLint stays the only emitter of each message. It is the very
28
28
  * graph the rules read (same machine, same manifest, same filter), never a second judge.
29
29
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-canon-be",
3
- "version": "3.11.18",
3
+ "version": "3.11.19",
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",
@@ -31,42 +31,42 @@ pins:
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
33
  '@starci/grammar':
34
- version: 0.21.11
34
+ version: 0.21.12
35
35
  group: starci
36
36
  install: registry
37
37
  side: fe
38
38
  source: packages/grammar/package.json
39
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.'
40
40
  '@starci/eslint-canon-be':
41
- version: 3.11.18
41
+ version: 3.11.19
42
42
  group: starci
43
43
  install: registry
44
44
  side: be
45
45
  source: packages/eslint-canon-be/package.json
46
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.'
47
47
  '@starci/eslint-canon-fe':
48
- version: 9.9.11
48
+ version: 9.9.12
49
49
  group: starci
50
50
  install: registry
51
51
  side: fe
52
52
  source: packages/eslint-canon-fe/package.json
53
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.'
54
54
  '@starci/eslint-grammar-core':
55
- version: 0.21.11
55
+ version: 0.21.12
56
56
  group: starci
57
57
  install: registry
58
58
  side: fe
59
59
  source: packages/eslint-grammar-core/package.json
60
60
  why: 'the StarCi Grammar component API lint, versioned with @starci/grammar; front ends compose this family package with the universal FE canon.'
61
61
  '@starci/eslint-grammar-offset-pop':
62
- version: 0.21.11
62
+ version: 0.21.12
63
63
  group: starci
64
64
  install: registry
65
65
  side: fe
66
66
  source: packages/eslint-grammar-offset-pop/package.json
67
67
  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
68
  '@starci/stylelint-canon':
69
- version: 2.5.0
69
+ version: 2.5.1
70
70
  group: starci
71
71
  install: registry
72
72
  side: fe
@@ -106,7 +106,7 @@ pins:
106
106
  source: packages/ai-router/package.json
107
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.'
108
108
  '@starci/hfs':
109
- version: 5.0.7
109
+ version: 5.0.8
110
110
  group: starci
111
111
  install: registry
112
112
  side: both
@@ -21,9 +21,9 @@ version: 3.1.0
21
21
  gates:
22
22
  pre-commit: the managed L0 hook runs app check --staged, managed-file drift, ESLint per side and stylelint on staged source, and prettier on staged files; typecheck and targeted specs belong to the op gate under R225
23
23
  pre-push: the managed app hook invokes the bundled push policy under R225; it starts no source check, build or test
24
- settle: the op gate `starci gate run` over the op's changed files (merge guard, starci app lint --changed, codegen, tsc, the slice's specs; only findings new against the workflow's previous checkpoint block), re-read at starci kernel settle, which refuses a red done; a green settle commits the op's checkpoint on wf-<workflowId>
24
+ settle: the op gate `starci gate run` over the op's changed files (merge guard, starci app check, codegen, tsc, the slice's specs; only findings new against the workflow's previous checkpoint block), re-read at starci kernel settle, which refuses a red done; a green settle commits the op's checkpoint on wf-<workflowId>
25
25
  land: the workflow's finish, the only time main is touched - gate.mjs over the whole workflow branch against its merge-base with main, the merge guard, review.verify of the exact head that lands, the branch rebased onto main, then main fast-forwarded and pushed
26
- ci: GitHub Actions runs the same pinned starci app lint, format:check, typecheck, unit with the per-file coverage threshold, build:be and build:fe, then the Sonar scan and gate
26
+ ci: GitHub Actions runs the same pinned starci app check --gate lint, format:check, typecheck, unit with the per-file coverage threshold, build:be and build:fe, then the Sonar scan and gate
27
27
  sonar: Sonar quality gate (knowledge/sonar-gate.yaml) - the imported lint findings, duplication, cognitive complexity and the coverage of the logic of be/src/modules at 100
28
28
  runtime: "`starci runtime check` (npm run check) of the StarCi runtime repository itself: scripts/checks/check-runtime.mjs runs node --check, scripts/hfs/runtime-check.mjs with knowledge/hfs/runtime-slots.yaml, and the retained self-checks"
29
29
  enforcerKinds:
@@ -229,7 +229,7 @@ rules:
229
229
  editions: [lite, full]
230
230
  docs: [docs/hfs-legacy-tooling.md#ci-and-hooks]
231
231
  code: "HFS_CI_MISSING_CANON"
232
- law: "CI runs the pinned `starci app lint` (`npm run lint`), a clone never redirects `core.hooksPath` away from husky, and the folder a set `core.hooksPath` names holds the installed hooks in every checkout (husky's dispatcher in `.husky/_`), so no commit lands without the pre-commit gate."
232
+ law: "CI runs the pinned `starci app check --gate lint` (`npm run lint`), a clone never redirects `core.hooksPath` away from husky, and the folder a set `core.hooksPath` names holds the installed hooks in every checkout (husky's dispatcher in `.husky/_`), so no commit lands without the pre-commit gate."
233
233
  kinds: [check, codemod]
234
234
  gates: [land, ci]
235
235
  failureCodes: ["HFS_CI_MISSING_CANON", "HFS_HOOKS_PATH_REDIRECTED", "HFS_HOOKS_NOT_INSTALLED"]
@@ -2503,7 +2503,7 @@ rules:
2503
2503
  - {path: packages/hfs/src/legacy-monorepo-coverage.spec.mjs, edition: full, codes: [HFS_MONO_WORKSPACES]}
2504
2504
  - id: R144
2505
2505
  code: "HFS_MONO_FE_WORKSPACE"
2506
- law: "Every fe app `fe/apps/<app>` is an npm workspace: its `package.json` is named `@<project>/<app>`, is private, declares its own runtime dependencies and has exactly the scripts `build: next build`, `dev: next dev`, `lint: starci app lint --workspace .`, `start: next start` and `typecheck: tsc --noEmit`; every fe package `fe/packages/<pkg>` is private with `build`, `typecheck` and the same workspace `lint` script."
2506
+ law: "Every fe app `fe/apps/<app>` is an npm workspace: its `package.json` is named `@<project>/<app>`, is private, declares its own runtime dependencies and has exactly the scripts `build: next build`, `dev: next dev`, `start: next start` and `typecheck: tsc --noEmit`; every fe package `fe/packages/<pkg>` is private with `build` and `typecheck`; no workspace has a `lint` script, the app is linted once from the root with `starci app check --gate lint`."
2507
2507
  kinds: [check]
2508
2508
  gates: [settle, land, ci]
2509
2509
  failureCodes: ["HFS_MONO_FE_WORKSPACE"]
@@ -40,11 +40,11 @@ newCode:
40
40
  metric: new_security_hotspots_reviewed
41
41
  minReviewedPercent: 100
42
42
  unreviewedMax: 0
43
- # The whole code, not only the new code. Every finding of the HFS canon reaches Sonar through ONE entry, `starci app lint`
43
+ # The whole code, not only the new code. Every finding of the HFS canon reaches Sonar through ONE entry, `starci app check --gate lint --out`
44
44
  # (packages/hfs, contract changes hfs-sonar-import and hfs-lint-entry). CI runs it per side with --side and --out,
45
45
  # then merges rules by id and joins issues into ONE file, reports/lint.sonar.json, named by sonar.externalIssuesReportPaths; the gate holds the open-issue count of
46
46
  # the whole project at zero. The file carries three engines:
47
- # starci-hfs the repository findings of `starci app check` (managed files, tree, pins, CI, contracts; the rule id is the finding code)
47
+ # starci-hfs the repository findings of the gates a run selects (managed files, tree, pins, CI, contracts; the rule id is the finding code)
48
48
  # eslint ESLint's json over the repository (the BE and FE canon plugins alike, per-file and project-graph rules)
49
49
  # stylelint stylelint's json over the style glob (front ends)
50
50
  # The engines share ONE placement rule (a finding on a file Sonar does not index is filed on the first source file); Sonar's own
@@ -3,8 +3,21 @@ import fs from 'node:fs';
3
3
  import path from 'node:path';
4
4
  /** Files above this size are not read by a tree check (a tracked binary or a generated dump is no source of these laws). */
5
5
  const MAX_READ_BYTES = 1024 * 1024;
6
+ let sink = null;
7
+ /** Runs `run` with every `readText` / `readJson` it makes reported to `onRead` (before the read), and returns its value. */
8
+ export function recordReads(onRead, run) {
9
+ const before = sink;
10
+ sink = onRead;
11
+ try {
12
+ return run();
13
+ }
14
+ finally {
15
+ sink = before;
16
+ }
17
+ }
6
18
  /** The text of `rel` under `repoRoot`, or null when it is absent, unreadable, over MAX_READ_BYTES or binary. */
7
19
  export function readText(repoRoot, rel) {
20
+ sink?.(repoRoot, rel);
8
21
  try {
9
22
  const target = path.join(repoRoot, rel);
10
23
  if (fs.statSync(target).size > MAX_READ_BYTES)
@@ -1,6 +1,6 @@
1
1
  // sonar-syntax-rules.mjs - the ESLint rules that keep a TypeScript app clear of the smells SonarCloud flagged in the example apps, judged on
2
2
  // the syntax tree alone (no type information, no dependency). Both lint canons (@starci/eslint-canon-be and -fe) publish them from their
3
- // bundled runtime copy under the names below, so a product inherits them and `starci app lint` refuses the finding before the scan sees it.
3
+ // bundled runtime copy under the names below, so a product inherits them and `starci app check --gate lint` refuses the finding before the scan sees it.
4
4
  // Each message names the Sonar rule it stands for, and a rule judges the files the example scans judge: a unit or end-to-end spec is outside the
5
5
  // scan (`sonar.exclusions`), so it is outside these rules. The rules that need the type checker (S1874, S6551, S7503) are borrowed from
6
6
  // typescript-eslint by the canon factories; the one that needs a regex ambiguity analysis (S8786) runs in the runtime's own `sonar-rules` check.
@@ -1,5 +1,5 @@
1
1
  // sonar-way.mjs - the Sonar way TypeScript profile (the default quality profile sonar.starci.org and SonarCloud apply) as ESLint rules:
2
- // the one mapping both lint canons (@starci/eslint-canon-be and -fe) publish, so `starci app lint` in the op loop refuses what the scan would
2
+ // the one mapping both lint canons (@starci/eslint-canon-be and -fe) publish, so `starci app check --gate lint` in the op loop refuses what the scan would
3
3
  // raise while the code is written. The base is eslint-plugin-sonarjs's recommended config, SonarSource's own port of Sonar way (each rule's
4
4
  // docs url names its S-id); its rules the canons already publish in another form stay with that owner (SONAR_WAY_OWNED), and the Sonar way
5
5
  // rules SonarSource builds on other ESLint rules are SONAR_WAY_EXTRA. Every rule is `error`; no rule is left to the server because its port