@skrr-ai/cli 0.1.118 → 0.1.120
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/base-command.d.ts +32 -0
- package/dist/base-command.js +113 -5
- package/dist/commands/commands.js +11 -0
- package/dist/commands/commitments/action-proposal.d.ts +13 -0
- package/dist/commands/commitments/action-proposal.js +39 -0
- package/dist/commands/commitments/action-proposals/decide.js +8 -1
- package/dist/commands/commitments/action-proposals/execute.js +11 -1
- package/dist/commands/commitments/create.js +2 -2
- package/dist/commands/commitments/doctor.d.ts +8 -0
- package/dist/commands/commitments/doctor.js +22 -0
- package/dist/commands/commitments/execute-remediation.js +12 -1
- package/dist/commands/commitments/observations.js +2 -2
- package/dist/commands/commitments/pack/bind.d.ts +18 -1
- package/dist/commands/commitments/pack/bind.js +66 -8
- package/dist/commands/commitments/pack/plan.d.ts +4 -1
- package/dist/commands/commitments/pack/plan.js +30 -2
- package/dist/commands/commitments/update.js +8 -2
- package/dist/commands/completion/index.js +1 -1
- package/dist/commands/completion/values.js +1 -1
- package/dist/commands/computer-use/audio.d.ts +1 -0
- package/dist/commands/computer-use/audio.js +1 -0
- package/dist/commands/computer-use/browser.d.ts +1 -0
- package/dist/commands/computer-use/browser.js +1 -0
- package/dist/commands/computer-use/disable.d.ts +1 -0
- package/dist/commands/computer-use/disable.js +1 -0
- package/dist/commands/computer-use/enable.d.ts +1 -0
- package/dist/commands/computer-use/enable.js +1 -0
- package/dist/commands/computer-use/index.d.ts +1 -0
- package/dist/commands/computer-use/index.js +1 -0
- package/dist/commands/computer-use/install.d.ts +1 -0
- package/dist/commands/computer-use/install.js +1 -0
- package/dist/commands/computer-use/recover.d.ts +1 -0
- package/dist/commands/computer-use/recover.js +1 -0
- package/dist/commands/computer-use/status.d.ts +1 -0
- package/dist/commands/computer-use/status.js +1 -0
- package/dist/commands/computer-use/stop.d.ts +1 -0
- package/dist/commands/computer-use/stop.js +1 -0
- package/dist/commands/context.js +16 -11
- package/dist/commands/convos/recovery.js +1 -1
- package/dist/commands/daemon/diagnostics.d.ts +9 -0
- package/dist/commands/daemon/diagnostics.js +53 -0
- package/dist/commands/daemon/index.js +2 -0
- package/dist/commands/daemon/maintenance/attest.d.ts +15 -0
- package/dist/commands/daemon/maintenance/attest.js +52 -0
- package/dist/commands/daemon/maintenance/hold.d.ts +17 -0
- package/dist/commands/daemon/maintenance/hold.js +70 -0
- package/dist/commands/daemon/maintenance/index.d.ts +12 -0
- package/dist/commands/daemon/maintenance/index.js +30 -0
- package/dist/commands/daemon/maintenance/resume.d.ts +13 -0
- package/dist/commands/daemon/maintenance/resume.js +36 -0
- package/dist/commands/daemon/maintenance/status.d.ts +13 -0
- package/dist/commands/daemon/maintenance/status.js +36 -0
- package/dist/commands/doctor.d.ts +4 -1
- package/dist/commands/doctor.js +50 -6
- package/dist/commands/followups/plans/cancel-batch.js +6 -3
- package/dist/commands/followups/plans/capacity.js +7 -3
- package/dist/commands/followups/plans/observability.js +11 -3
- package/dist/commands/followups/plans/preferences/set.js +26 -8
- package/dist/commands/followups/plans/preferences.js +1 -1
- package/dist/commands/followups/plans/show.js +1 -1
- package/dist/commands/goals/key-results/assess.d.ts +36 -0
- package/dist/commands/goals/key-results/assess.js +110 -0
- package/dist/commands/goals/key-results/history.d.ts +30 -0
- package/dist/commands/goals/key-results/history.js +104 -0
- package/dist/commands/goals/key-results/list.d.ts +5 -4
- package/dist/commands/goals/key-results/list.js +12 -6
- package/dist/commands/goals/key-results/show.d.ts +4 -2
- package/dist/commands/goals/key-results/show.js +25 -4
- package/dist/commands/goals/key-results/update.d.ts +4 -0
- package/dist/commands/goals/key-results/update.js +18 -24
- package/dist/commands/goals/plan-now.js +12 -1
- package/dist/commands/goals/planner-compare.d.ts +30 -0
- package/dist/commands/goals/planner-compare.js +136 -0
- package/dist/commands/machines/dedicated/service/exec.d.ts +3 -0
- package/dist/commands/machines/dedicated/service/exec.js +70 -11
- package/dist/commands/machines/hosted/destroy.d.ts +1 -0
- package/dist/commands/machines/hosted/destroy.js +11 -1
- package/dist/commands/machines/hosted/exec.d.ts +1 -0
- package/dist/commands/machines/hosted/exec.js +12 -1
- package/dist/commands/machines/hosted/index.js +1 -0
- package/dist/commands/machines/hosted/operation.d.ts +14 -0
- package/dist/commands/machines/hosted/operation.js +51 -0
- package/dist/commands/machines/hosted/pull.js +1 -1
- package/dist/commands/machines/hosted/start.js +6 -2
- package/dist/commands/memory/versions/list.d.ts +2 -0
- package/dist/commands/memory/versions/list.js +3 -2
- package/dist/commands/memory/versions/show.d.ts +2 -0
- package/dist/commands/memory/versions/show.js +3 -2
- package/dist/commands/spaces/auto-executor/compare.d.ts +18 -0
- package/dist/commands/spaces/auto-executor/compare.js +139 -0
- package/dist/commands/spaces/auto-executor/runs.d.ts +3 -0
- package/dist/commands/spaces/auto-executor/runs.js +13 -1
- package/dist/commands/spaces/charter/create-from-description.d.ts +21 -0
- package/dist/commands/spaces/charter/create-from-description.js +77 -0
- package/dist/commands/spaces/charter/show.d.ts +22 -0
- package/dist/commands/spaces/charter/show.js +61 -0
- package/dist/commands/spaces/heartbeats/list.d.ts +1 -16
- package/dist/commands/spaces/heartbeats/list.js +13 -0
- package/dist/commands/spaces/install-template.js +3 -0
- package/dist/commands/spaces/loops/migrate.d.ts +32 -0
- package/dist/commands/spaces/loops/migrate.js +103 -0
- package/dist/commands/spaces/loops/release.d.ts +14 -0
- package/dist/commands/spaces/loops/release.js +59 -0
- package/dist/commands/spaces/notebook.d.ts +25 -0
- package/dist/commands/spaces/notebook.js +75 -0
- package/dist/commands/spaces/proposals/discard.d.ts +17 -0
- package/dist/commands/spaces/proposals/discard.js +17 -0
- package/dist/commands/spaces/proposals/keep.d.ts +17 -0
- package/dist/commands/spaces/proposals/keep.js +17 -0
- package/dist/commands/spaces/proposals/list.d.ts +24 -0
- package/dist/commands/spaces/proposals/list.js +89 -0
- package/dist/commands/spaces/skills/propose.d.ts +29 -0
- package/dist/commands/spaces/skills/propose.js +82 -0
- package/dist/commands/spaces/templates/fork.js +3 -0
- package/dist/commands/spaces/triggers/show.js +6 -0
- package/dist/commands/spaces/workflows/retry.d.ts +1 -0
- package/dist/commands/spaces/workflows/retry.js +8 -1
- package/dist/commands/spaces/workflows/triggers/create.js +3 -2
- package/dist/commands/spaces/workflows/triggers/fire.js +4 -0
- package/dist/commands/spaces/workflows/triggers/update.js +2 -1
- package/dist/commands/spaces/write-policy/set.d.ts +22 -0
- package/dist/commands/spaces/write-policy/set.js +82 -0
- package/dist/commands/spaces/write-policy/show.d.ts +19 -0
- package/dist/commands/spaces/write-policy/show.js +49 -0
- package/dist/commands/store/artifacts/receipt.d.ts +14 -0
- package/dist/commands/store/artifacts/receipt.js +34 -0
- package/dist/commands/store/artifacts/release.d.ts +2 -0
- package/dist/commands/store/artifacts/release.js +11 -0
- package/dist/commands/store/governance/publish-release.d.ts +2 -0
- package/dist/commands/store/governance/publish-release.js +30 -1
- package/dist/commands/store/governance/release-receipt.d.ts +12 -0
- package/dist/commands/store/governance/release-receipt.js +32 -0
- package/dist/commands/tasks/approvals/list.d.ts +11 -5
- package/dist/commands/tasks/approvals/list.js +13 -6
- package/dist/commands/tasks/attachments/facts.d.ts +12 -0
- package/dist/commands/tasks/attachments/facts.js +29 -0
- package/dist/commands/tasks/attachments/upload.d.ts +1 -0
- package/dist/commands/tasks/attachments/upload.js +16 -0
- package/dist/commands/tasks/bulk-update.js +35 -1
- package/dist/commands/tasks/context.d.ts +15 -0
- package/dist/commands/tasks/context.js +69 -0
- package/dist/commands/tasks/copy.d.ts +18 -0
- package/dist/commands/tasks/copy.js +85 -0
- package/dist/commands/tasks/create-tree.js +97 -23
- package/dist/commands/tasks/create.js +9 -1
- package/dist/commands/tasks/deliverable/add.js +20 -10
- package/dist/commands/tasks/move.js +8 -1
- package/dist/commands/tasks/operations/show.d.ts +16 -0
- package/dist/commands/tasks/operations/show.js +98 -0
- package/dist/commands/tasks/operations/wait.d.ts +22 -0
- package/dist/commands/tasks/operations/wait.js +114 -0
- package/dist/commands/tasks/preflight.d.ts +1 -0
- package/dist/commands/tasks/preflight.js +11 -1
- package/dist/commands/tasks/rearm-recurrence.js +4 -0
- package/dist/commands/tasks/result/show.js +22 -0
- package/dist/commands/tasks/result/submit.d.ts +1 -0
- package/dist/commands/tasks/result/submit.js +3 -0
- package/dist/commands/tasks/retry-receipt.d.ts +15 -0
- package/dist/commands/tasks/retry-receipt.js +89 -0
- package/dist/commands/tasks/retry-review.d.ts +16 -0
- package/dist/commands/tasks/retry-review.js +66 -0
- package/dist/commands/tasks/retry.d.ts +4 -8
- package/dist/commands/tasks/retry.js +34 -68
- package/dist/commands/tasks/runs.d.ts +21 -0
- package/dist/commands/tasks/runs.js +95 -0
- package/dist/commands/tasks/show.d.ts +2 -0
- package/dist/commands/tasks/show.js +15 -1
- package/dist/commands/tasks/start-receipt.d.ts +15 -0
- package/dist/commands/tasks/start-receipt.js +95 -0
- package/dist/commands/tasks/start.d.ts +4 -0
- package/dist/commands/tasks/start.js +49 -3
- package/dist/commands/tasks/update.js +3 -0
- package/dist/commands/tasks/upsert.js +17 -3
- package/dist/commands/tasks/watch.d.ts +3 -0
- package/dist/commands/tasks/watch.js +85 -20
- package/dist/commands/wiki/history.d.ts +33 -0
- package/dist/commands/wiki/history.js +134 -0
- package/dist/commands/wiki/ls.d.ts +2 -0
- package/dist/commands/wiki/ls.js +8 -0
- package/dist/commands/wiki/update.d.ts +3 -1
- package/dist/commands/wiki/update.js +24 -2
- package/dist/commands/wiki/write.d.ts +22 -0
- package/dist/commands/wiki/write.js +144 -6
- package/dist/generated/agent-guides.json +81 -81
- package/dist/generated/managed-instruction-guides.json +1 -1
- package/dist/lib/agent-guides.d.ts +9 -0
- package/dist/lib/agent-guides.js +23 -1
- package/dist/lib/agentic-stream.d.ts +5 -0
- package/dist/lib/agentic-stream.js +122 -3
- package/dist/lib/api-fetch.d.ts +4 -0
- package/dist/lib/api-fetch.js +25 -7
- package/dist/lib/auth-diagnostics.d.ts +39 -0
- package/dist/lib/auth-diagnostics.js +71 -0
- package/dist/lib/cli-client-identity.d.ts +6 -0
- package/dist/lib/cli-client-identity.js +16 -0
- package/dist/lib/cli-installation-diagnostics.d.ts +52 -0
- package/dist/lib/cli-installation-diagnostics.js +254 -0
- package/dist/lib/command-hygiene.d.ts +45 -0
- package/dist/lib/command-hygiene.js +413 -0
- package/dist/lib/commitments.d.ts +64 -3
- package/dist/lib/commitments.js +34 -6
- package/dist/lib/completion-index.d.ts +16 -4
- package/dist/lib/completion-index.js +50 -14
- package/dist/lib/config.js +7 -1
- package/dist/lib/daemon-maintenance-command.d.ts +22 -0
- package/dist/lib/daemon-maintenance-command.js +39 -0
- package/dist/lib/daemon-maintenance.d.ts +275 -0
- package/dist/lib/daemon-maintenance.js +1035 -0
- package/dist/lib/dedicated-service.d.ts +3 -2
- package/dist/lib/dedicated-service.js +11 -3
- package/dist/lib/governed-store.d.ts +8 -0
- package/dist/lib/governed-store.js +5 -0
- package/dist/lib/hosted-machines.d.ts +33 -2
- package/dist/lib/hosted-machines.js +19 -1
- package/dist/lib/json-output.d.ts +1 -1
- package/dist/lib/machines.d.ts +9 -1
- package/dist/lib/machines.js +15 -1
- package/dist/lib/memory-history-session.d.ts +14 -0
- package/dist/lib/memory-history-session.js +60 -0
- package/dist/lib/node-adapter.js +13 -0
- package/dist/lib/record-output.d.ts +22 -0
- package/dist/lib/record-output.js +78 -0
- package/dist/lib/roles.d.ts +3 -3
- package/dist/lib/scoped-memory-command.d.ts +24 -0
- package/dist/lib/scoped-memory-command.js +87 -5
- package/dist/lib/space-charter.d.ts +49 -0
- package/dist/lib/space-charter.js +78 -0
- package/dist/lib/space-loop-migration.d.ts +18 -0
- package/dist/lib/space-loop-migration.js +128 -0
- package/dist/lib/space-notebook.d.ts +22 -0
- package/dist/lib/space-notebook.js +140 -0
- package/dist/lib/space-proposal-decision-command.d.ts +36 -0
- package/dist/lib/space-proposal-decision-command.js +108 -0
- package/dist/lib/space-proposals.d.ts +44 -0
- package/dist/lib/space-proposals.js +186 -0
- package/dist/lib/space-templates.d.ts +8 -0
- package/dist/lib/space-templates.js +17 -0
- package/dist/lib/space-write-policy.d.ts +24 -0
- package/dist/lib/space-write-policy.js +103 -0
- package/dist/lib/task-agent-context-capabilities.d.ts +10 -0
- package/dist/lib/task-agent-context-capabilities.js +22 -0
- package/dist/lib/task-agent-context-compatibility.d.ts +9 -0
- package/dist/lib/task-agent-context-compatibility.js +30 -0
- package/dist/lib/task-asset-upload.d.ts +22 -0
- package/dist/lib/task-asset-upload.js +257 -29
- package/dist/lib/task-batch.d.ts +15 -1
- package/dist/lib/task-batch.js +35 -2
- package/dist/lib/task-operation-watch.d.ts +66 -0
- package/dist/lib/task-operation-watch.js +159 -0
- package/dist/lib/task-resolver.d.ts +1 -1
- package/dist/lib/task-resolver.js +4 -3
- package/dist/lib/task-runtime-headers.js +13 -3
- package/dist/lib/task-work.d.ts +1 -1
- package/dist/lib/task-work.js +35 -1
- package/dist/lib/task-write-attribution.d.ts +14 -0
- package/dist/lib/task-write-attribution.js +35 -2
- package/dist/lib/triggers.d.ts +11 -0
- package/dist/lib/triggers.js +7 -0
- package/dist/lib/wiki-update.d.ts +1 -0
- package/dist/lib/wiki-update.js +10 -1
- package/dist/lib/wiki.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/computerWire.js +31 -15
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonToolApproval.js +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +13 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.d.ts +370 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/guidedUpdate.js +315 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.d.ts +178 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/maintenanceReportWire.js +262 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/toolApprovalSignature.js +106 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.d.ts +9 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/computerWire.js +32 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonToolApproval.js +1 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +33 -14
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.d.ts +370 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/guidedUpdate.js +404 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.d.ts +178 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/maintenanceReportWire.js +342 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.d.ts +51 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/toolApprovalSignature.js +138 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +20 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +27085 -20250
- package/oclif.manifest.json +10570 -7247
- package/package.json +20 -2
|
@@ -38,6 +38,414 @@ exports.auditCommands = auditCommands;
|
|
|
38
38
|
const fs = __importStar(require("node:fs"));
|
|
39
39
|
const path = __importStar(require("node:path"));
|
|
40
40
|
const usage_discovery_1 = require("./usage-discovery");
|
|
41
|
+
const provided = (note) => ({ status: 'provided', note });
|
|
42
|
+
const missing = (note) => ({ status: 'missing', note });
|
|
43
|
+
const notApplicable = (note) => ({
|
|
44
|
+
status: 'not_applicable',
|
|
45
|
+
note,
|
|
46
|
+
});
|
|
47
|
+
const NO_MACHINE_STATE = notApplicable('This flow does not control a machine lifecycle.');
|
|
48
|
+
/**
|
|
49
|
+
* This is intentionally an explicit first tranche rather than a guess based
|
|
50
|
+
* on descriptions. Each row names the owning surface and is safe to audit
|
|
51
|
+
* before changing any command behaviour.
|
|
52
|
+
*/
|
|
53
|
+
const HIGH_SIDE_EFFECT_COMMANDS = [
|
|
54
|
+
{
|
|
55
|
+
command: 'machines:hosted:start',
|
|
56
|
+
effect: 'machine_lifecycle',
|
|
57
|
+
owner: 'Hosted Machine transport',
|
|
58
|
+
priority: 'P0',
|
|
59
|
+
requirements: {
|
|
60
|
+
operationIdentifier: provided('The request-id flag identifies the logical machine start.'),
|
|
61
|
+
receipt: missing('Return the accepted start receipt alongside the created session.'),
|
|
62
|
+
recovery: provided('Timeout and setup-failure paths name status, pause, or destroy for the created machine.'),
|
|
63
|
+
machineState: provided('The JSON result returns the session state and wait observes readiness.'),
|
|
64
|
+
idempotency: provided('The start request supplies a client request id.'),
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
command: 'machines:hosted:destroy',
|
|
69
|
+
effect: 'machine_lifecycle',
|
|
70
|
+
owner: 'Hosted Machine transport',
|
|
71
|
+
priority: 'P0',
|
|
72
|
+
requirements: {
|
|
73
|
+
operationIdentifier: provided('The target session id is the durable destroy subject.'),
|
|
74
|
+
receipt: missing('Return a destroy receipt that distinguishes accepted from terminal termination.'),
|
|
75
|
+
recovery: missing('Name a read-only state check for a lost destroy response.'),
|
|
76
|
+
machineState: provided('The result returns the hosted session state.'),
|
|
77
|
+
idempotency: missing('Add a stable destroy identity for ambiguous transport retries.'),
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
command: 'machines:hosted:exec',
|
|
82
|
+
effect: 'remote_execution',
|
|
83
|
+
owner: 'Hosted Machine transport',
|
|
84
|
+
priority: 'P0',
|
|
85
|
+
requirements: {
|
|
86
|
+
operationIdentifier: missing('Return a durable execution id, not only the enclosing session id.'),
|
|
87
|
+
receipt: missing('Persist and return an invocation receipt for a completed or unknown command.'),
|
|
88
|
+
recovery: missing('Add inspect-before-retry guidance keyed by the returned execution id.'),
|
|
89
|
+
machineState: provided('The curated JSON result includes session.id and session.status.'),
|
|
90
|
+
idempotency: missing('Accept a caller-supplied execution identity and deduplicate that logical command.'),
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
command: 'machines:dedicated:exec',
|
|
95
|
+
effect: 'remote_execution',
|
|
96
|
+
owner: 'Dedicated Runtime execution',
|
|
97
|
+
priority: 'P0',
|
|
98
|
+
requirements: {
|
|
99
|
+
operationIdentifier: provided('The request-id flag identifies the logical command.'),
|
|
100
|
+
receipt: provided('The dedicated exec result is returned after start/observation under that request id.'),
|
|
101
|
+
recovery: provided('Contact-loss and unconfirmed-start errors direct the caller to reuse the request id.'),
|
|
102
|
+
machineState: provided('Wake/refusal states are carried through the dedicated-runtime response.'),
|
|
103
|
+
idempotency: provided('Repeating request-id returns the run already started.'),
|
|
104
|
+
},
|
|
105
|
+
},
|
|
106
|
+
...['start', 'stop', 'restart', 'update-image'].map((action) => ({
|
|
107
|
+
command: 'machines:dedicated:' + action,
|
|
108
|
+
effect: 'machine_lifecycle',
|
|
109
|
+
owner: 'Dedicated Runtime lifecycle',
|
|
110
|
+
priority: action === 'update-image' ? 'P0' : 'P1',
|
|
111
|
+
requirements: {
|
|
112
|
+
operationIdentifier: provided('The returned lease identifies the in-flight lifecycle operation.'),
|
|
113
|
+
receipt: provided('reportLeaseAction preserves the server action response for JSON callers.'),
|
|
114
|
+
recovery: provided('The wait contract distinguishes an unfinished operation and names show.'),
|
|
115
|
+
machineState: provided('The lease state is returned immediately and can be observed to the requested goal.'),
|
|
116
|
+
idempotency: provided('Lifecycle actions converge on desired lease state rather than replaying a second effect.'),
|
|
117
|
+
},
|
|
118
|
+
})),
|
|
119
|
+
{
|
|
120
|
+
command: 'machines:dedicated:destroy',
|
|
121
|
+
effect: 'machine_lifecycle',
|
|
122
|
+
owner: 'Dedicated Runtime lifecycle',
|
|
123
|
+
priority: 'P0',
|
|
124
|
+
requirements: {
|
|
125
|
+
operationIdentifier: provided('The returned lease is the durable subject of the destroy operation.'),
|
|
126
|
+
receipt: provided('reportLeaseAction returns the destroy response to JSON callers.'),
|
|
127
|
+
recovery: provided('Retention notes and restore describe the bounded recovery path.'),
|
|
128
|
+
machineState: provided('The returned lease exposes the transition and storage-retention outcome.'),
|
|
129
|
+
idempotency: provided('Destroy is a lease-state transition; repeated requests converge on that lease.'),
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
command: 'machines:dedicated:restore',
|
|
134
|
+
effect: 'machine_lifecycle',
|
|
135
|
+
owner: 'Dedicated Runtime lifecycle',
|
|
136
|
+
priority: 'P0',
|
|
137
|
+
requirements: {
|
|
138
|
+
operationIdentifier: provided('The request-id flag identifies a logical restore.'),
|
|
139
|
+
receipt: provided('The restore response carries the replacement lease.'),
|
|
140
|
+
recovery: provided('The command documents the retained recovery-point window.'),
|
|
141
|
+
machineState: provided('reportLeaseAction returns and optionally waits on the replacement lease state.'),
|
|
142
|
+
idempotency: provided('The documented request-id is safe to reuse for the same restore.'),
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
command: 'machines:dedicated:service:apply',
|
|
147
|
+
effect: 'machine_lifecycle',
|
|
148
|
+
owner: 'Dedicated Runtime services',
|
|
149
|
+
priority: 'P1',
|
|
150
|
+
requirements: {
|
|
151
|
+
operationIdentifier: provided('The lease id and service name identify the desired-state change.'),
|
|
152
|
+
receipt: provided('The created or updated service specification is returned as JSON.'),
|
|
153
|
+
recovery: provided('The command reads the stored revision and reports CAS conflicts instead of silently merging.'),
|
|
154
|
+
machineState: provided('The returned service declaration is the persisted desired state.'),
|
|
155
|
+
idempotency: provided('Apply is explicitly create-or-update and safe to re-run against its revision.'),
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
command: 'machines:dedicated:service:exec',
|
|
160
|
+
effect: 'remote_execution',
|
|
161
|
+
owner: 'Dedicated Runtime services',
|
|
162
|
+
priority: 'P1',
|
|
163
|
+
requirements: {
|
|
164
|
+
operationIdentifier: provided('The daemon persists a service-execution operationId before it spawns the child.'),
|
|
165
|
+
receipt: provided('The additive execution receipt distinguishes accepted, started, completed and unknown evidence.'),
|
|
166
|
+
recovery: provided('A lost relay response names service exec --request-id <id> --inspect before any retry.'),
|
|
167
|
+
machineState: provided('The additive execution envelope carries the observed service state and lease subject.'),
|
|
168
|
+
idempotency: provided('Reusing --request-id converges on the same durable service-execution receipt.'),
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
...['start', 'stop', 'restart'].map((action) => ({
|
|
172
|
+
command: 'machines:dedicated:service:' + action,
|
|
173
|
+
effect: 'machine_lifecycle',
|
|
174
|
+
owner: 'Dedicated Runtime services',
|
|
175
|
+
priority: 'P1',
|
|
176
|
+
requirements: {
|
|
177
|
+
operationIdentifier: provided('The lease id and service name identify the desired-state operation.'),
|
|
178
|
+
receipt: provided('The service action returns its updated declaration.'),
|
|
179
|
+
recovery: provided('Persisted desired state survives restarts and can be re-read with status.'),
|
|
180
|
+
machineState: provided('The returned declaration reports the desired service state.'),
|
|
181
|
+
idempotency: provided('Repeated desired-state actions converge on the same service state.'),
|
|
182
|
+
},
|
|
183
|
+
})),
|
|
184
|
+
{
|
|
185
|
+
command: 'tasks:start',
|
|
186
|
+
effect: 'durable_execution',
|
|
187
|
+
owner: 'Task execution',
|
|
188
|
+
priority: 'P0',
|
|
189
|
+
requirements: {
|
|
190
|
+
operationIdentifier: provided('The request-id flag is generated or supplied for each logical start.'),
|
|
191
|
+
receipt: provided('JSON exposes the start receipt and task/run identifiers.'),
|
|
192
|
+
recovery: provided('tasks start-receipt is named for a lost or machine-waiting start.'),
|
|
193
|
+
machineState: provided('A machine-waiting response is structured rather than reported as a failed start.'),
|
|
194
|
+
idempotency: provided('The request id is the task-start idempotency key.'),
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
command: 'tasks:retry',
|
|
199
|
+
effect: 'durable_execution',
|
|
200
|
+
owner: 'Task execution',
|
|
201
|
+
priority: 'P0',
|
|
202
|
+
requirements: {
|
|
203
|
+
operationIdentifier: missing('Add one retry-attempt id spanning the committed move and the subsequent start.'),
|
|
204
|
+
receipt: missing('Return a compound retry receipt that records both the status transition and dispatch result.'),
|
|
205
|
+
recovery: provided('A start failure names tasks show before another start is attempted.'),
|
|
206
|
+
machineState: provided('Machine waiting is a structured JSON outcome, not a false dispatch success.'),
|
|
207
|
+
idempotency: missing('Do not replay the move/start pair without a stable retry identity.'),
|
|
208
|
+
},
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
command: 'spaces:workflows:start',
|
|
212
|
+
effect: 'durable_execution',
|
|
213
|
+
owner: 'Workflow runtime',
|
|
214
|
+
priority: 'P1',
|
|
215
|
+
requirements: {
|
|
216
|
+
operationIdentifier: provided('The result promotes runId and status to top-level JSON fields.'),
|
|
217
|
+
receipt: provided('The created workflow run is the durable start receipt.'),
|
|
218
|
+
recovery: provided('The returned run id is inspectable with spaces workflows run.'),
|
|
219
|
+
machineState: NO_MACHINE_STATE,
|
|
220
|
+
idempotency: provided('The start-identity flag names the logical start.'),
|
|
221
|
+
},
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
command: 'spaces:workflows:retry',
|
|
225
|
+
effect: 'durable_execution',
|
|
226
|
+
owner: 'Workflow runtime',
|
|
227
|
+
priority: 'P1',
|
|
228
|
+
requirements: {
|
|
229
|
+
operationIdentifier: provided('The retry result identifies the resulting workflow run.'),
|
|
230
|
+
receipt: provided('The result records whether the run was reused or started.'),
|
|
231
|
+
recovery: missing('Print an inspect-before-retry command for an ambiguous retry response.'),
|
|
232
|
+
machineState: NO_MACHINE_STATE,
|
|
233
|
+
idempotency: missing('Accept a retry identity instead of relying on a repeated network request.'),
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
command: 'spaces:workflows:cancel',
|
|
238
|
+
effect: 'automation_control',
|
|
239
|
+
owner: 'Workflow runtime',
|
|
240
|
+
priority: 'P1',
|
|
241
|
+
requirements: {
|
|
242
|
+
operationIdentifier: provided('The workflow run id is the cancellation subject.'),
|
|
243
|
+
receipt: provided('cancelReceipt distinguishes a new cancellation from an already-settled run.'),
|
|
244
|
+
recovery: provided('Converging and failed cleanup paths name re-read or reconcile commands.'),
|
|
245
|
+
machineState: NO_MACHINE_STATE,
|
|
246
|
+
idempotency: provided('Cancellation is a convergent state transition and reports the receipt outcome.'),
|
|
247
|
+
},
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
command: 'spaces:workflows:proposals:apply',
|
|
251
|
+
effect: 'automation_control',
|
|
252
|
+
owner: 'Workflow runtime',
|
|
253
|
+
priority: 'P1',
|
|
254
|
+
requirements: {
|
|
255
|
+
operationIdentifier: provided('The proposal id and workflow id identify the reviewed draft mutation.'),
|
|
256
|
+
receipt: missing('Return a revision-fenced proposal-apply receipt rather than an unqualified workflow result.'),
|
|
257
|
+
recovery: missing('Name the draft read or proposal status command before a caller retries an ambiguous apply.'),
|
|
258
|
+
machineState: NO_MACHINE_STATE,
|
|
259
|
+
idempotency: missing('Bind repeated proposal application to a stable reviewed revision and identity.'),
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
command: 'spaces:workflows:triggers:fire',
|
|
264
|
+
effect: 'durable_execution',
|
|
265
|
+
owner: 'Workflow runtime',
|
|
266
|
+
priority: 'P1',
|
|
267
|
+
requirements: {
|
|
268
|
+
operationIdentifier: provided('The returned run identifies the trigger delivery.'),
|
|
269
|
+
receipt: provided('The trigger result records whether the run was reused or fired.'),
|
|
270
|
+
recovery: missing('Add an explicit run-inspection instruction to the human output and JSON hint.'),
|
|
271
|
+
machineState: NO_MACHINE_STATE,
|
|
272
|
+
idempotency: provided('The start-identity flag is the trigger delivery identity.'),
|
|
273
|
+
},
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
command: 'commitments:control:apply',
|
|
277
|
+
effect: 'automation_control',
|
|
278
|
+
owner: 'Commitment controls',
|
|
279
|
+
priority: 'P1',
|
|
280
|
+
requirements: {
|
|
281
|
+
operationIdentifier: provided('A required idempotency key identifies the exact reviewed control request.'),
|
|
282
|
+
receipt: provided('The command returns the actual control receipt.'),
|
|
283
|
+
recovery: provided('The input is a saved reviewed preview, so a retry is bound to the same scope and version.'),
|
|
284
|
+
machineState: NO_MACHINE_STATE,
|
|
285
|
+
idempotency: provided('The required key is checked against the reviewed control payload.'),
|
|
286
|
+
},
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
command: 'commitments:action-proposals:execute',
|
|
290
|
+
effect: 'automation_control',
|
|
291
|
+
owner: 'Commitment controls',
|
|
292
|
+
priority: 'P1',
|
|
293
|
+
requirements: {
|
|
294
|
+
operationIdentifier: provided('The frozen Action Bundle revision and digest form the stable operation id.'),
|
|
295
|
+
receipt: provided('The additive execution envelope classifies the durable proposal receipt.'),
|
|
296
|
+
recovery: provided('The result names the read-only proposal receipt required before any retry.'),
|
|
297
|
+
machineState: NO_MACHINE_STATE,
|
|
298
|
+
idempotency: provided('The action key and frozen bundle coordinates fence repeated execution nudges.'),
|
|
299
|
+
},
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
command: 'commitments:execute-remediation',
|
|
303
|
+
effect: 'automation_control',
|
|
304
|
+
owner: 'Commitment controls',
|
|
305
|
+
priority: 'P1',
|
|
306
|
+
requirements: {
|
|
307
|
+
operationIdentifier: provided('The immutable remediation action key and proposal revision form the operation id.'),
|
|
308
|
+
receipt: provided('The additive execution envelope classifies the durable remediation receipt.'),
|
|
309
|
+
recovery: provided('A stale-lease retry remains explicit and the receipt requires inspection before another retry.'),
|
|
310
|
+
machineState: NO_MACHINE_STATE,
|
|
311
|
+
idempotency: provided('The frozen remediation action key is surfaced as the retry identity.'),
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
{
|
|
315
|
+
command: 'store:artifacts:release',
|
|
316
|
+
effect: 'release_publication',
|
|
317
|
+
owner: 'Store release governance',
|
|
318
|
+
priority: 'P1',
|
|
319
|
+
requirements: {
|
|
320
|
+
operationIdentifier: provided('The immutable release id is surfaced as the publication operation id.'),
|
|
321
|
+
receipt: provided('The release result preserves its historical field and adds a versioned receipt envelope.'),
|
|
322
|
+
recovery: provided('The result names a read-only immutable-release receipt; incident response stays a separately authorized curator action.'),
|
|
323
|
+
machineState: NO_MACHINE_STATE,
|
|
324
|
+
idempotency: provided('A caller can reuse the immutable release id only for the exact reviewed publication.'),
|
|
325
|
+
},
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
command: 'store:governance:publish-release',
|
|
329
|
+
effect: 'release_publication',
|
|
330
|
+
owner: 'Store release governance',
|
|
331
|
+
priority: 'P1',
|
|
332
|
+
requirements: {
|
|
333
|
+
operationIdentifier: provided('The stable immutable release id is returned at the top level and in the receipt.'),
|
|
334
|
+
receipt: provided('The historical release field is retained with a versioned receipt envelope.'),
|
|
335
|
+
recovery: provided('The result names a read-only governed receipt; rollback stays a human-authorized incident procedure.'),
|
|
336
|
+
machineState: NO_MACHINE_STATE,
|
|
337
|
+
idempotency: provided('The reviewed release id is the publication identity; a source-revision fence rejects stale evidence.'),
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
];
|
|
341
|
+
const HUMAN_ONLY_EXEMPTIONS = [
|
|
342
|
+
{
|
|
343
|
+
command: 'create-token',
|
|
344
|
+
effect: 'credential_issuance',
|
|
345
|
+
reason: 'A CI token is secret material printed once for daemon bootstrap; durable receipts must not echo or retain it.',
|
|
346
|
+
reviewedEvidence: 'docs/cli/SKRR_AUTH.md#credential-types-and-allowed-surfaces',
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
command: 'generate-recovery-code',
|
|
350
|
+
effect: 'credential_issuance',
|
|
351
|
+
reason: 'This route requires a signed-in user session and fresh step-up proof; the secret is deliberately shown once.',
|
|
352
|
+
reviewedEvidence: 'docs/cli/SKRR_AUTH.md#recovery-codes',
|
|
353
|
+
},
|
|
354
|
+
];
|
|
355
|
+
const EXECUTION_CONTRACT_BY_COMMAND = new Map(HIGH_SIDE_EFFECT_COMMANDS.map((contract) => [contract.command, contract]));
|
|
356
|
+
const HUMAN_ONLY_EXEMPTION_BY_COMMAND = new Map(HUMAN_ONLY_EXEMPTIONS.map((exemption) => [exemption.command, exemption]));
|
|
357
|
+
/**
|
|
358
|
+
* Adding one of these verbs in a controlled execution namespace must add a
|
|
359
|
+
* reviewed row above. The narrow vocabulary avoids pretending that ordinary
|
|
360
|
+
* metadata changes need a remote-execution recovery contract.
|
|
361
|
+
*/
|
|
362
|
+
const CONTROLLED_EXECUTION_VERB = /(^|:)(?:exec|destroy|restore|restart|start|stop|update-image|apply|fire|cancel|retry|publish-release|drain)$/;
|
|
363
|
+
function isExecutionContractCandidate(command) {
|
|
364
|
+
if (EXECUTION_CONTRACT_BY_COMMAND.has(command) ||
|
|
365
|
+
HUMAN_ONLY_EXEMPTION_BY_COMMAND.has(command)) {
|
|
366
|
+
return true;
|
|
367
|
+
}
|
|
368
|
+
return ((command.startsWith('machines:dedicated:') ||
|
|
369
|
+
command.startsWith('machines:hosted:') ||
|
|
370
|
+
command.startsWith('spaces:workflows:')) &&
|
|
371
|
+
CONTROLLED_EXECUTION_VERB.test(command));
|
|
372
|
+
}
|
|
373
|
+
const EXECUTION_REQUIREMENT_ISSUES = {
|
|
374
|
+
operationIdentifier: {
|
|
375
|
+
code: 'EXECUTION_OPERATION_IDENTIFIER_MISSING',
|
|
376
|
+
label: 'operation identifier',
|
|
377
|
+
},
|
|
378
|
+
receipt: { code: 'EXECUTION_RECEIPT_MISSING', label: 'receipt' },
|
|
379
|
+
recovery: { code: 'EXECUTION_RECOVERY_GUIDANCE_MISSING', label: 'recovery guidance' },
|
|
380
|
+
machineState: {
|
|
381
|
+
code: 'EXECUTION_MACHINE_STATE_OUTPUT_MISSING',
|
|
382
|
+
label: 'machine-state output',
|
|
383
|
+
},
|
|
384
|
+
idempotency: {
|
|
385
|
+
code: 'EXECUTION_IDEMPOTENCY_BEHAVIOR_MISSING',
|
|
386
|
+
label: 'idempotency behaviour',
|
|
387
|
+
},
|
|
388
|
+
};
|
|
389
|
+
function auditExecutionContracts(commandIds) {
|
|
390
|
+
const candidates = [...new Set([...commandIds].filter(isExecutionContractCandidate))].sort();
|
|
391
|
+
const contracts = candidates
|
|
392
|
+
.map((command) => EXECUTION_CONTRACT_BY_COMMAND.get(command))
|
|
393
|
+
.filter((contract) => Boolean(contract));
|
|
394
|
+
const exemptions = candidates
|
|
395
|
+
.map((command) => HUMAN_ONLY_EXEMPTION_BY_COMMAND.get(command))
|
|
396
|
+
.filter((exemption) => Boolean(exemption));
|
|
397
|
+
const unclassified = candidates.filter((command) => !EXECUTION_CONTRACT_BY_COMMAND.has(command) && !HUMAN_ONLY_EXEMPTION_BY_COMMAND.has(command));
|
|
398
|
+
const issues = unclassified.map((command) => ({
|
|
399
|
+
code: 'HIGH_SIDE_EFFECT_COMMAND_UNCLASSIFIED',
|
|
400
|
+
severity: 'error',
|
|
401
|
+
command,
|
|
402
|
+
message: 'High-side-effect command is not in the execution-contract inventory. Add a reviewed contract row or a documented human-only exemption.',
|
|
403
|
+
}));
|
|
404
|
+
const missingByRequirement = {
|
|
405
|
+
operationIdentifier: 0,
|
|
406
|
+
receipt: 0,
|
|
407
|
+
recovery: 0,
|
|
408
|
+
machineState: 0,
|
|
409
|
+
idempotency: 0,
|
|
410
|
+
};
|
|
411
|
+
for (const contract of contracts) {
|
|
412
|
+
for (const requirement of Object.keys(contract.requirements)) {
|
|
413
|
+
const assessment = contract.requirements[requirement];
|
|
414
|
+
if (assessment.status !== 'missing')
|
|
415
|
+
continue;
|
|
416
|
+
missingByRequirement[requirement] += 1;
|
|
417
|
+
const issue = EXECUTION_REQUIREMENT_ISSUES[requirement];
|
|
418
|
+
issues.push({
|
|
419
|
+
code: issue.code,
|
|
420
|
+
severity: 'warning',
|
|
421
|
+
command: contract.command,
|
|
422
|
+
message: 'High-side-effect command lacks ' + issue.label + ': ' + assessment.note,
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
return {
|
|
427
|
+
report: {
|
|
428
|
+
candidates: candidates.length,
|
|
429
|
+
classified: contracts.length,
|
|
430
|
+
humanOnlyExemptions: exemptions.length,
|
|
431
|
+
missingOperationIdentifiers: missingByRequirement.operationIdentifier,
|
|
432
|
+
missingReceipts: missingByRequirement.receipt,
|
|
433
|
+
missingRecoveryGuidance: missingByRequirement.recovery,
|
|
434
|
+
missingMachineStateOutputs: missingByRequirement.machineState,
|
|
435
|
+
missingIdempotencyBehavior: missingByRequirement.idempotency,
|
|
436
|
+
contracts: contracts.map(({ command, effect, owner, priority, requirements }) => ({
|
|
437
|
+
command,
|
|
438
|
+
effect,
|
|
439
|
+
owner,
|
|
440
|
+
priority,
|
|
441
|
+
requirements,
|
|
442
|
+
})),
|
|
443
|
+
exemptions,
|
|
444
|
+
unclassified,
|
|
445
|
+
},
|
|
446
|
+
issues,
|
|
447
|
+
};
|
|
448
|
+
}
|
|
41
449
|
const AGENT_CRITICAL_COMMANDS = [
|
|
42
450
|
'context',
|
|
43
451
|
'doctor',
|
|
@@ -96,6 +504,7 @@ function auditCommands({ rootDir, manifest, }) {
|
|
|
96
504
|
const jsonCommands = commandIds.filter((id) => hasJsonFlag(commands[id]?.flags)).length;
|
|
97
505
|
let fromJsonCommands = 0;
|
|
98
506
|
let argsStringBlocks = 0;
|
|
507
|
+
const sourceCommandIds = new Set();
|
|
99
508
|
const sourceRoot = path.join(rootDir, 'src', 'commands');
|
|
100
509
|
if (fs.existsSync(sourceRoot)) {
|
|
101
510
|
sourceAvailable = true;
|
|
@@ -105,6 +514,7 @@ function auditCommands({ rootDir, manifest, }) {
|
|
|
105
514
|
const rel = path.relative(sourceRoot, file);
|
|
106
515
|
const source = fs.readFileSync(file, 'utf8');
|
|
107
516
|
const command = commandIdFromRelativePath(rel);
|
|
517
|
+
sourceCommandIds.add(command);
|
|
108
518
|
const hasFromJson = /['"]from-json['"]/.test(source);
|
|
109
519
|
const hasJson = /json:\s*Flags\.boolean/.test(source);
|
|
110
520
|
if (hasFromJson)
|
|
@@ -206,6 +616,8 @@ function auditCommands({ rootDir, manifest, }) {
|
|
|
206
616
|
}
|
|
207
617
|
}
|
|
208
618
|
}
|
|
619
|
+
const executionAudit = auditExecutionContracts(sourceAvailable ? sourceCommandIds : commandIds);
|
|
620
|
+
issues.push(...executionAudit.issues);
|
|
209
621
|
const errors = issues.filter((issue) => issue.severity === 'error').length;
|
|
210
622
|
const warnings = issues.filter((issue) => issue.severity === 'warning').length;
|
|
211
623
|
return {
|
|
@@ -229,6 +641,7 @@ function auditCommands({ rootDir, manifest, }) {
|
|
|
229
641
|
budgetErrors: usageBudgetIssues.length,
|
|
230
642
|
},
|
|
231
643
|
namingGrammar: exports.NAMING_GRAMMAR,
|
|
644
|
+
execution: executionAudit.report,
|
|
232
645
|
issues,
|
|
233
646
|
};
|
|
234
647
|
}
|
|
@@ -173,6 +173,12 @@ export type CommitmentPackPlanResponse = {
|
|
|
173
173
|
};
|
|
174
174
|
planDigest: string;
|
|
175
175
|
draft?: Record<string, unknown>;
|
|
176
|
+
/** A Pack planned into a Space: where it would go and who would hold it. */
|
|
177
|
+
spacePlacement?: {
|
|
178
|
+
spaceId: string;
|
|
179
|
+
agentId: string;
|
|
180
|
+
holder?: 'space_lead' | 'explicit';
|
|
181
|
+
};
|
|
176
182
|
[key: string]: unknown;
|
|
177
183
|
};
|
|
178
184
|
export type CommitmentPackBindResponse = {
|
|
@@ -181,11 +187,47 @@ export type CommitmentPackBindResponse = {
|
|
|
181
187
|
title?: string;
|
|
182
188
|
status?: string;
|
|
183
189
|
};
|
|
184
|
-
pack
|
|
190
|
+
/** The API answers with the plan it bound; `plan.pack` names the Pack. */
|
|
191
|
+
pack?: {
|
|
185
192
|
id: string;
|
|
186
193
|
version: string;
|
|
187
194
|
};
|
|
195
|
+
plan?: {
|
|
196
|
+
pack?: {
|
|
197
|
+
id: string;
|
|
198
|
+
version: string;
|
|
199
|
+
};
|
|
200
|
+
planDigest?: string;
|
|
201
|
+
};
|
|
188
202
|
reused?: boolean;
|
|
203
|
+
/**
|
|
204
|
+
* Present when the Pack was bound into a Space: the Commitment is that
|
|
205
|
+
* Space's loop, held by `agentId` (`holder: 'space_lead'` when it defaulted
|
|
206
|
+
* to the Space's lead). `knowledgeScope.default` is what the link service
|
|
207
|
+
* did with the Space knowledge opt-in; absent when an existing loop was
|
|
208
|
+
* reused unchanged.
|
|
209
|
+
*/
|
|
210
|
+
spaceLoop?: {
|
|
211
|
+
spaceId: string;
|
|
212
|
+
agentId: string;
|
|
213
|
+
holder?: 'space_lead' | 'explicit';
|
|
214
|
+
linkId?: string;
|
|
215
|
+
roles?: string[];
|
|
216
|
+
knowledgeScope?: {
|
|
217
|
+
default?: string;
|
|
218
|
+
enabled?: boolean;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
/**
|
|
222
|
+
* The plan's other links, written with the Space link when a new loop was
|
|
223
|
+
* bound: a `goal_advance` loop's `advance` + `watch` link to its Goal.
|
|
224
|
+
*/
|
|
225
|
+
workLinks?: Array<{
|
|
226
|
+
linkId: string;
|
|
227
|
+
targetType: string;
|
|
228
|
+
targetId: string;
|
|
229
|
+
roles: string[];
|
|
230
|
+
}>;
|
|
189
231
|
[key: string]: unknown;
|
|
190
232
|
};
|
|
191
233
|
export type CommitmentPackLifecycleResponse = {
|
|
@@ -311,6 +353,7 @@ export declare const commitmentApi: {
|
|
|
311
353
|
object: "commitment_action_proposal_list";
|
|
312
354
|
data: CommitmentActionProposal[];
|
|
313
355
|
}>;
|
|
356
|
+
actionProposal: (id: string, proposalId: string) => Promise<Record<string, unknown>>;
|
|
314
357
|
/**
|
|
315
358
|
* Propose a prepared action for a check.
|
|
316
359
|
*
|
|
@@ -327,7 +370,7 @@ export declare const commitmentApi: {
|
|
|
327
370
|
reason?: string;
|
|
328
371
|
reasonCode?: import("@skrr-ai/data-provider").ProposalDiscardReasonCode;
|
|
329
372
|
}) => Promise<Record<string, unknown>>;
|
|
330
|
-
executeActionProposal: (id: string, proposalId: string) => Promise<Record<string, unknown>>;
|
|
373
|
+
executeActionProposal: (id: string, proposalId: string, body?: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
331
374
|
preflight: (id: string, nextRunCount?: number) => Promise<CommitmentPreflightReport>;
|
|
332
375
|
effectivePolicy: (id: string) => Promise<Record<string, unknown>>;
|
|
333
376
|
/**
|
|
@@ -374,7 +417,11 @@ export declare const commitmentApi: {
|
|
|
374
417
|
remediationProposal: (id: string, proposalId: string) => Promise<Record<string, unknown>>;
|
|
375
418
|
proposeRemediation: (id: string, caseId: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
376
419
|
decideRemediationProposal: (id: string, proposalId: string, body: Record<string, unknown>) => Promise<Record<string, unknown>>;
|
|
377
|
-
executeRemediationProposal: (id: string, proposalId: string,
|
|
420
|
+
executeRemediationProposal: (id: string, proposalId: string, body?: {
|
|
421
|
+
retryExecuting?: boolean;
|
|
422
|
+
expectedRevision?: number;
|
|
423
|
+
expectedUpdatedAt?: string | null;
|
|
424
|
+
}) => Promise<Record<string, unknown>>;
|
|
378
425
|
triggerStatus: (id: string, limit?: number) => Promise<Record<string, unknown>>;
|
|
379
426
|
workLineage: (id: string, limit?: number) => Promise<Record<string, unknown>>;
|
|
380
427
|
/** One ordered explanation surface across the immutable commitment ledgers. */
|
|
@@ -802,6 +849,20 @@ export declare function extractStandstillFromCheck(check?: {
|
|
|
802
849
|
fix?: string;
|
|
803
850
|
alsoConstrained?: Array<Record<string, unknown>>;
|
|
804
851
|
} | null;
|
|
852
|
+
/**
|
|
853
|
+
* The fix to print beside a standstill, as `stopForRead` resolves a stop's on
|
|
854
|
+
* the server. The check's own stored sentence is the answer for a reason that
|
|
855
|
+
* still occurs. A reason only a pre-2026-10-09 Check carries stored a fix that
|
|
856
|
+
* names a retired Commitment mode (OSK-18146), so its current copy is printed
|
|
857
|
+
* instead, with `<commitment>` bound to this Commitment when its id is a plain
|
|
858
|
+
* token.
|
|
859
|
+
*
|
|
860
|
+
* Exported for tests.
|
|
861
|
+
*/
|
|
862
|
+
export declare function standstillFixForRead(standstill: {
|
|
863
|
+
reason: string;
|
|
864
|
+
fix?: string;
|
|
865
|
+
}, commitmentId?: string): string | undefined;
|
|
805
866
|
/**
|
|
806
867
|
* The `Autonomy:` line — the stated mode, annotated when the latest check
|
|
807
868
|
* actually ran at a STRICTER one (OSK-4881). Without the caveat, a commitment
|
package/dist/lib/commitments.js
CHANGED
|
@@ -20,6 +20,7 @@ exports.pendingCadenceRequestLines = pendingCadenceRequestLines;
|
|
|
20
20
|
exports.cadenceLabel = cadenceLabel;
|
|
21
21
|
exports.renderCommitmentList = renderCommitmentList;
|
|
22
22
|
exports.extractStandstillFromCheck = extractStandstillFromCheck;
|
|
23
|
+
exports.standstillFixForRead = standstillFixForRead;
|
|
23
24
|
exports.describeExecutorBlocked = describeExecutorBlocked;
|
|
24
25
|
exports.describeOperation = describeOperation;
|
|
25
26
|
exports.describeOperationFix = describeOperationFix;
|
|
@@ -195,6 +196,7 @@ exports.commitmentApi = {
|
|
|
195
196
|
checks: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/checks`, query)),
|
|
196
197
|
actionHistory: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/action-history`, query)),
|
|
197
198
|
actionProposals: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/action-proposals`, query)),
|
|
199
|
+
actionProposal: (id, proposalId) => data_provider_2.request.get(`${base(id)}/action-proposals/${encodeURIComponent(proposalId)}`),
|
|
198
200
|
/**
|
|
199
201
|
* Propose a prepared action for a check.
|
|
200
202
|
*
|
|
@@ -213,7 +215,7 @@ exports.commitmentApi = {
|
|
|
213
215
|
...(snapshot?.reasonCode ? { reasonCode: snapshot.reasonCode } : {}),
|
|
214
216
|
via: 'cli',
|
|
215
217
|
}),
|
|
216
|
-
executeActionProposal: (id, proposalId) => data_provider_2.request.post(`${base(id)}/action-proposals/${encodeURIComponent(proposalId)}/execute`,
|
|
218
|
+
executeActionProposal: (id, proposalId, body = {}) => data_provider_2.request.post(`${base(id)}/action-proposals/${encodeURIComponent(proposalId)}/execute`, body),
|
|
217
219
|
preflight: (id, nextRunCount) => data_provider_2.request.post(`${base(id)}/preflight`, {
|
|
218
220
|
...(typeof nextRunCount === 'number' ? { nextRunCount } : {}),
|
|
219
221
|
}),
|
|
@@ -247,8 +249,8 @@ exports.commitmentApi = {
|
|
|
247
249
|
remediationProposal: (id, proposalId) => data_provider_2.request.get(`${base(id)}/remediation-proposals/${encodeURIComponent(proposalId)}`),
|
|
248
250
|
proposeRemediation: (id, caseId, body) => data_provider_2.request.post(`${base(id)}/cases/${encodeURIComponent(caseId)}/remediation-proposals`, body),
|
|
249
251
|
decideRemediationProposal: (id, proposalId, body) => data_provider_2.request.post(`${base(id)}/remediation-proposals/${encodeURIComponent(proposalId)}/decision`, body),
|
|
250
|
-
executeRemediationProposal: (id, proposalId,
|
|
251
|
-
|
|
252
|
+
executeRemediationProposal: (id, proposalId, body = {}) => data_provider_2.request.post(`${base(id)}/remediation-proposals/${encodeURIComponent(proposalId)}/execute`, {
|
|
253
|
+
...body,
|
|
252
254
|
}),
|
|
253
255
|
/* ------------------------------------------------------------------------ *
|
|
254
256
|
* Observability and lineage
|
|
@@ -826,7 +828,7 @@ function pendingCadenceRequestLines(commitment) {
|
|
|
826
828
|
}),
|
|
827
829
|
];
|
|
828
830
|
}
|
|
829
|
-
function
|
|
831
|
+
function baseCadenceLabel(commitment) {
|
|
830
832
|
const cadence = commitment.cadence;
|
|
831
833
|
if (!cadence || !cadence.mode || cadence.mode === 'manual')
|
|
832
834
|
return 'manual';
|
|
@@ -842,6 +844,13 @@ function cadenceLabel(commitment) {
|
|
|
842
844
|
}
|
|
843
845
|
return `${cadence.mode === 'event_plus_interval' ? 'event+' : ''}${describeIntervalMs(cadence.intervalMs)}`;
|
|
844
846
|
}
|
|
847
|
+
function cadenceLabel(commitment) {
|
|
848
|
+
const base = baseCadenceLabel(commitment);
|
|
849
|
+
const window = (0, data_provider_1.describeCommitmentCadenceWindow)(commitment.cadence);
|
|
850
|
+
return window
|
|
851
|
+
? `${base} ${window}${commitment.cadence?.mode !== 'daily' ? ` (${commitment.cadence?.timezone || 'UTC'})` : ''}`
|
|
852
|
+
: base;
|
|
853
|
+
}
|
|
845
854
|
function renderCommitmentList(commitments, log) {
|
|
846
855
|
if (commitments.length === 0) {
|
|
847
856
|
log('No commitments.');
|
|
@@ -905,6 +914,24 @@ function extractStandstillFromCheck(check) {
|
|
|
905
914
|
}
|
|
906
915
|
return null;
|
|
907
916
|
}
|
|
917
|
+
/**
|
|
918
|
+
* The fix to print beside a standstill, as `stopForRead` resolves a stop's on
|
|
919
|
+
* the server. The check's own stored sentence is the answer for a reason that
|
|
920
|
+
* still occurs. A reason only a pre-2026-10-09 Check carries stored a fix that
|
|
921
|
+
* names a retired Commitment mode (OSK-18146), so its current copy is printed
|
|
922
|
+
* instead, with `<commitment>` bound to this Commitment when its id is a plain
|
|
923
|
+
* token.
|
|
924
|
+
*
|
|
925
|
+
* Exported for tests.
|
|
926
|
+
*/
|
|
927
|
+
function standstillFixForRead(standstill, commitmentId) {
|
|
928
|
+
if (!(0, data_provider_2.isLegacyStandstillReason)(standstill.reason))
|
|
929
|
+
return standstill.fix;
|
|
930
|
+
const fix = (0, data_provider_2.describeStandstill)(standstill.reason).fix ?? undefined;
|
|
931
|
+
if (!fix || !commitmentId || !/^[A-Za-z0-9_-]{1,80}$/.test(commitmentId))
|
|
932
|
+
return fix;
|
|
933
|
+
return fix.split('<commitment>').join(commitmentId);
|
|
934
|
+
}
|
|
908
935
|
/**
|
|
909
936
|
* The `Autonomy:` line — the stated mode, annotated when the latest check
|
|
910
937
|
* actually ran at a STRICTER one (OSK-4881). Without the caveat, a commitment
|
|
@@ -1184,8 +1211,9 @@ scheduleIssues) {
|
|
|
1184
1211
|
const streak = commitment.state?.consecutiveUnresolvedChecks;
|
|
1185
1212
|
const streakClause = typeof streak === 'number' && streak >= 2 ? `${streak} checks in a row: ` : '';
|
|
1186
1213
|
log(`Standstill:${` ${streakClause}${(0, data_provider_2.describeStandstill)(standstill.reason).title}`}`);
|
|
1187
|
-
|
|
1188
|
-
|
|
1214
|
+
const fix = standstillFixForRead(standstill, commitment.id);
|
|
1215
|
+
if (fix)
|
|
1216
|
+
log(` Fix: ${fix}`);
|
|
1189
1217
|
if (standstill.alsoConstrained?.length) {
|
|
1190
1218
|
const also = standstill.alsoConstrained
|
|
1191
1219
|
.map((entry) => {
|