@starci/hfs 4.11.21 → 4.11.22

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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.11.22 - 2026-10-30
4
+
5
+ - Changed: `starci app check` and `starci app lint` are green while fewer than 20 error findings remain and none is a hard blocker (owner ruling gate-threshold-20, contexts/harness/decisions.md; `runtime/scripts/hfs/gate-threshold.mjs` `gateVerdict`): a plaintext secret (HFS_PLAINTEXT_SECRET and its family), the boot proof (BE_APP_BOOT_PROOF_MISSING) or a migration finding (DB_MIGRATION_SHAPE, DB_MIGRATION_DESTRUCTIVE, LITE_DB_MIGRATION, BE_MIGRATION_REVERSIBLE) blocks at any count. Every finding is still printed and kept in the report (`gate` carries the verdict); typecheck, build and the tests are not judged by it. Specs: `src/gate-threshold.spec.mjs`; `src/check-eslint.spec.mjs` now expects green for one or two ordinary findings.
6
+ - Changed: the bundled canon pins name eslint-canon-be 3.8.21, eslint-canon-fe 9.5.23 and the Grammar family 0.15.34.
7
+
3
8
  ## 4.11.21 - 2026-10-30
4
9
 
5
10
  - Changed: an urgent release runs typecheck and the build only (owner ruling urgent-typecheck-build, contexts/harness/decisions.md): `URGENT_CHECKS` are the release gates `typecheck`, `build`, `build-be` and `build-fe` the app declares (`release/urgent.mjs`); app check, lint and the tests wait for the back-fill. `--lint-baseline` is retired with lint itself and refused (`RELEASE_URGENT_LINT_BASELINE_RETIRED`); `release/lint-baseline.mjs` is gone.
package/lint/run.mjs CHANGED
@@ -27,6 +27,7 @@ import { STYLE_GLOB } from '../sync/index.mjs';
27
27
  import { byCodeUnit } from '../report/order.mjs';
28
28
  import { braceVariants, globExpression } from '../runtime/scripts/lib/glob.mjs';
29
29
  import { grammarLintFor } from '../runtime/scripts/lib/grammar-lint.mjs';
30
+ import { gateVerdict } from '../runtime/scripts/hfs/gate-threshold.mjs';
30
31
 
31
32
  // --side judges only that side; root HFS findings belong to be, its Sonar report stays on that side.
32
33
  export const LINT_SCHEMA = 'starci/lint@1';
@@ -436,8 +437,10 @@ export async function lintRepository({ repoRoot, opts, hfsCheck, trackedFiles =
436
437
  linterReport('eslint', raw.eslint, { root: repoRoot, sourceRoots, tracked }),
437
438
  linterReport('stylelint', raw.stylelint, { root: repoRoot, sourceRoots, tracked }),
438
439
  ]);
439
- const report = { schema: LINT_SCHEMA, ok: findings.length === 0 && errors.length === 0, repoRoot, changed: changed ? [...changed].sort(byCodeUnit) : null, workspace, ...(opts.side === undefined ? {} : { side: opts.side }), counts: { error: findings.length }, engines, errors, findings };
440
- return { report, sonar, exit: errors.length ? 2 : findings.length ? 1 : 0 };
440
+ // Green under the threshold (gate-threshold.mjs): every finding is still reported, only the verdict changes.
441
+ const gate = gateVerdict(findings);
442
+ const report = { schema: LINT_SCHEMA, ok: gate.pass && errors.length === 0, repoRoot, changed: changed ? [...changed].sort(byCodeUnit) : null, workspace, ...(opts.side === undefined ? {} : { side: opts.side }), counts: { error: findings.length }, engines, errors, findings, gate };
443
+ return { report, sonar, exit: errors.length ? 2 : gate.pass ? 0 : 1 };
441
444
  }
442
445
 
443
446
  export function printLintText(report, out) {
@@ -445,4 +448,5 @@ export function printLintText(report, out) {
445
448
  for (const e of report.errors) out(`ERROR ${e}\n`);
446
449
  const per = Object.keys(report.engines).map((engine) => `${engine} ${report.findings.filter((f) => f.engine === engine).length}`).join(', ');
447
450
  out(`\nstarci app lint: ${report.counts.error} finding${report.counts.error === 1 ? '' : 's'} (${per})${report.errors.length ? `, ${report.errors.length} tool error${report.errors.length === 1 ? '' : 's'}` : ''}\n`);
451
+ if (report.gate?.line) out(`${report.gate.line}\n`);
448
452
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/hfs",
3
- "version": "4.11.21",
3
+ "version": "4.11.22",
4
4
  "description": "The StarCi app command implementation for scaffolding, linting, checking and synchronizing one product repository.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -31,35 +31,35 @@ 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.15.33
34
+ version: 0.15.34
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.8.20
41
+ version: 3.8.21
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.5.22
48
+ version: 9.5.23
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.15.33
55
+ version: 0.15.34
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.15.33
62
+ version: 0.15.34
63
63
  group: starci
64
64
  install: registry
65
65
  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: 4.11.21
109
+ version: 4.11.22
110
110
  group: starci
111
111
  install: registry
112
112
  side: both
@@ -0,0 +1,36 @@
1
+ // gate-threshold.mjs - the verdict of `starci app check` and `starci app lint` (owner ruling gate-threshold-20, 2026-10-30): green
2
+ // while fewer than GATE_ERROR_LIMIT error findings remain and none of them is a hard blocker, so a release is not held back finding
3
+ // by finding (5, 4, 3, ...) by the last few structural nits. A plaintext secret, a failed boot proof and a broken migration block at
4
+ // any count. Every finding is still printed; only the exit code changes. Typecheck, build and the tests are not judged here.
5
+
6
+ export const GATE_ERROR_LIMIT = 20;
7
+
8
+ /** The limit in force: policy/quality.yaml `gate.errorLimit`, handed in by the harness CLI as STARCI_GATE_ERROR_LIMIT, else 20. */
9
+ export function gateErrorLimit(env = process.env) {
10
+ const value = Number(env.STARCI_GATE_ERROR_LIMIT);
11
+ return Number.isInteger(value) && value > 0 ? value : GATE_ERROR_LIMIT;
12
+ }
13
+ export const GATE_THRESHOLD_RULING = 'owner ruling gate-threshold-20 2026-10-30: app check and lint pass under 20 error findings with no plaintext secret, boot proof or migration finding';
14
+
15
+ /** The codes that block at any count: plaintext secrets, the boot proof, the migrations. */
16
+ export const HARD_BLOCKERS = Object.freeze(new Set([
17
+ 'HFS_PLAINTEXT_SECRET', 'HFS_SECRET_PLAINTEXT_FILE', 'HFS_SECRET_OUTSIDE_ENC', 'HFS_SCRIPT_PLAINTEXT_LOAD', 'RT_SECRET_TRACKED',
18
+ 'STACKS_SECRET_ENV_LITERAL', 'APP_SECRET_IN_CI', 'BE_LOG_SECRET',
19
+ 'BE_APP_BOOT_PROOF_MISSING',
20
+ 'DB_MIGRATION_SHAPE', 'DB_MIGRATION_DESTRUCTIVE', 'LITE_DB_MIGRATION', 'BE_MIGRATION_REVERSIBLE',
21
+ ]));
22
+
23
+ /**
24
+ * The verdict over the error findings (each with `code`): { pass, count, hard, line }. `pass` is true when no hard blocker is
25
+ * among them and there are fewer than GATE_ERROR_LIMIT; `line` says which, for the report.
26
+ */
27
+ export function gateVerdict(errors, limit = gateErrorLimit()) {
28
+ const hard = [...new Set(errors.map((finding) => finding.code).filter((code) => HARD_BLOCKERS.has(code)))].sort();
29
+ const count = errors.length;
30
+ const pass = hard.length === 0 && count < limit;
31
+ const line = count === 0 ? null
32
+ : hard.length > 0 ? `gate: red, ${hard.join(', ')} block${hard.length === 1 ? 's' : ''} at any count (${count} error finding(s))`
33
+ : pass ? `gate: green under the threshold, ${count} error finding(s) < ${limit} and no hard blocker (owner ruling gate-threshold-20); they stay listed above`
34
+ : `gate: red, ${count} error finding(s), the threshold is fewer than ${limit}`;
35
+ return { pass, count, hard, line };
36
+ }
package/src/main.mjs CHANGED
@@ -73,6 +73,7 @@ import { dbBaselineMain } from '../runtime/scripts/hfs/db-baseline-verb.mjs';
73
73
  import { dbRestampMain } from '../runtime/scripts/hfs/db-restamp-verb.mjs';
74
74
  import { dbPlanMain } from '../runtime/scripts/hfs/db-plan-verb.mjs';
75
75
  import { formatCoverageReport } from '../runtime/scripts/hfs/coverage-from.mjs';
76
+ import { gateVerdict } from '../runtime/scripts/hfs/gate-threshold.mjs';
76
77
  import { HFS_DECLARATION_FILE, HfsSlotsError, loadSlotManifest, readRepoDeclaration } from '../runtime/scripts/hfs/slots.mjs';
77
78
  import { formatFindings } from '../sync/format.mjs';
78
79
  import { main as syncMain } from '../sync/cli.mjs';
@@ -363,9 +364,11 @@ async function checkMain(opts, { cwd: repoRoot, harness, edition, stdout: out, p
363
364
  const existing = changed ? changed.filter(file => fs.existsSync(path.join(repoRoot, file))) : [];
364
365
  const eslint = await eslintRepository({ repoRoot, changed, existing, run: runLinter });
365
366
  const findings = [...proof.findings, ...eslint.findings.map(finding => ({ ...finding, code: finding.code ?? finding.rule, level: 'error' }))];
366
- const result = { ...proof, findings, counts: { ...proof.counts, error: proof.counts.error + eslint.findings.length }, eslint: { ...eslint.engine, errors: eslint.errors }, ok: proof.ok && eslint.findings.length === 0 && eslint.errors.length === 0 };
367
+ // Green under the threshold (gate-threshold.mjs): every finding is still listed, only the verdict changes.
368
+ const verdict = gateVerdict(findings.filter(finding => finding.level === 'error'));
369
+ const result = { ...proof, findings, counts: { ...proof.counts, error: proof.counts.error + eslint.findings.length }, eslint: { ...eslint.engine, errors: eslint.errors }, ok: verdict.pass && eslint.errors.length === 0, gate: verdict };
367
370
  if (opts.json) out(`${JSON.stringify(result, null, 2)}\n`);
368
- else { printCheck(result, out); printCheckProofs(result, out); }
371
+ else { printCheck(result, out); printCheckProofs(result, out); if (verdict.line) out(`${verdict.line}\n`); }
369
372
  return eslint.errors.length ? 2 : result.ok ? 0 : 1;
370
373
  }
371
374