@starci/eslint-canon-fe 9.5.12 → 9.5.14

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,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 9.5.14 - 2026-10-29
4
+
5
+ - Changed: the bundled `runtime/scripts/lib/sops-envelope.mjs` admits an age set of one or more recipients for the selected-identity decrypt (`selectedAgeEnvelope`): the selected recipient must be one of the set, an empty entry or gap (`invalid-age-entry`) and a recipient named twice (`duplicate-age-recipient`) are refused, a dotenv envelope reads every `sops_age__list_<n>__` entry; the bundled canon pins name hfs 4.11.13, eslint-canon-be 3.8.12, eslint-canon-fe 9.5.14 and the Grammar family 0.15.25. No rule changed.
6
+
7
+ ## 9.5.13 - 2026-10-29
8
+
9
+ - Changed: the bundled canon pins name hfs 4.11.12, eslint-canon-be 3.8.11, eslint-canon-fe 9.5.13 and the Grammar family 0.15.24; the bundled slot judgement (`runtime/scripts/hfs/path-findings.mjs`) admits the one file a file slot names by its path, as eslint-canon-be does.
10
+
3
11
  ## 9.5.12 - 2026-10-29
4
12
 
5
13
  - Changed: the bundled canon pins name hfs 4.11.11, eslint-canon-be 3.8.10, eslint-canon-fe 9.5.12 and the Grammar family 0.15.23. No rule changed.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@starci/eslint-canon-fe",
3
- "version": "9.5.12",
3
+ "version": "9.5.14",
4
4
  "description": "Universal front-end lint laws for TypeScript and Next.js, independent of the selected Grammar family.",
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.23
34
+ version: 0.15.25
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.10
41
+ version: 3.8.12
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.12
48
+ version: 9.5.14
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.23
55
+ version: 0.15.25
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.23
62
+ version: 0.15.25
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.11
109
+ version: 4.11.13
110
110
  group: starci
111
111
  install: registry
112
112
  side: both
@@ -29,6 +29,8 @@ function sourceFormContext(file, resolver, suffixes, bannedSuffixes) {
29
29
  const base = path.posix.basename(file);
30
30
  if (FREE_NAMES.has(base)) return null;
31
31
  const slot = resolver.slot(c.slot);
32
+ // A file slot declares its one file by its path (be.platform.database.entities: src/modules/platform/database/entities.ts).
33
+ if (slot?.path === c.path) return null;
32
34
  if ([...(slot?.requires ?? []), ...(slot?.allows ?? [])].includes(base)) return null;
33
35
  const admitted = allowsFile(resolver, file);
34
36
  // Environment parsing is an app slot role, not a source suffix admitted outside that matching app file.
@@ -57,8 +59,8 @@ function sourceFormFinding(file, { c, base, suffixes, bannedSuffixes }, boundSuf
57
59
  }
58
60
 
59
61
  /**
60
- * BE_SOURCE_FORM (R89): every tracked src/ or apps/ TypeScript file of a back end is index.ts, main.ts, a migration of
61
- * be.persistence, the matching <app>.env.ts explicitly admitted by its app slot, or <kebab-name>.<suffix>.ts with <suffix> in the closed vocabulary ruleParams.be.suffixes (a name such
62
+ * BE_SOURCE_FORM (R89): every tracked src/ or apps/ TypeScript file of a back end is index.ts, main.ts, the one file a file
63
+ * slot names by its path (the lite entity registry src/modules/platform/database/entities.ts), a migration of be.persistence, the matching <app>.env.ts explicitly admitted by its app slot, or <kebab-name>.<suffix>.ts with <suffix> in the closed vocabulary ruleParams.be.suffixes (a name such
62
64
  * as order.service.spec.ts keeps its inner words kebab-case). A suffix of ruleParams.be.bannedSuffixes anywhere in the
63
65
  * name is refused by name. Paths no slot owns are HFS_SLOT_UNDECLARED's, not this code's.
64
66
  */
@@ -62,13 +62,17 @@ export function isSopsEnvelope(text) {
62
62
  try { return sopsTree(parseYaml(src)); } catch { return false; }
63
63
  }
64
64
 
65
- /** Admit one flat age envelope for the native selected-identity invocation; this is shape admission, never cryptographic proof. */
65
+ /** A refused admission, named by its reason. */
66
66
  const refusal = (reason) => ({ ok: false, reason });
67
67
 
68
+ const DOTENV_AGE_FIELD = /^age__list_(0|[1-9]\d{0,2})__map_(recipient|enc)$/u;
69
+
68
70
  function dotenvMetadataValue(meta, age, key, value) {
69
- if (key === 'age__list_0__map_recipient') age.recipient = value;
70
- else if (key === 'age__list_0__map_enc') age.enc = value;
71
- else if (key === 'mac_only_encrypted') {
71
+ const field = DOTENV_AGE_FIELD.exec(key);
72
+ if (field) {
73
+ const entry = (age[Number(field[1])] ??= {});
74
+ entry[field[2]] = value;
75
+ } else if (key === 'mac_only_encrypted') {
72
76
  if (value !== 'false') return 'partial-mac';
73
77
  meta[key] = false;
74
78
  } else if (key.includes('__')) return 'unsupported-key-group';
@@ -88,13 +92,14 @@ function readDotenvMetadata(text) {
88
92
  pairs.set(name, line.slice(at + 1).replaceAll(String.raw`\n`, '\n'));
89
93
  }
90
94
  const meta = {};
91
- const age = {};
95
+ const age = [];
92
96
  for (const [name, value] of pairs) {
93
97
  if (!name.startsWith('sops_')) continue;
94
98
  const reason = dotenvMetadataValue(meta, age, name.slice('sops_'.length), value);
95
99
  if (reason) return { refusal: reason };
96
100
  }
97
- meta.age = [age];
101
+ // A gap in the list indices is an entry sops never wrote: refused as an empty entry, never skipped.
102
+ meta.age = Array.from(age, (entry) => entry ?? null);
98
103
  return { meta };
99
104
  }
100
105
 
@@ -142,15 +147,35 @@ function validateAgeMetadata(meta, text, recipient) {
142
147
  const fields = new Set([...providers, 'age', 'lastmodified', 'mac', 'version', 'unencrypted_suffix', 'encrypted_suffix', 'unencrypted_regex', 'encrypted_regex', 'unencrypted_comment_regex', 'encrypted_comment_regex', 'mac_only_encrypted']);
143
148
  if (Object.keys(meta).some(name => !fields.has(name))) return refusal('unknown-metadata');
144
149
  if (Object.hasOwn(meta, 'mac_only_encrypted') && meta.mac_only_encrypted !== false) return refusal('partial-mac');
145
- if (!Array.isArray(meta.age) || meta.age.length !== 1) return refusal('unsupported-age-set');
146
- const entry = meta.age[0];
147
- if (!isAgeEntry(entry)) return refusal('invalid-age-entry');
148
- if (typeof entry.recipient !== 'string' || entry.recipient !== recipient) return refusal('recipient-mismatch');
149
- if (!hasValidAgePayload(entry)) return refusal('invalid-age-entry');
150
+ const set = ageSet(meta.age);
151
+ if (!set.ok) return set;
152
+ if (!set.recipients.includes(recipient)) return refusal('recipient-mismatch');
150
153
  if (!hasValidEnvelopeVersion(meta)) return refusal('invalid-envelope');
151
154
  return { ok: true };
152
155
  }
153
156
 
157
+ const AGE_RECIPIENT = /^age1[ac-hj-np-z02-9]+$/u;
158
+
159
+ /**
160
+ * The age set of an envelope: one or more entries (the owner key and an environment's server key are the standard pair), each a
161
+ * well-formed recipient with its wrapped data key; an empty entry or a recipient named twice is refused.
162
+ */
163
+ function ageSet(entries) {
164
+ if (!Array.isArray(entries) || entries.length === 0) return refusal('unsupported-age-set');
165
+ const recipients = [];
166
+ for (const entry of entries) {
167
+ if (!isAgeEntry(entry) || typeof entry.recipient !== 'string' || !AGE_RECIPIENT.test(entry.recipient) || !hasValidAgePayload(entry))
168
+ return refusal('invalid-age-entry');
169
+ if (recipients.includes(entry.recipient)) return refusal('duplicate-age-recipient');
170
+ recipients.push(entry.recipient);
171
+ }
172
+ return { ok: true, recipients };
173
+ }
174
+
175
+ /**
176
+ * Admit one flat age envelope for the native selected-identity invocation when `recipient` (the selected identity's public key) is
177
+ * one of its age set. Shape admission, never cryptographic proof.
178
+ */
154
179
  export function selectedAgeEnvelope(text, format, recipient) {
155
180
  if (!['binary', 'json', 'yaml', 'dotenv'].includes(format)) return refusal('unsupported-format');
156
181
  const parsed = readAgeMetadata(text, format);