@starci/hfs 4.7.16 → 4.7.18

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
+ ## 4.7.18 - 2026-10-21
4
+ - Changed: supersedes 4.7.17, published from a lane whose history the owner refused (an unapproved allowlist entry) and therefore a superseded orphan that is not used; this version carries the same work plus the standalone scaffold fix.
5
+ - Fixed: the managed CI's coverage job runs `starci app coverage verify <lcov>`, the coverage judgement alone over the merged report, instead of `npm run codegen && starci app check --coverage-from` (the whole app check the fast and lint jobs already ran); its default timeout is 15 minutes (`knowledge/hfs/ci-standard.yaml`). NIVO v0.3.0's coverage job took 18m43s of 20 and the tag run was cancelled.
6
+ - Fixed: the sonar row of `starci app release gate --sonar` no longer passes on the scanner's exit code alone: it reads `.scannerwork/report-task.txt`, polls `api/ce/task` until the analysis ends and reads `api/qualitygates/project_status` with the same token; ERROR is red as `RELEASE_SONAR_GATE_FAILED` naming each failed condition, a 600-second wait is `RELEASE_SONAR_GATE_TIMEOUT` and an unreadable answer `RELEASE_SONAR_GATE_UNREADABLE`; canon pins follow the matching package cohort.
7
+
8
+ - Fixed: `npx @starci/cli app scaffold` works from the published packages alone: the Sonar exclusions come from the jest preset copy @starci/hfs ships (`runtime/packages/jest-preset/sonar-exclusions.cjs`, `bundledPresets`), not from a @starci/jest-preset installed beside the CLI (it was `HFS_SYNC_PRESET_MISSING`); `starci app upgrade` reads the same copy instead of a hand-kept list.
9
+ - Fixed: a new scaffold path is git-initialised with an unborn main before any file is written (`HFS_SCAFFOLD_GIT_INIT_FAILED` when git cannot), as the verb promised, so `starci npm ci` can install the hooks; an existing empty unborn main repository is still accepted.
10
+
11
+ - Fixed: `BE_UNIT_SPEC_NOT_STAGED` exempts a measured file with nothing to execute (constants and types only), which has nothing a spec could call and whose spec the spec rules refuse; every measured file with a function, method, constructor or accessor still needs its spec staged beside it. It refused the scaffold's own first commit on the constant-only `http-status.policy.ts`; the scaffold now also ships `migrate-connections.client.spec.ts`.
12
+
3
13
  ## 4.7.16 - 2026-10-21
4
14
  - Fixed: `DB_MIGRATION_DESTRUCTIVE` counts a be/src source as a reference of a dropped or altered column only when the source names the column's table too, so a same-named column of another table (`public.brain_lessons.origin` beside a drop of `transactions.origin`) no longer blocks a contract migration; table and other object drops keep the leaf match; canon pins follow the matching package cohort.
5
15
 
package/coverage/cli.mjs CHANGED
@@ -3,14 +3,18 @@
3
3
  // coverage proof, the Codecov upload and the Sonar import read. The merge is the app's installed @starci/jest-preset (`@starci/jest-preset/merge`):
4
4
  // istanbul-lib-coverage merges the shard maps by source location, and the preset's own lcov reporter writes the result exactly as an unsharded run
5
5
  // would. A path is a coverage-final.json or a directory searched for every one below it; no report found refuses (exit 2), never an empty report.
6
+ // `starci app coverage verify <lcov>`: the coverage proof alone (scripts/hfs/coverage-from.mjs, the judgement `starci app check --coverage-from`
7
+ // adds to the whole check): every measured logic file is in the merged lcov at 100 per file. The managed CI's coverage job runs it after the merge,
8
+ // so the job re-runs none of the rules the fast and lint jobs already judged. Exit 0 proved, 1 refused (the report lists every finding), 2 bad usage.
6
9
  import path from 'node:path';
7
10
  import { createRequire } from 'node:module';
11
+ import { coverageFrom, formatCoverageReport } from '../runtime/scripts/hfs/coverage-from.mjs';
8
12
 
9
- const USAGE = 'usage: starci app coverage merge --out <lcov> <coverage-final.json-or-dir>... [--cwd <dir>]';
13
+ const USAGE = 'usage: starci app coverage merge --out <lcov> <coverage-final.json-or-dir>... [--cwd <dir>] | starci app coverage verify <lcov> [--cwd <dir>]';
10
14
 
11
15
  function parse(argv) {
12
16
  const [action, ...rest] = argv;
13
- if (action !== 'merge') throw new Error(USAGE);
17
+ if (action !== 'merge' && action !== 'verify') throw new Error(USAGE);
14
18
  const opts = { inputs: [] };
15
19
  for (let index = 0; index < rest.length; index += 1) {
16
20
  const arg = rest[index];
@@ -22,6 +26,11 @@ function parse(argv) {
22
26
  } else if (arg.startsWith('--')) throw new Error(`unknown flag ${arg}; ${USAGE}`);
23
27
  else opts.inputs.push(arg);
24
28
  }
29
+ opts.action = action;
30
+ if (action === 'verify') {
31
+ if (opts.out !== undefined || opts.inputs.length !== 1) throw new Error(USAGE);
32
+ return opts;
33
+ }
25
34
  if (!opts.out || !opts.inputs.length) throw new Error(USAGE);
26
35
  if (path.basename(opts.out) !== 'lcov.info') throw new Error(`--out names the lcov.info the coverage proof reads; ${USAGE}`);
27
36
  return opts;
@@ -34,11 +43,27 @@ function installedMerge(cwd) {
34
43
  }
35
44
  }
36
45
 
37
- /** Exit 0 merged, 2 bad usage, no preset or no report found. `merge` replaces the installed preset merge in a spec. */
38
- export async function coverageMain(argv, { cwd: baseCwd = process.cwd(), stdout = (s) => process.stdout.write(s), stderr = (s) => process.stderr.write(s), merge } = {}) {
46
+ /** The coverage proof of the app at `cwd` over the lcov `report`: exit 0 proved, 1 refused, 2 when the proof cannot run. */
47
+ function verifyCoverage(cwd, report, { stdout, stderr, prove }) {
48
+ try {
49
+ const result = prove({ repoRoot: cwd, coverageFrom: report });
50
+ stdout(formatCoverageReport(result));
51
+ return result.ok ? 0 : 1;
52
+ } catch (error) {
53
+ stderr(`starci app coverage verify: ${String(error?.message ?? error).split('\n')[0]}\n`);
54
+ return 2;
55
+ }
56
+ }
57
+
58
+ /**
59
+ * Exit 0 merged or proved, 1 a refused proof, 2 bad usage, no preset or no report found. `merge` replaces the installed preset merge and
60
+ * `prove` the coverage proof in a spec.
61
+ */
62
+ export async function coverageMain(argv, { cwd: baseCwd = process.cwd(), stdout = (s) => process.stdout.write(s), stderr = (s) => process.stderr.write(s), merge, prove = coverageFrom } = {}) {
39
63
  let opts;
40
64
  try { opts = parse(argv); } catch (error) { stderr(`starci app coverage: ${error.message}\n`); return 2; }
41
65
  const cwd = path.resolve(baseCwd, opts.cwd ?? '.');
66
+ if (opts.action === 'verify') return verifyCoverage(cwd, opts.inputs[0], { stdout, stderr, prove });
42
67
  try {
43
68
  const run = merge ?? installedMerge(cwd);
44
69
  const outDir = path.dirname(path.resolve(cwd, opts.out));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/hfs",
3
- "version": "4.7.16",
3
+ "version": "4.7.18",
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",