@skrr-ai/cli 0.1.94 → 0.1.96
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +175 -165
- package/bin/run.js +32 -0
- package/bin/update-npm-runner.cjs +33 -0
- package/bin/update-session.cjs +194 -0
- package/bin/update-worker.cjs +208 -0
- package/dist/base-command.js +0 -15
- package/dist/commands/agent/message/send.d.ts +2 -0
- package/dist/commands/agent/message/send.js +75 -5
- package/dist/commands/agents/chat.js +1 -1
- package/dist/commands/agents/create.d.ts +0 -3
- package/dist/commands/agents/create.js +0 -26
- package/dist/commands/agents/egress.d.ts +17 -0
- package/dist/commands/agents/egress.js +84 -0
- package/dist/commands/agents/mailbox/messages.d.ts +14 -0
- package/dist/commands/agents/mailbox/messages.js +52 -0
- package/dist/commands/agents/mailbox/show.d.ts +13 -0
- package/dist/commands/agents/mailbox/show.js +52 -0
- package/dist/commands/agents/operating-plan.js +8 -0
- package/dist/commands/agents/roles/capture.d.ts +16 -0
- package/dist/commands/agents/roles/capture.js +53 -0
- package/dist/commands/agents/roles/install.d.ts +1 -0
- package/dist/commands/agents/roles/install.js +8 -1
- package/dist/commands/agents/roles/preview.d.ts +2 -0
- package/dist/commands/agents/roles/preview.js +27 -3
- package/dist/commands/agents/update.d.ts +0 -3
- package/dist/commands/agents/update.js +1 -31
- package/dist/commands/agents/usage-cap.d.ts +4 -1
- package/dist/commands/agents/usage-cap.js +49 -10
- package/dist/commands/code/doctor.d.ts +1 -0
- package/dist/commands/code/doctor.js +6 -0
- package/dist/commands/code/index.js +4 -0
- package/dist/commands/code/install.d.ts +5 -62
- package/dist/commands/code/install.js +86 -279
- package/dist/commands/code/jobs/show.js +12 -0
- package/dist/commands/code/rollback.d.ts +8 -0
- package/dist/commands/code/rollback.js +20 -0
- package/dist/commands/code/update.d.ts +8 -37
- package/dist/commands/code/update.js +134 -213
- package/dist/commands/commitments/action-proposals/decide.d.ts +2 -0
- package/dist/commands/commitments/action-proposals/decide.js +12 -0
- package/dist/commands/commitments/action-proposals.js +7 -0
- package/dist/commands/commitments/create.d.ts +1 -0
- package/dist/commands/commitments/create.js +17 -1
- package/dist/commands/commitments/delivery.d.ts +1 -0
- package/dist/commands/commitments/delivery.js +11 -1
- package/dist/commands/commitments/doctor.js +4 -0
- package/dist/commands/commitments/effective-policy.js +26 -0
- package/dist/commands/commitments/endpoints/create.js +5 -2
- package/dist/commands/commitments/observations.d.ts +10 -0
- package/dist/commands/commitments/observations.js +88 -0
- package/dist/commands/commitments/pause.d.ts +1 -1
- package/dist/commands/commitments/pause.js +4 -3
- package/dist/commands/commitments/preflight.js +2 -1
- package/dist/commands/commitments/reports.d.ts +2 -0
- package/dist/commands/commitments/reports.js +22 -4
- package/dist/commands/commitments/update.d.ts +1 -0
- package/dist/commands/commitments/update.js +35 -5
- package/dist/commands/daemon/install.js +4 -0
- package/dist/commands/generate-recovery-code.d.ts +13 -1
- package/dist/commands/generate-recovery-code.js +146 -13
- package/dist/commands/grants/create.d.ts +1 -0
- package/dist/commands/grants/create.js +8 -0
- package/dist/commands/grants/rotate.d.ts +5 -0
- package/dist/commands/grants/rotate.js +13 -1
- package/dist/commands/grants/update.d.ts +12 -0
- package/dist/commands/grants/update.js +27 -0
- package/dist/commands/instructions/guide.d.ts +20 -0
- package/dist/commands/instructions/guide.js +84 -0
- package/dist/commands/instructions/install.js +57 -33
- package/dist/commands/instructions/setup.d.ts +14 -0
- package/dist/commands/instructions/setup.js +72 -0
- package/dist/commands/integrations/execute.js +1 -1
- package/dist/commands/login.d.ts +5 -6
- package/dist/commands/login.js +27 -11
- package/dist/commands/logout.js +7 -7
- package/dist/commands/machines/hosted/start.js +7 -1
- package/dist/commands/machines/list.js +4 -4
- package/dist/commands/measures/confirm.d.ts +1 -7
- package/dist/commands/measures/confirm.js +15 -14
- package/dist/commands/measures/list.d.ts +1 -7
- package/dist/commands/measures/list.js +1 -7
- package/dist/commands/measures/record.js +4 -4
- package/dist/commands/measures/show.d.ts +11 -0
- package/dist/commands/measures/show.js +26 -0
- package/dist/commands/northstars/governance/configure.d.ts +1 -0
- package/dist/commands/northstars/governance/configure.js +8 -1
- package/dist/commands/proposals/discard.d.ts +5 -0
- package/dist/commands/proposals/discard.js +8 -0
- package/dist/commands/proposals/keep.d.ts +5 -0
- package/dist/commands/proposals/keep.js +8 -0
- package/dist/commands/proposals/list.d.ts +15 -0
- package/dist/commands/proposals/list.js +74 -0
- package/dist/commands/proposals/show.d.ts +12 -0
- package/dist/commands/proposals/show.js +27 -0
- package/dist/commands/proposals/snooze.d.ts +5 -0
- package/dist/commands/proposals/snooze.js +8 -0
- package/dist/commands/security/overview.d.ts +11 -0
- package/dist/commands/security/overview.js +158 -0
- package/dist/commands/signals/monitors/create.d.ts +9 -0
- package/dist/commands/signals/monitors/create.js +29 -0
- package/dist/commands/signals/monitors/list.d.ts +8 -0
- package/dist/commands/signals/monitors/list.js +16 -0
- package/dist/commands/signals/monitors/pause.d.ts +11 -0
- package/dist/commands/signals/monitors/pause.js +17 -0
- package/dist/commands/signals/monitors/resume.d.ts +11 -0
- package/dist/commands/signals/monitors/resume.js +17 -0
- package/dist/commands/signals/monitors/revise.d.ts +12 -0
- package/dist/commands/signals/monitors/revise.js +25 -0
- package/dist/commands/signals/monitors/show.d.ts +11 -0
- package/dist/commands/signals/monitors/show.js +17 -0
- package/dist/commands/signals/monitors/test.d.ts +12 -0
- package/dist/commands/signals/monitors/test.js +25 -0
- package/dist/commands/signals/monitors/transitions.d.ts +11 -0
- package/dist/commands/signals/monitors/transitions.js +17 -0
- package/dist/commands/signals/monitors/validate.d.ts +9 -0
- package/dist/commands/signals/monitors/validate.js +24 -0
- package/dist/commands/signals/schemas/list.d.ts +8 -0
- package/dist/commands/signals/schemas/list.js +16 -0
- package/dist/commands/signals/schemas/show.d.ts +11 -0
- package/dist/commands/signals/schemas/show.js +17 -0
- package/dist/commands/signals/sources/list.d.ts +8 -0
- package/dist/commands/signals/sources/list.js +16 -0
- package/dist/commands/signals/sources/receipts.d.ts +11 -0
- package/dist/commands/signals/sources/receipts.js +17 -0
- package/dist/commands/signals/sources/show.d.ts +11 -0
- package/dist/commands/signals/sources/show.js +17 -0
- package/dist/commands/spaces/claim.d.ts +12 -0
- package/dist/commands/spaces/claim.js +42 -0
- package/dist/commands/spaces/ownership.d.ts +12 -0
- package/dist/commands/spaces/ownership.js +46 -0
- package/dist/commands/spaces/usage.d.ts +12 -0
- package/dist/commands/spaces/usage.js +28 -0
- package/dist/commands/spaces/workflows/run.js +3 -0
- package/dist/commands/spaces/workflows/runs.js +2 -1
- package/dist/commands/spaces/workflows/update.d.ts +6 -1
- package/dist/commands/spaces/workflows/update.js +34 -2
- package/dist/commands/tasks/cancel-cascade.js +1 -1
- package/dist/commands/tasks/cascade-status.d.ts +2 -0
- package/dist/commands/tasks/cascade-status.js +27 -1
- package/dist/commands/tasks/create-tree.d.ts +5 -1
- package/dist/commands/tasks/create-tree.js +35 -7
- package/dist/commands/tasks/create.d.ts +4 -0
- package/dist/commands/tasks/create.js +16 -0
- package/dist/commands/tasks/deliverable/add.js +12 -3
- package/dist/commands/tasks/economics-compare.d.ts +15 -0
- package/dist/commands/tasks/economics-compare.js +60 -0
- package/dist/commands/tasks/expectations/evaluate.d.ts +13 -0
- package/dist/commands/tasks/expectations/evaluate.js +43 -0
- package/dist/commands/tasks/interrupt.js +2 -2
- package/dist/commands/tasks/list.d.ts +1 -0
- package/dist/commands/tasks/list.js +44 -1
- package/dist/commands/tasks/pause-schedule.js +1 -1
- package/dist/commands/tasks/show.d.ts +5 -0
- package/dist/commands/tasks/show.js +17 -0
- package/dist/commands/tasks/update.d.ts +4 -0
- package/dist/commands/tasks/update.js +9 -0
- package/dist/commands/tasks/workflow-findings.js +2 -2
- package/dist/commands/token/list.d.ts +3 -5
- package/dist/commands/token/list.js +99 -57
- package/dist/commands/triggers/create.d.ts +2 -0
- package/dist/commands/triggers/create.js +15 -0
- package/dist/commands/update.d.ts +14 -0
- package/dist/commands/update.js +61 -0
- package/dist/commands/workspaces/grants.d.ts +12 -0
- package/dist/commands/workspaces/grants.js +31 -0
- package/dist/commands/workspaces/stewardship.d.ts +13 -0
- package/dist/commands/workspaces/stewardship.js +34 -0
- package/dist/generated/managed-instruction-guides.json +9 -0
- package/dist/hooks/init.d.ts +5 -0
- package/dist/hooks/init.js +27 -0
- package/dist/lib/agent-config.d.ts +0 -12
- package/dist/lib/agent-config.js +1 -27
- package/dist/lib/agent-mailbox.d.ts +35 -0
- package/dist/lib/agent-mailbox.js +55 -0
- package/dist/lib/commitment-endpoints.d.ts +2 -1
- package/dist/lib/commitment-endpoints.js +2 -5
- package/dist/lib/commitment-product.d.ts +3 -1
- package/dist/lib/commitment-product.js +10 -0
- package/dist/lib/commitment-terms.js +1 -1
- package/dist/lib/commitments.d.ts +17 -15
- package/dist/lib/commitments.js +173 -137
- package/dist/lib/compasses.d.ts +14 -0
- package/dist/lib/compasses.js +25 -11
- package/dist/lib/daemon-installer.d.ts +2 -0
- package/dist/lib/daemon-installer.js +100 -24
- package/dist/lib/first-party-harness-doctor.js +31 -1
- package/dist/lib/first-party-harness-remote-install.d.ts +71 -0
- package/dist/lib/first-party-harness-remote-install.js +310 -0
- package/dist/lib/first-party-harness-remote-update.d.ts +46 -0
- package/dist/lib/first-party-harness-remote-update.js +242 -0
- package/dist/lib/first-party-harness-startup-update.d.ts +26 -0
- package/dist/lib/first-party-harness-startup-update.js +166 -0
- package/dist/lib/first-party-harness-update.d.ts +46 -0
- package/dist/lib/first-party-harness-update.js +289 -0
- package/dist/lib/first-party-harness.js +7 -4
- package/dist/lib/grants.d.ts +5 -1
- package/dist/lib/grants.js +9 -1
- package/dist/lib/hosted-machines.d.ts +7 -0
- package/dist/lib/mailbox-human-command.d.ts +11 -0
- package/dist/lib/mailbox-human-command.js +41 -0
- package/dist/lib/managed-instruction-local.d.ts +12 -0
- package/dist/lib/managed-instruction-local.js +58 -0
- package/dist/lib/managed-instruction-setup.d.ts +35 -0
- package/dist/lib/managed-instruction-setup.js +306 -0
- package/dist/lib/measures.d.ts +28 -2
- package/dist/lib/measures.js +38 -14
- package/dist/lib/memory-sync.d.ts +1 -0
- package/dist/lib/memory-sync.js +279 -68
- package/dist/lib/message-intent.d.ts +6 -2
- package/dist/lib/message-intent.js +1 -0
- package/dist/lib/northstars.js +2 -1
- package/dist/lib/platform-update-local.d.ts +2 -0
- package/dist/lib/platform-update-local.js +113 -0
- package/dist/lib/platform-update.d.ts +39 -0
- package/dist/lib/platform-update.js +84 -0
- package/dist/lib/profile-machine-identity-guard.d.ts +2 -0
- package/dist/lib/profile-machine-identity-guard.js +13 -0
- package/dist/lib/prompt.d.ts +1 -0
- package/dist/lib/prompt.js +4 -3
- package/dist/lib/proposal-decision-command.d.ts +19 -0
- package/dist/lib/proposal-decision-command.js +64 -0
- package/dist/lib/proposals.d.ts +8 -0
- package/dist/lib/proposals.js +22 -0
- package/dist/lib/roles.d.ts +141 -6
- package/dist/lib/roles.js +8 -2
- package/dist/lib/signals.d.ts +20 -0
- package/dist/lib/signals.js +24 -0
- package/dist/lib/space-usage.d.ts +3 -0
- package/dist/lib/space-usage.js +17 -0
- package/dist/lib/stewardship-output.d.ts +4 -0
- package/dist/lib/stewardship-output.js +82 -0
- package/dist/lib/task-asset-upload.d.ts +3 -1
- package/dist/lib/task-asset-upload.js +1 -0
- package/dist/lib/task-batch.d.ts +9 -0
- package/dist/lib/task-batch.js +94 -17
- package/dist/lib/task-economics.d.ts +16 -0
- package/dist/lib/task-economics.js +22 -0
- package/dist/lib/task-instruction-offer.d.ts +1 -4
- package/dist/lib/task-instruction-offer.js +3 -129
- package/dist/lib/triggers.d.ts +11 -3
- package/dist/lib/triggers.js +58 -1
- package/dist/lib/update-check.d.ts +61 -53
- package/dist/lib/update-check.js +453 -314
- package/dist/lib/usage-discovery.d.ts +10 -0
- package/dist/lib/usage-discovery.js +24 -3
- package/dist/lib/workflow-run-budget.d.ts +12 -0
- package/dist/lib/workflow-run-budget.js +37 -0
- package/dist/lib/workspaces.d.ts +48 -0
- package/dist/lib/workspaces.js +8 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/cliHandoffWire.js +14 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessReleaseKeys.js +105 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/firstPartyHarnessUpdater.js +945 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/githubPushRefusal.js +49 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/harnessPermissionControls.js +62 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/index.js +4 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releasePolicy.js +169 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/releaseVersions.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.d.ts +4 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/cliHandoffWire.js +12 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.d.ts +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessChannels.js +3 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.d.ts +82 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessReleaseKeys.js +102 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.d.ts +110 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/firstPartyHarnessUpdater.js +923 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.d.ts +9 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/githubPushRefusal.js +44 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.d.ts +32 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/harnessPermissionControls.js +59 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/index.js +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/machineUuid.js +35 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.d.ts +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releasePolicy.js +163 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.d.ts +2 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/releaseVersions.js +41 -0
- package/dist/node_modules/@skrr-ai/auth-core/package.json +41 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8069 -7121
- package/docs/v1/README.md +28 -0
- package/docs/v1/api.md +55 -0
- package/docs/v1/changelog.md +16 -0
- package/docs/v1/check-examples.mjs +178 -0
- package/docs/v1/examples/api-readonly.mjs +144 -0
- package/docs/v1/operations.md +87 -0
- package/docs/v1/quickstart.md +71 -0
- package/oclif.manifest.json +49424 -46174
- package/package.json +34 -11
package/dist/lib/commitments.js
CHANGED
|
@@ -11,7 +11,6 @@ exports.describeCommitmentConcurrency = describeCommitmentConcurrency;
|
|
|
11
11
|
exports.parseIntervalToMs = parseIntervalToMs;
|
|
12
12
|
exports.buildWatchedSources = buildWatchedSources;
|
|
13
13
|
exports.describeEvidenceHealth = describeEvidenceHealth;
|
|
14
|
-
exports.describeStalledHealth = describeStalledHealth;
|
|
15
14
|
exports.describeIntervalMs = describeIntervalMs;
|
|
16
15
|
exports.buildSuccessCriteria = buildSuccessCriteria;
|
|
17
16
|
exports.cadenceLabel = cadenceLabel;
|
|
@@ -34,6 +33,7 @@ exports.renderCommitmentCases = renderCommitmentCases;
|
|
|
34
33
|
exports.renderCommitmentCaseDetail = renderCommitmentCaseDetail;
|
|
35
34
|
exports.renderCommitmentRemediationProposals = renderCommitmentRemediationProposals;
|
|
36
35
|
exports.renderCommitmentRemediationProposal = renderCommitmentRemediationProposal;
|
|
36
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
37
37
|
/**
|
|
38
38
|
* commitments.ts — request-based client for the Commitments subsystem
|
|
39
39
|
* (`/api/commitments/*`).
|
|
@@ -52,22 +52,22 @@ exports.renderCommitmentRemediationProposal = renderCommitmentRemediationProposa
|
|
|
52
52
|
* Two `kind`s: `achieve` (bounded, deadline-bearing) and `maintain` (perpetual
|
|
53
53
|
* "hold this state", derived from a Compass invariant — not authored here).
|
|
54
54
|
*/
|
|
55
|
-
const
|
|
56
|
-
Object.defineProperty(exports, "COMMITMENT_WATCHED_SOURCES", { enumerable: true, get: function () { return
|
|
57
|
-
Object.defineProperty(exports, "COMMITMENT_TEMPLATE_IDS", { enumerable: true, get: function () { return
|
|
58
|
-
Object.defineProperty(exports, "COMMITMENT_CADENCE_MODES", { enumerable: true, get: function () { return
|
|
59
|
-
Object.defineProperty(exports, "COMMITMENT_CADENCE_TIME_PATTERN", { enumerable: true, get: function () { return
|
|
60
|
-
Object.defineProperty(exports, "COMMITMENT_CADENCE_MAX_TIMES", { enumerable: true, get: function () { return
|
|
61
|
-
Object.defineProperty(exports, "COMMITMENT_EXECUTION_ISOLATION_MODES", { enumerable: true, get: function () { return
|
|
62
|
-
Object.defineProperty(exports, "COMMITMENT_STATUSES", { enumerable: true, get: function () { return
|
|
63
|
-
Object.defineProperty(exports, "COMMITMENT_KIND_VALUES", { enumerable: true, get: function () { return
|
|
55
|
+
const data_provider_2 = require("@skrr-ai/data-provider");
|
|
56
|
+
Object.defineProperty(exports, "COMMITMENT_WATCHED_SOURCES", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_WATCHED_SOURCES; } });
|
|
57
|
+
Object.defineProperty(exports, "COMMITMENT_TEMPLATE_IDS", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_TEMPLATE_IDS; } });
|
|
58
|
+
Object.defineProperty(exports, "COMMITMENT_CADENCE_MODES", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_CADENCE_MODES; } });
|
|
59
|
+
Object.defineProperty(exports, "COMMITMENT_CADENCE_TIME_PATTERN", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_CADENCE_TIME_PATTERN; } });
|
|
60
|
+
Object.defineProperty(exports, "COMMITMENT_CADENCE_MAX_TIMES", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_CADENCE_MAX_TIMES; } });
|
|
61
|
+
Object.defineProperty(exports, "COMMITMENT_EXECUTION_ISOLATION_MODES", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_EXECUTION_ISOLATION_MODES; } });
|
|
62
|
+
Object.defineProperty(exports, "COMMITMENT_STATUSES", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_STATUSES; } });
|
|
63
|
+
Object.defineProperty(exports, "COMMITMENT_KIND_VALUES", { enumerable: true, get: function () { return data_provider_2.COMMITMENT_KIND_VALUES; } });
|
|
64
64
|
const commitment_product_1 = require("./commitment-product");
|
|
65
65
|
const instruction_input_1 = require("./instruction-input");
|
|
66
66
|
const format_1 = require("./format");
|
|
67
67
|
const triggers_1 = require("./triggers");
|
|
68
68
|
/** Derived from the installed compatibility vocabulary so the CLI remains
|
|
69
69
|
* safe even while data-provider and CLI packages roll out separately. */
|
|
70
|
-
exports.COMMITMENT_AUTHORABLE_CADENCE_MODES =
|
|
70
|
+
exports.COMMITMENT_AUTHORABLE_CADENCE_MODES = data_provider_2.COMMITMENT_CADENCE_MODES.filter((mode) => mode !== 'sampled');
|
|
71
71
|
/**
|
|
72
72
|
* Interval bounds for `cadence.intervalMs`.
|
|
73
73
|
*
|
|
@@ -111,13 +111,13 @@ function packBase(id) {
|
|
|
111
111
|
return `/api/commitment-packs/${encodeURIComponent(id)}`;
|
|
112
112
|
}
|
|
113
113
|
exports.commitmentPackApi = {
|
|
114
|
-
list: () =>
|
|
115
|
-
plan: (body) =>
|
|
116
|
-
bind: (body) =>
|
|
117
|
-
preflight: (id, nextRunCount) =>
|
|
114
|
+
list: () => data_provider_2.request.get('/api/commitment-packs'),
|
|
115
|
+
plan: (body) => data_provider_2.request.post('/api/commitment-packs/plan', body),
|
|
116
|
+
bind: (body) => data_provider_2.request.post('/api/commitment-packs/bind', body),
|
|
117
|
+
preflight: (id, nextRunCount) => data_provider_2.request.post(`${packBase(id)}/preflight`, {
|
|
118
118
|
...(typeof nextRunCount === 'number' ? { nextRunCount } : {}),
|
|
119
119
|
}),
|
|
120
|
-
activate: (id) =>
|
|
120
|
+
activate: (id) => data_provider_2.request.post(`${packBase(id)}/activate`, {}),
|
|
121
121
|
};
|
|
122
122
|
exports.commitmentApi = {
|
|
123
123
|
/**
|
|
@@ -126,30 +126,30 @@ exports.commitmentApi = {
|
|
|
126
126
|
* the coverage check, which is how an endpoint ends up unreachable without
|
|
127
127
|
* anything failing.
|
|
128
128
|
*/
|
|
129
|
-
list: (query = {}) =>
|
|
129
|
+
list: (query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/commitments', query)),
|
|
130
130
|
/**
|
|
131
131
|
* Fleet-level liveness sweep health (OSK-10958): when the reconciler last
|
|
132
132
|
* swept, how stale that is, and the tally it last persisted. Aggregate only.
|
|
133
133
|
*/
|
|
134
|
-
livenessSweep: () =>
|
|
135
|
-
manifest: (id) =>
|
|
136
|
-
import: (body) =>
|
|
137
|
-
fork: (id, body) =>
|
|
134
|
+
livenessSweep: () => data_provider_2.request.get('/api/commitments/liveness/sweep'),
|
|
135
|
+
manifest: (id) => data_provider_2.request.get(`${base(id)}/manifest`),
|
|
136
|
+
import: (body) => data_provider_2.request.post('/api/commitments/import', body),
|
|
137
|
+
fork: (id, body) => data_provider_2.request.post(`${base(id)}/fork`, body),
|
|
138
138
|
// GET /:id returns `{ commitment, latestCheck }` — NOT a bare contract.
|
|
139
139
|
// Unwrap before rendering, or every field reads as undefined.
|
|
140
|
-
get: (id) =>
|
|
141
|
-
create: (body) =>
|
|
142
|
-
update: (id, body) =>
|
|
143
|
-
draftPreflight: (body) =>
|
|
144
|
-
workLinks: (id, includeInactive = false) =>
|
|
145
|
-
createWorkLink: (id, body) =>
|
|
146
|
-
updateWorkLink: (id, linkId, body) =>
|
|
147
|
-
detachWorkLink: (id, linkId) =>
|
|
148
|
-
plan: (body) =>
|
|
149
|
-
checkNow: (id) =>
|
|
150
|
-
checks: (id, query = {}) =>
|
|
151
|
-
actionHistory: (id, query = {}) =>
|
|
152
|
-
actionProposals: (id, query = {}) =>
|
|
140
|
+
get: (id) => data_provider_2.request.get(base(id)),
|
|
141
|
+
create: (body) => data_provider_2.request.post('/api/commitments', body),
|
|
142
|
+
update: (id, body) => data_provider_2.request.patch(base(id), body),
|
|
143
|
+
draftPreflight: (body) => data_provider_2.request.post('/api/commitments/preflight', body),
|
|
144
|
+
workLinks: (id, includeInactive = false) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/links`, { ...(includeInactive ? { includeInactive: true } : {}) })),
|
|
145
|
+
createWorkLink: (id, body) => data_provider_2.request.post(`${base(id)}/links`, body),
|
|
146
|
+
updateWorkLink: (id, linkId, body) => data_provider_2.request.patch(`${base(id)}/links/${encodeURIComponent(linkId)}`, body),
|
|
147
|
+
detachWorkLink: (id, linkId) => data_provider_2.request.delete(`${base(id)}/links/${encodeURIComponent(linkId)}`),
|
|
148
|
+
plan: (body) => data_provider_2.request.post('/api/commitments/plan', body),
|
|
149
|
+
checkNow: (id) => data_provider_2.request.post(`${base(id)}/check-now`, {}),
|
|
150
|
+
checks: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/checks`, query)),
|
|
151
|
+
actionHistory: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/action-history`, query)),
|
|
152
|
+
actionProposals: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/action-proposals`, query)),
|
|
153
153
|
/**
|
|
154
154
|
* Propose a prepared action for a check.
|
|
155
155
|
*
|
|
@@ -159,17 +159,20 @@ exports.commitmentApi = {
|
|
|
159
159
|
* rule exists to catch. A locally-running agent that has investigated a
|
|
160
160
|
* commitment and knows what should be done had no way to say so.
|
|
161
161
|
*/
|
|
162
|
-
proposeActionProposal: (id, body) =>
|
|
163
|
-
decideActionProposal: (id, proposalId, decision, snapshot) =>
|
|
162
|
+
proposeActionProposal: (id, body) => data_provider_2.request.post(`${base(id)}/action-proposals`, body),
|
|
163
|
+
decideActionProposal: (id, proposalId, decision, snapshot) => data_provider_2.request.post(`${base(id)}/action-proposals/${encodeURIComponent(proposalId)}/decision`, {
|
|
164
164
|
decision,
|
|
165
165
|
...(snapshot?.snapshotDigest ? { snapshotDigest: snapshot.snapshotDigest } : {}),
|
|
166
166
|
...(snapshot?.bundleVersion ? { bundleVersion: snapshot.bundleVersion } : {}),
|
|
167
|
+
...(snapshot?.reason ? { reason: snapshot.reason } : {}),
|
|
168
|
+
...(snapshot?.reasonCode ? { reasonCode: snapshot.reasonCode } : {}),
|
|
169
|
+
via: 'cli',
|
|
167
170
|
}),
|
|
168
|
-
executeActionProposal: (id, proposalId) =>
|
|
169
|
-
preflight: (id, nextRunCount) =>
|
|
171
|
+
executeActionProposal: (id, proposalId) => data_provider_2.request.post(`${base(id)}/action-proposals/${encodeURIComponent(proposalId)}/execute`, {}),
|
|
172
|
+
preflight: (id, nextRunCount) => data_provider_2.request.post(`${base(id)}/preflight`, {
|
|
170
173
|
...(typeof nextRunCount === 'number' ? { nextRunCount } : {}),
|
|
171
174
|
}),
|
|
172
|
-
effectivePolicy: (id) =>
|
|
175
|
+
effectivePolicy: (id) => data_provider_2.request.get(`${base(id)}/effective-policy`),
|
|
173
176
|
/**
|
|
174
177
|
* Executor rebind — `POST /api/commitments/:id/executor` (impl contract B4,
|
|
175
178
|
* docs/architecture/execution-handover-2026-09-17.md P4).
|
|
@@ -178,28 +181,28 @@ exports.commitmentApi = {
|
|
|
178
181
|
* explicit recorded act: the server appends an `executorHandovers` entry
|
|
179
182
|
* rather than letting a bare PATCH rewrite who owns the loop without a trail.
|
|
180
183
|
*/
|
|
181
|
-
setExecutor: (id, body) =>
|
|
182
|
-
pause: (id) =>
|
|
183
|
-
resume: (id) =>
|
|
184
|
-
complete: (id) =>
|
|
185
|
-
delivery: (id, body) =>
|
|
186
|
-
receipts: (id, query = 1) =>
|
|
187
|
-
receiptQuarterlyMetrics: (id, year, quarter) =>
|
|
188
|
-
deliveryPatch: (id, taskId) =>
|
|
189
|
-
deliveryBundle: (id, taskId) =>
|
|
190
|
-
operatingReview: (agentId) =>
|
|
191
|
-
reflection: (id) =>
|
|
192
|
-
decideReflectionProposal: (id, proposalKey, decision) =>
|
|
184
|
+
setExecutor: (id, body) => data_provider_2.request.post(`${base(id)}/executor`, body),
|
|
185
|
+
pause: (id) => data_provider_2.request.post(`${base(id)}/pause`, {}),
|
|
186
|
+
resume: (id) => data_provider_2.request.post(`${base(id)}/resume`, {}),
|
|
187
|
+
complete: (id) => data_provider_2.request.post(`${base(id)}/complete`, {}),
|
|
188
|
+
delivery: (id, body) => data_provider_2.request.post(`${base(id)}/delivery`, body),
|
|
189
|
+
receipts: (id, query = 1) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/receipts`, typeof query === 'number' ? { limit: query } : query)),
|
|
190
|
+
receiptQuarterlyMetrics: (id, year, quarter) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/receipt-metrics/quarterly`, { year, quarter })),
|
|
191
|
+
deliveryPatch: (id, taskId) => data_provider_2.request.get(`${base(id)}/delivery/${encodeURIComponent(taskId)}/patch`),
|
|
192
|
+
deliveryBundle: (id, taskId) => data_provider_2.request.get(`${base(id)}/delivery/${encodeURIComponent(taskId)}/bundle`),
|
|
193
|
+
operatingReview: (agentId) => data_provider_2.request.get(`/api/commitments/agents/${encodeURIComponent(agentId)}/operating-review`),
|
|
194
|
+
reflection: (id) => data_provider_2.request.get(`${base(id)}/reflection`),
|
|
195
|
+
decideReflectionProposal: (id, proposalKey, decision) => data_provider_2.request.post(`${base(id)}/reflection/proposals/${encodeURIComponent(proposalKey)}/decision`, {
|
|
193
196
|
decision,
|
|
194
197
|
}),
|
|
195
198
|
/** Case and remediation-proposal reads make a commitment's open loop inspectable. */
|
|
196
|
-
cases: (id, query = {}) =>
|
|
197
|
-
caseDetail: (id, caseId) =>
|
|
198
|
-
remediationProposals: (id, query = {}) =>
|
|
199
|
-
remediationProposal: (id, proposalId) =>
|
|
200
|
-
proposeRemediation: (id, caseId, body) =>
|
|
201
|
-
decideRemediationProposal: (id, proposalId, body) =>
|
|
202
|
-
executeRemediationProposal: (id, proposalId, retryExecuting = false) =>
|
|
199
|
+
cases: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/cases`, query)),
|
|
200
|
+
caseDetail: (id, caseId) => data_provider_2.request.get(`${base(id)}/cases/${encodeURIComponent(caseId)}`),
|
|
201
|
+
remediationProposals: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/remediation-proposals`, query)),
|
|
202
|
+
remediationProposal: (id, proposalId) => data_provider_2.request.get(`${base(id)}/remediation-proposals/${encodeURIComponent(proposalId)}`),
|
|
203
|
+
proposeRemediation: (id, caseId, body) => data_provider_2.request.post(`${base(id)}/cases/${encodeURIComponent(caseId)}/remediation-proposals`, body),
|
|
204
|
+
decideRemediationProposal: (id, proposalId, body) => data_provider_2.request.post(`${base(id)}/remediation-proposals/${encodeURIComponent(proposalId)}/decision`, body),
|
|
205
|
+
executeRemediationProposal: (id, proposalId, retryExecuting = false) => data_provider_2.request.post(`${base(id)}/remediation-proposals/${encodeURIComponent(proposalId)}/execute`, {
|
|
203
206
|
retryExecuting,
|
|
204
207
|
}),
|
|
205
208
|
/* ------------------------------------------------------------------------ *
|
|
@@ -211,33 +214,33 @@ exports.commitmentApi = {
|
|
|
211
214
|
* Agent is even allowed to pick (`wakeCapabilities`). Each has a distinct
|
|
212
215
|
* authority, which is why none of them is a field on `show`.
|
|
213
216
|
* ------------------------------------------------------------------------ */
|
|
214
|
-
triggerStatus: (id, limit) =>
|
|
215
|
-
workLineage: (id, limit) =>
|
|
217
|
+
triggerStatus: (id, limit) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/trigger-status`, { limit })),
|
|
218
|
+
workLineage: (id, limit) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/work-lineage`, { limit })),
|
|
216
219
|
/** One ordered explanation surface across the immutable commitment ledgers. */
|
|
217
220
|
/**
|
|
218
221
|
* Soft delete: the contract drops out of every read while the ledgers that
|
|
219
222
|
* reference it stay resolvable. Refused for an active or system-managed
|
|
220
223
|
* commitment — see CommitmentControl.deleteCommitment.
|
|
221
224
|
*/
|
|
222
|
-
remove: (id, reason, opts = {}) =>
|
|
225
|
+
remove: (id, reason, opts = {}) => data_provider_2.request.delete((0, triggers_1.withQuery)(base(id), {
|
|
223
226
|
...(reason ? { reason } : {}),
|
|
224
227
|
// Only sent when the caller actually decided. Omitting it is what makes
|
|
225
228
|
// the server ask rather than guess when there is open work.
|
|
226
229
|
...(opts.stopOpenWork === undefined ? {} : { stopOpenWork: String(opts.stopOpenWork) }),
|
|
227
230
|
})),
|
|
228
231
|
/** What a delete would leave behind. Read-only. */
|
|
229
|
-
deletionPreview: (id) =>
|
|
232
|
+
deletionPreview: (id) => data_provider_2.request.get(`${base(id)}/deletion-preview`),
|
|
230
233
|
/** Un-delete. Returns the Commitment PAUSED, never active. */
|
|
231
|
-
restore: (id) =>
|
|
232
|
-
trace: (id, query = {}) =>
|
|
234
|
+
restore: (id) => data_provider_2.request.post(`${base(id)}/restore`, {}),
|
|
235
|
+
trace: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/trace`, query)),
|
|
233
236
|
/** One Cycle per Check, newest first — the unit a person reads (D8). */
|
|
234
|
-
cycles: (id, query = {}) =>
|
|
237
|
+
cycles: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/cycles`, query)),
|
|
235
238
|
/** The latest Cycle walked as six questions; the first "no" is where it stopped. */
|
|
236
|
-
explain: (id) =>
|
|
237
|
-
ledger: (id, query = {}) =>
|
|
238
|
-
wakeCapabilities: (id) =>
|
|
239
|
-
dailyMetrics: (id, query = {}) =>
|
|
240
|
-
cadenceDecisions: (id, limit) =>
|
|
239
|
+
explain: (id) => data_provider_2.request.get(`${base(id)}/explain`),
|
|
240
|
+
ledger: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/ledger`, query)),
|
|
241
|
+
wakeCapabilities: (id) => data_provider_2.request.get(`${base(id)}/wake-capabilities`),
|
|
242
|
+
dailyMetrics: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/daily-metrics`, query)),
|
|
243
|
+
cadenceDecisions: (id, limit) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/cadence-decisions`, { limit })),
|
|
241
244
|
/**
|
|
242
245
|
* What the NEXT check would decide, computed without taking it.
|
|
243
246
|
*
|
|
@@ -250,7 +253,7 @@ exports.commitmentApi = {
|
|
|
250
253
|
* answer, and re-running a real check to find out changes the thing you are
|
|
251
254
|
* trying to observe.
|
|
252
255
|
*/
|
|
253
|
-
nextTick: (id) =>
|
|
256
|
+
nextTick: (id) => data_provider_2.request.get(`${base(id)}/next-tick`),
|
|
254
257
|
/**
|
|
255
258
|
* The accounting SHADOW readout behind allowance accounting.
|
|
256
259
|
*
|
|
@@ -259,7 +262,7 @@ exports.commitmentApi = {
|
|
|
259
262
|
* is "does this workspace have enough closed evidence to activate" rather than
|
|
260
263
|
* "what has this commitment spent". `cost` is the per-commitment question.
|
|
261
264
|
*/
|
|
262
|
-
accountingReadout: (id) =>
|
|
265
|
+
accountingReadout: (id) => data_provider_2.request.get(`${base(id)}/accounting-readout`),
|
|
263
266
|
/**
|
|
264
267
|
* Closed-period spend for ONE commitment over a UTC day window.
|
|
265
268
|
*
|
|
@@ -269,7 +272,7 @@ exports.commitmentApi = {
|
|
|
269
272
|
* quietly wrong. The server refuses a window that is not on UTC day
|
|
270
273
|
* boundaries, so the caller builds one rather than passing a wall-clock time.
|
|
271
274
|
*/
|
|
272
|
-
cost: (id, window) =>
|
|
275
|
+
cost: (id, window) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/cost`, window)),
|
|
273
276
|
/**
|
|
274
277
|
* What this commitment's RUNS claim to have seen (agent-as-sensor).
|
|
275
278
|
*
|
|
@@ -287,24 +290,32 @@ exports.commitmentApi = {
|
|
|
287
290
|
* "what have we already ruled out", which is the question a second
|
|
288
291
|
* investigation of the same drift most needs answered before it starts.
|
|
289
292
|
*/
|
|
290
|
-
hypotheses: (id, query = {}) =>
|
|
291
|
-
evaluations: (id, query = {}) =>
|
|
292
|
-
createEvaluation: (id, body) =>
|
|
293
|
-
retryEvaluationLearning: (id, scheduleId) =>
|
|
294
|
-
observations: (id, query = {}) =>
|
|
293
|
+
hypotheses: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/hypotheses`, query)),
|
|
294
|
+
evaluations: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/evaluations`, query)),
|
|
295
|
+
createEvaluation: (id, body) => data_provider_2.request.post(`${base(id)}/evaluations`, body),
|
|
296
|
+
retryEvaluationLearning: (id, scheduleId) => data_provider_2.request.post(`${base(id)}/evaluations/${encodeURIComponent(scheduleId)}/retry-learning`, {}),
|
|
297
|
+
observations: (id, query = {}) => {
|
|
298
|
+
const { latest, ...history } = query;
|
|
299
|
+
return data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/observations`, {
|
|
300
|
+
...history,
|
|
301
|
+
...(latest === true ? { latest: true } : {}),
|
|
302
|
+
}));
|
|
303
|
+
},
|
|
304
|
+
observationSeries: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/observations/series`, query)),
|
|
305
|
+
observationCompare: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/observations/compare`, query)),
|
|
295
306
|
/* ------------------------------------------------------------------------ *
|
|
296
307
|
* Steering
|
|
297
308
|
* ------------------------------------------------------------------------ */
|
|
298
309
|
/** One-tap feedback on a check — the signal Reflection retunes cadence from. */
|
|
299
|
-
checkFeedback: (id, checkId, body) =>
|
|
310
|
+
checkFeedback: (id, checkId, body) => data_provider_2.request.post(`${base(id)}/checks/${encodeURIComponent(checkId)}/feedback`, body),
|
|
300
311
|
/** Bounded, named corrections — never a free-form contract edit. */
|
|
301
|
-
remediate: (id, body) =>
|
|
312
|
+
remediate: (id, body) => data_provider_2.request.post(`${base(id)}/remediation`, body),
|
|
302
313
|
/** Approve/reject an Agent-proposed cadence change the server parked. */
|
|
303
|
-
decideCadenceRequest: (id, requestId, approved) =>
|
|
314
|
+
decideCadenceRequest: (id, requestId, approved) => data_provider_2.request.post(`${base(id)}/cadence-requests/${encodeURIComponent(requestId)}/decision`, {
|
|
304
315
|
approved,
|
|
305
316
|
}),
|
|
306
|
-
linkGoal: (id, goalId) =>
|
|
307
|
-
unlinkGoal: (id, goalId) =>
|
|
317
|
+
linkGoal: (id, goalId) => data_provider_2.request.put(`${base(id)}/goals/${encodeURIComponent(goalId)}`, {}),
|
|
318
|
+
unlinkGoal: (id, goalId) => data_provider_2.request.delete(`${base(id)}/goals/${encodeURIComponent(goalId)}`),
|
|
308
319
|
};
|
|
309
320
|
/** One-tap check feedback. `handled` means "I dealt with it", not "good nudge". */
|
|
310
321
|
exports.COMMITMENT_FEEDBACK_KINDS = ['useful', 'noisy', 'wrong', 'handled'];
|
|
@@ -380,6 +391,9 @@ function normalizeCreateBody(input) {
|
|
|
380
391
|
if (src[key] !== undefined)
|
|
381
392
|
out[key] = src[key];
|
|
382
393
|
}
|
|
394
|
+
const delivery = out.delivery;
|
|
395
|
+
if (delivery?.reviewPolicy !== undefined)
|
|
396
|
+
(0, commitment_product_1.normalizeTaskReviewPolicy)(delivery.reviewPolicy);
|
|
383
397
|
if (out.status !== 'draft') {
|
|
384
398
|
delete out.status;
|
|
385
399
|
}
|
|
@@ -603,57 +617,6 @@ function describeEvidenceHealth(health, criteriaCount) {
|
|
|
603
617
|
}
|
|
604
618
|
return `${state}${detail}`;
|
|
605
619
|
}
|
|
606
|
-
/**
|
|
607
|
-
* Why a commitment is `stalled`, in the reconciler's own words.
|
|
608
|
-
*
|
|
609
|
-
* These clauses are the CLI voicing of the `details` table in
|
|
610
|
-
* `CommitmentLivenessReconciler.alertCopy` — an operator who gets the alert
|
|
611
|
-
* ("<name> is stalled — its expected checks are no longer arriving") and then
|
|
612
|
-
* runs `commitments show` must read the same sentence, or the two surfaces look
|
|
613
|
-
* like two different problems.
|
|
614
|
-
*
|
|
615
|
-
* `contract_version_mismatch` has no entry there because it is not a diagnosis;
|
|
616
|
-
* the reconciler synthesises it when the running contract is fenced behind the
|
|
617
|
-
* authored one. It still reaches `state.liveness.diagnosisKind`, so it needs a
|
|
618
|
-
* clause here or the one case with an obvious fix prints bare.
|
|
619
|
-
*/
|
|
620
|
-
const STALLED_DIAGNOSES = {
|
|
621
|
-
scheduler_stalled: 'its expected checks are no longer arriving',
|
|
622
|
-
work_failing: 'every recent run reached the agent and failed while doing the work',
|
|
623
|
-
runtime_failing: 'recent runs never started — the runtime refused them',
|
|
624
|
-
result_rejected: 'every recent run reached the agent, but its result was rejected',
|
|
625
|
-
observation_unreadable: 'the latest check could not read every configured source',
|
|
626
|
-
execution_budget_exhausted: 'recent planned work was skipped — the execution budget is exhausted',
|
|
627
|
-
no_advancement: 'no server-recorded advancement exists inside the declared window',
|
|
628
|
-
owner_action_blocked: 'a completed work run is blocked pending owner action',
|
|
629
|
-
contract_version_mismatch: 'the running contract is older than the authored one; its triggers have not resynced',
|
|
630
|
-
};
|
|
631
|
-
/**
|
|
632
|
-
* `stalled` is a verdict, not a reason. Printed bare it reads like `unknown`
|
|
633
|
-
* with a harsher word, and the operator's next move is to go and read run
|
|
634
|
-
* history to find what the reconciler had already decided. Returns undefined
|
|
635
|
-
* for every other health value, including `unknown` — "nobody has judged" has
|
|
636
|
-
* no diagnosis to name.
|
|
637
|
-
*/
|
|
638
|
-
function describeStalledHealth(commitment) {
|
|
639
|
-
if (!['blocked', 'failed'].includes(commitment.assessment?.operation || ''))
|
|
640
|
-
return undefined;
|
|
641
|
-
const liveness = (commitment.state?.liveness || {});
|
|
642
|
-
const kind = typeof liveness.diagnosisKind === 'string' ? liveness.diagnosisKind : undefined;
|
|
643
|
-
const clause = (kind && STALLED_DIAGNOSES[kind]) ||
|
|
644
|
-
'this loop has stopped producing; the reconciler did not record which check failed';
|
|
645
|
-
// What refused and what to change, when the reconciler recorded them
|
|
646
|
-
// (OSK-12137). A machine failure has a specific fix; printing only the
|
|
647
|
-
// verdict would send the owner to read run history for it.
|
|
648
|
-
const code = typeof liveness.diagnosisCode === 'string' && liveness.diagnosisCode
|
|
649
|
-
? ` (${liveness.diagnosisCode})`
|
|
650
|
-
: '';
|
|
651
|
-
const since = typeof liveness.unhealthySinceAt === 'string' ? ` (since ${liveness.unhealthySinceAt})` : '';
|
|
652
|
-
const fix = typeof liveness.diagnosisFix === 'string' && liveness.diagnosisFix
|
|
653
|
-
? ` — ${liveness.diagnosisFix}`
|
|
654
|
-
: '';
|
|
655
|
-
return `${clause}${code}${since}${fix}`;
|
|
656
|
-
}
|
|
657
620
|
/** Render an interval back as a compact human string. */
|
|
658
621
|
function describeIntervalMs(ms) {
|
|
659
622
|
if (!ms || !Number.isFinite(ms))
|
|
@@ -866,7 +829,7 @@ latestCheck) {
|
|
|
866
829
|
const evidenceHealth = latestCheck?.inputs?.evidenceHealth;
|
|
867
830
|
const evidenceLine = describeEvidenceHealth(evidenceHealth, criteria.length);
|
|
868
831
|
const assessment = commitment.assessment
|
|
869
|
-
? (0,
|
|
832
|
+
? (0, data_provider_2.readCommitmentAssessment)(commitment.assessment)
|
|
870
833
|
: undefined;
|
|
871
834
|
log(`Assessment: ${assessment?.label ?? 'Unknown'}`);
|
|
872
835
|
log(`Evidence: ${assessment?.evidence ?? 'unavailable'}`);
|
|
@@ -886,7 +849,7 @@ latestCheck) {
|
|
|
886
849
|
if (standstill) {
|
|
887
850
|
const streak = commitment.state?.consecutiveUnresolvedChecks;
|
|
888
851
|
const streakClause = typeof streak === 'number' && streak >= 2 ? `${streak} checks in a row: ` : '';
|
|
889
|
-
log(`Standstill:${` ${streakClause}${(0,
|
|
852
|
+
log(`Standstill:${` ${streakClause}${(0, data_provider_2.describeStandstill)(standstill.reason).title}`}`);
|
|
890
853
|
if (standstill.fix)
|
|
891
854
|
log(` Fix: ${standstill.fix}`);
|
|
892
855
|
if (standstill.alsoConstrained?.length) {
|
|
@@ -899,7 +862,7 @@ latestCheck) {
|
|
|
899
862
|
})
|
|
900
863
|
.filter((r) => Boolean(r));
|
|
901
864
|
if (also.length)
|
|
902
|
-
log(` Also constrained: ${also.map((reason) => (0,
|
|
865
|
+
log(` Also constrained: ${also.map((reason) => (0, data_provider_2.describeStandstill)(reason).title).join(', ')}`);
|
|
903
866
|
}
|
|
904
867
|
}
|
|
905
868
|
const sources = (commitment.watchedSources || [])
|
|
@@ -1221,6 +1184,25 @@ function cycleSummary(cycle) {
|
|
|
1221
1184
|
}
|
|
1222
1185
|
return cycle.note || cycle.decision?.summary || cycle.decision?.posture || 'nothing to act on';
|
|
1223
1186
|
}
|
|
1187
|
+
/** Content-free rows admitted by the native sensor loader; licenses stay unknown. */
|
|
1188
|
+
function platformFetchLines(cycle) {
|
|
1189
|
+
const lines = [];
|
|
1190
|
+
for (const value of cycle.fetchReceipts || []) {
|
|
1191
|
+
const r = (0, data_provider_1.normalizeFetchReceipt)(value);
|
|
1192
|
+
if (!r) {
|
|
1193
|
+
lines.push('Platform fetch receipt: unknown.');
|
|
1194
|
+
continue;
|
|
1195
|
+
}
|
|
1196
|
+
lines.push(`Platform fetch: ${r.host || 'unknown'}${r.path || ''} · ${r.fetchedAt} · ${r.status === null ? 'HTTP response unknown' : `HTTP ${r.status}`} · ${r.bytes === null ? 'bytes unknown' : `${r.bytes} B`} · credential headers: ${r.authenticated ? 'present' : 'absent'} · license: unknown`);
|
|
1197
|
+
if (r.contentDigest)
|
|
1198
|
+
lines.push(` bounded-body SHA256: ${r.contentDigest}`);
|
|
1199
|
+
}
|
|
1200
|
+
if (cycle.fetchReceiptUnavailable)
|
|
1201
|
+
lines.push('Platform fetch receipt: unknown.');
|
|
1202
|
+
if (cycle.fetchReceiptsTruncated)
|
|
1203
|
+
lines.push(`Showing ${cycle.fetchReceipts?.length || 0} of ${cycle.fetchReceiptCount || 0} platform fetch receipts.`);
|
|
1204
|
+
return lines;
|
|
1205
|
+
}
|
|
1224
1206
|
/**
|
|
1225
1207
|
* One line per Cycle:
|
|
1226
1208
|
* `09-22 12:04 ● stopped act commitment_execution_budget_exhausted — Raise maxRunsPerDay…`
|
|
@@ -1235,7 +1217,19 @@ function formatCommitmentCycles(page) {
|
|
|
1235
1217
|
for (const cycle of cycles) {
|
|
1236
1218
|
const glyph = CYCLE_GLYPH[cycle.outcome] || '?';
|
|
1237
1219
|
lines.push(`${cycleTime(cycle.startedAt)} ${glyph} ${String(cycle.outcome).padEnd(9)} ${cycleWake(cycle).padEnd(18)} ${cycleSummary(cycle)}`);
|
|
1220
|
+
lines.push(...platformFetchLines(cycle));
|
|
1221
|
+
lines.push(...formatCycleLatency(cycle));
|
|
1222
|
+
for (const task of cycle.tasks || []) {
|
|
1223
|
+
if (task.closureState !== 'open_items' && task.closureState !== 'overridden')
|
|
1224
|
+
continue;
|
|
1225
|
+
const label = task.closureState === 'overridden'
|
|
1226
|
+
? 'closed by explicit override'
|
|
1227
|
+
: 'closed with open items';
|
|
1228
|
+
lines.push(` task ${task.identifier || task.id} ${task.status || '-'} — ${label}`);
|
|
1229
|
+
}
|
|
1238
1230
|
for (const run of cycle.runs || []) {
|
|
1231
|
+
if (run.reportPayload)
|
|
1232
|
+
lines.push(` run ${run.id} report: ${run.reportPayload.status === 'rejected' ? 'structured report rejected; plain summary used' : 'structured report validated (delivery tracked separately)'}`);
|
|
1239
1233
|
if (!['machine', 'contract', 'work'].includes(run.failureClass))
|
|
1240
1234
|
continue;
|
|
1241
1235
|
const owner = run.failureOwner === 'model' ? 'model' : run.failureOwner || 'work';
|
|
@@ -1247,6 +1241,20 @@ function formatCommitmentCycles(page) {
|
|
|
1247
1241
|
}
|
|
1248
1242
|
return lines;
|
|
1249
1243
|
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Stage latency, measured on the server. An unmeasured hop prints
|
|
1246
|
+
* `unmeasurable`: "cannot see" must never read as "fast".
|
|
1247
|
+
*/
|
|
1248
|
+
function formatCycleLatency(cycle) {
|
|
1249
|
+
const latency = cycle.latency;
|
|
1250
|
+
const missingFor = (stage) => (latency?.pendingStages ? latency.pendingStages.includes(stage) : latency?.pending)
|
|
1251
|
+
? 'pending'
|
|
1252
|
+
: 'unmeasurable';
|
|
1253
|
+
if (latency?.measured === false) {
|
|
1254
|
+
return [` latency: ${latency.pending ? 'pending' : 'unmeasurable'}`];
|
|
1255
|
+
}
|
|
1256
|
+
return Object.entries(latency?.stages || {}).map(([stage, ms]) => ` ${stage}: ${typeof ms === 'number' ? `${ms}ms` : missingFor(stage)}`);
|
|
1257
|
+
}
|
|
1250
1258
|
const ANSWER_GLYPH = { yes: '✓', no: '✗', 'n/a': '–' };
|
|
1251
1259
|
/** The six questions for the latest Cycle, the first ✗ carrying its fix. */
|
|
1252
1260
|
function formatCommitmentExplanation(explanation) {
|
|
@@ -1256,6 +1264,8 @@ function formatCommitmentExplanation(explanation) {
|
|
|
1256
1264
|
? `Latest cycle: ${cycleTime(cycle.startedAt)} ${cycle.outcome} (${cycle.id})`
|
|
1257
1265
|
: `No cycle yet (status: ${explanation.status || '-'})`,
|
|
1258
1266
|
];
|
|
1267
|
+
if (cycle)
|
|
1268
|
+
lines.push(...formatCycleLatency(cycle));
|
|
1259
1269
|
for (const answer of explanation.answers || []) {
|
|
1260
1270
|
lines.push(` ${ANSWER_GLYPH[answer.answer] || '?'} ${answer.question} ${answer.because}`);
|
|
1261
1271
|
if (answer.fix)
|
|
@@ -1268,6 +1278,12 @@ function formatCommitmentExplanation(explanation) {
|
|
|
1268
1278
|
: `Stopped at: ${explanation.stoppedAt}`);
|
|
1269
1279
|
// What the next Run may do without asking — an Ask-mode Agent can ask
|
|
1270
1280
|
// nobody on an unattended Run (OSK-12201). Same lines as show/preflight.
|
|
1281
|
+
if (cycle) {
|
|
1282
|
+
lines.push(...platformFetchLines(cycle));
|
|
1283
|
+
for (const run of cycle.runs || [])
|
|
1284
|
+
if (run.reportPayload)
|
|
1285
|
+
lines.push(` run ${run.id} report: ${run.reportPayload.status === 'rejected' ? 'structured report rejected; plain summary used' : 'structured report validated (delivery tracked separately)'}`);
|
|
1286
|
+
}
|
|
1271
1287
|
lines.push(...permissionLines(explanation.permissions));
|
|
1272
1288
|
return lines;
|
|
1273
1289
|
}
|
|
@@ -1299,9 +1315,22 @@ function renderCommitmentObservations(response, log, options = {}) {
|
|
|
1299
1315
|
const data = records(response.data);
|
|
1300
1316
|
renderRows(data.map((item) => ({
|
|
1301
1317
|
at: text(firstValue(item, ['observedAt', 'createdAt', 'updatedAt'])),
|
|
1318
|
+
recorded: text(firstValue(item, ['recordedAt', 'createdAt'])),
|
|
1319
|
+
clamped: yesNo(item.observedAtClamped),
|
|
1320
|
+
claimed: text(item.claimedObservedAt),
|
|
1321
|
+
model: text(record(item.producer)?.model, 'model not reported'),
|
|
1322
|
+
modelSource: text(record(item.producer)?.modelSource, 'unknown'),
|
|
1302
1323
|
key: text(firstValue(item, ['key', 'observationKey', 'name'])),
|
|
1303
1324
|
value: (0, format_1.formatCell)(firstValue(item, ['value', 'observedValue', 'latestValue'])),
|
|
1304
1325
|
changed: yesNo(firstValue(item, ['changed', 'changeVerdict', 'verdict'])),
|
|
1326
|
+
reason: [
|
|
1327
|
+
(0, data_provider_1.describeObservationChange)(item).reason,
|
|
1328
|
+
(0, data_provider_1.describeObservationChange)(item).progress,
|
|
1329
|
+
]
|
|
1330
|
+
.filter(Boolean)
|
|
1331
|
+
.join(' '),
|
|
1332
|
+
reference: (0, data_provider_1.describeObservationChange)(item)
|
|
1333
|
+
.reference || '-',
|
|
1305
1334
|
// `declared` decides whether a row can move the loop at all: an undeclared
|
|
1306
1335
|
// key is recorded and inert, and "the sensor saw nothing" must not look
|
|
1307
1336
|
// like "the sensor saw something we did not ask about". An observation
|
|
@@ -1312,9 +1341,16 @@ function renderCommitmentObservations(response, log, options = {}) {
|
|
|
1312
1341
|
confidence: (0, format_1.formatCell)(item.confidence),
|
|
1313
1342
|
})), [
|
|
1314
1343
|
{ key: 'at', header: 'OBSERVED', maxWidth: 24 },
|
|
1344
|
+
{ key: 'recorded', header: 'RECORDED', maxWidth: 24 },
|
|
1345
|
+
{ key: 'clamped', header: 'CLAMPED', maxWidth: 8 },
|
|
1346
|
+
{ key: 'claimed', header: 'CLAIMED', maxWidth: 24 },
|
|
1347
|
+
{ key: 'model', header: 'MODEL', maxWidth: 40 },
|
|
1348
|
+
{ key: 'modelSource', header: 'MODEL SOURCE', maxWidth: 18 },
|
|
1315
1349
|
{ key: 'key', header: 'KEY', maxWidth: 30 },
|
|
1316
1350
|
{ key: 'value', header: 'VALUE', maxWidth: 38 },
|
|
1317
1351
|
{ key: 'changed', header: 'CHANGED', maxWidth: 8 },
|
|
1352
|
+
{ key: 'reason', header: 'REASON', maxWidth: 20 },
|
|
1353
|
+
{ key: 'reference', header: 'REFERENCE', maxWidth: 80 },
|
|
1318
1354
|
{ key: 'declared', header: 'DECLARED', maxWidth: 9 },
|
|
1319
1355
|
{ key: 'access', header: 'ACCESS', maxWidth: 13 },
|
|
1320
1356
|
{ key: 'confidence', header: 'CONF', maxWidth: 6 },
|
package/dist/lib/compasses.d.ts
CHANGED
|
@@ -23,6 +23,20 @@ export interface Compass {
|
|
|
23
23
|
domain?: string;
|
|
24
24
|
identity?: Record<string, unknown>;
|
|
25
25
|
scope?: Record<string, unknown>;
|
|
26
|
+
/** Enforced owner rules; everything else on a Compass is guidance. */
|
|
27
|
+
rules?: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
kind: string;
|
|
30
|
+
status?: string;
|
|
31
|
+
text?: string;
|
|
32
|
+
phrases?: string[];
|
|
33
|
+
effect?: string;
|
|
34
|
+
}>;
|
|
35
|
+
/** Stored rules that no longer validate: held covered results until edited or retired. */
|
|
36
|
+
rulesInvalid?: Array<{
|
|
37
|
+
id: string | null;
|
|
38
|
+
issues: string[];
|
|
39
|
+
}>;
|
|
26
40
|
invariantTargets?: CompassInvariantTarget[];
|
|
27
41
|
autonomyDefaults?: Record<string, unknown>;
|
|
28
42
|
communicationDefaults?: Record<string, unknown>;
|
package/dist/lib/compasses.js
CHANGED
|
@@ -5,6 +5,7 @@ exports.renderCompassList = renderCompassList;
|
|
|
5
5
|
exports.renderCompass = renderCompass;
|
|
6
6
|
exports.renderRevisionList = renderRevisionList;
|
|
7
7
|
exports.renderCompassTrace = renderCompassTrace;
|
|
8
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
8
9
|
/**
|
|
9
10
|
* compasses.ts — request-based client for `/api/compasses`.
|
|
10
11
|
*
|
|
@@ -25,22 +26,22 @@ exports.renderCompassTrace = renderCompassTrace;
|
|
|
25
26
|
* config rather than rewinding — so the ledger records that someone chose
|
|
26
27
|
* to go back.
|
|
27
28
|
*/
|
|
28
|
-
const
|
|
29
|
+
const data_provider_2 = require("@skrr-ai/data-provider");
|
|
29
30
|
const format_1 = require("./format");
|
|
30
31
|
const triggers_1 = require("./triggers");
|
|
31
32
|
exports.COMPASS_STATUSES = ['active', 'archived'];
|
|
32
33
|
const base = (id) => `/api/compasses/${encodeURIComponent(id)}`;
|
|
33
34
|
exports.compassApi = {
|
|
34
|
-
list: (query) =>
|
|
35
|
-
create: (body) =>
|
|
36
|
-
get: (id, query) =>
|
|
37
|
-
update: (id, body) =>
|
|
38
|
-
archive: (id, query) =>
|
|
39
|
-
revisions: (id, query) =>
|
|
40
|
-
trace: (id, query) =>
|
|
41
|
-
revert: (id, body) =>
|
|
42
|
-
appendTactic: (id, body) =>
|
|
43
|
-
commitments: (id, query) =>
|
|
35
|
+
list: (query) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/compasses', query)),
|
|
36
|
+
create: (body) => data_provider_2.request.post('/api/compasses', body),
|
|
37
|
+
get: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(base(id), query)),
|
|
38
|
+
update: (id, body) => data_provider_2.request.patch(base(id), body),
|
|
39
|
+
archive: (id, query) => data_provider_2.request.delete((0, triggers_1.withQuery)(base(id), query)),
|
|
40
|
+
revisions: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/revisions`, query)),
|
|
41
|
+
trace: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/trace`, query)),
|
|
42
|
+
revert: (id, body) => data_provider_2.request.post(`${base(id)}/revert`, body),
|
|
43
|
+
appendTactic: (id, body) => data_provider_2.request.post(`${base(id)}/tactics`, body),
|
|
44
|
+
commitments: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/commitments`, query)),
|
|
44
45
|
};
|
|
45
46
|
function shortDate(value) {
|
|
46
47
|
if (!value)
|
|
@@ -85,6 +86,19 @@ function renderCompass(compass, log) {
|
|
|
85
86
|
if (compass.communicationDefaults) {
|
|
86
87
|
log(`Comms ${JSON.stringify(compass.communicationDefaults)}`);
|
|
87
88
|
}
|
|
89
|
+
const rules = compass.rules ?? [];
|
|
90
|
+
if (rules.length) {
|
|
91
|
+
const active = rules.filter((rule) => (rule.status ?? 'active') === 'active');
|
|
92
|
+
log('');
|
|
93
|
+
log(`Enforced rules (${active.length} active, ${rules.length - active.length} other):`);
|
|
94
|
+
for (const rule of rules)
|
|
95
|
+
log(` • ${rule.id} [${rule.status ?? 'active'}]: ${rule.kind === 'text_required'
|
|
96
|
+
? `append "${rule.text}"`
|
|
97
|
+
: `${rule.effect} on ${(rule.phrases ?? []).map((phrase) => `"${phrase}"`).join(', ')}`}`);
|
|
98
|
+
log(` ${data_provider_1.OWNER_RULE_COVERAGE}`);
|
|
99
|
+
}
|
|
100
|
+
for (const bad of compass.rulesInvalid ?? [])
|
|
101
|
+
log(` ! INVALID rule ${bad.id ?? '(no id)'}: ${bad.issues.join('; ')}. Covered results are held until it is edited or retired.`);
|
|
88
102
|
const targets = compass.invariantTargets ?? [];
|
|
89
103
|
log('');
|
|
90
104
|
if (targets.length === 0) {
|
|
@@ -20,6 +20,8 @@ export interface DaemonInstallOptions {
|
|
|
20
20
|
feedBase?: string;
|
|
21
21
|
/** Injected for tests; defaults to global fetch. */
|
|
22
22
|
fetchImpl?: typeof fetch;
|
|
23
|
+
/** Cancel an in-progress install, including consumption of a response body. */
|
|
24
|
+
signal?: AbortSignal;
|
|
23
25
|
/**
|
|
24
26
|
* Trust anchors. Defaults to the pinned production set; tests substitute a
|
|
25
27
|
* generated keypair, exactly as the first-party harness installer does. Passing an EMPTY
|