@starci/hfs 4.4.0 → 4.4.1
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 +3 -0
- package/README.md +1 -1
- package/db/migrate.mjs +4 -4
- package/db/post-cutover.mjs +4 -4
- package/emit/contracts.mjs +2 -2
- package/emit/db-types.mjs +2 -2
- package/lint/run.mjs +2 -2
- package/package.json +1 -1
- package/release/gate.mjs +4 -4
- package/release/index.mjs +2 -2
- package/release/push.mjs +1 -1
- package/report/sonar.mjs +1 -1
- package/runtime/config.example.yaml +7 -6
- package/runtime/engine/config.mjs +10 -18
- package/runtime/engine/removed-vocabulary.mjs +0 -2
- package/runtime/knowledge/hfs/canon-pins.yaml +4 -4
- package/runtime/knowledge/hfs/rules.yaml +410 -967
- package/runtime/knowledge/hfs/slots.yaml +13 -24
- package/runtime/modules/kernel/failure-codes.yaml +0 -22
- package/runtime/modules/kernel/removed-vocabulary.yaml +30 -0
- package/runtime/modules/models/runtimes.yaml +4 -6
- package/runtime/packages/cli/src/catalog.generated.mjs +46 -381
- package/runtime/scripts/api/git/lib.mjs +3 -3
- package/runtime/scripts/api/sops/lib.mjs +1 -1
- package/runtime/scripts/hfs/app-wiring.mjs +2 -2
- package/runtime/scripts/hfs/architecture/config.mjs +1 -1
- package/runtime/scripts/hfs/architecture/index.mjs +1 -1
- package/runtime/scripts/hfs/architecture/supabase.mjs +1 -1
- package/runtime/scripts/hfs/architecture/tiers.mjs +1 -1
- package/runtime/scripts/hfs/architecture.mjs +1 -1
- package/runtime/scripts/hfs/coverage-from.mjs +1 -1
- package/runtime/scripts/hfs/coverage-scope.mjs +1 -1
- package/runtime/scripts/hfs/example-secrets.mjs +1 -1
- package/runtime/scripts/hfs/manifest-shape.mjs +3 -3
- package/runtime/scripts/hfs/param-names.mjs +1 -1
- package/runtime/scripts/hfs/rule-catalog.mjs +3 -1
- package/runtime/scripts/hfs/rules/a15-findings.mjs +1 -1
- package/runtime/scripts/hfs/rules/assets.mjs +1 -1
- package/runtime/scripts/hfs/rules/cli.mjs +1 -1
- package/runtime/scripts/hfs/rules/contract-compat.mjs +1 -1
- package/runtime/scripts/hfs/rules/contract.mjs +1 -1
- package/runtime/scripts/hfs/rules/frontend-tree.mjs +2 -2
- package/runtime/scripts/hfs/rules/supabase-secrets.mjs +1 -1
- package/runtime/scripts/hfs/runtime-rules/workflow-source.mjs +2 -2
- package/runtime/scripts/hfs/slots.mjs +2 -2
- package/runtime/scripts/hfs/typescript-programs.mjs +0 -8
- package/runtime/scripts/lib/env.mjs +2 -2
- package/runtime/scripts/lib/git.mjs +1 -1
- package/runtime/scripts/lib/i18n.mjs +0 -2
- package/runtime/scripts/lib/language.mjs +1 -1
- package/runtime/scripts/lib/roots.mjs +2 -4
- package/scaffold/add-fe-overlay.mjs +0 -121
- package/scaffold/add-fe-page.mjs +0 -268
- package/scaffold/supabase-ports.mjs +1 -1
- package/stack/age-install.mjs +1 -1
- package/stack/cli.mjs +2 -2
- package/stack/context.mjs +1 -1
- package/stack/digest.mjs +1 -1
- package/stack/edge-alias.mjs +1 -1
- package/stack/image-scan.mjs +1 -1
- package/stack/ingress-create.mjs +2 -2
- package/stack/ingress.mjs +3 -3
- package/stack/remote.mjs +2 -2
- package/stack/sealed.mjs +5 -5
- package/sync/format.mjs +1 -1
- package/sync/hygiene.mjs +1 -1
- package/sync/index.mjs +2 -2
- package/sync/stack-images.mjs +2 -2
- package/upgrade/index.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 4.4.1 - 2026-10-17
|
|
4
|
+
- Changed: the bundled runtime copies follow the runtime of 1.0.0-alpha.19 (owner ruling no-runtime-specs, 2026-10-17): the failure codes, the slot manifest (`exampleNa`) and the rule catalog (`specNa`, `exampleNa`) carry the removal of the runtime's own specs; package behavior is unchanged. The managed codecov.yml, the CI coverage upload and the hfs sync render stay (Codecov is kept for apps and examples); internal exports that only the deleted runtime specs read are no longer exported.
|
|
5
|
+
|
|
3
6
|
## 4.4.0 - 2026-10-15
|
|
4
7
|
- Fixed: a swarm service on a shared external edge network no longer keeps the implicit short service name as an alias (`docker stack deploy` adds `api` for nivo_api on every network, so another tenant resolving `http://api` reached the wrong stack). `starci app stack deploy` and rollback reconcile the edge attachment to exactly the declared aliases right after `docker stack deploy` (`STACK_DEPLOY_EDGE_ALIAS` when they still differ), `stack verify` refuses an undeclared alias on an edge-attached service, and the deploy preflight and `stack doctor` extend `STACK_DEPLOY_ALIAS_SHARED` to a short name that another container or service of the edge network already resolves (`STACK_DEPLOY_EDGE_UNREADABLE` when the network cannot be inspected).
|
|
5
8
|
- Added: R295 `BE_MODULE_DEFINITION_MISSING`: every Nest module has a module definition (owner ruling 2026-10-15 `owner:module-definition-everywhere`). The slot manifest allows `<x>.module-definition.ts` and `<x>.options.ts` beside every feature, transport, cli group, queue, reactor and job module; the generators of `starci app add` and `starci app new` write the three files and register the module as `X.register({})`.
|
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ The upload authenticates with GitHub's OIDC token: the managed `ci.yml` job has
|
|
|
185
185
|
editing a list), plus the catalog slice of every code `starci app check` can emit: its own and the machine's (`ARCHITECTURE_RULE_IDS`,
|
|
186
186
|
derived from the machine's rule id lists). After changing any of those files, `knowledge/hfs/slots.yaml`,
|
|
187
187
|
`knowledge/hfs/canon-pins.yaml`, `knowledge/patterns/fe/folder.yaml` or the catalog entries of those codes, run `starci release sync-runtime`;
|
|
188
|
-
`
|
|
188
|
+
`starci release sync-runtime --check` fails on a stale copy. Bump `version` here and in the pin when the behaviour changes.
|
|
189
189
|
|
|
190
190
|
The examples gate `starci runtime check --only example-architecture` runs `starci app lint` of this CLI at the root of every `examples/*`
|
|
191
191
|
app with an `hfs.json` (each `examples/<app>` root) and fails on any finding or any tool that could not run;
|
package/db/migrate.mjs
CHANGED
|
@@ -56,7 +56,7 @@ const CHECKS = {
|
|
|
56
56
|
};
|
|
57
57
|
|
|
58
58
|
/** Judges the `database:` block. Returns { config } or { problems }; `baseline` is the one required field. */
|
|
59
|
-
|
|
59
|
+
function normalizeDatabase(block) {
|
|
60
60
|
if (!plain(block)) return { problems: ['database: must be a mapping'] };
|
|
61
61
|
const problems = [];
|
|
62
62
|
for (const [key, value] of Object.entries(block)) {
|
|
@@ -159,7 +159,7 @@ function tableVersions(text) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/** Remote (and local) versions from `supabase migration list`: the JSON form, or the older table. */
|
|
162
|
-
|
|
162
|
+
const parseMigrationList = (text) => jsonVersions(text) ?? tableVersions(text);
|
|
163
163
|
|
|
164
164
|
/** The versions a `db push --dry-run` would apply. */
|
|
165
165
|
export const pendingVersions = (text) => [...new Set([...text.matchAll(PENDING)].map((match) => match[1]))];
|
|
@@ -245,7 +245,7 @@ export const listRemote = (session) => parseMigrationList(runCli(session, ['migr
|
|
|
245
245
|
/* ---- the plan */
|
|
246
246
|
|
|
247
247
|
/** Pure: what to do given the remote history. `done` means baseline + forward are present and nothing else is. */
|
|
248
|
-
|
|
248
|
+
function planMigration(model, remote) {
|
|
249
249
|
const done = [...model.pushVersions].every((version) => remote.has(version)) && [...remote].every((version) => model.allowed.has(version));
|
|
250
250
|
const sim = new Set(remote);
|
|
251
251
|
const repairs = model.decl.restamp.filter((pair) => sim.has(pair.from));
|
|
@@ -329,7 +329,7 @@ function applyPlan(session, plan) {
|
|
|
329
329
|
* `starci app db migrate`. options: { execute, linked, urlEnv }. Dry run reads the remote history once and prints the plan; --execute (with
|
|
330
330
|
* STARCI_DB_ARMED=1) applies it. Already baseline + forward: `nothing to do`, no mutating call, ok.
|
|
331
331
|
*/
|
|
332
|
-
|
|
332
|
+
async function migrateDatabase(ctx, decl, options = {}) {
|
|
333
333
|
const model = buildModel(ctx.cwd, decl);
|
|
334
334
|
const session = { ctx, model, target: resolveTarget(ctx, decl, options) };
|
|
335
335
|
const remote = listRemote(session);
|
package/db/post-cutover.mjs
CHANGED
|
@@ -19,7 +19,7 @@ const MS_PER_HOUR = 3.6e6;
|
|
|
19
19
|
const DEFAULT_MIN_AGE_HOURS = 48;
|
|
20
20
|
|
|
21
21
|
/** Makes a DROP signature comparable with pg_proc's regprocedure text. */
|
|
22
|
-
|
|
22
|
+
function normalizeSignature(signature, schema) {
|
|
23
23
|
const lowered = signature.trim().toLowerCase();
|
|
24
24
|
const bare = lowered.startsWith(`${schema}.`) ? lowered.slice(schema.length + 1) : lowered;
|
|
25
25
|
const words = bare
|
|
@@ -36,7 +36,7 @@ function droppedSignature(statement) {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/** The signatures a migration drops: every `DROP FUNCTION [IF EXISTS] <signature>;` statement. */
|
|
39
|
-
|
|
39
|
+
function dropSignatures(sql, schema) {
|
|
40
40
|
return sql.replace(/--[^\n]*/gu, '').split(';').flatMap((statement) => {
|
|
41
41
|
const signature = droppedSignature(statement.trim());
|
|
42
42
|
return signature === null ? [] : [normalizeSignature(signature, schema)];
|
|
@@ -48,7 +48,7 @@ const settingsOf = (post) => ({
|
|
|
48
48
|
});
|
|
49
49
|
|
|
50
50
|
/** The read-only pg_proc query of the declared function families (identifiers are validated, so nothing free-form reaches the SQL). */
|
|
51
|
-
|
|
51
|
+
function preflightSql({ schema, prefixes, names }) {
|
|
52
52
|
const escaped = (prefix) => prefix.replaceAll('_', String.raw`\_`);
|
|
53
53
|
const clauses = [...names.map((name) => `proname = '${name}'`), ...prefixes.map((prefix) => `proname like '${escaped(prefix)}%'`)];
|
|
54
54
|
return `select oid::regprocedure::text as signature from pg_proc where pronamespace = '${schema}'::regnamespace and (${clauses.join(' or ')})`;
|
|
@@ -104,7 +104,7 @@ function applyHeld(session, remote) {
|
|
|
104
104
|
* `starci app db post-cutover`. options: { execute, linked, urlEnv, greenAt, ownerConfirms, query }. Dry run: remote read plus the read-only preflight.
|
|
105
105
|
* --execute: gate open and STARCI_DB_ARMED=1, then `db push --include-all` of exactly the held-back versions.
|
|
106
106
|
*/
|
|
107
|
-
|
|
107
|
+
async function postCutoverDatabase(ctx, decl, options = {}) {
|
|
108
108
|
const model = buildModel(ctx.cwd, decl);
|
|
109
109
|
if (model.held.length === 0) return { ok: true, lines: ['no held-back migration in the repository. Nothing to do.'], data: { held: [], done: true, executed: false } };
|
|
110
110
|
if (decl.postCutover === null) throw refusal('DB_POSTCUTOVER_UNDECLARED', 'database.postCutover is not declared: the function preflight needs it (an empty mapping declares no family)');
|
package/emit/contracts.mjs
CHANGED
|
@@ -41,7 +41,7 @@ const OPERATIONS_WORKER = path.join(path.dirname(fileURLToPath(import.meta.url))
|
|
|
41
41
|
export const appModulePath = (app) => `apps/${app}/src/app.module.ts`;
|
|
42
42
|
|
|
43
43
|
/** The repository-relative path of an app's snapshot. */
|
|
44
|
-
|
|
44
|
+
const snapshotPath = (app) => `contracts/${app}/schema.graphql`;
|
|
45
45
|
|
|
46
46
|
/** The `paths` aliases of a tsconfig as [{ prefix, targets }], `@modules/*` giving prefix `@modules/`. Pure. */
|
|
47
47
|
export function aliasesOf(paths, baseDir) {
|
|
@@ -57,7 +57,7 @@ export function aliasTarget(aliases, specifier) {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/** The api apps of a declaration that can serve GraphQL: kind `api`. Pure. */
|
|
60
|
-
|
|
60
|
+
const apiApps = (declaration) => (declaration.apps ?? []).filter((app) => app.kind === 'api').map((app) => app.name);
|
|
61
61
|
|
|
62
62
|
/** The text written to a snapshot file: the printed schema and one final newline. Pure. */
|
|
63
63
|
export const snapshotText = (printed) => `${printed.replace(/\n+$/, '')}\n`;
|
package/emit/db-types.mjs
CHANGED
|
@@ -22,13 +22,13 @@ export const dbTypesPath = 'supabase/types/database.types.ts';
|
|
|
22
22
|
|
|
23
23
|
/** The folder of the app's migrations, and the first line of the committed types: the digest of the migrations they were generated from. */
|
|
24
24
|
const MIGRATIONS_DIR = 'supabase/migrations';
|
|
25
|
-
|
|
25
|
+
const TYPES_STAMP = '// migrations-sha256: ';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
28
|
* The sha256 of the app's migrations, hex: every `supabase/migrations/*.sql` by name, each as name, NUL, its text with LF line ends,
|
|
29
29
|
* NUL. The offline codegen hook of a lite app (templates/app/codegen-lite) computes the same digest and refuses types stamped with another.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
function migrationsDigest(root) {
|
|
32
32
|
const dir = path.join(root, MIGRATIONS_DIR);
|
|
33
33
|
const hash = createHash('sha256');
|
|
34
34
|
for (const name of (fs.existsSync(dir) ? fs.readdirSync(dir) : []).filter((file) => file.endsWith('.sql')).sort()) {
|
package/lint/run.mjs
CHANGED
|
@@ -63,8 +63,8 @@ export function parseLintArgs(argv) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/** The typed ESLint run reads nothing above the app root: its TypeScript `sys` is bound by this preload (3.3, bound-sys.cjs). */
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const BOUND_ENV = 'STARCI_LINT_BOUND';
|
|
67
|
+
const linterBoundArgs = () => ['--require', fileURLToPath(new URL('./bound-sys.cjs', import.meta.url))];
|
|
68
68
|
|
|
69
69
|
/** The child `node` ran with `args` from `cwd`: its exit status, signal, spawn error and the text of both streams, once it closes. */
|
|
70
70
|
function runNode(args, options) {
|
package/package.json
CHANGED
package/release/gate.mjs
CHANGED
|
@@ -36,7 +36,7 @@ const scriptGate = (script) => ({
|
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
/** The gates derived from the managed package scripts: the app check first, then every script the sync renders that the app has. */
|
|
39
|
-
|
|
39
|
+
function defaultGates(scripts) {
|
|
40
40
|
const present = SCRIPT_GATES.filter((script) => typeof scripts?.[script] === 'string');
|
|
41
41
|
return [{ name: 'app-check', command: ['npx', 'starci', 'app', 'check'], summary: null, env: {} }, ...present.map(scriptGate)];
|
|
42
42
|
}
|
|
@@ -128,7 +128,7 @@ function nextFree(prefix, version, taken) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/** The tag this release uses and its state: on-head (reused), free (will be created) or taken (exists on another commit). */
|
|
131
|
-
|
|
131
|
+
function chooseTag(ctx, config, { prefix, remote }) {
|
|
132
132
|
const onHead = annotatedOnHead(ctx, prefix);
|
|
133
133
|
const taken = takenTags(ctx, prefix, remote);
|
|
134
134
|
const exact = `${prefix}${config.version}`;
|
|
@@ -147,7 +147,7 @@ const lineAfter = (text, label) => {
|
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
/** The jest summary lines of a log: { suites, failedSuites, tests, failed, passed } or null when jest printed none. */
|
|
150
|
-
|
|
150
|
+
function jestSummary(text) {
|
|
151
151
|
const suites = lineAfter(text, 'Test Suites:');
|
|
152
152
|
const tests = lineAfter(text, 'Tests:');
|
|
153
153
|
if (suites === null || tests === null) return null;
|
|
@@ -159,7 +159,7 @@ export function jestSummary(text) {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
/** Judges a jest-style gate from its log: green needs suites that all passed, every test passed and no coverage threshold miss. */
|
|
162
|
-
|
|
162
|
+
function judgeJest(text) {
|
|
163
163
|
const summary = jestSummary(text);
|
|
164
164
|
const misses = (text.match(THRESHOLD_MISS) ?? []).length;
|
|
165
165
|
if (!summary) return { pass: false, detail: 'no jest summary in the log', summary: null, misses };
|
package/release/index.mjs
CHANGED
|
@@ -22,7 +22,7 @@ export function contextOf(io = {}) {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** Splits argv into { flags, positional }; an unknown flag or a flag without its value is a refusal. */
|
|
25
|
-
|
|
25
|
+
function parseVerbFlags(argv, spec, code = 'RELEASE_USAGE') {
|
|
26
26
|
const flags = {};
|
|
27
27
|
const positional = [];
|
|
28
28
|
for (let index = 0; index < argv.length; index += 1) {
|
|
@@ -53,7 +53,7 @@ function readPackage(root) {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
/** The normalised `release:` block (tolerant of absence) with the package version: { root, version, gates, tagPrefix, defaultBranch, tagMatchesVersion }. */
|
|
56
|
-
|
|
56
|
+
function loadReleaseConfig(root) {
|
|
57
57
|
const pkg = readPackage(root);
|
|
58
58
|
if (typeof pkg.version !== 'string' || !VERSION.test(pkg.version)) throw refusal(RELEASE_CODE, 'package.json needs a version like 1.2.3 (the release tag derives from it)');
|
|
59
59
|
const { config, problems } = normalizeRelease(readDeclaration(root).release, pkg.scripts);
|
package/release/push.mjs
CHANGED
|
@@ -17,7 +17,7 @@ const greenRecord = (record, head, tag) => record?.head === head && record?.tag
|
|
|
17
17
|
&& Array.isArray(record.gates) && record.gates.length > 0 && record.gates.every((gate) => gate?.pass === true);
|
|
18
18
|
|
|
19
19
|
/** The release gate as the hook reads it: the annotated tag on HEAD whose L4 record names head and tag. Returns { tag } or { reason }. */
|
|
20
|
-
|
|
20
|
+
function gateState(ctx, head, prefix) {
|
|
21
21
|
const tags = annotatedOnHead(ctx, prefix);
|
|
22
22
|
if (tags.length === 0) return { reason: `no ANNOTATED tag ${prefix}[0-9]* on HEAD: run starci app release gate --execute first` };
|
|
23
23
|
const file = path.join(releaseDir(ctx), `${head}.l4.json`);
|
package/report/sonar.mjs
CHANGED
|
@@ -50,7 +50,7 @@ export function mergeReports(reports) {
|
|
|
50
50
|
* indexes, and a finding about hfs.json, a workflow, a config file or a directory is not on one, so it is filed on this
|
|
51
51
|
* file and its message names the real path. Null when the tracked tree has no source file.
|
|
52
52
|
*/
|
|
53
|
-
|
|
53
|
+
function anchorOf(tracked, sourceRoots) {
|
|
54
54
|
const roots = sourceRoots.map((root) => `${posix(root).replace(/\/$/, '')}/`);
|
|
55
55
|
return [...tracked].map(posix).filter((file) => SOURCE_FILE.test(file) && roots.some((root) => file.startsWith(root))).sort(cmp)[0] ?? null;
|
|
56
56
|
}
|
|
@@ -185,10 +185,11 @@ sonar: {organization: null}
|
|
|
185
185
|
# minFreeRamPct free-RAM percentage below which no new heavy op starts
|
|
186
186
|
# set them only in the gitignored config.yaml copy, e.g.
|
|
187
187
|
# resources: {minFreeDiskGb: 5, minFreeDiskPct: 1, minFreeRamPct: 10}
|
|
188
|
-
# release
|
|
189
|
-
# suite: local the shipped default: `starci release cut` runs the root
|
|
190
|
-
#
|
|
191
|
-
#
|
|
192
|
-
#
|
|
193
|
-
#
|
|
188
|
+
# release - where the Linux parity of a release is judged (scripts/guards/release-suite-mode.mjs; docs/releasing.md "Where the suite runs"). One key:
|
|
189
|
+
# suite: local the shipped default: `starci release cut` runs the root rows (npm run test:packages, npm run test:e2e, npm run check) and the Linux parity container before it pushes,
|
|
190
|
+
# and the pre-push gate asks for the green root rows
|
|
191
|
+
# suite: ci the owner's recorded choice (2026-10-09): no local Linux container; the GitHub ci workflow runs the Linux parity (and SonarCloud) AFTER the push.
|
|
192
|
+
# The cut still runs the same root rows and the example apps; the record lists linux-parity as delegated, never green.
|
|
193
|
+
# A release can reach GitHub and its tag before the Linux parity has run; a red CI is fixed forward with the next pre-release (starci release ci-status).
|
|
194
|
+
# "none" is refused: the Linux parity does not vanish, it moves to CI. Set it only in the gitignored config.yaml copy: release: {suite: ci}
|
|
194
195
|
release: {suite: local}
|
|
@@ -9,7 +9,7 @@ import {validateSonar} from './sonar-config.mjs';
|
|
|
9
9
|
import {validateRelease,RELEASE_KEYS} from './release-config.mjs';
|
|
10
10
|
import {validateOrca,ORCA_KEYS} from './orca-config.mjs';
|
|
11
11
|
import {validateResources,RESOURCE_KEYS} from './resources-config.mjs';
|
|
12
|
-
import {ENV_NAME,
|
|
12
|
+
import { ENV_NAME, connectorSecret } from './secrets.mjs';
|
|
13
13
|
import {byCodeUnit} from './by-code-unit.mjs';
|
|
14
14
|
import {EFFORT_LEVELS,MODELS_KEYS,validateModelsBlock,refuseRemovedKeys,shippedTiers} from './model-config.mjs';
|
|
15
15
|
const knownNames=names=>[...names].sort(byCodeUnit).join(', ');
|
|
@@ -162,8 +162,6 @@ function validateConnectors(connectors){
|
|
|
162
162
|
if(connectors.cloudflare!==undefined)validateCloudflareConnector(connectors.cloudflare);
|
|
163
163
|
if(connectors.telegram!==undefined)validateTelegramConnector(connectors.telegram);
|
|
164
164
|
}
|
|
165
|
-
/** Load connector credentials from the explicitly verified runtime main; never print the returned environment. */
|
|
166
|
-
export function connectorEnv(config,env=process.env,verifiedRuntimeRoot=undefined){return secretEnv(verifiedRuntimeRoot,env);}
|
|
167
165
|
/**
|
|
168
166
|
* The normalized `connectors` block: defaults filled in, the secrets' PRESENCE (booleans, never values),
|
|
169
167
|
* whether each connector is ready to run, and the owner-facing warnings the security posture earns.
|
|
@@ -243,8 +241,8 @@ export function uatSettings(config=loadConfig()){
|
|
|
243
241
|
const GRANT=/^([a-z0-9][a-z0-9.-]*)=(\d+)@([a-z]+(?:\+[a-z]+)*)$/;
|
|
244
242
|
/** One grant string `<pool>=<slots>@<role>+<role>` as {pool, slots, roles}, or null when it is not that shape. */
|
|
245
243
|
/** The closed set of top-level config.yaml blocks: the validator accepts these and refuses every other key. */
|
|
246
|
-
|
|
247
|
-
|
|
244
|
+
const CONFIG_BLOCKS=Object.freeze(['language','model','effort','models','allocation','kernel','budgets','supervisor','parallel','delegation','connectors','asks','uat','specs','reconciler','debugLoop','orca','roots','resources','sonar','release','launchTrust','retention']);
|
|
245
|
+
function parseAllocationGrant(text){
|
|
248
246
|
const m=typeof text==='string'?GRANT.exec(text.trim()):null;
|
|
249
247
|
return m?{pool:m[1],slots:Number(m[2]),roles:m[3].split('+')}:null;
|
|
250
248
|
}
|
|
@@ -327,7 +325,7 @@ const validateEarlyConfigBlocks=(config)=>{
|
|
|
327
325
|
if(config?.orca!==undefined){validateOrca(config.orca);} if(config?.roots!==undefined){validateRoots(config.roots);} if(config?.resources!==undefined){validateResources(config.resources);} if(config?.sonar!==undefined){validateSonar(config.sonar);} if(config?.release!==undefined){validateRelease(config.release);}
|
|
328
326
|
};
|
|
329
327
|
const validateConfigBlocks=(config,knownProviders,runtimes,profile)=>{
|
|
330
|
-
// specs (owner 2026-09-28): {
|
|
328
|
+
// specs (owner 2026-09-28): {unit?, e2e?} booleans - each family a boolean; absent = its default (SPEC_DEFAULTS: unit on, e2e off; specsSettings).
|
|
331
329
|
if(config?.specs!==undefined&&config.specs!==null&&(!plain(config.specs)||Object.keys(config.specs).some(key=>!CONFIG_KEY_TREE.specs.includes(key)||typeof config.specs[key]!=='boolean')))throw new Error(`Invalid config.yaml: specs must be {${SPEC_FAMILIES.map(k=>k+'?: boolean').join(', ')}}, or null.`);
|
|
332
330
|
// reconciler (scripts/reconciler/state.mjs reconcilerConfig): {enabled?: boolean, profile?: operational|observe, controllers?: {<name>: {mode: off|shadow|active}}}, or null.
|
|
333
331
|
if(config?.reconciler!==undefined&&config.reconciler!==null){validateReconcilerBlock(config.reconciler);} if(config?.allocation!==undefined){validateAllocationBlock(config.allocation,runtimes);}
|
|
@@ -356,8 +354,8 @@ export function configuredAllocationPolicy(config=loadConfig()){
|
|
|
356
354
|
:null;
|
|
357
355
|
return {grants,source:allocation?'allocation':'default'};
|
|
358
356
|
}
|
|
359
|
-
/** The variable that confines the owner's `config.yaml` to a directory tree: set, an owner file is read only from under that directory (
|
|
360
|
-
|
|
357
|
+
/** The variable that confines the owner's `config.yaml` to a directory tree: set, an owner file is read only from under that directory (e2e/setup/isolated-temp.mjs points it at a spec's own temp root). */
|
|
358
|
+
const OWNER_CONFIG_WITHIN_ENV='STARCI_OWNER_CONFIG_WITHIN';
|
|
361
359
|
const foldPath=p=>process.platform==='win32'?path.resolve(p).toLowerCase():path.resolve(p);
|
|
362
360
|
/**
|
|
363
361
|
* Whether the owner's `config.yaml` under `root` is visible to this process. Unconfined (the variable unset) every owner file is visible; confined, only the files under the named
|
|
@@ -398,31 +396,25 @@ export function inspectOwnerConfig(root=configRoot){
|
|
|
398
396
|
}
|
|
399
397
|
/**
|
|
400
398
|
* The owner's spec switches (config.yaml root `specs`, owner 2026-09-28; defaults set 2026-09-29, none needs a config block):
|
|
401
|
-
* harness - .claude's own specs. Default false = touching-only: harness work writes and runs the specs of new or changed code
|
|
402
|
-
* and the land gate runs only the specs touching the landed files (`land.mjs --specs touching`, its default);
|
|
403
|
-
* the whole suite never runs in a land - `--specs all` is refused unless this is true. The full suite runs in
|
|
404
|
-
* the owner-approved /starci release flow (scripts/supervisor/release-cut.mjs), which needs no key. true = `--specs all` may run;
|
|
405
399
|
* unit - product unit specs in workflows. Default on: a code-writing op writes/updates the unit specs of the source it
|
|
406
400
|
* adds or changes and runs only those; the full unit suite is unit.verify's or the approved /starci release flow's. false = the ops'
|
|
407
401
|
* policy.specsToggle deferral path (scripts/route/spec-deferral.mjs);
|
|
408
402
|
* e2e - product e2e in workflows. Default OFF: e2e runs only when the goal or the owner explicitly asks (set true,
|
|
409
403
|
* or `starci kernel run-deferred-tests`); e2e.verify then runs the FULL e2e suite.
|
|
410
|
-
* An absent, null or unreadable owner file reads as the defaults:
|
|
404
|
+
* An absent, null or unreadable owner file reads as the defaults: unit on, e2e off. The runtime itself has no specs (owner ruling no-runtime-specs), so there is no switch for them.
|
|
411
405
|
*/
|
|
412
|
-
const SPEC_FAMILIES=Object.freeze(['
|
|
406
|
+
const SPEC_FAMILIES=Object.freeze(['unit','e2e']);
|
|
413
407
|
const SEAT_KEYS=Object.freeze(['agent','model','effort']);
|
|
414
408
|
/** The keys each config block accepts directly under it (the validators read these lists; docs/config-format.md and the example are checked against them). Blocks whose keys are open or deeper than this are not listed. */
|
|
415
|
-
|
|
409
|
+
const CONFIG_KEY_TREE=Object.freeze({
|
|
416
410
|
models:MODELS_KEYS,allocation:Object.freeze(['grants']),kernel:SEAT_KEYS,budgets:Object.freeze(['maxOps']),parallel:Object.freeze(['gear']),
|
|
417
411
|
supervisor:Object.freeze(['mode','pollIntervalMs','repos','stallMinutes','kernel','workers','landGate','frozenMinutes']),
|
|
418
412
|
delegation:Object.freeze(['asks','until','excludes','note']),asks:Object.freeze(['autoAcceptRecommended','excludes']),uat:Object.freeze(['maxConcurrent']),
|
|
419
413
|
specs:SPEC_FAMILIES,reconciler:Object.freeze(['enabled','profile','controllers']),debugLoop:Object.freeze(['interval','worktreeLimit']),
|
|
420
414
|
orca:ORCA_KEYS,roots:ROOT_KEYS,resources:RESOURCE_KEYS,release:RELEASE_KEYS,
|
|
421
415
|
});
|
|
422
|
-
export const SPEC_DEFAULTS=Object.freeze({
|
|
416
|
+
export const SPEC_DEFAULTS=Object.freeze({unit:true,e2e:false});
|
|
423
417
|
export function specsSettings(config){const specs=plain(config?.specs)?config.specs:{};return Object.fromEntries(SPEC_FAMILIES.map(key=>[key,typeof specs[key]==='boolean'?specs[key]:SPEC_DEFAULTS[key]]));}
|
|
424
|
-
/** specs.harness of the owner file under `root` (tolerant read: inspectOwnerConfig): true only when the owner opted in to `--specs all`. */
|
|
425
|
-
export function harnessSpecsEnabled(root=configRoot){return specsSettings(inspectOwnerConfig(root).config).harness;}
|
|
426
418
|
/**
|
|
427
419
|
* config.yaml `debugLoop` (skills/starci, scripts/debug/digest): {interval?, worktreeLimit?}, each optional.
|
|
428
420
|
* interval <n>s | <n>m | <n>h — the cadence of the chat /loop that runs `starci debug digest`.
|
|
@@ -12,8 +12,6 @@ function loaded(){
|
|
|
12
12
|
return cache.doc;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
/** The kinds a removed spelling has. */
|
|
16
|
-
export const removedKinds=()=>loaded().kinds;
|
|
17
15
|
|
|
18
16
|
/** modules/kernel/removed-vocabulary.yaml: the one list of spellings the runtime refuses, each with its replacement and the release that removed it. */
|
|
19
17
|
export const removedVocabulary=()=>loaded().removed;
|
|
@@ -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.1
|
|
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.1
|
|
40
40
|
group: starci
|
|
41
41
|
install: registry
|
|
42
42
|
side: fe
|
|
@@ -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.4.
|
|
79
|
+
version: 1.4.1
|
|
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.4.
|
|
86
|
+
version: 4.4.1
|
|
87
87
|
group: starci
|
|
88
88
|
install: registry
|
|
89
89
|
side: both
|