@starci/eslint-canon-fe 8.4.2 → 8.4.4
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,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 8.4.4 - 2026-10-18
|
|
4
|
+
- Changed: bundled runtime copies follow runtime 1.0.0-alpha.21 (canon pins, failure codes, the narrowed secret patterns); canon rules are unchanged.
|
|
5
|
+
|
|
6
|
+
## 8.4.3 - 2026-10-18
|
|
7
|
+
- Changed: bundled runtime copies include the refreshed canon pins for the alpha.20 patch set; canon rules are unchanged.
|
|
8
|
+
|
|
3
9
|
## 8.4.2 - 2026-10-17
|
|
4
10
|
|
|
5
11
|
- Changed: bundled runtime copies follow runtime 1.0.0-alpha.20, including the canon pins and shared architecture checks.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@starci/eslint-canon-fe",
|
|
3
|
-
"version": "8.4.
|
|
3
|
+
"version": "8.4.4",
|
|
4
4
|
"description": "The StarCi front-end lint canon: every rule its laws publish, gathered as one flat-config plugin and attached by one factory.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,14 +29,14 @@ pins:
|
|
|
29
29
|
source: packages/grammar/package.json
|
|
30
30
|
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.'
|
|
31
31
|
'@starci/eslint-canon-be':
|
|
32
|
-
version: 3.4.
|
|
32
|
+
version: 3.4.4
|
|
33
33
|
group: starci
|
|
34
34
|
install: registry
|
|
35
35
|
side: be
|
|
36
36
|
source: packages/eslint/be/package.json
|
|
37
37
|
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.'
|
|
38
38
|
'@starci/eslint-canon-fe':
|
|
39
|
-
version: 8.4.
|
|
39
|
+
version: 8.4.4
|
|
40
40
|
group: starci
|
|
41
41
|
install: registry
|
|
42
42
|
side: fe
|
|
@@ -62,7 +62,7 @@ pins:
|
|
|
62
62
|
side: both
|
|
63
63
|
source: packages/prettier-config/package.json
|
|
64
64
|
'@starci/jest-preset':
|
|
65
|
-
version: 2.3.
|
|
65
|
+
version: 2.3.1
|
|
66
66
|
group: starci
|
|
67
67
|
install: registry
|
|
68
68
|
side: be
|
|
@@ -76,14 +76,14 @@ pins:
|
|
|
76
76
|
source: packages/test-world/package.json
|
|
77
77
|
why: 'the shared e2e library of every back end (R47, R48), a devDependency of every back end: the warm stack behind toxiproxy, the network-edge fakes, the Nest boot, the typed useTestWorld handle, useSandbox for contract specs and the outage lock. Kafka is real own infra (the one digest-pinned apache/kafka KRaft image, a broker listener and proxy per slot, slot-prefixed topics, consumer groups and client ids) and Postgres is schema-per-context (a schema and a login role per context in a shared database). Each worker has its own data slot (<ns>_w<k>) with its own databases, Keycloak realm, leased Redis DB, bucket/collection/topic prefixes, fakes host, toxiproxy proxies and outage lock; a run provisions min(jest workers, workers cap, default 2) slots, and state file protocol 2 pairs exactly with @starci/jest-preset (TEST_WORLD_PAIR_MISMATCH otherwise). A modules world boots real peer apps beside its modules, world.apps.<name>.during(fn) is the outage of a peer app, w.keycloak.clientSecret(client) answers the run-generated secret of a confidential realm client, world.keycloak.events/sessions read the realm user events and live sessions, world.infra.postgresql.connection(name) takes one database connection down while the others serve, and world.resolve and scope.resolve take any Nest token. Every path a declaration names (`stack`, seeds, the realm, Dockerfiles) resolves from the app root (the directory of hfs.json); the globalSetup registers the path aliases as TypeScript resolves them. Its CLI main is exported at ./cli for starci app stack.'
|
|
78
78
|
'@starci/cli':
|
|
79
|
-
version: 1.
|
|
79
|
+
version: 1.6.0
|
|
80
80
|
group: starci
|
|
81
81
|
install: registry
|
|
82
82
|
side: both
|
|
83
83
|
source: packages/cli/package.json
|
|
84
84
|
why: 'the only StarCi command package; product repositories install it for starci app, while @starci/hfs remains its pinned transitive implementation.'
|
|
85
85
|
'@starci/hfs':
|
|
86
|
-
version: 4.
|
|
86
|
+
version: 4.6.0
|
|
87
87
|
group: starci
|
|
88
88
|
install: registry
|
|
89
89
|
side: both
|
|
@@ -41,8 +41,8 @@ newCode:
|
|
|
41
41
|
minReviewedPercent: 100
|
|
42
42
|
unreviewedMax: 0
|
|
43
43
|
# The whole code, not only the new code. Every finding of the HFS canon reaches Sonar through ONE entry, `starci app lint`
|
|
44
|
-
# (packages/hfs, contract changes hfs-sonar-import and hfs-lint-entry)
|
|
45
|
-
#
|
|
44
|
+
# (packages/hfs, contract changes hfs-sonar-import and hfs-lint-entry). CI runs it per side with --side and --sonar,
|
|
45
|
+
# then merges rules by id and joins issues into ONE file, reports/lint.sonar.json, named by sonar.externalIssuesReportPaths; the gate holds the open-issue count of
|
|
46
46
|
# the whole project at zero. The file carries three engines:
|
|
47
47
|
# starci-hfs the repository findings of `starci app check` (managed files, tree, pins, CI, contracts; the rule id is the finding code)
|
|
48
48
|
# eslint ESLint's json over the repository (the BE and FE canon plugins alike, per-file and project-graph rules)
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// A finding names the file, the line and the pattern, never the value.
|
|
8
8
|
import fs from 'node:fs';
|
|
9
9
|
import path from 'node:path';
|
|
10
|
-
import { FORBIDDEN_FILES,
|
|
10
|
+
import { FORBIDDEN_FILES, secretHitsInFile } from '../../lib/secret-patterns.mjs';
|
|
11
11
|
import { isSopsEnvelope } from '../../lib/sops-envelope.mjs';
|
|
12
12
|
import { found, readText } from './read.mjs';
|
|
13
13
|
|
|
@@ -34,20 +34,17 @@ export function untrackedSecretFindings({ repoRoot, files, repo }) {
|
|
|
34
34
|
* no sops envelope, or a line that matches a secret pattern. `text` is the file's text, or null when it cannot be read (binary, too
|
|
35
35
|
* large, absent). The whole-tree check reads the work tree and the commit hook (`starci app hygiene`) reads the staged blob: one judgement.
|
|
36
36
|
*/
|
|
37
|
-
export function secretFileFindings({ file, text }) {
|
|
37
|
+
export function secretFileFindings({ file, text, manifestText }) {
|
|
38
38
|
const being = FORBIDDEN_FILES.find((rule) => rule.test(file));
|
|
39
39
|
if (being) return [found(PLAINTEXT_SECRET, file, `${file} is a plaintext secret by being (${being.name}); a secret is committed only as a sops envelope at .starcistacks/<env>/secrets/<slug>.enc`, { pattern: being.name })];
|
|
40
40
|
if (text === null || text === undefined || NOT_SCANNED.test(file)) return [];
|
|
41
41
|
if (file.endsWith('.enc')) return isSopsEnvelope(text) ? [] : [found(PLAINTEXT_SECRET, file, `${file} is named like a sealed secret but is not a sops envelope; encrypt the value with sops and commit only the envelope`, { pattern: 'sops-not-envelope' })];
|
|
42
42
|
const findings = [];
|
|
43
|
-
const lines = text.split(/\r?\n/);
|
|
44
43
|
const seen = new Set();
|
|
45
|
-
for (const
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
findings.push(found(PLAINTEXT_SECRET, file, `${file}:${index + 1} holds a plaintext secret (${pattern}); seal it with sops at .starcistacks/<env>/secrets/<slug>.enc and read it by *_FILE`, { line: index + 1, pattern }));
|
|
50
|
-
}
|
|
44
|
+
for (const { line, pattern } of secretHitsInFile(file, text, { manifestText })) {
|
|
45
|
+
if (seen.has(pattern)) continue;
|
|
46
|
+
seen.add(pattern);
|
|
47
|
+
findings.push(found(PLAINTEXT_SECRET, file, `${file}:${line} holds a plaintext secret (${pattern}); seal it with sops at .starcistacks/<env>/secrets/<slug>.enc and read it by *_FILE`, { line, pattern }));
|
|
51
48
|
}
|
|
52
49
|
return findings;
|
|
53
50
|
}
|
|
@@ -62,7 +59,8 @@ export function secretFindings({ repoRoot, files, resolver }) {
|
|
|
62
59
|
findings.push(found(PLAINTEXT_SECRET, file, `${file} is a plaintext secret file tracked in ${slot.slot}${destination}`, { slot: slot.slot, goesTo: slot.goesTo }));
|
|
63
60
|
continue;
|
|
64
61
|
}
|
|
65
|
-
|
|
62
|
+
const manifestText = /(?:^|\/)README\.md$/.test(file) ? readText(repoRoot, path.posix.join(path.posix.dirname(file), '.starcistacks/application-stacks.yaml')) : undefined;
|
|
63
|
+
findings.push(...secretFileFindings({ file, text: readText(repoRoot, file), manifestText }));
|
|
66
64
|
}
|
|
67
65
|
return findings;
|
|
68
66
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { parseYaml } from '../../engine/yaml.mjs';
|
|
2
|
+
|
|
1
3
|
// secret-patterns.mjs — the one list of secret shapes the runtime refuses to carry: the push secret scan
|
|
2
4
|
// (scripts/supervisor/push-mains.mjs scanDiff) refuses an outgoing range that adds one, and the typed-log
|
|
3
5
|
// redaction (scripts/kernel/typed-logs.mjs redactText) blanks the value before a log row is stored.
|
|
@@ -102,3 +104,78 @@ export function secretHits(file, text) {
|
|
|
102
104
|
}
|
|
103
105
|
return names;
|
|
104
106
|
}
|
|
107
|
+
|
|
108
|
+
const BADGE_BEGIN = '<!-- >>> starci app sync (managed block; do not edit) >>> -->';
|
|
109
|
+
const BADGE_END = '<!-- <<< starci app sync <<< -->';
|
|
110
|
+
|
|
111
|
+
/** Provider-shaped credentials remain refused even where the keyword heuristic admits public badge tokens. */
|
|
112
|
+
function blankBadgeValue(value) {
|
|
113
|
+
return secretHits('badge.mjs', value).length ? value : ' '.repeat(value.length);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/** Only scalar values at the two block-mapping service paths qualify; every other YAML substring remains scanned. */
|
|
117
|
+
function manifestBadgeText(text) {
|
|
118
|
+
try { parseYaml(text); } catch { return text; }
|
|
119
|
+
const parents = [];
|
|
120
|
+
return text.split('\n').map(line => {
|
|
121
|
+
if (/^\s*(?:#.*)?$/.test(line)) return line;
|
|
122
|
+
const indent = /^ */.exec(line)[0].length;
|
|
123
|
+
while (parents.length && parents.at(-1).indent >= indent) parents.pop();
|
|
124
|
+
const match = /^( *)(?:([A-Za-z0-9_-]+)|"([A-Za-z0-9_-]+)"|'([A-Za-z0-9_-]+)'):(.*)$/.exec(line);
|
|
125
|
+
if (!match) { parents.push({ indent, key: null }); return line; }
|
|
126
|
+
match[5] = match[5].trimStart();
|
|
127
|
+
const key = match[2] ?? match[3] ?? match[4];
|
|
128
|
+
const keys = [...parents.map(parent => parent.key), key].join('.');
|
|
129
|
+
const container = /^(?:#.*)?$/.test(match[5].trim());
|
|
130
|
+
const nestedScalar = parents.some(parent => parent.container === false);
|
|
131
|
+
parents.push({ indent, key, container });
|
|
132
|
+
if (nestedScalar) return line;
|
|
133
|
+
if (!['services.codecov.badgeToken', 'services.sonar.badgeToken'].includes(keys)) return line;
|
|
134
|
+
const scalar = /^(?:"([A-Za-z0-9_-]{6,128})"|'([A-Za-z0-9_-]{6,128})'|([A-Za-z0-9_-]{6,128}))(?=\s*(?:#|$))/.exec(match[5]);
|
|
135
|
+
if (!scalar) return line;
|
|
136
|
+
const start = line.length - match[5].length;
|
|
137
|
+
return line.slice(0, start) + blankBadgeValue(scalar[0]) + match[5].slice(scalar[0].length);
|
|
138
|
+
}).join('\n');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Unreadable manifests admit only the default badge hosts; readable Sonar declarations select their own hosts. */
|
|
142
|
+
function badgeHosts(manifestText) {
|
|
143
|
+
const hosts = new Set(['codecov.io']);
|
|
144
|
+
let doc;
|
|
145
|
+
try { doc = parseYaml(manifestText); } catch { hosts.add('sonarcloud.io'); return hosts; }
|
|
146
|
+
const sonar = doc?.services?.sonar;
|
|
147
|
+
if (sonar?.provider === 'sonarcloud') hosts.add('sonarcloud.io');
|
|
148
|
+
else for (const host of [sonar?.host?.public, sonar?.host?.local]) {
|
|
149
|
+
try { hosts.add(new URL(host).host); } catch { /* Invalid hosts admit nothing. */ }
|
|
150
|
+
}
|
|
151
|
+
return hosts;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/** Only token query values in managed Markdown badge images on declared hosts are blanked; links and other parameters remain scanned. */
|
|
155
|
+
function readmeBadgeText(text, manifestText) {
|
|
156
|
+
const begin = text.indexOf(BADGE_BEGIN), end = text.indexOf(BADGE_END, begin + BADGE_BEGIN.length);
|
|
157
|
+
if (begin < 0 || end < 0) return text;
|
|
158
|
+
const hosts = badgeHosts(manifestText);
|
|
159
|
+
const start = begin + BADGE_BEGIN.length;
|
|
160
|
+
const block = text.slice(start, end).replace(/!\[[^\]\n]*\]\((https?:\/\/[^\s)]+)\)/g, (image, address) => {
|
|
161
|
+
let url;
|
|
162
|
+
try { url = new URL(address); } catch { return image; }
|
|
163
|
+
if (!hosts.has(url.host) || url.username || url.password) return image;
|
|
164
|
+
const badgePath = url.host === 'codecov.io' ? /\/graph\/badge\.svg$/.test(url.pathname) : url.pathname === '/api/project_badges/measure';
|
|
165
|
+
if (!badgePath) return image;
|
|
166
|
+
const fragment = address.indexOf('#');
|
|
167
|
+
const queryEnd = fragment < 0 ? address.length : fragment;
|
|
168
|
+
const safe = address.slice(0, queryEnd).replace(/([?&]token=)([^&#)\s]*)/g, (_, prefix, value) => prefix + blankBadgeValue(value));
|
|
169
|
+
return image.replace(address, () => safe + address.slice(queryEnd));
|
|
170
|
+
});
|
|
171
|
+
return text.slice(0, start) + block + text.slice(end);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/** Whole-file secret judgement exempts only declared public badge values and preserves original line numbers and every provider shape. */
|
|
175
|
+
export function secretHitsInFile(file, fullText, { manifestText } = {}) {
|
|
176
|
+
const normalized = file.replace(/\\/g, '/');
|
|
177
|
+
let text = fullText;
|
|
178
|
+
if (/(?:^|\/)\.starcistacks\/application-stacks\.yaml$/.test(normalized)) text = manifestBadgeText(text);
|
|
179
|
+
if (/(?:^|\/)README\.md$/.test(normalized)) text = readmeBadgeText(text, manifestText);
|
|
180
|
+
return text.split(/\r?\n/).flatMap((line, index) => secretHits(file, line).map(pattern => ({ line: index + 1, pattern })));
|
|
181
|
+
}
|