@starci/hfs 4.11.17 → 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 +10 -0
- package/package.json +1 -1
- package/runtime/knowledge/hfs/canon-pins.yaml +6 -6
- package/runtime/knowledge/hfs/slots.yaml +4 -4
- package/runtime/modules/schemas/application-stacks.schema.yaml +9 -1
- package/runtime/scripts/hfs/rules/stacks-release.mjs +44 -8
- package/runtime/scripts/hfs/rules/stacks.mjs +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
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
|
+
|
|
8
|
+
## 4.11.18 - 2026-10-30
|
|
9
|
+
|
|
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.
|
|
11
|
+
- Fixed: `application-stacks.schema.yaml` declares `deploy.remote.serverRecipient` (a public `age1…` recipient), which `app secret server-key <env> --execute` records and the deploy config parser reads, and takes `deploy.secrets.settings` as one `{ member, keys }` or a non-empty list of them, as `stack-deploy-config.mjs` does. Spec: `src/hfs-stacks-deploy-schema.spec.mjs`.
|
|
12
|
+
|
|
3
13
|
## 4.11.17 - 2026-10-30
|
|
4
14
|
|
|
5
15
|
- Fixed: `stemOfEvent` (the event class file name of R151) maps underscores to dashes as well as dots, matching eslint-canon-be's `event-consumer-shape` and the kebab case of `source-suffix`.
|
package/package.json
CHANGED
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
109
|
+
version: 4.11.19
|
|
110
110
|
group: starci
|
|
111
111
|
install: registry
|
|
112
112
|
side: both
|
|
@@ -887,14 +887,14 @@ slots:
|
|
|
887
887
|
tests: none
|
|
888
888
|
requires: [application-stacks.yaml]
|
|
889
889
|
allows: [application-stacks.yaml, "<env>/README.md", "<env>/environment.json", "<env>/infra/{compose,swarm,k8s,terraform}/**", "<env>/infra/metadata.json",
|
|
890
|
-
"<env>/runtime/{config,env}/**", "<env>/runtime/env/KEYS.md", "<env>/secrets/<slug>.enc", "<env>/secrets/.gitkeep", "<env>/seeds/**"]
|
|
890
|
+
"<env>/runtime/{config,env}/**", "<env>/runtime/env/KEYS.md", "<env>/secrets/<slug>.{enc.yaml,enc}", "<env>/secrets/.gitkeep", "<env>/seeds/**"]
|
|
891
891
|
forbids: ["<env>/runtime/files/**", "**/*.enc outside <env>/secrets/", DESIGN.md, deployment.json, "k8s/ at root"]
|
|
892
892
|
# Owner ruling 2026-10-14: lite declares docker-swarm production, app runtime config, sealed custody and seed data.
|
|
893
893
|
# The db service supplies the database; schedules are platform/jobs ticks (R335); production has no Compose or host cron.
|
|
894
894
|
lite:
|
|
895
895
|
requires: [application-stacks.yaml]
|
|
896
896
|
allows: [application-stacks.yaml, images/db/Dockerfile, "<env>/README.md", "<env>/environment.json", "<env>/infra/swarm/**", "<env>/infra/metadata.json",
|
|
897
|
-
"<env>/runtime/{config,env}/**", "<env>/runtime/env/KEYS.md", "<env>/secrets/<slug>.enc", "<env>/secrets/.gitkeep", "<env>/seeds/**"]
|
|
897
|
+
"<env>/runtime/{config,env}/**", "<env>/runtime/env/KEYS.md", "<env>/secrets/<slug>.{enc.yaml,enc}", "<env>/secrets/.gitkeep", "<env>/seeds/**"]
|
|
898
898
|
forbids: ["<env>/runtime/files/**", "**/*.enc outside <env>/secrets/", DESIGN.md, deployment.json, "k8s/ at root"]
|
|
899
899
|
rules: [HFS_STACKS_SHAPE, HFS_STACKS_IN_SIDE, HFS_PLAINTEXT_SECRET, HFS_IDENTITY_CUSTODY]
|
|
900
900
|
- id: app.sops
|
|
@@ -950,7 +950,7 @@ slots:
|
|
|
950
950
|
tracked: external
|
|
951
951
|
tier: none
|
|
952
952
|
tests: none
|
|
953
|
-
goesTo: ".starcistacks/<env>/secrets/<slug>.enc (at the app root); decrypted values only in memory or under %LOCALAPPDATA%/StarCi/secrets/<project>/<env>/ via *_FILE"
|
|
953
|
+
goesTo: ".starcistacks/<env>/secrets/<slug>.enc.yaml (at the app root); decrypted values only in memory or under %LOCALAPPDATA%/StarCi/secrets/<project>/<env>/ via *_FILE"
|
|
954
954
|
rules: [HFS_PLAINTEXT_SECRET]
|
|
955
955
|
|
|
956
956
|
# ----- app root: the database of a lite app (ruling:lite-self-hosted-postgres-passport-minio): a self-hosted PostgreSQL in the app's
|
|
@@ -1248,7 +1248,7 @@ slots:
|
|
|
1248
1248
|
tracked: external
|
|
1249
1249
|
tier: none
|
|
1250
1250
|
tests: none
|
|
1251
|
-
goesTo: ".starcistacks/<env>/secrets/<slug>.enc (at the app root); decrypted values only in memory or under %LOCALAPPDATA%/StarCi/secrets/<project>/<env>/ via *_FILE"
|
|
1251
|
+
goesTo: ".starcistacks/<env>/secrets/<slug>.enc.yaml (at the app root); decrypted values only in memory or under %LOCALAPPDATA%/StarCi/secrets/<project>/<env>/ via *_FILE"
|
|
1252
1252
|
rules: [HFS_PLAINTEXT_SECRET]
|
|
1253
1253
|
- id: be.root-e2e
|
|
1254
1254
|
since: 3.1.0
|
|
@@ -658,6 +658,10 @@ $defs:
|
|
|
658
658
|
ops: {$ref: '#/$defs/deployName'}
|
|
659
659
|
sshKey: {$ref: '#/$defs/deployName'}
|
|
660
660
|
knownHosts: {$ref: '#/$defs/deployName'}
|
|
661
|
+
serverRecipient:
|
|
662
|
+
description: The deploy server's public age recipient, recorded by starci app secret server-key <env> --execute.
|
|
663
|
+
type: string
|
|
664
|
+
pattern: '^age1[a-z0-9]+$'
|
|
661
665
|
deployImage:
|
|
662
666
|
type: object
|
|
663
667
|
additionalProperties: false
|
|
@@ -682,7 +686,11 @@ $defs:
|
|
|
682
686
|
description: Which sealed keys become which Swarm secrets, granted to which services.
|
|
683
687
|
type: array
|
|
684
688
|
items: {$ref: '#/$defs/deployGrant'}
|
|
685
|
-
settings:
|
|
689
|
+
settings:
|
|
690
|
+
description: One sealed member and its keys, or a list of them (one per member); a key is named by one entry only.
|
|
691
|
+
oneOf:
|
|
692
|
+
- {$ref: '#/$defs/deployMemberKeys'}
|
|
693
|
+
- {type: array, minItems: 1, items: {$ref: '#/$defs/deployMemberKeys'}}
|
|
686
694
|
deployGrant:
|
|
687
695
|
type: object
|
|
688
696
|
additionalProperties: false
|
|
@@ -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 =
|
|
276
|
-
if (text
|
|
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(...
|
|
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
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
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 }) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// stacks.mjs - HFS_STACKS_SHAPE (R10): standard stack shape, Sonar owner and deployment runtime consistency.
|
|
2
2
|
// - every tracked path under the app root's `.starcistacks/` is one the app.starcistacks slot allows (its `allows` list is the shape:
|
|
3
3
|
// application-stacks.yaml and <env>/{README.md, environment.json, infra/{compose,swarm,k8s,terraform}, runtime/{config,env},
|
|
4
|
-
// secrets/<slug>.enc, seeds}); a `.enc` outside <env>/secrets/ is never allowed, `runtime/files/`, a root `DESIGN.md`,
|
|
4
|
+
// secrets/<slug>.enc.yaml, seeds}); a `.enc` outside <env>/secrets/ is never allowed, `runtime/files/`, a root `DESIGN.md`,
|
|
5
5
|
// `deployment.json` and `k8s/` are not in the list, so they fall out of it;
|
|
6
6
|
// - the declaration (read by scripts/lib/stack-declaration.mjs, the one reader of it) states a sonar service, a local
|
|
7
7
|
// Sonar is owned by the host (`stack.owner: host`, root `.claude/ext/sonar`).
|
|
@@ -26,8 +26,8 @@ function treeFindings(files, allowed, prefix) {
|
|
|
26
26
|
const findings = [];
|
|
27
27
|
for (const file of files.filter((f) => f.startsWith(prefix))) {
|
|
28
28
|
const rel = file.slice(prefix.length);
|
|
29
|
-
if (/\.enc(?:\.yaml)?$/.test(rel) && !INSIDE_SECRETS.test(rel)) findings.push(shapeFinding(file, `${file} is a sealed secret outside <env>/secrets/<slug>.enc; move it to .starcistacks/<env>/secrets/`));
|
|
30
|
-
else if (!allowed.some((expression) => expression.test(rel))) findings.push(shapeFinding(file, `${file} is not part of the standard .starcistacks shape (application-stacks.yaml, images/db/Dockerfile in lite and <env>/{README.md, environment.json, infra, runtime/{config,env}, secrets/<slug>.enc, seeds}); move or delete it`));
|
|
29
|
+
if (/\.enc(?:\.yaml)?$/.test(rel) && !INSIDE_SECRETS.test(rel)) findings.push(shapeFinding(file, `${file} is a sealed secret outside <env>/secrets/<slug>.enc.yaml; move it to .starcistacks/<env>/secrets/`));
|
|
30
|
+
else if (!allowed.some((expression) => expression.test(rel))) findings.push(shapeFinding(file, `${file} is not part of the standard .starcistacks shape (application-stacks.yaml, images/db/Dockerfile in lite and <env>/{README.md, environment.json, infra, runtime/{config,env}, secrets/<slug>.enc.yaml, seeds}); move or delete it`));
|
|
31
31
|
}
|
|
32
32
|
return findings;
|
|
33
33
|
}
|