wicked-crew 0.7.40 → 0.7.45
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/audit.d.ts +3 -0
- package/dist/api/audit.d.ts.map +1 -1
- package/dist/api/audit.js +2 -0
- package/dist/api/audit.js.map +1 -1
- package/dist/api/capture.d.ts +149 -0
- package/dist/api/capture.d.ts.map +1 -0
- package/dist/api/capture.js +330 -0
- package/dist/api/capture.js.map +1 -0
- package/dist/api/chat-citations.d.ts +174 -0
- package/dist/api/chat-citations.d.ts.map +1 -0
- package/dist/api/chat-citations.js +528 -0
- package/dist/api/chat-citations.js.map +1 -0
- package/dist/api/chat-transcripts.d.ts +20 -1
- package/dist/api/chat-transcripts.d.ts.map +1 -1
- package/dist/api/chat-transcripts.js +29 -0
- package/dist/api/chat-transcripts.js.map +1 -1
- package/dist/api/delivery-cache.d.ts +2 -2
- package/dist/api/delivery-freeze.d.ts +66 -0
- package/dist/api/delivery-freeze.d.ts.map +1 -0
- package/dist/api/delivery-freeze.js +104 -0
- package/dist/api/delivery-freeze.js.map +1 -0
- package/dist/api/delivery-index.d.ts +53 -9
- package/dist/api/delivery-index.d.ts.map +1 -1
- package/dist/api/delivery-index.js +115 -22
- package/dist/api/delivery-index.js.map +1 -1
- package/dist/api/demo.d.ts +90 -0
- package/dist/api/demo.d.ts.map +1 -0
- package/dist/api/demo.js +492 -0
- package/dist/api/demo.js.map +1 -0
- package/dist/api/diagnostics.d.ts +64 -1
- package/dist/api/diagnostics.d.ts.map +1 -1
- package/dist/api/diagnostics.js +129 -1
- package/dist/api/diagnostics.js.map +1 -1
- package/dist/api/eval-sample.d.ts +6 -6
- package/dist/api/governance-steering.d.ts +2 -2
- package/dist/api/mcp.d.ts +282 -0
- package/dist/api/mcp.d.ts.map +1 -0
- package/dist/api/mcp.js +521 -0
- package/dist/api/mcp.js.map +1 -0
- package/dist/api/plan-schema.d.ts +56 -0
- package/dist/api/plan-schema.d.ts.map +1 -0
- package/dist/api/plan-schema.js +26 -0
- package/dist/api/plan-schema.js.map +1 -0
- package/dist/api/roster-standing.d.ts +15 -2
- package/dist/api/roster-standing.d.ts.map +1 -1
- package/dist/api/roster-standing.js +55 -3
- package/dist/api/roster-standing.js.map +1 -1
- package/dist/api/routes.d.ts +630 -51
- package/dist/api/routes.d.ts.map +1 -1
- package/dist/api/routes.js +738 -127
- package/dist/api/routes.js.map +1 -1
- package/dist/api/run-files.d.ts.map +1 -1
- package/dist/api/run-files.js +31 -2
- package/dist/api/run-files.js.map +1 -1
- package/dist/api/run-liveness.d.ts +41 -0
- package/dist/api/run-liveness.d.ts.map +1 -0
- package/dist/api/run-liveness.js +166 -0
- package/dist/api/run-liveness.js.map +1 -0
- package/dist/api/seat-health.d.ts.map +1 -1
- package/dist/api/seat-health.js +20 -4
- package/dist/api/seat-health.js.map +1 -1
- package/dist/api/seat-probe.d.ts +141 -0
- package/dist/api/seat-probe.d.ts.map +1 -0
- package/dist/api/seat-probe.js +257 -0
- package/dist/api/seat-probe.js.map +1 -0
- package/dist/api/seat-record.d.ts +40 -0
- package/dist/api/seat-record.d.ts.map +1 -0
- package/dist/api/seat-record.js +218 -0
- package/dist/api/seat-record.js.map +1 -0
- package/dist/api/seat-signin.d.ts.map +1 -1
- package/dist/api/seat-signin.js +3 -1
- package/dist/api/seat-signin.js.map +1 -1
- package/dist/api/seat-standing.d.ts +24 -4
- package/dist/api/seat-standing.d.ts.map +1 -1
- package/dist/api/seat-standing.js +50 -3
- package/dist/api/seat-standing.js.map +1 -1
- package/dist/api/server.d.ts +34 -48
- package/dist/api/server.d.ts.map +1 -1
- package/dist/api/server.js +283 -107
- package/dist/api/server.js.map +1 -1
- package/dist/api/skills.d.ts +3 -1
- package/dist/api/skills.d.ts.map +1 -1
- package/dist/api/skills.js +7 -2
- package/dist/api/skills.js.map +1 -1
- package/dist/api/stall-watchdog.d.ts +34 -3
- package/dist/api/stall-watchdog.d.ts.map +1 -1
- package/dist/api/stall-watchdog.js +107 -8
- package/dist/api/stall-watchdog.js.map +1 -1
- package/dist/api/steering-landing.d.ts +6 -6
- package/dist/api/steering-landing.d.ts.map +1 -1
- package/dist/api/steering-landing.js +7 -9
- package/dist/api/steering-landing.js.map +1 -1
- package/dist/api/testing.d.ts +6 -4
- package/dist/api/testing.d.ts.map +1 -1
- package/dist/api/testing.js +82 -47
- package/dist/api/testing.js.map +1 -1
- package/dist/campaign/boot-resume.d.ts +34 -0
- package/dist/campaign/boot-resume.d.ts.map +1 -0
- package/dist/campaign/boot-resume.js +45 -0
- package/dist/campaign/boot-resume.js.map +1 -0
- package/dist/campaigns/rollup.d.ts +4 -1
- package/dist/campaigns/rollup.d.ts.map +1 -1
- package/dist/campaigns/rollup.js +6 -1
- package/dist/campaigns/rollup.js.map +1 -1
- package/dist/campaigns/routes.d.ts +2 -2
- package/dist/cli/bearer.d.ts +27 -1
- package/dist/cli/bearer.d.ts.map +1 -1
- package/dist/cli/bearer.js +62 -2
- package/dist/cli/bearer.js.map +1 -1
- package/dist/cli/governance.d.ts +11 -0
- package/dist/cli/governance.d.ts.map +1 -1
- package/dist/cli/governance.js +8 -2
- package/dist/cli/governance.js.map +1 -1
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +140 -75
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/mcp.d.ts +11 -0
- package/dist/cli/mcp.d.ts.map +1 -1
- package/dist/cli/mcp.js +40 -9
- package/dist/cli/mcp.js.map +1 -1
- package/dist/cli/service.d.ts +78 -0
- package/dist/cli/service.d.ts.map +1 -0
- package/dist/cli/service.js +334 -0
- package/dist/cli/service.js.map +1 -0
- package/dist/core/adapter.d.ts +238 -12
- package/dist/core/adapter.d.ts.map +1 -1
- package/dist/core/adapter.js +619 -157
- package/dist/core/adapter.js.map +1 -1
- package/dist/core/bridge-reaper.d.ts +4 -1
- package/dist/core/bridge-reaper.d.ts.map +1 -1
- package/dist/core/bridge-reaper.js +15 -1
- package/dist/core/bridge-reaper.js.map +1 -1
- package/dist/core/bus-notice.d.ts +27 -0
- package/dist/core/bus-notice.d.ts.map +1 -0
- package/dist/core/bus-notice.js +24 -0
- package/dist/core/bus-notice.js.map +1 -0
- package/dist/core/bus.d.ts +99 -0
- package/dist/core/bus.d.ts.map +1 -0
- package/dist/core/bus.js +176 -0
- package/dist/core/bus.js.map +1 -0
- package/dist/core/deliver-exclusions.d.ts +71 -0
- package/dist/core/deliver-exclusions.d.ts.map +1 -0
- package/dist/core/deliver-exclusions.js +110 -0
- package/dist/core/deliver-exclusions.js.map +1 -0
- package/dist/core/deliver-text.d.ts +61 -14
- package/dist/core/deliver-text.d.ts.map +1 -1
- package/dist/core/deliver-text.js +178 -30
- package/dist/core/deliver-text.js.map +1 -1
- package/dist/core/deliver-triage.d.ts +11 -2
- package/dist/core/deliver-triage.d.ts.map +1 -1
- package/dist/core/deliver-triage.js +19 -1
- package/dist/core/deliver-triage.js.map +1 -1
- package/dist/core/deliver.d.ts +161 -3
- package/dist/core/deliver.d.ts.map +1 -1
- package/dist/core/deliver.js +463 -25
- package/dist/core/deliver.js.map +1 -1
- package/dist/core/deliverable-floor.d.ts.map +1 -1
- package/dist/core/deliverable-floor.js +5 -7
- package/dist/core/deliverable-floor.js.map +1 -1
- package/dist/core/engine-bus.d.ts +40 -0
- package/dist/core/engine-bus.d.ts.map +1 -0
- package/dist/core/engine-bus.js +27 -0
- package/dist/core/engine-bus.js.map +1 -0
- package/dist/core/estate-mcp-client.d.ts +87 -5
- package/dist/core/estate-mcp-client.d.ts.map +1 -1
- package/dist/core/estate-mcp-client.js +90 -11
- package/dist/core/estate-mcp-client.js.map +1 -1
- package/dist/core/linked-issues.d.ts +46 -0
- package/dist/core/linked-issues.d.ts.map +1 -0
- package/dist/core/linked-issues.js +123 -0
- package/dist/core/linked-issues.js.map +1 -0
- package/dist/core/run-identity.d.ts +100 -0
- package/dist/core/run-identity.d.ts.map +1 -0
- package/dist/core/run-identity.js +178 -0
- package/dist/core/run-identity.js.map +1 -0
- package/dist/core/shutdown.d.ts +16 -0
- package/dist/core/shutdown.d.ts.map +1 -0
- package/dist/core/shutdown.js +39 -0
- package/dist/core/shutdown.js.map +1 -0
- package/dist/core/types.d.ts +15 -1
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +4 -0
- package/dist/core/types.js.map +1 -1
- package/dist/interactive/bridge-pool.d.ts +67 -3
- package/dist/interactive/bridge-pool.d.ts.map +1 -1
- package/dist/interactive/bridge-pool.js +129 -13
- package/dist/interactive/bridge-pool.js.map +1 -1
- package/dist/interactive/bridge-root.d.ts +9 -0
- package/dist/interactive/bridge-root.d.ts.map +1 -1
- package/dist/interactive/bridge-root.js +11 -4
- package/dist/interactive/bridge-root.js.map +1 -1
- package/dist/interactive/chat-events.d.ts +14 -9
- package/dist/interactive/chat-events.d.ts.map +1 -1
- package/dist/interactive/chat-events.js +55 -57
- package/dist/interactive/chat-events.js.map +1 -1
- package/dist/interactive/council-outcome.d.ts +1 -0
- package/dist/interactive/council-outcome.d.ts.map +1 -1
- package/dist/interactive/council-outcome.js +33 -0
- package/dist/interactive/council-outcome.js.map +1 -1
- package/dist/interactive/draft-events.d.ts +36 -17
- package/dist/interactive/draft-events.d.ts.map +1 -1
- package/dist/interactive/draft-events.js +121 -92
- package/dist/interactive/draft-events.js.map +1 -1
- package/dist/interactive/draft-skill.d.ts +59 -0
- package/dist/interactive/draft-skill.d.ts.map +1 -1
- package/dist/interactive/draft-skill.js +233 -0
- package/dist/interactive/draft-skill.js.map +1 -1
- package/dist/interactive/edit-events.d.ts +1 -14
- package/dist/interactive/edit-events.d.ts.map +1 -1
- package/dist/interactive/edit-events.js +37 -70
- package/dist/interactive/edit-events.js.map +1 -1
- package/dist/interactive/proxy-routes.d.ts +2 -2
- package/dist/interactive/proxy-routes.d.ts.map +1 -1
- package/dist/interactive/proxy-routes.js +4 -13
- package/dist/interactive/proxy-routes.js.map +1 -1
- package/dist/interactive/ws-relay.d.ts +9 -10
- package/dist/interactive/ws-relay.d.ts.map +1 -1
- package/dist/interactive/ws-relay.js +23 -50
- package/dist/interactive/ws-relay.js.map +1 -1
- package/dist/mcp/broker.d.ts +88 -0
- package/dist/mcp/broker.d.ts.map +1 -0
- package/dist/mcp/broker.js +307 -0
- package/dist/mcp/broker.js.map +1 -0
- package/dist/mcp/call-records.d.ts +61 -0
- package/dist/mcp/call-records.d.ts.map +1 -0
- package/dist/mcp/call-records.js +135 -0
- package/dist/mcp/call-records.js.map +1 -0
- package/dist/mcp/classify.d.ts +45 -0
- package/dist/mcp/classify.d.ts.map +1 -0
- package/dist/mcp/classify.js +83 -0
- package/dist/mcp/classify.js.map +1 -0
- package/dist/mcp/discovery.d.ts +24 -0
- package/dist/mcp/discovery.d.ts.map +1 -0
- package/dist/mcp/discovery.js +78 -0
- package/dist/mcp/discovery.js.map +1 -0
- package/dist/mcp/invoke.d.ts +36 -0
- package/dist/mcp/invoke.d.ts.map +1 -0
- package/dist/mcp/invoke.js +80 -0
- package/dist/mcp/invoke.js.map +1 -0
- package/dist/mcp/policies.d.ts +110 -0
- package/dist/mcp/policies.d.ts.map +1 -0
- package/dist/mcp/policies.js +400 -0
- package/dist/mcp/policies.js.map +1 -0
- package/dist/mcp/probe.d.ts +66 -0
- package/dist/mcp/probe.d.ts.map +1 -0
- package/dist/mcp/probe.js +116 -0
- package/dist/mcp/probe.js.map +1 -0
- package/dist/mcp/redact.d.ts +34 -0
- package/dist/mcp/redact.d.ts.map +1 -0
- package/dist/mcp/redact.js +84 -0
- package/dist/mcp/redact.js.map +1 -0
- package/dist/mcp/registry-store.d.ts +69 -0
- package/dist/mcp/registry-store.d.ts.map +1 -0
- package/dist/mcp/registry-store.js +82 -0
- package/dist/mcp/registry-store.js.map +1 -0
- package/dist/mcp/registry.d.ts +147 -0
- package/dist/mcp/registry.d.ts.map +1 -0
- package/dist/mcp/registry.js +509 -0
- package/dist/mcp/registry.js.map +1 -0
- package/dist/mcp/rest.d.ts +111 -0
- package/dist/mcp/rest.d.ts.map +1 -0
- package/dist/mcp/rest.js +606 -0
- package/dist/mcp/rest.js.map +1 -0
- package/dist/mcp/secrets.d.ts +66 -0
- package/dist/mcp/secrets.d.ts.map +1 -0
- package/dist/mcp/secrets.js +180 -0
- package/dist/mcp/secrets.js.map +1 -0
- package/dist/mcp/tool-list.d.ts +25 -0
- package/dist/mcp/tool-list.d.ts.map +1 -0
- package/dist/mcp/tool-list.js +62 -0
- package/dist/mcp/tool-list.js.map +1 -0
- package/dist/mcp/upstream-error.d.ts +12 -0
- package/dist/mcp/upstream-error.d.ts.map +1 -0
- package/dist/mcp/upstream-error.js +14 -0
- package/dist/mcp/upstream-error.js.map +1 -0
- package/dist/mcp/usage.d.ts +31 -0
- package/dist/mcp/usage.d.ts.map +1 -0
- package/dist/mcp/usage.js +159 -0
- package/dist/mcp/usage.js.map +1 -0
- package/dist/presets/routes.d.ts +53 -0
- package/dist/presets/routes.d.ts.map +1 -0
- package/dist/presets/routes.js +115 -0
- package/dist/presets/routes.js.map +1 -0
- package/dist/projects/activity.d.ts +6 -18
- package/dist/projects/activity.d.ts.map +1 -1
- package/dist/projects/activity.js +17 -60
- package/dist/projects/activity.js.map +1 -1
- package/dist/projects/events.d.ts +6 -5
- package/dist/projects/events.d.ts.map +1 -1
- package/dist/projects/events.js +33 -58
- package/dist/projects/events.js.map +1 -1
- package/dist/projects/routes.d.ts.map +1 -1
- package/dist/projects/routes.js +19 -0
- package/dist/projects/routes.js.map +1 -1
- package/dist/projects/state-home-preflight.d.ts.map +1 -1
- package/dist/projects/state-home-preflight.js +7 -0
- package/dist/projects/state-home-preflight.js.map +1 -1
- package/dist/projects/state-home-registry.d.ts.map +1 -1
- package/dist/projects/state-home-registry.js +9 -1
- package/dist/projects/state-home-registry.js.map +1 -1
- package/dist/qe/acceptance.d.ts +28 -28
- package/dist/qe/acceptance.d.ts.map +1 -1
- package/dist/qe/acceptance.js +60 -61
- package/dist/qe/acceptance.js.map +1 -1
- package/dist/qe/test-sets.d.ts +3 -5
- package/dist/qe/test-sets.d.ts.map +1 -1
- package/dist/qe/test-sets.js +5 -7
- package/dist/qe/test-sets.js.map +1 -1
- package/dist/skills/installed.d.ts +51 -0
- package/dist/skills/installed.d.ts.map +1 -0
- package/dist/skills/installed.js +46 -0
- package/dist/skills/installed.js.map +1 -0
- package/dist/standing-orders/evaluator.d.ts +113 -0
- package/dist/standing-orders/evaluator.d.ts.map +1 -0
- package/dist/standing-orders/evaluator.js +225 -0
- package/dist/standing-orders/evaluator.js.map +1 -0
- package/dist/standing-orders/history.d.ts +58 -0
- package/dist/standing-orders/history.d.ts.map +1 -0
- package/dist/standing-orders/history.js +117 -0
- package/dist/standing-orders/history.js.map +1 -0
- package/dist/standing-orders/parse.d.ts +19 -0
- package/dist/standing-orders/parse.d.ts.map +1 -0
- package/dist/standing-orders/parse.js +75 -0
- package/dist/standing-orders/parse.js.map +1 -0
- package/dist/standing-orders/routes.d.ts +180 -0
- package/dist/standing-orders/routes.d.ts.map +1 -0
- package/dist/standing-orders/routes.js +95 -0
- package/dist/standing-orders/routes.js.map +1 -0
- package/dist/standing-orders/store.d.ts +154 -0
- package/dist/standing-orders/store.d.ts.map +1 -0
- package/dist/standing-orders/store.js +189 -0
- package/dist/standing-orders/store.js.map +1 -0
- package/dist/studio/assets/index-CvV5qITf.css +32 -0
- package/dist/studio/assets/index-jCOy6Ns7.js +568 -0
- package/dist/studio/index.html +3 -3
- package/dist/studio/testid-inventory.json +3274 -894
- package/dist/team/key.d.ts +5 -0
- package/dist/team/key.d.ts.map +1 -0
- package/dist/team/key.js +21 -0
- package/dist/team/key.js.map +1 -0
- package/dist/team/routes.d.ts +196 -0
- package/dist/team/routes.d.ts.map +1 -0
- package/dist/team/routes.js +274 -0
- package/dist/team/routes.js.map +1 -0
- package/dist/team/ws-relay.d.ts +39 -0
- package/dist/team/ws-relay.d.ts.map +1 -0
- package/dist/team/ws-relay.js +63 -0
- package/dist/team/ws-relay.js.map +1 -0
- package/endpoint-manifest.json +502 -6
- package/package.json +6 -6
- package/dist/interactive/demo-events.d.ts +0 -367
- package/dist/interactive/demo-events.d.ts.map +0 -1
- package/dist/interactive/demo-events.js +0 -1293
- package/dist/interactive/demo-events.js.map +0 -1
- package/dist/qe/gate-events.d.ts +0 -113
- package/dist/qe/gate-events.d.ts.map +0 -1
- package/dist/qe/gate-events.js +0 -172
- package/dist/qe/gate-events.js.map +0 -1
- package/dist/studio/assets/index-Bg7Z3BR-.css +0 -32
- package/dist/studio/assets/index-BvOFMjf9.js +0 -554
|
@@ -65,4 +65,63 @@ export declare function draftQualityClause(outPath: string, budget: PageBudget,
|
|
|
65
65
|
}): string;
|
|
66
66
|
/** The one log line a seam writes when it arms, saying which way the gate went and why. */
|
|
67
67
|
export declare function draftSkillArmLine(seam: string, held: boolean): string;
|
|
68
|
+
/** The self-check script, relative to the wicked-garden plugin root. */
|
|
69
|
+
export declare const DRAFT_SELF_CHECK_SCRIPT = "scripts/draft/self_check.py";
|
|
70
|
+
/** The garden launcher crew spawns (it resolves the plugin's Python: venv → uv → python3 → python). */
|
|
71
|
+
export declare const DRAFT_LAUNCHER_SCRIPT: string;
|
|
72
|
+
/** How long the floor gets before it is reported UNAVAILABLE (a claims scan walks the snapshot). */
|
|
73
|
+
export declare const DRAFT_FLOOR_TIMEOUT_MS = 120000;
|
|
74
|
+
/** What crew's re-derivation of the draft floor concluded. */
|
|
75
|
+
export interface DraftFloorVerdict {
|
|
76
|
+
/** `pass` — every floor the check could judge is met; `fail` — a floor is breached, with the
|
|
77
|
+
* rule named in {@link breaches}; `unverified` — no floor failed but the page count could not
|
|
78
|
+
* be verified (disclosed, published); `unavailable` — the floor could not run at all. */
|
|
79
|
+
verdict: 'pass' | 'fail' | 'unverified' | 'unavailable';
|
|
80
|
+
/** One line per breached floor, each naming the rule — what the thread and the log say. */
|
|
81
|
+
breaches: string[];
|
|
82
|
+
/** One line for the log / the thread: what was re-derived and what it found. */
|
|
83
|
+
summary: string;
|
|
84
|
+
}
|
|
85
|
+
/** `wicked-garden run scripts/draft/self_check.py …` as argv for `node <launcher>` — the same
|
|
86
|
+
* inputs the worker's clause names ({@link draftQualityClause}), minus `--render`: crew does not
|
|
87
|
+
* drive a browser at finalize (see the module note above). */
|
|
88
|
+
export declare function draftFloorArgv(gardenRoot: string, outPath: string, budget: PageBudget, snapshotDirs: readonly string[], opts?: {
|
|
89
|
+
style?: string;
|
|
90
|
+
}): string[];
|
|
91
|
+
/**
|
|
92
|
+
* The verdict, from the self-check's own `--json` report (pure — this is what the tests pin).
|
|
93
|
+
*
|
|
94
|
+
* `claims` and `contrast` are deterministic over the file alone, so their failure IS a breach.
|
|
95
|
+
* `pages` is only a breach when the count already exceeds the budget (see the module note): a
|
|
96
|
+
* count below an `--exact` budget is unproven without a render and is reported as unverified.
|
|
97
|
+
*
|
|
98
|
+
* The report's SHAPE is judged first (codex review): a report whose `checks.claims` /
|
|
99
|
+
* `checks.contrast` are missing or carry no boolean `ok` is not this floor's report — a schema
|
|
100
|
+
* drift, or another program's output — and answers `unavailable`, never `pass`. And a report that
|
|
101
|
+
* declares itself FAILED for a reason this floor does not recognise is a breach in its own right:
|
|
102
|
+
* the floor reports the check's own `failed` list rather than passing a document the check refused.
|
|
103
|
+
*/
|
|
104
|
+
export declare function draftFloorVerdict(report: unknown, budget: PageBudget): DraftFloorVerdict;
|
|
105
|
+
/** Where the live wicked-garden plugin is, or null when nothing is installed / discovery refused
|
|
106
|
+
* (a symlink below a config dir). The same source the daemon's skills runtime publishes from. */
|
|
107
|
+
export declare function gardenPluginRoot(): string | null;
|
|
108
|
+
/** Injectable IO for {@link runDraftFloor} — tests substitute the spawn and the root. */
|
|
109
|
+
export interface DraftFloorIo {
|
|
110
|
+
gardenRoot?: () => string | null;
|
|
111
|
+
/** Runs `node <argv>` and resolves its stdout (the `--json` report). Default: `node:child_process`. */
|
|
112
|
+
run?: (argv: string[], timeoutMs: number) => Promise<{
|
|
113
|
+
stdout: string;
|
|
114
|
+
code: number | null;
|
|
115
|
+
}>;
|
|
116
|
+
timeoutMs?: number;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Re-derive the draft floor on the SAVED document: run the skill's own self-check and judge its
|
|
120
|
+
* report ({@link draftFloorVerdict}). Never throws — a floor that cannot run answers
|
|
121
|
+
* `unavailable` with the reason, because a broken check must not read as a pass and must not take
|
|
122
|
+
* document generation down with it.
|
|
123
|
+
*/
|
|
124
|
+
export declare function runDraftFloor(outPath: string, budget: PageBudget, snapshotDirs: readonly string[], opts?: {
|
|
125
|
+
style?: string;
|
|
126
|
+
}, io?: DraftFloorIo): Promise<DraftFloorVerdict>;
|
|
68
127
|
//# sourceMappingURL=draft-skill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draft-skill.d.ts","sourceRoot":"","sources":["../../src/interactive/draft-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"draft-skill.d.ts","sourceRoot":"","sources":["../../src/interactive/draft-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAIpD,gHAAgH;AAChH,eAAO,MAAM,WAAW,wBAAwB,CAAC;AACjD,qDAAqD;AACrD,eAAO,MAAM,0BAA0B,YAAY,CAAC;AAEpD,gGAAgG;AAChG,MAAM,MAAM,SAAS,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;AAElD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,GAAG,WAAW,CAM3E;AAED,2EAA2E;AAC3E,MAAM,MAAM,UAAU,GAClB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,IAAI,CAAC;IAAC,MAAM,EAAE,OAAO,GAAG,eAAe,CAAA;CAAE,GACjE;IAAE,KAAK,EAAE,I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AkBD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,UAAU,GAAG,iBAAiB,CA8ExF;AAED;kGACkG;AAClG,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAMhD;AAED,yFAAyF;AACzF,MAAM,WAAW,YAAY;IAC3B,UAAU,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,uGAAuG;IACvG,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAAC;IAC9F,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAsBD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,SAAS,MAAM,EAAE,EAC/B,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAO,EAC7B,EAAE,GAAE,YAAiB,GACpB,OAAO,CAAC,iBAAiB,CAAC,CAmC5B"}
|
|
@@ -21,6 +21,10 @@
|
|
|
21
21
|
* stamp the phases only then, and LOG which way it went — a run on an older garden proceeds as
|
|
22
22
|
* before (no floor), and the log line says so and names the fix (upgrade garden, republish).
|
|
23
23
|
*/
|
|
24
|
+
import { spawn } from 'node:child_process';
|
|
25
|
+
import { join } from 'node:path';
|
|
26
|
+
import { childEnvWithBootEstateDb } from '../core/governance-store.js';
|
|
27
|
+
import { discoverLivePlugin } from '../skills/plugin-source.js';
|
|
24
28
|
/** The skill's name as the snapshot keys it (path-derived: `skills/draft/SKILL.md` → `wicked-garden-draft`). */
|
|
25
29
|
export const DRAFT_SKILL = 'wicked-garden-draft';
|
|
26
30
|
/** The first wicked-garden release that ships it. */
|
|
@@ -124,4 +128,233 @@ export function draftSkillArmLine(seam, held) {
|
|
|
124
128
|
`the quality floor, exactly as before; upgrade wicked-garden, republish the snapshot and restart crew to arm it ` +
|
|
125
129
|
`(stamping it anyway would make the engine refuse every run at plan time: "the skills snapshot … does not hold the skills this run requires")`;
|
|
126
130
|
}
|
|
131
|
+
// ── THE DRAFT FLOOR: crew re-derives the skill's own verdict from the artifact (crew#621/#504) ──
|
|
132
|
+
//
|
|
133
|
+
// ## The defect
|
|
134
|
+
//
|
|
135
|
+
// On `interactive-draft` both agent phases ran `ungated: true` — "no deterministic floor: no
|
|
136
|
+
// pinned validator … no judge" — so the only thing between a breaching document and the user's
|
|
137
|
+
// canvas was the worker's own word. The brief asked for a print-ready two-page A4 brochure and the
|
|
138
|
+
// draft that landed was a ~3.4-page web layout with literal placeholder copy ("Demo and contact
|
|
139
|
+
// URL to be supplied") and invented "acceptance record" proof rows labelled only in an invisible
|
|
140
|
+
// ARIA attribute (crew#504). The worker IS told to run the `wicked-garden-draft` self-check
|
|
141
|
+
// ({@link draftQualityClause}) — and a run where it did, and fixed nine dangling citations, is
|
|
142
|
+
// exactly the run that proves the instruction is not a floor: nothing re-derived it.
|
|
143
|
+
//
|
|
144
|
+
// ## What crew can honestly own
|
|
145
|
+
//
|
|
146
|
+
// A `validator_pin` is a CONTENT ADDRESS into wicked-core's validator vault, and provisioning one
|
|
147
|
+
// is not exposed through the napi surface crew drives (`core/deliver.ts` documents this: the only
|
|
148
|
+
// pin crew can name is the worktree-diff EVIDENCE floor, which is fail-closed on the repo-less
|
|
149
|
+
// runs every interactive seam launches). So crew cannot pin the self-check as the draft phase's
|
|
150
|
+
// engine validator. What it CAN do is what the deliverable floor does one level out: re-derive the
|
|
151
|
+
// verdict itself, deterministically, from the artifact — by RUNNING the skill's own check, the same
|
|
152
|
+
// command with the same inputs, before the draft is published. No second copy of the rules: the
|
|
153
|
+
// floor's verdict IS `scripts/draft/self_check.py`'s.
|
|
154
|
+
//
|
|
155
|
+
// ## The one divergence, and why it is safe
|
|
156
|
+
//
|
|
157
|
+
// The worker runs the check with `--render` (headless Chrome prints the document and the page count
|
|
158
|
+
// is authoritative). Crew does not drive a browser at finalize, so its page count is the structural
|
|
159
|
+
// estimate — a LOWER bound, which cannot see a wrapper that overflows its sheet. A breach is
|
|
160
|
+
// therefore only reported when the count already EXCEEDS the budget (`> budget`): that direction is
|
|
161
|
+
// proven without a render, while "fewer pages than an exact budget" is exactly what only a render
|
|
162
|
+
// can judge and is left to the worker's own `--render` run and the page-count disclosure.
|
|
163
|
+
//
|
|
164
|
+
// A floor that cannot run (no garden plugin root, no Python, a timeout, an answer that is not the
|
|
165
|
+
// report's shape) is reported as UNAVAILABLE and the draft is published with that said out loud —
|
|
166
|
+
// never rounded to a pass, and never a hard failure of document generation on a machine whose
|
|
167
|
+
// Python is missing.
|
|
168
|
+
/** The self-check script, relative to the wicked-garden plugin root. */
|
|
169
|
+
export const DRAFT_SELF_CHECK_SCRIPT = 'scripts/draft/self_check.py';
|
|
170
|
+
/** The garden launcher crew spawns (it resolves the plugin's Python: venv → uv → python3 → python). */
|
|
171
|
+
export const DRAFT_LAUNCHER_SCRIPT = join('scripts', 'wicked-garden.mjs');
|
|
172
|
+
/** How long the floor gets before it is reported UNAVAILABLE (a claims scan walks the snapshot). */
|
|
173
|
+
export const DRAFT_FLOOR_TIMEOUT_MS = 120_000;
|
|
174
|
+
/** `wicked-garden run scripts/draft/self_check.py …` as argv for `node <launcher>` — the same
|
|
175
|
+
* inputs the worker's clause names ({@link draftQualityClause}), minus `--render`: crew does not
|
|
176
|
+
* drive a browser at finalize (see the module note above). */
|
|
177
|
+
export function draftFloorArgv(gardenRoot, outPath, budget, snapshotDirs, opts = {}) {
|
|
178
|
+
const pages = budget.pages !== null
|
|
179
|
+
? ['--pages', String(budget.pages), ...(budget.exact ? ['--exact'] : [])]
|
|
180
|
+
: ['--no-pages'];
|
|
181
|
+
const mode = opts.style === 'web' ? ['--mode', 'screen', '--min-font-pt', '0'] : [];
|
|
182
|
+
return [
|
|
183
|
+
join(gardenRoot, DRAFT_LAUNCHER_SCRIPT),
|
|
184
|
+
'run',
|
|
185
|
+
DRAFT_SELF_CHECK_SCRIPT,
|
|
186
|
+
outPath,
|
|
187
|
+
...pages,
|
|
188
|
+
...mode,
|
|
189
|
+
...snapshotDirs.flatMap((d) => ['--repo', d]),
|
|
190
|
+
'--json',
|
|
191
|
+
];
|
|
192
|
+
}
|
|
193
|
+
/** The count of each finding kind, as a readable list ("6 uncited-number, 1 placeholder"). */
|
|
194
|
+
function kindList(byKind) {
|
|
195
|
+
if (typeof byKind !== 'object' || byKind === null)
|
|
196
|
+
return '';
|
|
197
|
+
return Object.entries(byKind)
|
|
198
|
+
.filter(([, v]) => typeof v === 'number')
|
|
199
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
200
|
+
.map(([k, v]) => `${String(v)} ${k}`)
|
|
201
|
+
.join(', ');
|
|
202
|
+
}
|
|
203
|
+
/** A check record with a boolean `ok` — the shape the floor judges. `null` for anything else. */
|
|
204
|
+
function checkRecord(value) {
|
|
205
|
+
if (typeof value !== 'object' || value === null)
|
|
206
|
+
return null;
|
|
207
|
+
return typeof value.ok === 'boolean' ? value : null;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* The verdict, from the self-check's own `--json` report (pure — this is what the tests pin).
|
|
211
|
+
*
|
|
212
|
+
* `claims` and `contrast` are deterministic over the file alone, so their failure IS a breach.
|
|
213
|
+
* `pages` is only a breach when the count already exceeds the budget (see the module note): a
|
|
214
|
+
* count below an `--exact` budget is unproven without a render and is reported as unverified.
|
|
215
|
+
*
|
|
216
|
+
* The report's SHAPE is judged first (codex review): a report whose `checks.claims` /
|
|
217
|
+
* `checks.contrast` are missing or carry no boolean `ok` is not this floor's report — a schema
|
|
218
|
+
* drift, or another program's output — and answers `unavailable`, never `pass`. And a report that
|
|
219
|
+
* declares itself FAILED for a reason this floor does not recognise is a breach in its own right:
|
|
220
|
+
* the floor reports the check's own `failed` list rather than passing a document the check refused.
|
|
221
|
+
*/
|
|
222
|
+
export function draftFloorVerdict(report, budget) {
|
|
223
|
+
if (typeof report !== 'object' || report === null) {
|
|
224
|
+
return {
|
|
225
|
+
verdict: 'unavailable',
|
|
226
|
+
breaches: [],
|
|
227
|
+
summary: 'the draft floor could not be re-derived: the self-check printed no report',
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
const rep = report;
|
|
231
|
+
const checks = rep.checks;
|
|
232
|
+
if (typeof checks !== 'object' ||
|
|
233
|
+
checks === null ||
|
|
234
|
+
checkRecord(checks.claims) === null ||
|
|
235
|
+
checkRecord(checks.contrast) === null) {
|
|
236
|
+
return {
|
|
237
|
+
verdict: 'unavailable',
|
|
238
|
+
breaches: [],
|
|
239
|
+
summary: `the draft floor could not be re-derived: ${DRAFT_SELF_CHECK_SCRIPT} answered JSON that is not its ` +
|
|
240
|
+
`report (no checks.claims / checks.contrast verdict) — the floor judges nothing it cannot read`,
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
const claims = rep.checks?.claims;
|
|
244
|
+
const contrast = rep.checks?.contrast;
|
|
245
|
+
const pages = rep.checks?.pages;
|
|
246
|
+
const breaches = [];
|
|
247
|
+
if (claims?.ok === false) {
|
|
248
|
+
const kinds = kindList(claims.by_kind);
|
|
249
|
+
breaches.push(`claims: ${kinds !== '' ? kinds : 'findings'} — every number, URL and product claim must be cited ` +
|
|
250
|
+
`(data-source path:line), every mock visibly labelled, and no placeholder copy may ship`);
|
|
251
|
+
}
|
|
252
|
+
if (contrast?.ok === false) {
|
|
253
|
+
const fails = typeof contrast.contrast_failures === 'number' ? contrast.contrast_failures : 0;
|
|
254
|
+
const sizes = typeof contrast.size_failures === 'number' ? contrast.size_failures : 0;
|
|
255
|
+
breaches.push(`contrast: ${fails} text/background pair(s) below the 4.5:1 floor and ${sizes} below the print size floor — ` +
|
|
256
|
+
`the reader must be able to read it`);
|
|
257
|
+
}
|
|
258
|
+
const count = typeof pages?.pages === 'number' ? pages.pages : null;
|
|
259
|
+
const pagesUnverified = pages !== undefined && pages.verified === false;
|
|
260
|
+
if (budget.pages !== null && count !== null && count > budget.pages) {
|
|
261
|
+
breaches.push(`pages: the brief's budget is ${budget.pages} printed page(s)${budget.exact ? ' exactly' : ' at most'} and the ` +
|
|
262
|
+
`document already declares ${count} — a page-size/count breach (the count is a lower bound: it cannot see a ` +
|
|
263
|
+
`wrapper that overflows its sheet)`);
|
|
264
|
+
}
|
|
265
|
+
// The check refused the document for a reason this floor does not know how to name: report the
|
|
266
|
+
// refusal as the check stated it, never a pass (codex review).
|
|
267
|
+
if (breaches.length === 0 && rep.verdict === 'FAIL') {
|
|
268
|
+
const failed = Array.isArray(rep.failed) ? rep.failed.filter((f) => typeof f === 'string') : [];
|
|
269
|
+
breaches.push(`the self-check reports FAIL on ${failed.length > 0 ? failed.join(', ') : 'a floor this check names'} — ` +
|
|
270
|
+
`a verdict this floor cannot attribute to one rule, so the document is not published on it`);
|
|
271
|
+
}
|
|
272
|
+
if (breaches.length > 0) {
|
|
273
|
+
return {
|
|
274
|
+
verdict: 'fail',
|
|
275
|
+
breaches,
|
|
276
|
+
summary: `the draft floor FAILED on the saved document: ${breaches.length} breach(es) — ${breaches.join(' | ')}`,
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
if (pagesUnverified) {
|
|
280
|
+
return {
|
|
281
|
+
verdict: 'unverified',
|
|
282
|
+
breaches: [],
|
|
283
|
+
summary: `the draft floor met every rule it could judge; the page count is UNVERIFIED without a render ` +
|
|
284
|
+
`(${typeof pages?.summary === 'string' ? pages.summary : 'structural estimate only'})`,
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
return { verdict: 'pass', breaches: [], summary: 'the draft floor met every rule on the saved document' };
|
|
288
|
+
}
|
|
289
|
+
/** Where the live wicked-garden plugin is, or null when nothing is installed / discovery refused
|
|
290
|
+
* (a symlink below a config dir). The same source the daemon's skills runtime publishes from. */
|
|
291
|
+
export function gardenPluginRoot() {
|
|
292
|
+
try {
|
|
293
|
+
return discoverLivePlugin()?.path ?? null;
|
|
294
|
+
}
|
|
295
|
+
catch {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
function runNode(argv, timeoutMs) {
|
|
300
|
+
return new Promise((resolvePromise, reject) => {
|
|
301
|
+
// The child's env goes through `childEnvWithBootEstateDb` like every other spawn in src/
|
|
302
|
+
// (crew#495, `tests/governance-child-env.test.ts`): a daemon-exported governance store must
|
|
303
|
+
// not reach the self-check's Python.
|
|
304
|
+
const child = spawn(process.execPath, argv, {
|
|
305
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
306
|
+
timeout: timeoutMs,
|
|
307
|
+
env: childEnvWithBootEstateDb(),
|
|
308
|
+
});
|
|
309
|
+
let stdout = '';
|
|
310
|
+
child.stdout?.on('data', (d) => {
|
|
311
|
+
stdout += d.toString();
|
|
312
|
+
});
|
|
313
|
+
child.stderr?.resume(); // drained, never buffered: the JSON report is on stdout
|
|
314
|
+
child.on('error', reject);
|
|
315
|
+
child.on('close', (code) => resolvePromise({ stdout, code }));
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Re-derive the draft floor on the SAVED document: run the skill's own self-check and judge its
|
|
320
|
+
* report ({@link draftFloorVerdict}). Never throws — a floor that cannot run answers
|
|
321
|
+
* `unavailable` with the reason, because a broken check must not read as a pass and must not take
|
|
322
|
+
* document generation down with it.
|
|
323
|
+
*/
|
|
324
|
+
export async function runDraftFloor(outPath, budget, snapshotDirs, opts = {}, io = {}) {
|
|
325
|
+
const root = (io.gardenRoot ?? gardenPluginRoot)();
|
|
326
|
+
if (root === null) {
|
|
327
|
+
return {
|
|
328
|
+
verdict: 'unavailable',
|
|
329
|
+
breaches: [],
|
|
330
|
+
summary: 'the draft floor could not be re-derived: no installed wicked-garden plugin root was found, so ' +
|
|
331
|
+
`${DRAFT_SELF_CHECK_SCRIPT} could not be run (install wicked-garden, or set WICKED_CREW_SKILLS_SOURCE)`,
|
|
332
|
+
};
|
|
333
|
+
}
|
|
334
|
+
const argv = draftFloorArgv(root, outPath, budget, snapshotDirs, opts);
|
|
335
|
+
let answer;
|
|
336
|
+
try {
|
|
337
|
+
answer = await (io.run ?? runNode)(argv, io.timeoutMs ?? DRAFT_FLOOR_TIMEOUT_MS);
|
|
338
|
+
}
|
|
339
|
+
catch (err) {
|
|
340
|
+
return {
|
|
341
|
+
verdict: 'unavailable',
|
|
342
|
+
breaches: [],
|
|
343
|
+
summary: `the draft floor could not be re-derived: ${err instanceof Error ? err.message : String(err)}`,
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
let report;
|
|
347
|
+
try {
|
|
348
|
+
report = JSON.parse(answer.stdout.trim());
|
|
349
|
+
}
|
|
350
|
+
catch {
|
|
351
|
+
return {
|
|
352
|
+
verdict: 'unavailable',
|
|
353
|
+
breaches: [],
|
|
354
|
+
summary: `the draft floor could not be re-derived: ${DRAFT_SELF_CHECK_SCRIPT} exited ${String(answer.code)} without a ` +
|
|
355
|
+
`JSON report (is Python 3 installed for the wicked-garden launcher?)`,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
return draftFloorVerdict(report, budget);
|
|
359
|
+
}
|
|
127
360
|
//# sourceMappingURL=draft-skill.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draft-skill.js","sourceRoot":"","sources":["../../src/interactive/draft-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAIH,gHAAgH;AAChH,MAAM,CAAC,MAAM,WAAW,GAAG,qBAAqB,CAAC;AACjD,qDAAqD;AACrD,MAAM,CAAC,MAAM,0BAA0B,GAAG,SAAS,CAAC;AAKpD;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,GAAgB,EAAE,IAAa;IAC5D,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,CAAC;IACtB,OAAO;QACL,GAAG,GAAG;Q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|
|
@@ -40,9 +40,6 @@ export declare const FEEDBACK_PROCESSED = "wicked.interactive.feedback.processed
|
|
|
40
40
|
export declare const EDIT_COMPLETED = "wicked.interactive.edit.completed";
|
|
41
41
|
/** Exact-type filter with a domain guard — no wildcard, one event type is the whole trigger. */
|
|
42
42
|
export declare const INTERACTIVE_EDIT_BUS_FILTER = "wicked.interactive.feedback.processed@wicked-interactive";
|
|
43
|
-
/** Dedicated durable-cursor identity — NOT the draft seam's, so the two interactive seams
|
|
44
|
-
* advance independent cursors and stopping one never strands the other. */
|
|
45
|
-
export declare const INTERACTIVE_EDIT_BUS_PLUGIN = "wicked-crew-interactive-edit";
|
|
46
43
|
export declare const INTERACTIVE_EDIT_WORKFLOW = "interactive-edit";
|
|
47
44
|
/**
|
|
48
45
|
* The governed workflow that fulfils a structural handoff. ONE agent phase — `edit` (build,
|
|
@@ -131,8 +128,7 @@ export interface EditCollection {
|
|
|
131
128
|
export declare function collectEditResults(items: HandoffFileItem[]): EditCollection;
|
|
132
129
|
/** Options for {@link startInteractiveEditSubscriber}. */
|
|
133
130
|
export interface InteractiveEditOptions {
|
|
134
|
-
/**
|
|
135
|
-
* (honors `WICKED_BUS_DATA_DIR`) — where interactive's service emits unless redirected. */
|
|
131
|
+
/** The bus db the daemon handed its engine (core/bus.ts); without one the seam does not arm. */
|
|
136
132
|
dbPath?: string;
|
|
137
133
|
/** Poll cadence, ms (default 2000; tests shorten it). */
|
|
138
134
|
pollIntervalMs?: number;
|
|
@@ -168,15 +164,6 @@ export interface InteractiveEditOptions {
|
|
|
168
164
|
* (`WICKED_INTERACTIVE_ROOT` › `~/wicked-interactive/docs`); the server wires the
|
|
169
165
|
* per-project `interactiveRoot` setting through here. */
|
|
170
166
|
resolveDocsRoot?: (projectId: string | undefined) => string;
|
|
171
|
-
/** Is the DEMO seam actually armed in this process? Probed per event (the demo seam arms
|
|
172
|
-
* after this one, and can fail to arm at all — bus missing, workflow registration refused).
|
|
173
|
-
* The kind gate above hands demo docs to that seam; when it is NOT there, handing off is
|
|
174
|
-
* handing off to NOBODY — the canvas would sit on a handoff no seam ever answers and no
|
|
175
|
-
* status ever closes. So an un-armed demo seam turns the silent skip into an honest error
|
|
176
|
-
* status (see `handleFeedbackProcessed`). Default: `() => false` — a caller that does not
|
|
177
|
-
* wire the probe has no demo seam to hand anything to, and saying so out loud beats
|
|
178
|
-
* guessing. */
|
|
179
|
-
demoSeamArmed?: () => boolean;
|
|
180
167
|
/** Called after a launch that FILED the run into a project (the handoff carried
|
|
181
168
|
* `project_id`). The server wires this to the same post-commit half the launch route
|
|
182
169
|
* performs: tag the run in the live membership index + emit `wicked.crew.membership.attached`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"edit-events.d.ts","sourceRoot":"","sources":["../../src/interactive/edit-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;
|
|
1
|
+
{"version":3,"file":"edit-events.d.ts","sourceRoot":"","sources":["../../src/interactive/edit-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAKH,OAAO,EAQL,KAAK,YAAY,EAIlB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAsE,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAKtH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,KAAK,EAA6B,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAa/E,eAAO,MAAM,kBAAkB,0CAA0C,CAAC;AAC1E,eAAO,MAAM,cAAc,sCAAsC,CAAC;AAElE,gGAAgG;AAChG,eAAO,MAAM,2BAA2B,6DAAgD,CAAC;AAIzF,eAAO,MAAM,yBAAyB,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,6BAA6B,EAAE,WAoB3C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C;AACzC,MAAM,WAAW,2BAA2B;IAC1C,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;IAC7B,gDAAgD;IAChD,MAAM,EAAE,wBAAwB,CAAC;IACjC;oGACgG;IAChG,YAAY,IAAI,MAAM,EAAE,CAAC;CAC1B;AA2CD;;;;;;;;GAQG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,WAAW,EACpB,IAAI,GAAE,sBAA2B,GAChC,OAAO,CAAC,2BAA2B,GAAG,IAAI,CAAC,CAmf7C"}
|
|
@@ -39,18 +39,16 @@ import { InteractiveHandoffLedger } from './ledger.js';
|
|
|
39
39
|
import { DRAFT_SKILL, draftQualityClause, draftSkillArmLine, withDraftSkill } from './draft-skill.js';
|
|
40
40
|
import { crewStateHome } from '../projects/state-home.js';
|
|
41
41
|
import { resolveProjectGraphBinding } from '../projects/graph.js';
|
|
42
|
-
import { readDocHead } from './chat-events.js';
|
|
42
|
+
import { DEMO_DOC_MOVED_MESSAGE, readDocHead } from './chat-events.js';
|
|
43
43
|
import { resolveInteractiveRoot } from './bridge-root.js';
|
|
44
|
-
import { acpFallbackLine,
|
|
44
|
+
import { acpFallbackLine, ungatedGateNote, unitDistributedLine, workerToolCallDeniedLine, } from './council-outcome.js';
|
|
45
45
|
import { busSubscriberErrorReporter } from './bus-subscriber-errors.js';
|
|
46
|
+
import { emitOnBus, requireEngineBus, tapBus } from '../core/bus.js';
|
|
46
47
|
// ── Vocabulary constants (interactive's, verbatim — src/service/events.js is the truth) ──────
|
|
47
48
|
export const FEEDBACK_PROCESSED = 'wicked.interactive.feedback.processed';
|
|
48
49
|
export const EDIT_COMPLETED = 'wicked.interactive.edit.completed';
|
|
49
50
|
/** Exact-type filter with a domain guard — no wildcard, one event type is the whole trigger. */
|
|
50
51
|
export const INTERACTIVE_EDIT_BUS_FILTER = `${FEEDBACK_PROCESSED}@${INTERACTIVE_DOMAIN}`;
|
|
51
|
-
/** Dedicated durable-cursor identity — NOT the draft seam's, so the two interactive seams
|
|
52
|
-
* advance independent cursors and stopping one never strands the other. */
|
|
53
|
-
export const INTERACTIVE_EDIT_BUS_PLUGIN = 'wicked-crew-interactive-edit';
|
|
54
52
|
// ── The workflow (workflows-as-data) ─────────────────────────────────────────────────────────
|
|
55
53
|
export const INTERACTIVE_EDIT_WORKFLOW = 'interactive-edit';
|
|
56
54
|
/**
|
|
@@ -71,7 +69,6 @@ export const INTERACTIVE_EDIT_WORKFLOW = 'interactive-edit';
|
|
|
71
69
|
*/
|
|
72
70
|
export const INTERACTIVE_EDIT_WORKFLOW_DEF = {
|
|
73
71
|
id: INTERACTIVE_EDIT_WORKFLOW,
|
|
74
|
-
is_system: true,
|
|
75
72
|
phases: [
|
|
76
73
|
{
|
|
77
74
|
id: 'edit',
|
|
@@ -248,22 +245,14 @@ function rosterOf(adapter, roster) {
|
|
|
248
245
|
export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
249
246
|
const log = opts.log ?? ((m) => console.error(m));
|
|
250
247
|
let draftSkillHeld = false; // set at arm time (draft-skill.ts); read at launch for the task clause
|
|
251
|
-
|
|
248
|
+
// This seam reads and writes the bus through the engine that holds it (wicked-core#631,
|
|
249
|
+
// core/bus.ts). Checked here so a bus no engine holds disables the seam before anything is armed.
|
|
250
|
+
let busDbPath;
|
|
252
251
|
try {
|
|
253
|
-
|
|
252
|
+
busDbPath = requireEngineBus(opts.dbPath);
|
|
254
253
|
}
|
|
255
254
|
catch (err) {
|
|
256
|
-
log(`[interactive-edit]
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
let db;
|
|
260
|
-
let config;
|
|
261
|
-
try {
|
|
262
|
-
config = bus.loadConfig(opts.dbPath !== undefined ? { db_path: opts.dbPath } : {});
|
|
263
|
-
db = bus.openDb(opts.dbPath !== undefined ? { db_path: opts.dbPath } : {});
|
|
264
|
-
}
|
|
265
|
-
catch (err) {
|
|
266
|
-
log(`[interactive-edit] could not open the bus db${opts.dbPath !== undefined ? ` at ${opts.dbPath}` : ''} — governed structural edits disabled: ${err instanceof Error ? err.message : String(err)}`);
|
|
255
|
+
log(`[interactive-edit] has no bus${opts.dbPath !== undefined ? ` at ${opts.dbPath}` : ''} — governed structural edits disabled: ${err instanceof Error ? err.message : String(err)}`);
|
|
267
256
|
return null;
|
|
268
257
|
}
|
|
269
258
|
// The workflow rides the normal registration path — core validates the def BEFORE it is
|
|
@@ -291,10 +280,10 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
291
280
|
const inFlight = new Map(); // runId → live state
|
|
292
281
|
/** Emit onto interactive's vocabulary as the `wi-crew` producer. Never throws into the
|
|
293
282
|
* caller: narration/announce failures are logged — a lost status line must not kill the
|
|
294
|
-
* subscription, and a duplicate edit emit (
|
|
295
|
-
function emitInteractive(type, payload, idempotencyKey) {
|
|
283
|
+
* subscription, and a duplicate edit emit (its key already on the bus) is the idempotency key WORKING. */
|
|
284
|
+
async function emitInteractive(type, payload, idempotencyKey) {
|
|
296
285
|
try {
|
|
297
|
-
|
|
286
|
+
await emitOnBus(busDbPath, {
|
|
298
287
|
event_type: type,
|
|
299
288
|
domain: INTERACTIVE_DOMAIN,
|
|
300
289
|
subdomain: type === EDIT_COMPLETED ? 'feedback' : 'status',
|
|
@@ -305,11 +294,6 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
305
294
|
return true;
|
|
306
295
|
}
|
|
307
296
|
catch (err) {
|
|
308
|
-
const code = err.error;
|
|
309
|
-
if (code === 'WB-002') {
|
|
310
|
-
// Duplicate idempotency key — the emit already happened (redelivery race). Success.
|
|
311
|
-
return true;
|
|
312
|
-
}
|
|
313
297
|
log(`[interactive-edit] emit ${type} failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
314
298
|
return false;
|
|
315
299
|
}
|
|
@@ -372,11 +356,9 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
372
356
|
if (event.type === 'unitDistributed') {
|
|
373
357
|
if (isFloorOrd(event))
|
|
374
358
|
return;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
// Honest about a council that held on a fraction of its seats (F-4R2-007).
|
|
379
|
-
narrate(flight, `Council picked ${who} to rework ${blocks}${pct}${councilOutcomeSuffix(event)}…`);
|
|
359
|
+
// One helper narrates the frame by `routingMethod` (S5 `teamed` = "Routed …", a recorded
|
|
360
|
+
// council = "Council picked …" honest about its benched seats, F-4R2-007).
|
|
361
|
+
narrate(flight, unitDistributedLine(event, `to rework ${blocks}`));
|
|
380
362
|
return;
|
|
381
363
|
}
|
|
382
364
|
if (event.type === 'unitDispatched') {
|
|
@@ -427,7 +409,8 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
427
409
|
}
|
|
428
410
|
if (event.type === 'sessionCompleted') {
|
|
429
411
|
endFlight(runId);
|
|
430
|
-
|
|
412
|
+
// The announce awaits the bus writer; a throw is logged, as a synchronous one was.
|
|
413
|
+
finalize(flight, runId).catch((err) => log(`[interactive-edit] finalizing run ${runId} failed: ${err instanceof Error ? err.message : String(err)}`));
|
|
431
414
|
return;
|
|
432
415
|
}
|
|
433
416
|
if (event.type === 'stepFailed') {
|
|
@@ -451,7 +434,7 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
451
434
|
log(`[interactive-edit] run ${runId} for handoff ${flight.key} ended: ${event.type}`);
|
|
452
435
|
}
|
|
453
436
|
});
|
|
454
|
-
function finalize(flight, runId) {
|
|
437
|
+
async function finalize(flight, runId) {
|
|
455
438
|
const { documentId, projectId, version, key, items } = flight;
|
|
456
439
|
// The deterministic pre-emit self-check (INV-2 at scale): a violating fragment would be
|
|
457
440
|
// rejected SILENTLY by the service (regenerate.js Inv2Error) — the user's edit would just
|
|
@@ -471,10 +454,10 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
471
454
|
return;
|
|
472
455
|
}
|
|
473
456
|
// Announce with the handoff's version (the parent the service forks from) and the
|
|
474
|
-
// deterministic doc+version key — a re-announce is a
|
|
475
|
-
const emitted = emitInteractive(EDIT_COMPLETED, { ...docScope(documentId, projectId), version, results }, editIdempotencyKey(documentId, version));
|
|
457
|
+
// deterministic doc+version key — a re-announce is a no-op (the key resolves to the existing row).
|
|
458
|
+
const emitted = await emitInteractive(EDIT_COMPLETED, { ...docScope(documentId, projectId), version, results }, editIdempotencyKey(documentId, version));
|
|
476
459
|
if (!emitted) {
|
|
477
|
-
// The bus refused the announce
|
|
460
|
+
// The bus refused the announce: the edit exists on disk but never reached
|
|
478
461
|
// the service. Fail HONEST — leaving the ledger row launched-but-never-closed would
|
|
479
462
|
// silently eat every replay of this handoff (the launch gate is `ledger.has`).
|
|
480
463
|
ledger.recordFailure(key);
|
|
@@ -501,37 +484,24 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
501
484
|
const handoff = parseStructuralFeedback(event.event_type, event.payload);
|
|
502
485
|
if (handoff === null)
|
|
503
486
|
return;
|
|
504
|
-
// THE KIND GATE (CREW-UX-9): the frame carries no `kind`, so the doc's own manifest is
|
|
505
|
-
//
|
|
506
|
-
//
|
|
507
|
-
//
|
|
508
|
-
//
|
|
509
|
-
//
|
|
487
|
+
// THE KIND GATE (CREW-UX-9): the frame carries no `kind`, so the doc's own manifest is the
|
|
488
|
+
// truth. A demo doc's step feedback means "re-author the demo and re-record" — answering it
|
|
489
|
+
// here would land a storyboard-text edit the next re-record overwrites. Demos are made by the
|
|
490
|
+
// Demo experience's `demo` preset now (studio#373, M9b), which re-records a chapter at its own
|
|
491
|
+
// review gate; a demo DOCUMENT has no answerer, so the handoff is declined with an honest error
|
|
492
|
+
// status rather than dropped. Fail-open on an unreadable manifest: this seam's old behaviour.
|
|
510
493
|
const docsRoot = (opts.resolveDocsRoot ?? (() => resolveInteractiveRoot(null)))(handoff.projectId);
|
|
511
494
|
const head = readDocHead(docsRoot, handoff.documentId);
|
|
512
495
|
if (head !== null && head.kind === 'demo') {
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
`this daemon. Nothing was changed. Start crew with the interactive demo events ` +
|
|
523
|
-
`enabled (drop --no-interactive-demo-events / WICKED_INTERACTIVE_DEMO_EVENTS), then ` +
|
|
524
|
-
`resubmit this feedback.`,
|
|
525
|
-
});
|
|
526
|
-
// DELIBERATELY no ledger row: this handoff was NOT answered, it was declined. An
|
|
527
|
-
// operator who arms the demo seam and replays the frame must get a real re-author run,
|
|
528
|
-
// and the launch gate is `ledger.has` — a row here would eat that replay forever.
|
|
529
|
-
log(`[interactive-edit] doc ${handoff.documentId} is a demo but the demo seam is NOT armed ` +
|
|
530
|
-
`— handoff v${handoff.version} answered with an honest error status, not silently dropped`);
|
|
531
|
-
return;
|
|
532
|
-
}
|
|
533
|
-
log(`[interactive-edit] doc ${handoff.documentId} is a demo — its step feedback re-authors ` +
|
|
534
|
-
`the spec (demo seam), not the storyboard; handoff v${handoff.version} skipped here`);
|
|
496
|
+
emitStatus({
|
|
497
|
+
...docScope(handoff.documentId, handoff.projectId),
|
|
498
|
+
version: handoff.version,
|
|
499
|
+
state: 'error',
|
|
500
|
+
message: DEMO_DOC_MOVED_MESSAGE,
|
|
501
|
+
});
|
|
502
|
+
// DELIBERATELY no ledger row: this handoff was NOT answered, it was declined.
|
|
503
|
+
log(`[interactive-edit] doc ${handoff.documentId} is a demo document — handoff v${handoff.version} ` +
|
|
504
|
+
`declined with an honest error status (demos are made in the Demo experience)`);
|
|
535
505
|
return;
|
|
536
506
|
}
|
|
537
507
|
const key = handoffKey(handoff.documentId, handoff.version);
|
|
@@ -673,17 +643,14 @@ export async function startInteractiveEditSubscriber(adapter, opts = {}) {
|
|
|
673
643
|
inFlight.set(runId, flight);
|
|
674
644
|
log(`[interactive-edit] handoff ${key} → governed run ${runId} (${items.length} item(s), handoff ${handoffPath})`);
|
|
675
645
|
}
|
|
676
|
-
const sub =
|
|
677
|
-
|
|
678
|
-
plugin: INTERACTIVE_EDIT_BUS_PLUGIN,
|
|
646
|
+
const sub = await tapBus({
|
|
647
|
+
dbPath: busDbPath,
|
|
679
648
|
filter: INTERACTIVE_EDIT_BUS_FILTER,
|
|
680
649
|
// Live triggers only: replaying a bus backlog would answer handoffs whose edits the assist
|
|
681
650
|
// loop long since produced. History reconciliation belongs to the state plane, not here.
|
|
682
|
-
cursor_init: 'latest',
|
|
683
651
|
pollIntervalMs: opts.pollIntervalMs ?? 2000,
|
|
684
652
|
// Our own ledger + idempotency key are the dedupe; a bus-level retry of a failed launch
|
|
685
653
|
// would double-launch precisely because the ledger row is only written on success.
|
|
686
|
-
maxRetries: 0,
|
|
687
654
|
handler: (event) => handleFeedbackProcessed(event),
|
|
688
655
|
onError: busSubscriberErrorReporter({
|
|
689
656
|
describe: (err, event) => `[interactive-edit] handler error on event ${String(event?.event_id ?? '?')}: ${err.message}`,
|