wicked-crew 0.9.2 → 0.9.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/dist/api/delivery-assurance.d.ts +22 -1
- package/dist/api/delivery-assurance.d.ts.map +1 -1
- package/dist/api/delivery-assurance.js +66 -2
- package/dist/api/delivery-assurance.js.map +1 -1
- package/dist/api/routes.d.ts +148 -8
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +59 -19
- package/dist/api/routes.js.map +1 -1
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +31 -31
- package/dist/api/server.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +32 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/service.js +1 -1
- package/dist/cli/service.js.map +1 -1
- package/dist/core/adapter.d.ts +21 -3
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +72 -18
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/ado-deliver-helper.d.ts +5 -0
- package/dist/core/ado-deliver-helper.d.ts.map +1 -1
- package/dist/core/ado-deliver-helper.js +50 -2
- package/dist/core/ado-deliver-helper.js.map +1 -1
- package/dist/core/deliver-credentials.d.ts +8 -4
- package/dist/core/deliver-credentials.d.ts.map +1 -1
- package/dist/core/deliver-credentials.js +25 -7
- package/dist/core/deliver-credentials.js.map +1 -1
- package/dist/core/deliver-text.d.ts +8 -0
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +16 -0
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver.d.ts +22 -18
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +168 -79
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/types.d.ts +7 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +11 -20
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +69 -108
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +13 -46
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +81 -130
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +11 -19
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +16 -31
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/interactive/edit-events.d.ts +11 -21
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +70 -83
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/interactive/run-units.d.ts +91 -0
- package/dist/interactive/run-units.d.ts.map +1 -0
- package/dist/interactive/run-units.js +149 -0
- package/dist/interactive/run-units.js.map +1 -0
- package/dist/skills/core-closure.d.ts +26 -0
- package/dist/skills/core-closure.d.ts.map +1 -1
- package/dist/skills/core-closure.js +45 -0
- package/dist/skills/core-closure.js.map +1 -1
- package/dist/skills/phase-skill-gaps.d.ts +16 -71
- package/dist/skills/phase-skill-gaps.d.ts.map +1 -1
- package/dist/skills/phase-skill-gaps.js +16 -145
- package/dist/skills/phase-skill-gaps.js.map +1 -1
- package/dist/studio/assets/{index-BLYKfepE.css → index-BGfFmWw4.css} +1 -1
- package/dist/studio/assets/{index-BbXtfDnB.js → index-BMRUMU4X.js} +112 -112
- package/dist/studio/editors/wicked-page/editor.json +1 -1
- package/dist/studio/editors/wicked-page/index.html +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/studio/testid-inventory.json +83 -5
- package/endpoint-manifest.json +1 -1
- package/package.json +3 -3
|
@@ -45,6 +45,32 @@ export interface NameMention {
|
|
|
45
45
|
}
|
|
46
46
|
/** The non-null `skill_ref`s across a set of workflow defs. */
|
|
47
47
|
export declare function registeredSkillRefs(workflows: ReadonlyArray<WorkflowDef>): Set<string>;
|
|
48
|
+
/** The non-empty `skill_ref`s across a set of presets' steps. */
|
|
49
|
+
export declare function presetSkillRefs(presets: ReadonlyArray<{
|
|
50
|
+
steps: ReadonlyArray<object>;
|
|
51
|
+
}>): Set<string>;
|
|
52
|
+
/**
|
|
53
|
+
* (crew#935, codex r5 on #938) The skill_refs of the engine's BUILT-IN presets, read once at boot:
|
|
54
|
+
* a workflow that became a preset registers no def, so `registeredSkillRefs(listWorkflows())` no
|
|
55
|
+
* longer sees its skills, and a skill a preset ALWAYS requires (`wicked-garden-draft` on the
|
|
56
|
+
* interactive-* presets) could be disabled and published, failing every run that needs it. The
|
|
57
|
+
* built-ins are compiled into the engine, so one read holds until restart. An addon without presets,
|
|
58
|
+
* or a read that fails, answers the empty set (logged): the registered defs still count.
|
|
59
|
+
*/
|
|
60
|
+
export declare function builtinPresetSkillRefs(adapter: {
|
|
61
|
+
presetsSupported(): boolean;
|
|
62
|
+
listPresets(): Promise<ReadonlyArray<{
|
|
63
|
+
created_by: string;
|
|
64
|
+
steps: ReadonlyArray<object>;
|
|
65
|
+
}>>;
|
|
66
|
+
}, warn: (msg: string) => void): Promise<Set<string>>;
|
|
67
|
+
/**
|
|
68
|
+
* (crew#935) The core reference set: the registered defs' refs plus the built-in presets' refs the
|
|
69
|
+
* catalog HOLDS. A held preset skill cannot be disabled out from under its preset; one the catalog
|
|
70
|
+
* lacks is not a publish blocker (an older garden still publishes for every other workflow, and a run
|
|
71
|
+
* of that preset fails at admission naming the skill).
|
|
72
|
+
*/
|
|
73
|
+
export declare function coreSkillRefs(defRefs: ReadonlySet<string>, presetRefs: ReadonlySet<string>, held: ReadonlySet<string>): Set<string>;
|
|
48
74
|
/**
|
|
49
75
|
* Every well-formed qualified-name token in `text` with its line — catalog-agnostic, PROSE only.
|
|
50
76
|
* Glob/prefix tokens (trailing `-`/`_`) and `:`-continued subagent types are not names and are not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-closure.d.ts","sourceRoot":"","sources":["../../src/skills/core-closure.ts"],"names":[],"mappings":"AAAA;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;AAC7E,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAMjH;AAED,MAAM,WAAW,aAAa;IAC5B,4DAA4D;IAC5D,IAAI,EAAE,MAAM,CAAC;IACb,sDAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IAClB,kDAAkD;IAClD,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,yGAAyG;IACzG,cAAc,EAAE,aAAa,EAAE,CAAC;CACjC;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,WAAW,CAgCrG"}
|
|
@@ -51,6 +51,51 @@ export function registeredSkillRefs(workflows) {
|
|
|
51
51
|
}
|
|
52
52
|
return out;
|
|
53
53
|
}
|
|
54
|
+
/** The non-empty `skill_ref`s across a set of presets' steps. */
|
|
55
|
+
export function presetSkillRefs(presets) {
|
|
56
|
+
const out = new Set();
|
|
57
|
+
for (const p of presets) {
|
|
58
|
+
for (const s of p.steps) {
|
|
59
|
+
const ref = s.skill_ref;
|
|
60
|
+
if (typeof ref === 'string' && ref !== '')
|
|
61
|
+
out.add(ref);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* (crew#935, codex r5 on #938) The skill_refs of the engine's BUILT-IN presets, read once at boot:
|
|
68
|
+
* a workflow that became a preset registers no def, so `registeredSkillRefs(listWorkflows())` no
|
|
69
|
+
* longer sees its skills, and a skill a preset ALWAYS requires (`wicked-garden-draft` on the
|
|
70
|
+
* interactive-* presets) could be disabled and published, failing every run that needs it. The
|
|
71
|
+
* built-ins are compiled into the engine, so one read holds until restart. An addon without presets,
|
|
72
|
+
* or a read that fails, answers the empty set (logged): the registered defs still count.
|
|
73
|
+
*/
|
|
74
|
+
export async function builtinPresetSkillRefs(adapter, warn) {
|
|
75
|
+
try {
|
|
76
|
+
// A partial adapter (a directly-driven route set, a test double) may carry neither method.
|
|
77
|
+
if (typeof adapter.presetsSupported !== 'function' || !adapter.presetsSupported())
|
|
78
|
+
return new Set();
|
|
79
|
+
return presetSkillRefs((await adapter.listPresets()).filter((p) => p.created_by === 'builtin'));
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
warn(`[skills] could not read the built-in presets' skill_refs: ${err instanceof Error ? err.message : String(err)}`);
|
|
83
|
+
return new Set();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* (crew#935) The core reference set: the registered defs' refs plus the built-in presets' refs the
|
|
88
|
+
* catalog HOLDS. A held preset skill cannot be disabled out from under its preset; one the catalog
|
|
89
|
+
* lacks is not a publish blocker (an older garden still publishes for every other workflow, and a run
|
|
90
|
+
* of that preset fails at admission naming the skill).
|
|
91
|
+
*/
|
|
92
|
+
export function coreSkillRefs(defRefs, presetRefs, held) {
|
|
93
|
+
const out = new Set(defRefs);
|
|
94
|
+
for (const r of presetRefs)
|
|
95
|
+
if (held.has(r))
|
|
96
|
+
out.add(r);
|
|
97
|
+
return out;
|
|
98
|
+
}
|
|
54
99
|
/**
|
|
55
100
|
* Every well-formed qualified-name token in `text` with its line — catalog-agnostic, PROSE only.
|
|
56
101
|
* Glob/prefix tokens (trailing `-`/`_`) and `:`-continued subagent types are not names and are not
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-closure.js","sourceRoot":"","sources":["../../src/skills/core-closure.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG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phases that
|
|
2
|
+
* Phases that ran WITHOUT a skill their workflow declares (crew#661) — the historical record.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* Until crew#935 the interactive seams (draft / edit / chat) stamped `wicked-garden-draft` only when
|
|
5
|
+
* the published snapshot held it, and otherwise armed with NO `skill_ref` and ran every run without
|
|
6
|
+
* the quality floor, disclosed on `/diagnostics` and on each run (`AgentSession.skill_gaps`, from a
|
|
7
|
+
* `run.skill.unarmed` audit entry). Since crew#935 those seams launch wicked-core's built-in
|
|
8
|
+
* `interactive-*` presets, which ALWAYS run the skill: a snapshot without it fails the run instead
|
|
9
|
+
* (fail closed, the call on wicked-core#860). No seam arms degraded any more, so nothing new is
|
|
10
|
+
* recorded. What stays:
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* refuses — `unitDistributed.degradedReason` (a thinner council), `distinctnessFallback`
|
|
15
|
-
* (creator-seat judge), `gateEvaluated.ungated`. The BASE skill is the counter-example that fails
|
|
16
|
-
* loud (`baseSkillPolicy: 'require'`, D-8b): it IS the governance directive, so a run without it is
|
|
17
|
-
* not governed the way it claims. Refusing here would stop every interactive ask on a snapshot that
|
|
18
|
-
* was merely never republished — a capability outage for a quality gap.
|
|
19
|
-
*
|
|
20
|
-
* Two halves, both keyed on what the seam DECIDED at arm time (the decision holds until restart —
|
|
21
|
-
* a republish does not re-arm a running seam, so "the snapshot holds it now" is not the answer):
|
|
22
|
-
*
|
|
23
|
-
* - {@link PhaseSkillArming} records each seam's arm-time outcome; `GET /diagnostics` reports the
|
|
24
|
-
* gaps (`skills.phaseSkillGaps` + a `skills.phase-skill` finding) and `/health.warnings` carries
|
|
25
|
-
* the finding.
|
|
26
|
-
* - {@link RunSkillGapIndex} records, per LAUNCHED run whose workflow armed with a gap, a
|
|
27
|
-
* `run.skill.unarmed` audit entry and serves it as `AgentSession.skill_gaps` — durable across a
|
|
28
|
-
* restart through the trail, like every other daemon-side run fact (RetryIndex, GuidanceIndex).
|
|
12
|
+
* - {@link RunSkillGapIndex} reads the trail's existing `run.skill.unarmed` entries back, so a run
|
|
13
|
+
* that DID run degraded keeps saying so (`skill_gaps`) across restarts.
|
|
14
|
+
* - `GET /diagnostics.skills.phaseSkillGaps` stays on the wire, always `[]` ({@link withPhaseSkillGaps}).
|
|
29
15
|
*/
|
|
30
16
|
import type { AuditLog } from '../api/audit.js';
|
|
31
|
-
import type {
|
|
32
|
-
import type { WorkflowDef } from '../core/types.js';
|
|
33
|
-
import type { SkillsHealth, SkillsHealthFinding } from './runtime.js';
|
|
17
|
+
import type { SkillsHealth } from './runtime.js';
|
|
34
18
|
/** One subsystem whose declared skill was not handed at arm time — the wire's `DiagnosticsPhaseSkillGap`. */
|
|
35
19
|
export interface PhaseSkillGap {
|
|
36
20
|
/** The seam (`interactive-draft` / `interactive-edit` / `interactive-chat`). */
|
|
@@ -52,55 +36,16 @@ export interface PhaseSkillGap {
|
|
|
52
36
|
export type RunSkillGap = Omit<PhaseSkillGap, 'armedAt'>;
|
|
53
37
|
/** The audit action a run launched with a skill gap is recorded under. */
|
|
54
38
|
export declare const RUN_SKILL_UNARMED_ACTION = "run.skill.unarmed";
|
|
55
|
-
/** The
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export declare function describePhaseSkillGap(gap: PhaseSkillGap): string;
|
|
59
|
-
export declare class PhaseSkillArming {
|
|
60
|
-
/** The published generation right now (`SkillsRuntime.health().current?.gen`), or `null`. */
|
|
61
|
-
private readonly currentGen;
|
|
62
|
-
private readonly now;
|
|
63
|
-
private readonly bySubsystem;
|
|
64
|
-
constructor(
|
|
65
|
-
/** The published generation right now (`SkillsRuntime.health().current?.gen`), or `null`. */
|
|
66
|
-
currentGen: () => number | null, now?: () => number);
|
|
67
|
-
/**
|
|
68
|
-
* Wrap the seam's `skillHeld` predicate so the arm-time answer is recorded against `subsystem`
|
|
69
|
-
* and `def` (the UNSTAMPED def the seam registers — its agent phases are the ones the skill rides).
|
|
70
|
-
* The answer itself is passed through unchanged.
|
|
71
|
-
*/
|
|
72
|
-
probe(subsystem: string, def: WorkflowDef, held: (name: string) => boolean): (name: string) => boolean;
|
|
73
|
-
/** Drop a subsystem's outcome — its seam asked the question but then failed to arm (it returned
|
|
74
|
-
* null and runs nothing), so no phase of it runs, unarmed or otherwise. */
|
|
75
|
-
forget(subsystem: string): void;
|
|
76
|
-
/** Record one arm-time outcome (latest wins per subsystem). */
|
|
77
|
-
record(subsystem: string, def: WorkflowDef, skill: string, held: boolean): void;
|
|
78
|
-
/** Every subsystem that armed without its declared skill, subsystem-sorted. Empty = nothing unarmed. */
|
|
79
|
-
gaps(): PhaseSkillGap[];
|
|
80
|
-
/** The gap for runs launched on `workflowId`, or `undefined` when that workflow armed with its skill (or never armed here). */
|
|
81
|
-
gapForWorkflow(workflowId: string): PhaseSkillGap | undefined;
|
|
82
|
-
}
|
|
83
|
-
/** The `skills.phase-skill` findings for the recorded gaps (one per subsystem, `warning`: the runs proceed, degraded). */
|
|
84
|
-
export declare function phaseSkillFindings(gaps: readonly PhaseSkillGap[]): SkillsHealthFinding[];
|
|
85
|
-
/** The diagnostics `skills` block with the arm-time gaps folded in: `phaseSkillGaps` (always present — `[]`
|
|
86
|
-
* when nothing armed unarmed) and one `skills.phase-skill` finding per gap appended to `findings`. */
|
|
87
|
-
export declare function withPhaseSkillGaps(health: SkillsHealth, arming: PhaseSkillArming | undefined): SkillsHealth & {
|
|
39
|
+
/** The diagnostics `skills` block with `phaseSkillGaps` (crew#661's field, kept on the wire): always
|
|
40
|
+
* `[]` since crew#935 — no seam arms without its declared skill. */
|
|
41
|
+
export declare function withPhaseSkillGaps(health: SkillsHealth): SkillsHealth & {
|
|
88
42
|
phaseSkillGaps: PhaseSkillGap[];
|
|
89
43
|
};
|
|
90
|
-
/** run id → the skill gaps it launched with
|
|
44
|
+
/** run id → the skill gaps it launched with, read back from the audit trail (crew#661 records; none are written since crew#935). */
|
|
91
45
|
export declare class RunSkillGapIndex {
|
|
92
46
|
private readonly byRun;
|
|
93
47
|
/** Best-effort boot hydrate from every `run.skill.unarmed` entry (a failed read leaves runs undisclosed until the next launch, logged). */
|
|
94
48
|
hydrate(audit: AuditLog, log?: (msg: string) => void): Promise<void>;
|
|
95
|
-
/** Record a launch: the audit entry (durable) and the map (served). Idempotent per (run, subsystem, skill). */
|
|
96
|
-
record(audit: AuditLog, actor: Parameters<AuditLog['record']>[1], runId: string, gap: PhaseSkillGap): RunSkillGap;
|
|
97
|
-
/**
|
|
98
|
-
* The daemon's launch listener half: a RUN the engine ACCEPTED on a workflow that armed with a
|
|
99
|
-
* gap is recorded (audit + map) and logged at warn naming the run. Never throws — a listener
|
|
100
|
-
* failure would fail the launch (`CoreAdapter.notifyLaunch`), and disclosure must not turn a
|
|
101
|
-
* degraded run into a refused one; a failure to disclose is itself logged.
|
|
102
|
-
*/
|
|
103
|
-
onLaunch(notice: LaunchNotice, arming: PhaseSkillArming, audit: AuditLog, actor: Parameters<AuditLog['record']>[1], warn: (msg: string) => void): RunSkillGap | undefined;
|
|
104
49
|
/** The gaps this run launched with, or `undefined` (the DTO field is then ABSENT). */
|
|
105
50
|
gapsFor(runId: string): RunSkillGap[] | undefined;
|
|
106
51
|
private add;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase-skill-gaps.d.ts","sourceRoot":"","sources":["../../src/skills/phase-skill-gaps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"phase-skill-gaps.d.ts","sourceRoot":"","sources":["../../src/skills/phase-skill-gaps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,6GAA6G;AAC7G,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,SAAS,EAAE,MAAM,CAAC;IAClB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,8FAA8F;IAC9F,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,wGAAwG;IACxG,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iHAAiH;AACjH,MAAM,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;AAEzD,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,sBAAsB,CAAC;AAgB5D;qEACqE;AACrE,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,YAAY,GAAG,YAAY,GAAG;IAAE,cAAc,EAAE,aAAa,EAAE,CAAA;CAAE,CAE3G;AAED,oIAAoI;AACpI,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoC;IAE1D,2IAA2I;IACrI,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAmB1E,sFAAsF;IACtF,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW,EAAE,GAAG,SAAS;IAKjD,OAAO,CAAC,GAAG;CAOZ"}
|
|
@@ -1,110 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Phases that
|
|
2
|
+
* Phases that ran WITHOUT a skill their workflow declares (crew#661) — the historical record.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
4
|
+
* Until crew#935 the interactive seams (draft / edit / chat) stamped `wicked-garden-draft` only when
|
|
5
|
+
* the published snapshot held it, and otherwise armed with NO `skill_ref` and ran every run without
|
|
6
|
+
* the quality floor, disclosed on `/diagnostics` and on each run (`AgentSession.skill_gaps`, from a
|
|
7
|
+
* `run.skill.unarmed` audit entry). Since crew#935 those seams launch wicked-core's built-in
|
|
8
|
+
* `interactive-*` presets, which ALWAYS run the skill: a snapshot without it fails the run instead
|
|
9
|
+
* (fail closed, the call on wicked-core#860). No seam arms degraded any more, so nothing new is
|
|
10
|
+
* recorded. What stays:
|
|
10
11
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* refuses — `unitDistributed.degradedReason` (a thinner council), `distinctnessFallback`
|
|
15
|
-
* (creator-seat judge), `gateEvaluated.ungated`. The BASE skill is the counter-example that fails
|
|
16
|
-
* loud (`baseSkillPolicy: 'require'`, D-8b): it IS the governance directive, so a run without it is
|
|
17
|
-
* not governed the way it claims. Refusing here would stop every interactive ask on a snapshot that
|
|
18
|
-
* was merely never republished — a capability outage for a quality gap.
|
|
19
|
-
*
|
|
20
|
-
* Two halves, both keyed on what the seam DECIDED at arm time (the decision holds until restart —
|
|
21
|
-
* a republish does not re-arm a running seam, so "the snapshot holds it now" is not the answer):
|
|
22
|
-
*
|
|
23
|
-
* - {@link PhaseSkillArming} records each seam's arm-time outcome; `GET /diagnostics` reports the
|
|
24
|
-
* gaps (`skills.phaseSkillGaps` + a `skills.phase-skill` finding) and `/health.warnings` carries
|
|
25
|
-
* the finding.
|
|
26
|
-
* - {@link RunSkillGapIndex} records, per LAUNCHED run whose workflow armed with a gap, a
|
|
27
|
-
* `run.skill.unarmed` audit entry and serves it as `AgentSession.skill_gaps` — durable across a
|
|
28
|
-
* restart through the trail, like every other daemon-side run fact (RetryIndex, GuidanceIndex).
|
|
12
|
+
* - {@link RunSkillGapIndex} reads the trail's existing `run.skill.unarmed` entries back, so a run
|
|
13
|
+
* that DID run degraded keeps saying so (`skill_gaps`) across restarts.
|
|
14
|
+
* - `GET /diagnostics.skills.phaseSkillGaps` stays on the wire, always `[]` ({@link withPhaseSkillGaps}).
|
|
29
15
|
*/
|
|
30
16
|
/** The audit action a run launched with a skill gap is recorded under. */
|
|
31
17
|
export const RUN_SKILL_UNARMED_ACTION = 'run.skill.unarmed';
|
|
32
|
-
/** The remedy text: republish from a garden carrying the skill, then restart (the seams judge at arm time). */
|
|
33
|
-
export function phaseSkillRemedy(skill) {
|
|
34
|
-
return (`republish the skills snapshot from a wicked-garden that carries '${skill}' (install or upgrade wicked-garden, ` +
|
|
35
|
-
`then POST /api/v1/skills/refresh-baseline and POST /api/v1/skills/publish — or the studio Skills page), ` +
|
|
36
|
-
`then restart crew: the seams decide at arm time`);
|
|
37
|
-
}
|
|
38
|
-
/** The operator-facing sentence for one gap (the `skills.phase-skill` finding's message). */
|
|
39
|
-
export function describePhaseSkillGap(gap) {
|
|
40
|
-
return (`${gap.subsystem}: phase${gap.phases.length === 1 ? '' : 's'} ${gap.phases.join(', ')} declare skill '${gap.skill}' ` +
|
|
41
|
-
`but run WITHOUT it — the published skills snapshot${gap.gen === null ? ' (none published)' : ` (generation ${gap.gen})`} ` +
|
|
42
|
-
`does not hold it; remedy: ${gap.remedy}`);
|
|
43
|
-
}
|
|
44
|
-
export class PhaseSkillArming {
|
|
45
|
-
currentGen;
|
|
46
|
-
now;
|
|
47
|
-
bySubsystem = new Map();
|
|
48
|
-
constructor(
|
|
49
|
-
/** The published generation right now (`SkillsRuntime.health().current?.gen`), or `null`. */
|
|
50
|
-
currentGen, now = Date.now) {
|
|
51
|
-
this.currentGen = currentGen;
|
|
52
|
-
this.now = now;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Wrap the seam's `skillHeld` predicate so the arm-time answer is recorded against `subsystem`
|
|
56
|
-
* and `def` (the UNSTAMPED def the seam registers — its agent phases are the ones the skill rides).
|
|
57
|
-
* The answer itself is passed through unchanged.
|
|
58
|
-
*/
|
|
59
|
-
probe(subsystem, def, held) {
|
|
60
|
-
return (name) => {
|
|
61
|
-
const answer = held(name);
|
|
62
|
-
this.record(subsystem, def, name, answer);
|
|
63
|
-
return answer;
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/** Drop a subsystem's outcome — its seam asked the question but then failed to arm (it returned
|
|
67
|
-
* null and runs nothing), so no phase of it runs, unarmed or otherwise. */
|
|
68
|
-
forget(subsystem) {
|
|
69
|
-
this.bySubsystem.delete(subsystem);
|
|
70
|
-
}
|
|
71
|
-
/** Record one arm-time outcome (latest wins per subsystem). */
|
|
72
|
-
record(subsystem, def, skill, held) {
|
|
73
|
-
if (held) {
|
|
74
|
-
this.bySubsystem.set(subsystem, null);
|
|
75
|
-
return;
|
|
76
|
-
}
|
|
77
|
-
let gen = null;
|
|
78
|
-
try {
|
|
79
|
-
gen = this.currentGen();
|
|
80
|
-
}
|
|
81
|
-
catch {
|
|
82
|
-
gen = null; // an unreadable manifest is "unknown generation", never a guess
|
|
83
|
-
}
|
|
84
|
-
this.bySubsystem.set(subsystem, {
|
|
85
|
-
subsystem,
|
|
86
|
-
workflow: def.id,
|
|
87
|
-
phases: def.phases.filter((p) => p.executor === undefined).map((p) => p.id),
|
|
88
|
-
skill,
|
|
89
|
-
gen,
|
|
90
|
-
armedAt: this.now(),
|
|
91
|
-
remedy: phaseSkillRemedy(skill),
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
/** Every subsystem that armed without its declared skill, subsystem-sorted. Empty = nothing unarmed. */
|
|
95
|
-
gaps() {
|
|
96
|
-
return [...this.bySubsystem.values()]
|
|
97
|
-
.filter((g) => g !== null)
|
|
98
|
-
.sort((a, b) => a.subsystem.localeCompare(b.subsystem));
|
|
99
|
-
}
|
|
100
|
-
/** The gap for runs launched on `workflowId`, or `undefined` when that workflow armed with its skill (or never armed here). */
|
|
101
|
-
gapForWorkflow(workflowId) {
|
|
102
|
-
for (const g of this.bySubsystem.values())
|
|
103
|
-
if (g !== null && g.workflow === workflowId)
|
|
104
|
-
return g;
|
|
105
|
-
return undefined;
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
18
|
function isRunSkillGap(v) {
|
|
109
19
|
if (typeof v !== 'object' || v === null)
|
|
110
20
|
return false;
|
|
@@ -117,17 +27,12 @@ function isRunSkillGap(v) {
|
|
|
117
27
|
(o['gen'] === null || typeof o['gen'] === 'number') &&
|
|
118
28
|
typeof o['remedy'] === 'string');
|
|
119
29
|
}
|
|
120
|
-
/** The `skills
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
}
|
|
124
|
-
/** The diagnostics `skills` block with the arm-time gaps folded in: `phaseSkillGaps` (always present — `[]`
|
|
125
|
-
* when nothing armed unarmed) and one `skills.phase-skill` finding per gap appended to `findings`. */
|
|
126
|
-
export function withPhaseSkillGaps(health, arming) {
|
|
127
|
-
const gaps = arming?.gaps() ?? [];
|
|
128
|
-
return { ...health, findings: [...health.findings, ...phaseSkillFindings(gaps)], phaseSkillGaps: gaps };
|
|
30
|
+
/** The diagnostics `skills` block with `phaseSkillGaps` (crew#661's field, kept on the wire): always
|
|
31
|
+
* `[]` since crew#935 — no seam arms without its declared skill. */
|
|
32
|
+
export function withPhaseSkillGaps(health) {
|
|
33
|
+
return { ...health, phaseSkillGaps: [] };
|
|
129
34
|
}
|
|
130
|
-
/** run id → the skill gaps it launched with
|
|
35
|
+
/** run id → the skill gaps it launched with, read back from the audit trail (crew#661 records; none are written since crew#935). */
|
|
131
36
|
export class RunSkillGapIndex {
|
|
132
37
|
byRun = new Map();
|
|
133
38
|
/** Best-effort boot hydrate from every `run.skill.unarmed` entry (a failed read leaves runs undisclosed until the next launch, logged). */
|
|
@@ -148,40 +53,6 @@ export class RunSkillGapIndex {
|
|
|
148
53
|
log?.(`[skills] run skill-gap hydrate failed (earlier runs read without their skill_gaps until restart): ${err instanceof Error ? err.message : String(err)}`);
|
|
149
54
|
}
|
|
150
55
|
}
|
|
151
|
-
/** Record a launch: the audit entry (durable) and the map (served). Idempotent per (run, subsystem, skill). */
|
|
152
|
-
record(audit, actor, runId, gap) {
|
|
153
|
-
const { armedAt: _armedAt, ...runGap } = gap;
|
|
154
|
-
void _armedAt;
|
|
155
|
-
if (this.add(runId, runGap))
|
|
156
|
-
audit.record(RUN_SKILL_UNARMED_ACTION, actor, { runId, detail: { gap: runGap } });
|
|
157
|
-
return runGap;
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* The daemon's launch listener half: a RUN the engine ACCEPTED on a workflow that armed with a
|
|
161
|
-
* gap is recorded (audit + map) and logged at warn naming the run. Never throws — a listener
|
|
162
|
-
* failure would fail the launch (`CoreAdapter.notifyLaunch`), and disclosure must not turn a
|
|
163
|
-
* degraded run into a refused one; a failure to disclose is itself logged.
|
|
164
|
-
*/
|
|
165
|
-
onLaunch(notice, arming, audit, actor, warn) {
|
|
166
|
-
try {
|
|
167
|
-
// `accepted` only — the engine TOOK the run. A `handed` launch can still be refused, and a durable
|
|
168
|
-
// record written then would stick to a later retry under the same (client-supplied) id.
|
|
169
|
-
if (notice.kind !== 'run' || notice.status !== 'accepted' || notice.workflow === undefined)
|
|
170
|
-
return undefined;
|
|
171
|
-
const gap = arming.gapForWorkflow(notice.workflow);
|
|
172
|
-
if (gap === undefined)
|
|
173
|
-
return undefined;
|
|
174
|
-
const runGap = this.record(audit, actor, notice.id, gap);
|
|
175
|
-
warn(`[${gap.subsystem}] run ${notice.id} launched DEGRADED: phase${gap.phases.length === 1 ? '' : 's'} ` +
|
|
176
|
-
`${gap.phases.join(', ')} run WITHOUT declared skill '${gap.skill}' (not in the published skills snapshot` +
|
|
177
|
-
`${gap.gen === null ? '' : `, generation ${gap.gen}`}) — disclosed as skill_gaps on the run; remedy: ${gap.remedy}`);
|
|
178
|
-
return runGap;
|
|
179
|
-
}
|
|
180
|
-
catch (err) {
|
|
181
|
-
warn(`[skills] could not disclose the skill gap on run ${notice.id}: ${err instanceof Error ? err.message : String(err)}`);
|
|
182
|
-
return undefined;
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
56
|
/** The gaps this run launched with, or `undefined` (the DTO field is then ABSENT). */
|
|
186
57
|
gapsFor(runId) {
|
|
187
58
|
const list = this.byRun.get(runId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phase-skill-gaps.js","sourceRoot":"","sources":["../../src/skills/phase-skill-gaps.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"phase-skill-gaps.js","sourceRoot":"","sources":["../../src/skills/phase-skill-gaps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AA0BH,0EAA0E;AAC1E,MAAM,CAAC,MAAM,wBAAwB,GAAG,mBAAmB,CAAC;AAE5D,SAAS,aAAa,CAAC,CAAU;IAC/B,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,KAAK,CAAC;IACtD,MAAM,CAAC,GAAG,CAA4B,CAAC;IACvC,OAAO,CACL,OAAO,CAAC,CAAC,WAAW,CAAC,KAAK,QAAQ;QAClC,OAAO,CAAC,CAAC,UAAU,CAAC,KAAK,QAAQ;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACzB,CAAC,CAAC,QAAQ,CAAe,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC;QAC9D,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,QAAQ;QAC9B,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,CAAC,KAAK,CAAC,KAAK,QAAQ,CAAC;QACnD,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,QAAQ,CAChC,CAAC;AACJ,CAAC;AAED;qEACqE;AACrE,MAAM,UAAU,kBAAkB,CAAC,MAAoB;IACrD,OAAO,EAAE,GAAG,MAAM,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AAC3C,CAAC;AAED,oIAAoI;AACpI,M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