@starci/hfs 4.11.18 → 4.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,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 4.11.19 - 2026-10-30
4
+
5
+ - Fixed: `HFS_SCHEDULE_UNDECLARED` (R268) reads an application SQL template whose `${}` sits where Postgres wants an identifier (`LISTEN ${channel}`, `SET x = ${n}`): the template is read with each `${}` as NULL, and when that does not parse, again with each as an identifier (`stacks-release.mjs` `templateObservations`). Such a statement was taken for an undeclared pg_cron job. A bare interpolated function name (`FROM ${fn}(...)`) still fails closed, since it may be `cron.schedule`; the skeleton's `callDbFunction` quotes `"${schema}"."${name}"` and parses as it is.
6
+ - Fixed: SQL named in a same-file `const` before its `query`/`execute` call is judged as if inline (`sqlConstants`); moving the text out of the call no longer hid it from the scanner. Specs: `src/hfs-stacks-release.spec.mjs`.
7
+
3
8
  ## 4.11.18 - 2026-10-30
4
9
 
5
10
  - Fixed: `HFS_STACKS_SHAPE` (R10) accepts the sealed member `app secret set` writes, `<env>/secrets/<slug>.enc.yaml` (ruling app-secrets-one-standard, `scripts/lib/sealed-member.mjs`), beside the legacy `<slug>.enc`. The `.starcistacks` slot (`knowledge/hfs/slots.yaml`, both editions) allowed only `<slug>.enc`, so every standard member was refused; the messages and `goesTo` name `.enc.yaml`. Spec: `src/hfs-stacks-shape.spec.mjs` holds one of each.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/hfs",
3
- "version": "4.11.18",
3
+ "version": "4.11.19",
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.30
34
+ version: 0.15.31
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.17
41
+ version: 3.8.18
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.19
48
+ version: 9.5.20
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.30
55
+ version: 0.15.31
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.30
62
+ version: 0.15.31
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.18
109
+ version: 4.11.19
110
110
  group: starci
111
111
  install: registry
112
112
  side: both
@@ -269,25 +269,61 @@ function sqlObservations(text, file) {
269
269
 
270
270
  function sourceSqlObservations(source, file) {
271
271
  const observations = [];
272
+ const constants = sqlConstants(source);
272
273
  const visit = node => {
273
274
  if (ts.isCallExpression(node) && /(?:^|\.)(?:query|execute)$/.test(node.expression.getText())) {
274
275
  const argument = unwrap(node.arguments[0]);
275
- const text = sqlTemplateText(argument);
276
- if (text !== null) observations.push(...sqlObservations(text, file));
276
+ const text = argument && ts.isIdentifier(argument) ? constants.get(argument.text) : argument;
277
+ if (text) observations.push(...templateObservations(text, file));
277
278
  }
278
279
  if (ts.isTaggedTemplateExpression(node) && /(?:^|\.)sql$/.test(node.tag.getText()))
279
- observations.push(...sqlObservations(sqlTemplateText(node.template), file));
280
+ observations.push(...templateObservations(node.template, file));
280
281
  ts.forEachChild(node, visit);
281
282
  };
282
283
  visit(source);
283
284
  return observations;
284
285
  }
285
286
 
286
- function sqlTemplateText(node) {
287
- if (!node) return null;
288
- if (ts.isStringLiteralLike(node)) return node.text;
289
- if (!ts.isTemplateExpression(node)) return null;
290
- return node.head.text + node.templateSpans.map(span => `NULL${span.literal.text}`).join('');
287
+ /** The file's `const NAME = <string or template>` statements, so SQL named before its query call is judged as if inline. */
288
+ function sqlConstants(source) {
289
+ const constants = new Map();
290
+ const visit = node => {
291
+ if (ts.isVariableDeclarationList(node) && (node.flags & ts.NodeFlags.Const)) {
292
+ for (const declaration of node.declarations) {
293
+ const value = unwrap(declaration.initializer);
294
+ if (ts.isIdentifier(declaration.name) && value && (ts.isStringLiteralLike(value) || ts.isTemplateExpression(value)))
295
+ constants.set(declaration.name.text, value);
296
+ }
297
+ }
298
+ ts.forEachChild(node, visit);
299
+ };
300
+ visit(source);
301
+ return constants;
302
+ }
303
+
304
+ const DYNAMIC = 'starci_dynamic_sql';
305
+
306
+ /**
307
+ * The observations of an application SQL text. A template is read with each `${}` as NULL; when that does not parse (an
308
+ * interpolated identifier: `LISTEN ${channel}`, `SET x = ${n}`, `FROM ${fn}(...)`), it is read again with each `${}` as an
309
+ * identifier. A function whose name is interpolated bare may be pg_cron, so it stays an unknown observation; the skeleton's
310
+ * `callDbFunction` quotes `"${schema}"."${name}"`, which parses as it is.
311
+ */
312
+ function templateObservations(node, file) {
313
+ if (ts.isStringLiteralLike(node)) return sqlObservations(node.text, file);
314
+ if (!ts.isTemplateExpression(node)) return [];
315
+ const spell = placeholder => node.head.text + node.templateSpans.map(span => `${placeholder}${span.literal.text}`).join('');
316
+ const nulls = spell('NULL');
317
+ if (parseSql(nulls)) return sqlObservations(nulls, file);
318
+ const named = spell(DYNAMIC);
319
+ const tree = parseSql(named);
320
+ if (!tree) return [{ id: null, cadence: null, at: file }];
321
+ let dynamicCall = false;
322
+ walkSql(tree, value => {
323
+ if (value.FuncCall && (value.FuncCall.funcname ?? []).some(part => part.String?.sval === DYNAMIC)) dynamicCall = true;
324
+ });
325
+ if (dynamicCall) return [{ id: null, cadence: null, at: file }];
326
+ return sqlObservations(named, file);
291
327
  }
292
328
 
293
329
  function recurringObservations({ doc, repoRoot, files, file, issues }) {