wicked-crew 0.7.32 → 0.7.34
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/README.md +2 -1
- package/dist/api/chat-turns.d.ts +87 -0
- package/dist/api/chat-turns.d.ts.map +1 -0
- package/dist/api/chat-turns.js +147 -0
- package/dist/api/chat-turns.js.map +1 -0
- package/dist/api/eval-sample.d.ts +18 -18
- package/dist/api/governance-steering.d.ts +4 -4
- package/dist/api/roster-standing.d.ts +42 -0
- package/dist/api/roster-standing.d.ts.map +1 -0
- package/dist/api/roster-standing.js +54 -0
- package/dist/api/roster-standing.js.map +1 -0
- package/dist/api/routes.d.ts +61 -3
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +171 -42
- package/dist/api/routes.js.map +1 -1
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +89 -1
- package/dist/api/server.js.map +1 -1
- package/dist/api/skills.d.ts.map +1 -1
- package/dist/api/skills.js +12 -3
- package/dist/api/skills.js.map +1 -1
- package/dist/api/testing.d.ts +4 -4
- package/dist/campaigns/routes.d.ts +14 -14
- package/dist/cli/index.js +23 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/core/adapter.d.ts +30 -0
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +66 -2
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/engine-roster.d.ts +28 -0
- package/dist/core/engine-roster.d.ts.map +1 -1
- package/dist/core/engine-roster.js +28 -0
- package/dist/core/engine-roster.js.map +1 -1
- package/dist/core/types.d.ts +9 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +6 -0
- package/dist/core/types.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +2 -2
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +19 -4
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/bus-subscriber-errors.d.ts +61 -0
- package/dist/interactive/bus-subscriber-errors.d.ts.map +1 -0
- package/dist/interactive/bus-subscriber-errors.js +85 -0
- package/dist/interactive/bus-subscriber-errors.js.map +1 -0
- package/dist/interactive/chat-events.d.ts +16 -0
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +59 -10
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/demo-events.d.ts +66 -0
- package/dist/interactive/demo-events.d.ts.map +1 -1
- package/dist/interactive/demo-events.js +154 -10
- package/dist/interactive/demo-events.js.map +1 -1
- package/dist/interactive/doc-delete-routes.js +2 -2
- package/dist/interactive/doc-delete-routes.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +13 -0
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +34 -9
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +68 -0
- package/dist/interactive/draft-skill.d.ts.map +1 -0
- package/dist/interactive/draft-skill.js +127 -0
- package/dist/interactive/draft-skill.js.map +1 -0
- package/dist/interactive/edit-events.d.ts +13 -0
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +35 -9
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/interactive/proxy-routes.d.ts +36 -0
- package/dist/interactive/proxy-routes.d.ts.map +1 -1
- package/dist/interactive/proxy-routes.js +90 -3
- package/dist/interactive/proxy-routes.js.map +1 -1
- package/dist/interactive/ws-relay.d.ts +2 -0
- package/dist/interactive/ws-relay.d.ts.map +1 -1
- package/dist/interactive/ws-relay.js +7 -3
- package/dist/interactive/ws-relay.js.map +1 -1
- package/dist/projects/activity.d.ts +17 -3
- package/dist/projects/activity.d.ts.map +1 -1
- package/dist/projects/activity.js +34 -13
- package/dist/projects/activity.js.map +1 -1
- package/dist/projects/events.d.ts +2 -0
- package/dist/projects/events.d.ts.map +1 -1
- package/dist/projects/events.js +7 -3
- package/dist/projects/events.js.map +1 -1
- package/dist/projects/state-home-preflight.d.ts +163 -0
- package/dist/projects/state-home-preflight.d.ts.map +1 -0
- package/dist/projects/state-home-preflight.js +310 -0
- package/dist/projects/state-home-preflight.js.map +1 -0
- package/dist/projects/state-home-registry.d.ts +25 -0
- package/dist/projects/state-home-registry.d.ts.map +1 -0
- package/dist/projects/state-home-registry.js +50 -0
- package/dist/projects/state-home-registry.js.map +1 -0
- package/dist/qe/gate-events.d.ts +2 -0
- package/dist/qe/gate-events.d.ts.map +1 -1
- package/dist/qe/gate-events.js +7 -3
- package/dist/qe/gate-events.js.map +1 -1
- package/dist/skills/base-skill.d.ts +92 -0
- package/dist/skills/base-skill.d.ts.map +1 -0
- package/dist/skills/base-skill.js +105 -0
- package/dist/skills/base-skill.js.map +1 -0
- package/dist/skills/runtime.d.ts +43 -1
- package/dist/skills/runtime.d.ts.map +1 -1
- package/dist/skills/runtime.js +110 -5
- package/dist/skills/runtime.js.map +1 -1
- package/dist/skills/store.d.ts +11 -0
- package/dist/skills/store.d.ts.map +1 -1
- package/dist/skills/store.js +16 -0
- package/dist/skills/store.js.map +1 -1
- package/dist/studio/assets/{index-Clm0MXDF.js → index-DhojBZ1T.js} +91 -91
- package/dist/studio/index.html +1 -1
- package/dist/studio/testid-inventory.json +51 -3
- package/endpoint-manifest.json +2 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/projects/activity.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src/projects/activity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAc5C,IAAI,UAAyC,CAAC;AAC9C;;;;;GAKG;AACH,SAAS,MAAM;IACb,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;QAC7B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,aAAa,CAAC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AC;IAC3E,CAAC;IACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACrC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACzC,MAAM,UAAU,GACd,OAAO,CAAC,MAAM,KAAK,KAAK,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,IAAI,KAAK,SAAS;QACnE,CAAC,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE,CAAC;QAChC,CAAC,CAAC,IAAI,CAAC;IACX,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACjC,CAAC"}
|
|
@@ -41,6 +41,8 @@ export interface ProjectBusOptions {
|
|
|
41
41
|
/** Poll cadence for the /ws bridge subscriber, ms (tests shorten it). */
|
|
42
42
|
pollIntervalMs?: number;
|
|
43
43
|
log?: (msg: string) => void;
|
|
44
|
+
/** Error-level logger for connection-fatal subscriber errors (the /diagnostics ring folds it); defaults to `log`. */
|
|
45
|
+
logError?: (msg: string) => void;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Open the bus and arm both halves. Returns `null` (logged) when wicked-bus is not importable
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/projects/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/projects/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH;;8FAE8F;AAC9F,eAAO,MAAM,eAAe,gBAAgB,CAAC;AAM7C,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAC7D,eAAO,MAAM,eAAe,gCAAgC,CAAC;AAC7D,eAAO,MAAM,gBAAgB,iCAAiC,CAAC;AAC/D,eAAO,MAAM,mB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/dist/projects/events.js
CHANGED
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
* events simply don't ride, and the daemon boots regardless.
|
|
21
21
|
*/
|
|
22
22
|
import { broadcast } from '../events/bus.js';
|
|
23
|
+
import { busSubscriberErrorReporter } from '../interactive/bus-subscriber-errors.js';
|
|
23
24
|
/** Crew's bus DOMAIN COLUMN value — the product-scoped plugin name, matching the repo precedent
|
|
24
25
|
* (`INTERACTIVE_DOMAIN = 'wicked-interactive'`). The EVENT TYPES carry the §4 grammar's bare
|
|
25
26
|
* `crew` segment (`wicked.crew.project.created`); the two spellings are different fields. */
|
|
@@ -104,9 +105,12 @@ export async function startProjectBus(opts = {}) {
|
|
|
104
105
|
ts: event.emitted_at,
|
|
105
106
|
});
|
|
106
107
|
},
|
|
107
|
-
onError: (
|
|
108
|
-
|
|
109
|
-
|
|
108
|
+
onError: busSubscriberErrorReporter({
|
|
109
|
+
describe: (err, event) => `[projects] /ws bridge error on event ${String(event?.event_id ?? '?')}: ${err.message}`,
|
|
110
|
+
log,
|
|
111
|
+
logError: opts.logError,
|
|
112
|
+
pollIntervalMs: opts.pollIntervalMs ?? 2000,
|
|
113
|
+
}),
|
|
110
114
|
});
|
|
111
115
|
}
|
|
112
116
|
catch (err) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/projects/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/projects/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE7C,OAAO,EAAE,0BAA0B,EAAE,MAAM,yCAAyC,CAAC;AAErF;;8FAE8F;AAC9F,MAAM,CAAC,MAAM,eAAe,GAAG,aAAa,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AAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE,CACH,CAAC;IACJ,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAE,MAAM,CAAC,SAAS,CAAY,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5F,OAAO;QACL,IAAI;QACJ,MAAM;QACN,IAAI,EAAE,KAAK,IAAI,EAAE;YACf,IAAI,MAAM,KAAK,IAAI;gBAAE,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QAC3C,CAAC;KACF,CAAC;AACJ,CAAC;AAED,mFAAmF;AAEnF,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,wBAAwB,SAAS,KAAK,CAAC;AAChD,CAAC;AACD,MAAM,UAAU,iBAAiB,CAAC,SAAiB,EAAE,SAAiB;IACpE,OAAO,wBAAwB,SAAS,IAAI,SAAS,EAAE,CAAC;AAC1D,CAAC;AACD,MAAM,UAAU,kBAAkB,CAAC,SAAiB,EAAE,SAAiB;IACrE,OAAO,yBAAyB,SAAS,IAAI,SAAS,EAAE,CAAC;AAC3D,CAAC;AACD,MAAM,UAAU,qBAAqB,CACnC,SAAiB,EACjB,IAAY,EACZ,GAAW,EACX,UAAkB;IAElB,OAAO,4BAA4B,SAAS,IAAI,IAAI,IAAI,GAAG,IAAI,UAAU,EAAE,CAAC;AAC9E,CAAC;AACD,MAAM,UAAU,qBAAqB,CAAC,SAAiB,EAAE,QAAgB,EAAE,EAAU;IACnF,OAAO,4BAA4B,SAAS,IAAI,QAAQ,IAAI,EAAE,EAAE,CAAC;AACnE,CAAC"}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state-home PREFLIGHT (wicked-core#411 / crew#497; acceptance findings F-RC1-011, F-RC2-020,
|
|
3
|
+
* F-032/F-033): say at BOOT — and keep saying, on every `GET /diagnostics`, `GET /health` and
|
|
4
|
+
* `POST /runs` — that the daemon's state home holds an entry the worker Read fence cannot classify,
|
|
5
|
+
* instead of letting every governed run discover it at its first worker.
|
|
6
|
+
*
|
|
7
|
+
* # What happened
|
|
8
|
+
*
|
|
9
|
+
* Core's fence over the state home is an EXPLICIT registry (`tests/fixtures/state-home-subtrees.json`,
|
|
10
|
+
* design v3.1 §1): an entry it does not classify refuses the launch by name, fail closed. Right —
|
|
11
|
+
* but it fired at the run's FIRST WORKER, after a planning council and the intake gate, as a failed
|
|
12
|
+
* unit the failure-triage judge labelled "triage judge errored" and escalated with an "Approve to
|
|
13
|
+
* retry" that could only fail again. The daemon booted GREEN: `/health` ok, `/diagnostics` clean,
|
|
14
|
+
* `recentErrors: []`. Twice in one day that cost every governed run on a host — the acceptance rig's
|
|
15
|
+
* `WICKED_WORKFLOWS_DIR=<state home>/workflows` (crew seeds the interactive-* drop-in defs there at
|
|
16
|
+
* boot), and a `skills.fixture-debris-…` directory left in the operator's live state home.
|
|
17
|
+
*
|
|
18
|
+
* # What this module does
|
|
19
|
+
*
|
|
20
|
+
* 1. {@link assertWickedRootsOutsideStateHome} — the BOOT refusal: a `WICKED_*` root variable
|
|
21
|
+
* pointed INSIDE the state home is a configuration error `serve` refuses with (the rig's
|
|
22
|
+
* shape). The defaults all live outside; the three variables here are the ones whose target
|
|
23
|
+
* crew writes into (or spawns a bridge that does).
|
|
24
|
+
* 2. {@link StateHomeWatch} — the SURVEY: which state home the fence classifies and every entry it
|
|
25
|
+
* cannot classify there. Asked of the engine (`Core.preflightStateHome`, the same code the
|
|
26
|
+
* fence and core's intake refusal run) when the installed addon carries it; on an older addon
|
|
27
|
+
* crew classifies with its own copy of the registry's names (`state-home-registry.ts`, held
|
|
28
|
+
* equal to the fixture by test). Re-run on demand — a `readdir` of two directories — so an
|
|
29
|
+
* entry that appears AFTER boot (the live daemon's debris did) is reported without a restart.
|
|
30
|
+
* 3. {@link stateHomeBlockerBody} — the `POST /runs` 409: the typed error body, naming every entry
|
|
31
|
+
* and the remedy, until the entries are gone.
|
|
32
|
+
*
|
|
33
|
+
* The daemon does NOT refuse to serve over an unregistered entry (studio must still load and show
|
|
34
|
+
* the blocker); it refuses to LAUNCH. Every message is in operator terms — the entry, the state
|
|
35
|
+
* home, the variable, what to do — and none cites a repository fixture path (F-033).
|
|
36
|
+
*/
|
|
37
|
+
/** The remedy every message ends with — spelled once, operator terms, no repository paths. */
|
|
38
|
+
export declare const STATE_HOME_REMEDY: string;
|
|
39
|
+
/** The finding kind `GET /diagnostics.stateHome.findings[]` and `GET /health.warnings[]` carry. */
|
|
40
|
+
export declare const STATE_HOME_FINDING_KIND = "state-home.unregistered";
|
|
41
|
+
/** The machine-readable code on the `POST /runs` 409 body. */
|
|
42
|
+
export declare const STATE_HOME_BLOCKER_CODE = "state_home_unregistered";
|
|
43
|
+
/**
|
|
44
|
+
* The `WICKED_*` root variables whose target crew WRITES INTO (or spawns a bridge that does), with
|
|
45
|
+
* what lands there — the ones an operator can point inside the state home by accident (the rig
|
|
46
|
+
* did). Each default lives outside the state home; the fixture registers the top-level name each
|
|
47
|
+
* would create so a pre-existing placement is fenced, and this module refuses to boot into one.
|
|
48
|
+
*/
|
|
49
|
+
export declare const STATE_HOME_ROOT_ENVS: ReadonlyArray<{
|
|
50
|
+
variable: string;
|
|
51
|
+
creates: string;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* A `WICKED_*` root variable pointed inside the state home (crew#497). A CONFIGURATION error
|
|
55
|
+
* `serve` refuses with — the same posture as an unshareable bus db or governance store.
|
|
56
|
+
*/
|
|
57
|
+
export declare class StateHomePlacementError extends Error {
|
|
58
|
+
readonly variable: string;
|
|
59
|
+
readonly value: string;
|
|
60
|
+
readonly stateHome: string;
|
|
61
|
+
/** The top-level entry the variable's target would create under the state home. */
|
|
62
|
+
readonly entry: string;
|
|
63
|
+
constructor(variable: string, value: string, stateHome: string, entry: string, creates: string);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Refuse a `WICKED_*` root pointed inside `stateHome` (the rig's F-RC1-011 shape). Pure over `env`
|
|
67
|
+
* so the boot and the tests spell the rule once; throws {@link StateHomePlacementError} naming the
|
|
68
|
+
* variable, its value, the entry it would create and the remedy. An unset or empty variable is
|
|
69
|
+
* fine (the default lives outside the state home).
|
|
70
|
+
*/
|
|
71
|
+
export declare function assertWickedRootsOutsideStateHome(env: NodeJS.ProcessEnv, stateHome: string): void;
|
|
72
|
+
/** One entry the registry cannot classify (mirrors core's `UnregisteredEntry`). */
|
|
73
|
+
export interface UnregisteredStateHomeEntry {
|
|
74
|
+
name: string;
|
|
75
|
+
path: string;
|
|
76
|
+
/** `state-home` — a top-level entry; `skills-root` — a child of `<state home>/skills` that is
|
|
77
|
+
* neither the read slot nor a registered denied child. */
|
|
78
|
+
level: 'state-home' | 'skills-root';
|
|
79
|
+
}
|
|
80
|
+
export interface StateHomeFinding {
|
|
81
|
+
kind: typeof STATE_HOME_FINDING_KIND;
|
|
82
|
+
severity: 'error';
|
|
83
|
+
message: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* What `GET /diagnostics` reports as `stateHome` (additive; the next `wicked-crew-api-types` cut
|
|
87
|
+
* declares it). Honest throughout: a field the daemon cannot answer is `null`, never invented.
|
|
88
|
+
*/
|
|
89
|
+
export interface StateHomeHealth {
|
|
90
|
+
/** The state home surveyed (the fence's, derived from the handed snapshot; else the db parent). */
|
|
91
|
+
stateHome: string | null;
|
|
92
|
+
/** `snapshot` — derived from the handed `WICKED_SKILLS_SNAPSHOT` (the directory the fence
|
|
93
|
+
* classifies); `db` — the core db's parent, surveyed for information when no snapshot is handed. */
|
|
94
|
+
derivedFrom: 'snapshot' | 'db' | null;
|
|
95
|
+
/** Who classified: the engine (`Core.preflightStateHome`), crew's own registry copy on an older
|
|
96
|
+
* addon, or nobody (no db path and no snapshot — a library boot). */
|
|
97
|
+
source: 'engine' | 'crew' | 'unavailable';
|
|
98
|
+
unregistered: UnregisteredStateHomeEntry[];
|
|
99
|
+
/** `true` exactly when a HANDED snapshot derives a state home with unregistered entries — the
|
|
100
|
+
* condition core's intake fence refuses every launch on, and what `POST /runs` answers 409 for. */
|
|
101
|
+
refusesLaunches: boolean;
|
|
102
|
+
findings: StateHomeFinding[];
|
|
103
|
+
remedy: string;
|
|
104
|
+
/** Why the survey could not run, or `null`. */
|
|
105
|
+
error: string | null;
|
|
106
|
+
/** When this survey was taken (unix ms). */
|
|
107
|
+
checkedAt: number;
|
|
108
|
+
}
|
|
109
|
+
/** The engine's `Core.preflightStateHome` static, as the adapter exposes it (or `null` on an older addon). */
|
|
110
|
+
export type EnginePreflight = (snapshotPath: string | null, dbPath: string) => Promise<string>;
|
|
111
|
+
/**
|
|
112
|
+
* Crew's own survey of `stateHome` — the fallback classification for an addon without
|
|
113
|
+
* `Core.preflightStateHome`: every top-level entry `state-home-registry.ts` does not classify, and
|
|
114
|
+
* every child of the skills root that is neither the read slot nor a registered name
|
|
115
|
+
* (`skills/root-names.ts`). Sorted as listed. Throws when a directory cannot be listed.
|
|
116
|
+
*/
|
|
117
|
+
export declare function surveyStateHome(stateHome: string): UnregisteredStateHomeEntry[];
|
|
118
|
+
/**
|
|
119
|
+
* The state home a handed snapshot derives (core's `state_home::of_snapshot`, by SHAPE alone):
|
|
120
|
+
* `<state home>/skills/snapshots/<gen>` — three components up when the parent is the read slot,
|
|
121
|
+
* the grandparent the skills root and the last component a generation (decimal digits). `null`
|
|
122
|
+
* for any other spelling.
|
|
123
|
+
*/
|
|
124
|
+
export declare function stateHomeOfSnapshot(snapshotPath: string): string | null;
|
|
125
|
+
export interface StateHomeWatchOptions {
|
|
126
|
+
/** The core db the engine was spawned over (`CoreAdapter.dbPath`), or `null` (a stub route set). */
|
|
127
|
+
dbPath: string | null;
|
|
128
|
+
/** What `WICKED_SKILLS_SNAPSHOT` is exported as right now — read at each refresh so a later
|
|
129
|
+
* publish is judged against the generation it hands. */
|
|
130
|
+
snapshotPath: () => string | null;
|
|
131
|
+
/** The engine binding, or `null` on an addon without it (crew classifies then). */
|
|
132
|
+
engine: EnginePreflight | null;
|
|
133
|
+
/** Crew's fallback survey — injectable for tests. */
|
|
134
|
+
survey?: (stateHome: string) => UnregisteredStateHomeEntry[];
|
|
135
|
+
now?: () => number;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* The daemon's live state-home classification: {@link refresh} re-runs the survey (engine first,
|
|
139
|
+
* crew's copy on an older addon) and {@link last} is the most recent answer — what the routes
|
|
140
|
+
* report and gate on. Never throws: a survey that cannot run is an answer with `error` set.
|
|
141
|
+
*/
|
|
142
|
+
export declare class StateHomeWatch {
|
|
143
|
+
private readonly opts;
|
|
144
|
+
private lastHealth;
|
|
145
|
+
constructor(opts: StateHomeWatchOptions);
|
|
146
|
+
/** The most recent survey (the boot's until {@link refresh} runs again). */
|
|
147
|
+
get last(): StateHomeHealth;
|
|
148
|
+
/** Re-survey now and return the answer. */
|
|
149
|
+
refresh(): Promise<StateHomeHealth>;
|
|
150
|
+
private fromEngine;
|
|
151
|
+
private fromCrew;
|
|
152
|
+
}
|
|
153
|
+
/** The `POST /runs` 409 body while the state home refuses launches: the typed error, as fields. */
|
|
154
|
+
export declare function stateHomeBlockerBody(health: StateHomeHealth): {
|
|
155
|
+
error: string;
|
|
156
|
+
code: typeof STATE_HOME_BLOCKER_CODE;
|
|
157
|
+
stateHome: string | null;
|
|
158
|
+
unregistered: UnregisteredStateHomeEntry[];
|
|
159
|
+
remedy: string;
|
|
160
|
+
};
|
|
161
|
+
/** Does an engine launch rejection carry core's own intake refusal (`StateHomeConfigError`)? */
|
|
162
|
+
export declare function isEngineStateHomeRefusal(message: string): boolean;
|
|
163
|
+
//# sourceMappingURL=state-home-preflight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-home-preflight.d.ts","sourceRoot":"","sources":["../../src/projects/state-home-preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;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C;IACrC,OAAO,IAAI,OAAO,CAAC,eAAe,CAAC;YAkB3B,UAAU;IAyBxB,OAAO,CAAC,QAAQ;CAoCjB;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,eAAe,GAAG;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,OAAO,uBAAuB,CAAC;IACrC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,YAAY,EAAE,0BAA0B,EAAE,CAAC;IAC3C,MAAM,EAAE,MAAM,CAAC;CAChB,CAcA;AAED,gGAAgG;AAChG,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEjE"}
|
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The state-home PREFLIGHT (wicked-core#411 / crew#497; acceptance findings F-RC1-011, F-RC2-020,
|
|
3
|
+
* F-032/F-033): say at BOOT — and keep saying, on every `GET /diagnostics`, `GET /health` and
|
|
4
|
+
* `POST /runs` — that the daemon's state home holds an entry the worker Read fence cannot classify,
|
|
5
|
+
* instead of letting every governed run discover it at its first worker.
|
|
6
|
+
*
|
|
7
|
+
* # What happened
|
|
8
|
+
*
|
|
9
|
+
* Core's fence over the state home is an EXPLICIT registry (`tests/fixtures/state-home-subtrees.json`,
|
|
10
|
+
* design v3.1 §1): an entry it does not classify refuses the launch by name, fail closed. Right —
|
|
11
|
+
* but it fired at the run's FIRST WORKER, after a planning council and the intake gate, as a failed
|
|
12
|
+
* unit the failure-triage judge labelled "triage judge errored" and escalated with an "Approve to
|
|
13
|
+
* retry" that could only fail again. The daemon booted GREEN: `/health` ok, `/diagnostics` clean,
|
|
14
|
+
* `recentErrors: []`. Twice in one day that cost every governed run on a host — the acceptance rig's
|
|
15
|
+
* `WICKED_WORKFLOWS_DIR=<state home>/workflows` (crew seeds the interactive-* drop-in defs there at
|
|
16
|
+
* boot), and a `skills.fixture-debris-…` directory left in the operator's live state home.
|
|
17
|
+
*
|
|
18
|
+
* # What this module does
|
|
19
|
+
*
|
|
20
|
+
* 1. {@link assertWickedRootsOutsideStateHome} — the BOOT refusal: a `WICKED_*` root variable
|
|
21
|
+
* pointed INSIDE the state home is a configuration error `serve` refuses with (the rig's
|
|
22
|
+
* shape). The defaults all live outside; the three variables here are the ones whose target
|
|
23
|
+
* crew writes into (or spawns a bridge that does).
|
|
24
|
+
* 2. {@link StateHomeWatch} — the SURVEY: which state home the fence classifies and every entry it
|
|
25
|
+
* cannot classify there. Asked of the engine (`Core.preflightStateHome`, the same code the
|
|
26
|
+
* fence and core's intake refusal run) when the installed addon carries it; on an older addon
|
|
27
|
+
* crew classifies with its own copy of the registry's names (`state-home-registry.ts`, held
|
|
28
|
+
* equal to the fixture by test). Re-run on demand — a `readdir` of two directories — so an
|
|
29
|
+
* entry that appears AFTER boot (the live daemon's debris did) is reported without a restart.
|
|
30
|
+
* 3. {@link stateHomeBlockerBody} — the `POST /runs` 409: the typed error body, naming every entry
|
|
31
|
+
* and the remedy, until the entries are gone.
|
|
32
|
+
*
|
|
33
|
+
* The daemon does NOT refuse to serve over an unregistered entry (studio must still load and show
|
|
34
|
+
* the blocker); it refuses to LAUNCH. Every message is in operator terms — the entry, the state
|
|
35
|
+
* home, the variable, what to do — and none cites a repository fixture path (F-033).
|
|
36
|
+
*/
|
|
37
|
+
import { lstatSync, readdirSync } from 'node:fs';
|
|
38
|
+
import { dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
39
|
+
import { SKILLS_ROOT_NAMES } from '../skills/root-names.js';
|
|
40
|
+
import { SKILLS_DIRNAME, SNAPSHOTS_DIRNAME } from '../skills/store.js';
|
|
41
|
+
import { isRegisteredStateHomeEntry } from './state-home-registry.js';
|
|
42
|
+
/** The remedy every message ends with — spelled once, operator terms, no repository paths. */
|
|
43
|
+
export const STATE_HOME_REMEDY = 'move each entry out of the state home (or point the WICKED_* variable that created it at a ' +
|
|
44
|
+
'directory OUTSIDE the state home) and restart the daemon; a store crew or the engine is meant to ' +
|
|
45
|
+
'keep there must first be added to the state-home registry that wicked-core and wicked-crew ship, ' +
|
|
46
|
+
'in a release of both';
|
|
47
|
+
/** The finding kind `GET /diagnostics.stateHome.findings[]` and `GET /health.warnings[]` carry. */
|
|
48
|
+
export const STATE_HOME_FINDING_KIND = 'state-home.unregistered';
|
|
49
|
+
/** The machine-readable code on the `POST /runs` 409 body. */
|
|
50
|
+
export const STATE_HOME_BLOCKER_CODE = 'state_home_unregistered';
|
|
51
|
+
/**
|
|
52
|
+
* The `WICKED_*` root variables whose target crew WRITES INTO (or spawns a bridge that does), with
|
|
53
|
+
* what lands there — the ones an operator can point inside the state home by accident (the rig
|
|
54
|
+
* did). Each default lives outside the state home; the fixture registers the top-level name each
|
|
55
|
+
* would create so a pre-existing placement is fenced, and this module refuses to boot into one.
|
|
56
|
+
*/
|
|
57
|
+
export const STATE_HOME_ROOT_ENVS = [
|
|
58
|
+
{ variable: 'WICKED_WORKFLOWS_DIR', creates: 'the workflow overlay directory (crew seeds the interactive-* drop-in defs into it at boot)' },
|
|
59
|
+
{ variable: 'WICKED_STEERING_INBOX_DIR', creates: 'the steering-inbox documents a governed run must READ — unreadable by construction under the fence' },
|
|
60
|
+
{ variable: 'WICKED_INTERACTIVE_ROOT', creates: "the wicked-interactive docs store and its `.wi-serve.json` (written by the bridge crew spawns)" },
|
|
61
|
+
];
|
|
62
|
+
/**
|
|
63
|
+
* A `WICKED_*` root variable pointed inside the state home (crew#497). A CONFIGURATION error
|
|
64
|
+
* `serve` refuses with — the same posture as an unshareable bus db or governance store.
|
|
65
|
+
*/
|
|
66
|
+
export class StateHomePlacementError extends Error {
|
|
67
|
+
variable;
|
|
68
|
+
value;
|
|
69
|
+
stateHome;
|
|
70
|
+
/** The top-level entry the variable's target would create under the state home. */
|
|
71
|
+
entry;
|
|
72
|
+
constructor(variable, value, stateHome, entry, creates) {
|
|
73
|
+
super(`${variable}=${value} points inside the daemon's state home ${stateHome} (it would create \`${entry}\` there — ${creates}). ` +
|
|
74
|
+
'The worker Read fence denies every file tool the whole state home except the handed skills snapshot, so a run ' +
|
|
75
|
+
`could never read what lands under \`${entry}\`, and an entry the fence's registry does not classify would refuse EVERY ` +
|
|
76
|
+
`worker launch. Refusing to start. Remedy: point ${variable} at a directory OUTSIDE ${stateHome} (or unset it for the default) and start the daemon again.`);
|
|
77
|
+
this.name = 'StateHomePlacementError';
|
|
78
|
+
this.variable = variable;
|
|
79
|
+
this.value = value;
|
|
80
|
+
this.stateHome = stateHome;
|
|
81
|
+
this.entry = entry;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/** Is `p` inside `root` (or `root` itself)? Pure — spelled paths, both resolved absolute. */
|
|
85
|
+
function isInside(p, root) {
|
|
86
|
+
const rel = relative(resolve(root), resolve(p));
|
|
87
|
+
return rel === '' || (!rel.startsWith('..') && !isAbsolute(rel));
|
|
88
|
+
}
|
|
89
|
+
/** The first path segment of `p` below `root` — the top-level entry it would create there. */
|
|
90
|
+
function topLevelUnder(p, root) {
|
|
91
|
+
const rel = relative(resolve(root), resolve(p));
|
|
92
|
+
return rel === '' ? '' : rel.split(/[\\/]/)[0];
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Refuse a `WICKED_*` root pointed inside `stateHome` (the rig's F-RC1-011 shape). Pure over `env`
|
|
96
|
+
* so the boot and the tests spell the rule once; throws {@link StateHomePlacementError} naming the
|
|
97
|
+
* variable, its value, the entry it would create and the remedy. An unset or empty variable is
|
|
98
|
+
* fine (the default lives outside the state home).
|
|
99
|
+
*/
|
|
100
|
+
export function assertWickedRootsOutsideStateHome(env, stateHome) {
|
|
101
|
+
for (const { variable, creates } of STATE_HOME_ROOT_ENVS) {
|
|
102
|
+
const value = env[variable];
|
|
103
|
+
if (value === undefined || value === '')
|
|
104
|
+
continue;
|
|
105
|
+
if (!isInside(value, stateHome))
|
|
106
|
+
continue;
|
|
107
|
+
const entry = topLevelUnder(value, stateHome);
|
|
108
|
+
throw new StateHomePlacementError(variable, value, stateHome, entry === '' ? '(the state home itself)' : entry, creates);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
/** Does a skills-root child name match one of the store's registered patterns (exact or `stem*`)? */
|
|
112
|
+
function skillsChildRegistered(name) {
|
|
113
|
+
if (name === SNAPSHOTS_DIRNAME)
|
|
114
|
+
return true;
|
|
115
|
+
return SKILLS_ROOT_NAMES.some(({ pattern }) => {
|
|
116
|
+
if (pattern.includes('/'))
|
|
117
|
+
return false; // a pattern below the slot, not a root child
|
|
118
|
+
return pattern.endsWith('*') ? name.startsWith(pattern.slice(0, -1)) : name === pattern;
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Crew's own survey of `stateHome` — the fallback classification for an addon without
|
|
123
|
+
* `Core.preflightStateHome`: every top-level entry `state-home-registry.ts` does not classify, and
|
|
124
|
+
* every child of the skills root that is neither the read slot nor a registered name
|
|
125
|
+
* (`skills/root-names.ts`). Sorted as listed. Throws when a directory cannot be listed.
|
|
126
|
+
*/
|
|
127
|
+
export function surveyStateHome(stateHome) {
|
|
128
|
+
const out = [];
|
|
129
|
+
for (const name of readdirSync(stateHome).sort()) {
|
|
130
|
+
if (!isRegisteredStateHomeEntry(name)) {
|
|
131
|
+
out.push({ name, path: join(stateHome, name), level: 'state-home' });
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
const skillsDir = join(stateHome, SKILLS_DIRNAME);
|
|
135
|
+
let skillsIsDir = false;
|
|
136
|
+
try {
|
|
137
|
+
skillsIsDir = lstatSync(skillsDir).isDirectory();
|
|
138
|
+
}
|
|
139
|
+
catch {
|
|
140
|
+
skillsIsDir = false; // absent, or a link — nothing to classify here (the launch refuses a link as a kind mismatch)
|
|
141
|
+
}
|
|
142
|
+
if (skillsIsDir) {
|
|
143
|
+
for (const name of readdirSync(skillsDir).sort()) {
|
|
144
|
+
if (!skillsChildRegistered(name)) {
|
|
145
|
+
out.push({ name, path: join(skillsDir, name), level: 'skills-root' });
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
return out;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The state home a handed snapshot derives (core's `state_home::of_snapshot`, by SHAPE alone):
|
|
153
|
+
* `<state home>/skills/snapshots/<gen>` — three components up when the parent is the read slot,
|
|
154
|
+
* the grandparent the skills root and the last component a generation (decimal digits). `null`
|
|
155
|
+
* for any other spelling.
|
|
156
|
+
*/
|
|
157
|
+
export function stateHomeOfSnapshot(snapshotPath) {
|
|
158
|
+
const gen = snapshotPath.split(/[\\/]/).filter((s) => s !== '').at(-1) ?? '';
|
|
159
|
+
if (!/^\d+$/.test(gen))
|
|
160
|
+
return null;
|
|
161
|
+
const slot = dirname(snapshotPath);
|
|
162
|
+
const skills = dirname(slot);
|
|
163
|
+
if (slot.split(/[\\/]/).at(-1) !== SNAPSHOTS_DIRNAME)
|
|
164
|
+
return null;
|
|
165
|
+
if (skills.split(/[\\/]/).at(-1) !== SKILLS_DIRNAME)
|
|
166
|
+
return null;
|
|
167
|
+
const home = dirname(skills);
|
|
168
|
+
return home === skills ? null : home;
|
|
169
|
+
}
|
|
170
|
+
function findingsFor(unregistered, stateHome, refuses) {
|
|
171
|
+
return unregistered.map((u) => ({
|
|
172
|
+
kind: STATE_HOME_FINDING_KIND,
|
|
173
|
+
severity: 'error',
|
|
174
|
+
message: `\`${u.name}\`${u.level === 'skills-root' ? ' (under the skills root)' : ''} at ${u.path} is not in the state-home registry, so the worker Read fence cannot classify it` +
|
|
175
|
+
(refuses
|
|
176
|
+
? ` — EVERY worker launch from this daemon is refused until it is gone (state home ${stateHome ?? '?'})`
|
|
177
|
+
: ` — the fence would refuse every worker launch the moment a skills snapshot is handed from this state home (${stateHome ?? '?'})`) +
|
|
178
|
+
`. Remedy: ${STATE_HOME_REMEDY}`,
|
|
179
|
+
}));
|
|
180
|
+
}
|
|
181
|
+
/**
|
|
182
|
+
* The daemon's live state-home classification: {@link refresh} re-runs the survey (engine first,
|
|
183
|
+
* crew's copy on an older addon) and {@link last} is the most recent answer — what the routes
|
|
184
|
+
* report and gate on. Never throws: a survey that cannot run is an answer with `error` set.
|
|
185
|
+
*/
|
|
186
|
+
export class StateHomeWatch {
|
|
187
|
+
opts;
|
|
188
|
+
lastHealth;
|
|
189
|
+
constructor(opts) {
|
|
190
|
+
this.opts = opts;
|
|
191
|
+
this.lastHealth = {
|
|
192
|
+
stateHome: null,
|
|
193
|
+
derivedFrom: null,
|
|
194
|
+
source: 'unavailable',
|
|
195
|
+
unregistered: [],
|
|
196
|
+
refusesLaunches: false,
|
|
197
|
+
findings: [],
|
|
198
|
+
remedy: STATE_HOME_REMEDY,
|
|
199
|
+
error: null,
|
|
200
|
+
checkedAt: (opts.now ?? Date.now)(),
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/** The most recent survey (the boot's until {@link refresh} runs again). */
|
|
204
|
+
get last() {
|
|
205
|
+
return this.lastHealth;
|
|
206
|
+
}
|
|
207
|
+
/** Re-survey now and return the answer. */
|
|
208
|
+
async refresh() {
|
|
209
|
+
const now = (this.opts.now ?? Date.now)();
|
|
210
|
+
const snapshotPath = this.opts.snapshotPath();
|
|
211
|
+
const dbPath = this.opts.dbPath;
|
|
212
|
+
if (snapshotPath === null && dbPath === null) {
|
|
213
|
+
this.lastHealth = { ...this.lastHealth, source: 'unavailable', checkedAt: now };
|
|
214
|
+
return this.lastHealth;
|
|
215
|
+
}
|
|
216
|
+
let health;
|
|
217
|
+
if (this.opts.engine !== null) {
|
|
218
|
+
health = await this.fromEngine(this.opts.engine, snapshotPath, dbPath ?? ':memory:', now);
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
health = this.fromCrew(snapshotPath, dbPath, now);
|
|
222
|
+
}
|
|
223
|
+
this.lastHealth = health;
|
|
224
|
+
return health;
|
|
225
|
+
}
|
|
226
|
+
async fromEngine(engine, snapshotPath, dbPath, now) {
|
|
227
|
+
try {
|
|
228
|
+
const parsed = JSON.parse(await engine(snapshotPath, dbPath));
|
|
229
|
+
const unregistered = Array.isArray(parsed.unregistered) ? parsed.unregistered : [];
|
|
230
|
+
const stateHome = typeof parsed.stateHome === 'string' ? parsed.stateHome : null;
|
|
231
|
+
const refuses = parsed.refusesLaunches === true;
|
|
232
|
+
return {
|
|
233
|
+
stateHome,
|
|
234
|
+
derivedFrom: parsed.derivedFrom === 'snapshot' || parsed.derivedFrom === 'db' ? parsed.derivedFrom : null,
|
|
235
|
+
source: 'engine',
|
|
236
|
+
unregistered,
|
|
237
|
+
refusesLaunches: refuses,
|
|
238
|
+
findings: findingsFor(unregistered, stateHome, refuses),
|
|
239
|
+
remedy: typeof parsed.remedy === 'string' && parsed.remedy !== '' ? parsed.remedy : STATE_HOME_REMEDY,
|
|
240
|
+
error: typeof parsed.error === 'string' ? parsed.error : null,
|
|
241
|
+
checkedAt: now,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
catch (err) {
|
|
245
|
+
// The engine could not answer (a rejected task, malformed JSON): say so and fall back to
|
|
246
|
+
// crew's own classification rather than report a clean state home nobody checked.
|
|
247
|
+
const crew = this.fromCrew(snapshotPath, this.opts.dbPath, now);
|
|
248
|
+
return { ...crew, error: `engine preflight failed (${err instanceof Error ? err.message : String(err)})${crew.error === null ? '' : `; ${crew.error}`}` };
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
fromCrew(snapshotPath, dbPath, now) {
|
|
252
|
+
let stateHome = null;
|
|
253
|
+
let derivedFrom = null;
|
|
254
|
+
let error = null;
|
|
255
|
+
if (snapshotPath !== null) {
|
|
256
|
+
stateHome = stateHomeOfSnapshot(snapshotPath);
|
|
257
|
+
if (stateHome === null) {
|
|
258
|
+
error = `the handed snapshot \`${snapshotPath}\` does not have the shape <state home>/skills/snapshots/<gen>, so no state home derives from it`;
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
derivedFrom = 'snapshot';
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
else if (dbPath !== null && dbPath !== ':memory:' && !dbPath.includes('://')) {
|
|
265
|
+
stateHome = dirname(resolve(dbPath));
|
|
266
|
+
derivedFrom = 'db';
|
|
267
|
+
}
|
|
268
|
+
let unregistered = [];
|
|
269
|
+
if (stateHome !== null) {
|
|
270
|
+
try {
|
|
271
|
+
unregistered = (this.opts.survey ?? surveyStateHome)(stateHome);
|
|
272
|
+
}
|
|
273
|
+
catch (err) {
|
|
274
|
+
error = `cannot list ${stateHome} to classify it (${err instanceof Error ? err.message : String(err)})`;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
const refuses = derivedFrom === 'snapshot' && unregistered.length > 0;
|
|
278
|
+
return {
|
|
279
|
+
stateHome,
|
|
280
|
+
derivedFrom,
|
|
281
|
+
source: 'crew',
|
|
282
|
+
unregistered,
|
|
283
|
+
refusesLaunches: refuses,
|
|
284
|
+
findings: findingsFor(unregistered, stateHome, refuses),
|
|
285
|
+
remedy: STATE_HOME_REMEDY,
|
|
286
|
+
error,
|
|
287
|
+
checkedAt: now,
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
/** The `POST /runs` 409 body while the state home refuses launches: the typed error, as fields. */
|
|
292
|
+
export function stateHomeBlockerBody(health) {
|
|
293
|
+
const named = health.unregistered
|
|
294
|
+
.map((u) => `\`${u.name}\`${u.level === 'skills-root' ? ' (under the skills root)' : ''}`)
|
|
295
|
+
.join(', ');
|
|
296
|
+
return {
|
|
297
|
+
error: `configuration error: the daemon's state home ${health.stateHome ?? '?'} holds ${health.unregistered.length} ` +
|
|
298
|
+
`${health.unregistered.length === 1 ? 'entry' : 'entries'} the worker Read fence cannot classify — ${named} — so every worker ` +
|
|
299
|
+
`launch from this daemon would be refused; the run was not started. Remedy: ${health.remedy}`,
|
|
300
|
+
code: STATE_HOME_BLOCKER_CODE,
|
|
301
|
+
stateHome: health.stateHome,
|
|
302
|
+
unregistered: health.unregistered,
|
|
303
|
+
remedy: health.remedy,
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
/** Does an engine launch rejection carry core's own intake refusal (`StateHomeConfigError`)? */
|
|
307
|
+
export function isEngineStateHomeRefusal(message) {
|
|
308
|
+
return /configuration error: the daemon's state home .* the worker Read fence cannot classify/.test(message);
|
|
309
|
+
}
|
|
310
|
+
//# sourceMappingURL=state-home-preflight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-home-preflight.js","sourceRoot":"","sources":["../../src/projects/state-home-preflight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE,8FAA8F;AAC9F,MAAM,CAAC,MAAM,iBAAiB,GAC5B,6FAA6F;IAC7F,mGAAmG;IACnG,mGAAmG;IACnG,sBAAsB,CAAC;AAEzB,mGAAmG;AACnG,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,uBAAuB,GAAG,yBAAyB,CAAC;AAEjE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAyD;IACxF,EAAE,QAAQ,EAAE,sBAAsB,EAAE,OAAO,EAAE,4FAA4F,EAAE;IAC3I,EAAE,QAAQ,EAAE,2BAA2B,EAAE,OAAO,EAAE,oGAAoG,EAAE;IACxJ,EAAE,QAAQ,EAAE,yBAAyB,EAAE,OAAO,EA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AuB;QAC7B,SAAS,EAAE,MAAM,CAAC,SAAS;QAC3B,YAAY,EAAE,MAAM,CAAC,YAAY;QACjC,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;AACJ,CAAC;AAED,gGAAgG;AAChG,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,OAAO,uFAAuF,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/G,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The TOP-LEVEL names of the daemon state home, as crew's `src/` knows them (wicked-core#411 /
|
|
3
|
+
* crew#497).
|
|
4
|
+
*
|
|
5
|
+
* The registry of record is `tests/fixtures/state-home-subtrees.json` — the file wicked-core
|
|
6
|
+
* embeds to build the worker Read fence (design v3.1 §1) and crew mirrors byte for byte. It lives
|
|
7
|
+
* under `tests/` so `src/` cannot read it, yet the daemon needs the same classification at BOOT
|
|
8
|
+
* to say, before anyone launches, that an entry under its state home is one the fence will refuse
|
|
9
|
+
* every worker launch over (`state-home-preflight.ts`). The engine answers that question itself
|
|
10
|
+
* once the addon carries `Core.preflightStateHome`; on an older addon crew classifies with THIS
|
|
11
|
+
* list. Same doctrine as `skills/root-names.ts` for the skills root's children: `src/` carries the
|
|
12
|
+
* names, `tests/state-home-subtrees.test.ts` asserts they equal the fixture, so the two cannot
|
|
13
|
+
* drift without a red test.
|
|
14
|
+
*
|
|
15
|
+
* `names` are exact top-level names; `prefixes` cover a file and its sidecars (`core.db`,
|
|
16
|
+
* `core.db-wal`, `core.db.events`, …). Nothing here is enumerated at runtime to BUILD a rule —
|
|
17
|
+
* that is core's fail-closed contract; crew only REPORTS what core would refuse.
|
|
18
|
+
*/
|
|
19
|
+
/** Exact top-level names the registry classifies. */
|
|
20
|
+
export declare const STATE_HOME_ENTRY_NAMES: ReadonlyArray<string>;
|
|
21
|
+
/** Top-level PREFIXES the registry classifies (a file and its sidecars). */
|
|
22
|
+
export declare const STATE_HOME_ENTRY_PREFIXES: ReadonlyArray<string>;
|
|
23
|
+
/** Is `topLevel` a name the registry classifies? */
|
|
24
|
+
export declare function isRegisteredStateHomeEntry(topLevel: string): boolean;
|
|
25
|
+
//# sourceMappingURL=state-home-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state-home-registry.d.ts","sourceRoot":"","sources":["../../src/projects/state-home-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,qDAAqD;AACrD,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,MAAM,CAsBxD,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,EAAE,aAAa,CAAC,MAAM,CAAoC,CAAC;AAEjG,oDAAoD;AACpD,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKpE"}
|