@skrr-ai/cli 0.1.150 → 0.1.152
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 +20 -20
- package/dist/base-command.d.ts +6 -6
- package/dist/base-command.js +26 -26
- package/dist/commands/agenda/trigger/list.d.ts +1 -1
- package/dist/commands/agenda/trigger/list.js +6 -6
- package/dist/commands/agents/always-on/disable.js +10 -3
- package/dist/commands/agents/always-on/enable.js +1 -1
- package/dist/commands/agents/always-on/reconcile.js +1 -1
- package/dist/commands/agents/always-on/status.js +31 -8
- package/dist/commands/agents/chat.d.ts +3 -0
- package/dist/commands/agents/chat.js +27 -0
- package/dist/commands/agents/create.d.ts +2 -2
- package/dist/commands/agents/create.js +12 -12
- package/dist/commands/agents/egress.js +1 -1
- package/dist/commands/agents/list.d.ts +1 -1
- package/dist/commands/agents/list.js +1 -1
- package/dist/commands/agents/plan-day.d.ts +3 -0
- package/dist/commands/agents/plan-day.js +31 -8
- package/dist/commands/agents/roles/capture.d.ts +1 -1
- package/dist/commands/agents/roles/capture.js +2 -2
- package/dist/commands/agents/roles/install.js +1 -1
- package/dist/commands/agents/show.d.ts +3 -0
- package/dist/commands/agents/show.js +59 -3
- package/dist/commands/agents/spawn.js +38 -38
- package/dist/commands/agents/triggers/list.js +2 -1
- package/dist/commands/agents/update.d.ts +1 -1
- package/dist/commands/agents/update.js +3 -3
- package/dist/commands/balance/usage/breakdown.d.ts +1 -1
- package/dist/commands/balance/usage/breakdown.js +22 -6
- package/dist/commands/balance/usage/events.d.ts +3 -2
- package/dist/commands/balance/usage/events.js +34 -7
- package/dist/commands/code/jobs/show.js +1 -1
- package/dist/commands/compass/archive.d.ts +1 -1
- package/dist/commands/compass/archive.js +1 -1
- package/dist/commands/compass/create.js +1 -1
- package/dist/commands/compass/{commitments.d.ts → duties.d.ts} +5 -5
- package/dist/commands/compass/{commitments.js → duties.js} +14 -14
- package/dist/commands/compass/trace.d.ts +1 -1
- package/dist/commands/compass/trace.js +2 -2
- package/dist/commands/convos/messages.js +2 -1
- package/dist/commands/doctor.d.ts +1 -1
- package/dist/commands/doctor.js +1 -1
- package/dist/commands/{commitments → duties}/accounting.d.ts +7 -7
- package/dist/commands/{commitments → duties}/accounting.js +13 -13
- package/dist/commands/{commitments → duties}/action-history.d.ts +3 -3
- package/dist/commands/{commitments → duties}/action-history.js +12 -12
- package/dist/commands/{commitments → duties}/action-proposal.d.ts +2 -2
- package/dist/commands/{commitments → duties}/action-proposal.js +6 -6
- package/dist/commands/{commitments → duties}/action-proposals/decide.d.ts +2 -2
- package/dist/commands/{commitments → duties}/action-proposals/decide.js +8 -8
- package/dist/commands/{commitments → duties}/action-proposals/execute.d.ts +2 -2
- package/dist/commands/{commitments → duties}/action-proposals/execute.js +7 -7
- package/dist/commands/{commitments → duties}/action-proposals/propose.d.ts +4 -4
- package/dist/commands/{commitments → duties}/action-proposals/propose.js +15 -15
- package/dist/commands/{commitments → duties}/action-proposals.d.ts +1 -1
- package/dist/commands/{commitments → duties}/action-proposals.js +6 -6
- package/dist/commands/{commitments → duties}/analytics/detail.d.ts +5 -5
- package/dist/commands/{commitments → duties}/analytics/detail.js +13 -13
- package/dist/commands/{commitments → duties}/analytics/index.d.ts +5 -5
- package/dist/commands/{commitments → duties}/analytics/index.js +30 -30
- package/dist/commands/{commitments → duties}/analytics/replay.d.ts +3 -3
- package/dist/commands/{commitments → duties}/analytics/replay.js +11 -11
- package/dist/commands/{commitments → duties}/attach.d.ts +3 -3
- package/dist/commands/{commitments → duties}/attach.js +21 -21
- package/dist/commands/{commitments → duties}/bundle.d.ts +1 -1
- package/dist/commands/{commitments → duties}/bundle.js +7 -7
- package/dist/commands/{commitments → duties}/cadence-decisions.d.ts +3 -3
- package/dist/commands/duties/cadence-decisions.js +41 -0
- package/dist/commands/{commitments → duties}/cadence-requests/decide.d.ts +4 -4
- package/dist/commands/{commitments → duties}/cadence-requests/decide.js +11 -11
- package/dist/commands/{commitments → duties}/case.d.ts +2 -2
- package/dist/commands/{commitments → duties}/case.js +8 -8
- package/dist/commands/{commitments → duties}/cases.d.ts +2 -2
- package/dist/commands/{commitments → duties}/cases.js +9 -9
- package/dist/commands/{commitments → duties}/check-now.d.ts +6 -6
- package/dist/commands/{commitments → duties}/check-now.js +29 -29
- package/dist/commands/{commitments → duties}/checks.d.ts +3 -3
- package/dist/commands/{commitments → duties}/checks.js +13 -13
- package/dist/commands/{commitments → duties}/complete.d.ts +2 -2
- package/dist/commands/duties/complete.js +40 -0
- package/dist/commands/{commitments → duties}/control/apply.d.ts +1 -1
- package/dist/commands/{commitments → duties}/control/apply.js +7 -7
- package/dist/commands/{commitments → duties}/control/preview.d.ts +1 -1
- package/dist/commands/{commitments → duties}/control/preview.js +8 -8
- package/dist/commands/{commitments → duties}/control/show.d.ts +1 -1
- package/dist/commands/{commitments → duties}/control/show.js +6 -6
- package/dist/commands/{commitments → duties}/cost.d.ts +6 -6
- package/dist/commands/{commitments → duties}/cost.js +14 -14
- package/dist/commands/{commitments → duties}/create.d.ts +8 -8
- package/dist/commands/{commitments → duties}/create.js +92 -92
- package/dist/commands/{commitments → duties}/cycles.d.ts +2 -2
- package/dist/commands/{commitments → duties}/cycles.js +11 -11
- package/dist/commands/{commitments → duties}/decide-remediation.d.ts +2 -2
- package/dist/commands/{commitments → duties}/decide-remediation.js +6 -6
- package/dist/commands/{commitments → duties}/delete.d.ts +4 -4
- package/dist/commands/{commitments → duties}/delete.js +24 -24
- package/dist/commands/{commitments → duties}/delivery.d.ts +1 -1
- package/dist/commands/{commitments → duties}/delivery.js +15 -15
- package/dist/commands/{commitments → duties}/detach.d.ts +3 -3
- package/dist/commands/{commitments → duties}/detach.js +20 -20
- package/dist/commands/{commitments → duties}/doctor.d.ts +4 -4
- package/dist/commands/{commitments → duties}/doctor.js +21 -21
- package/dist/commands/{commitments → duties}/effective-policy.d.ts +3 -3
- package/dist/commands/{commitments → duties}/effective-policy.js +24 -24
- package/dist/commands/{commitments → duties}/endpoints/connect.d.ts +2 -2
- package/dist/commands/{commitments → duties}/endpoints/connect.js +10 -10
- package/dist/commands/{commitments → duties}/endpoints/create.d.ts +3 -3
- package/dist/commands/{commitments → duties}/endpoints/create.js +16 -16
- package/dist/commands/{commitments → duties}/endpoints/delete.d.ts +3 -3
- package/dist/commands/{commitments → duties}/endpoints/delete.js +11 -11
- package/dist/commands/{commitments → duties}/endpoints/health.d.ts +2 -2
- package/dist/commands/{commitments → duties}/endpoints/health.js +10 -10
- package/dist/commands/{commitments → duties}/endpoints/list.d.ts +3 -3
- package/dist/commands/{commitments → duties}/endpoints/list.js +11 -11
- package/dist/commands/{commitments → duties}/endpoints/revoke.d.ts +4 -4
- package/dist/commands/{commitments → duties}/endpoints/revoke.js +13 -13
- package/dist/commands/{commitments → duties}/evaluations.d.ts +2 -2
- package/dist/commands/{commitments → duties}/evaluations.js +8 -8
- package/dist/commands/{commitments → duties}/execute-remediation.d.ts +2 -2
- package/dist/commands/{commitments → duties}/execute-remediation.js +7 -7
- package/dist/commands/{commitments → duties}/explain.d.ts +2 -2
- package/dist/commands/{commitments → duties}/explain.js +13 -13
- package/dist/commands/{commitments → duties}/export.d.ts +3 -3
- package/dist/commands/{commitments → duties}/export.js +15 -15
- package/dist/commands/{commitments → duties}/feedback.d.ts +4 -4
- package/dist/commands/{commitments → duties}/feedback.js +13 -13
- package/dist/commands/{commitments → duties}/fork.d.ts +3 -3
- package/dist/commands/{commitments → duties}/fork.js +11 -11
- package/dist/commands/{commitments → duties}/goals/link.d.ts +6 -6
- package/dist/commands/duties/goals/link.js +41 -0
- package/dist/commands/{commitments → duties}/goals/unlink.d.ts +4 -4
- package/dist/commands/duties/goals/unlink.js +37 -0
- package/dist/commands/{commitments → duties}/handover.d.ts +5 -5
- package/dist/commands/{commitments → duties}/handover.js +21 -21
- package/dist/commands/{commitments → duties}/hypotheses.d.ts +3 -3
- package/dist/commands/{commitments → duties}/hypotheses.js +13 -13
- package/dist/commands/{commitments → duties}/import.d.ts +2 -2
- package/dist/commands/{commitments → duties}/import.js +10 -10
- package/dist/commands/{commitments → duties}/ledger.d.ts +4 -4
- package/dist/commands/{commitments → duties}/ledger.js +12 -12
- package/dist/commands/{commitments → duties}/lineage.d.ts +5 -5
- package/dist/commands/duties/lineage.js +43 -0
- package/dist/commands/{commitments → duties}/links/create.d.ts +2 -2
- package/dist/commands/{commitments → duties}/links/create.js +9 -9
- package/dist/commands/{commitments → duties}/links/detach.d.ts +2 -2
- package/dist/commands/{commitments → duties}/links/detach.js +7 -7
- package/dist/commands/{commitments → duties}/links/list.d.ts +2 -2
- package/dist/commands/{commitments → duties}/links/list.js +9 -9
- package/dist/commands/{commitments → duties}/links/update.d.ts +2 -2
- package/dist/commands/{commitments → duties}/links/update.js +7 -7
- package/dist/commands/{commitments → duties}/list.d.ts +3 -3
- package/dist/commands/{commitments → duties}/list.js +17 -17
- package/dist/commands/{commitments → duties}/liveness.d.ts +6 -6
- package/dist/commands/{commitments → duties}/liveness.js +13 -13
- package/dist/commands/{commitments → duties}/metrics.d.ts +3 -3
- package/dist/commands/{commitments → duties}/metrics.js +12 -12
- package/dist/commands/{commitments → duties}/next-tick.d.ts +7 -7
- package/dist/commands/{commitments → duties}/next-tick.js +14 -14
- package/dist/commands/{commitments → duties}/observation/probe.d.ts +1 -1
- package/dist/commands/{commitments → duties}/observation/probe.js +12 -12
- package/dist/commands/{commitments → duties}/observation/summary.d.ts +1 -1
- package/dist/commands/duties/observation/summary.js +53 -0
- package/dist/commands/{commitments → duties}/observations.d.ts +4 -4
- package/dist/commands/{commitments → duties}/observations.js +18 -18
- package/dist/commands/{commitments → duties}/open.d.ts +1 -1
- package/dist/commands/{commitments → duties}/open.js +13 -13
- package/dist/commands/{commitments → duties}/operating-review.d.ts +5 -5
- package/dist/commands/{commitments → duties}/operating-review.js +21 -21
- package/dist/commands/{commitments → duties}/pack/activate.d.ts +1 -1
- package/dist/commands/{commitments → duties}/pack/activate.js +6 -6
- package/dist/commands/{commitments → duties}/pack/bind.d.ts +4 -4
- package/dist/commands/{commitments → duties}/pack/bind.js +19 -19
- package/dist/commands/{commitments → duties}/pack/list.d.ts +2 -2
- package/dist/commands/{commitments → duties}/pack/list.js +10 -10
- package/dist/commands/{commitments → duties}/pack/plan.d.ts +3 -3
- package/dist/commands/{commitments → duties}/pack/plan.js +12 -12
- package/dist/commands/{commitments → duties}/pack/preflight.d.ts +3 -3
- package/dist/commands/{commitments → duties}/pack/preflight.js +10 -10
- package/dist/commands/{commitments → duties}/patch.d.ts +1 -1
- package/dist/commands/{commitments → duties}/patch.js +7 -7
- package/dist/commands/{commitments → duties}/pause.d.ts +2 -2
- package/dist/commands/{commitments → duties}/pause.js +16 -16
- package/dist/commands/{commitments → duties}/plan.d.ts +4 -4
- package/dist/commands/{commitments → duties}/plan.js +20 -20
- package/dist/commands/{commitments → duties}/preflight.d.ts +8 -8
- package/dist/commands/{commitments → duties}/preflight.js +32 -32
- package/dist/commands/{commitments → duties}/propose-remediation.d.ts +2 -2
- package/dist/commands/{commitments → duties}/propose-remediation.js +6 -6
- package/dist/commands/{commitments → duties}/readiness/show.d.ts +1 -1
- package/dist/commands/{commitments → duties}/readiness/show.js +6 -6
- package/dist/commands/{commitments → duties}/readiness/verify.d.ts +1 -1
- package/dist/commands/{commitments → duties}/readiness/verify.js +7 -7
- package/dist/commands/{commitments → duties}/receipt-metrics.d.ts +4 -4
- package/dist/commands/{commitments → duties}/receipt-metrics.js +16 -16
- package/dist/commands/{commitments → duties}/receipt.d.ts +1 -1
- package/dist/commands/{commitments → duties}/receipt.js +10 -10
- package/dist/commands/{commitments → duties}/reflect.d.ts +4 -4
- package/dist/commands/{commitments → duties}/reflect.js +12 -12
- package/dist/commands/{commitments → duties}/reflection-decision.d.ts +2 -2
- package/dist/commands/{commitments → duties}/reflection-decision.js +7 -7
- package/dist/commands/{commitments → duties}/reflection.d.ts +2 -2
- package/dist/commands/{commitments → duties}/reflection.js +9 -9
- package/dist/commands/{commitments → duties}/remediate.d.ts +5 -5
- package/dist/commands/{commitments → duties}/remediate.js +14 -14
- package/dist/commands/{commitments → duties}/remediation-proposal.d.ts +2 -2
- package/dist/commands/{commitments → duties}/remediation-proposal.js +7 -7
- package/dist/commands/{commitments → duties}/remediation-proposals.d.ts +2 -2
- package/dist/commands/{commitments → duties}/remediation-proposals.js +8 -8
- package/dist/commands/{commitments → duties}/reports.d.ts +5 -5
- package/dist/commands/{commitments → duties}/reports.js +35 -35
- package/dist/commands/{commitments → duties}/restore.d.ts +2 -2
- package/dist/commands/duties/restore.js +46 -0
- package/dist/commands/{commitments → duties}/resume.d.ts +2 -2
- package/dist/commands/duties/resume.js +37 -0
- package/dist/commands/{commitments → duties}/roster.d.ts +2 -2
- package/dist/commands/duties/roster.js +39 -0
- package/dist/commands/{commitments → duties}/show.d.ts +7 -7
- package/dist/commands/{commitments → duties}/show.js +40 -40
- package/dist/commands/{commitments → duties}/status.d.ts +3 -3
- package/dist/commands/duties/status.js +41 -0
- package/dist/commands/{commitments → duties}/subject.d.ts +4 -4
- package/dist/commands/{commitments → duties}/subject.js +29 -29
- package/dist/commands/{commitments → duties}/trace.d.ts +3 -3
- package/dist/commands/{commitments → duties}/trace.js +12 -12
- package/dist/commands/{commitments → duties}/trigger-status.d.ts +6 -6
- package/dist/commands/{commitments → duties}/trigger-status.js +19 -19
- package/dist/commands/{commitments → duties}/update.d.ts +5 -5
- package/dist/commands/{commitments → duties}/update.js +64 -64
- package/dist/commands/{commitments → duties}/wake-capabilities.d.ts +6 -6
- package/dist/commands/{commitments → duties}/wake-capabilities.js +22 -22
- package/dist/commands/{commitments → duties}/work-plan.d.ts +1 -1
- package/dist/commands/{commitments → duties}/work-plan.js +6 -6
- package/dist/commands/goals/key-results/show.js +2 -1
- package/dist/commands/goals/plan-now.js +3 -2
- package/dist/commands/goals/planner-compare.d.ts +1 -1
- package/dist/commands/goals/planner-compare.js +13 -2
- package/dist/commands/grants/create.d.ts +1 -1
- package/dist/commands/grants/create.js +9 -9
- package/dist/commands/grants/list.d.ts +1 -1
- package/dist/commands/grants/list.js +2 -2
- package/dist/commands/harnesses/list.d.ts +2 -1
- package/dist/commands/harnesses/list.js +7 -5
- package/dist/commands/harnesses/models.js +1 -1
- package/dist/commands/harnesses/quota.d.ts +9 -11
- package/dist/commands/harnesses/quota.js +83 -18
- package/dist/commands/harnesses/show.js +1 -1
- package/dist/commands/harnesses/usage.d.ts +19 -0
- package/dist/commands/harnesses/usage.js +27 -7
- package/dist/commands/initiatives/list.d.ts +1 -1
- package/dist/commands/initiatives/list.js +1 -1
- package/dist/commands/measures/create.d.ts +2 -2
- package/dist/commands/measures/create.js +4 -4
- package/dist/commands/measures/list.d.ts +1 -1
- package/dist/commands/measures/list.js +2 -2
- package/dist/commands/memory/topics/create.js +4 -1
- package/dist/commands/northstars/create.js +4 -4
- package/dist/commands/northstars/delete.d.ts +3 -3
- package/dist/commands/northstars/delete.js +8 -8
- package/dist/commands/northstars/governance/configure.js +15 -15
- package/dist/commands/northstars/intents/decide.d.ts +1 -1
- package/dist/commands/northstars/intents/decide.js +1 -1
- package/dist/commands/northstars/link.d.ts +4 -4
- package/dist/commands/northstars/link.js +8 -8
- package/dist/commands/northstars/list.d.ts +2 -2
- package/dist/commands/northstars/list.js +3 -3
- package/dist/commands/northstars/recommendations/apply.d.ts +1 -1
- package/dist/commands/northstars/recommendations/apply.js +2 -2
- package/dist/commands/northstars/review-now.js +2 -2
- package/dist/commands/northstars/show.d.ts +3 -3
- package/dist/commands/northstars/show.js +5 -5
- package/dist/commands/northstars/unlink.d.ts +3 -3
- package/dist/commands/northstars/unlink.js +6 -6
- package/dist/commands/northstars/update.js +3 -3
- package/dist/commands/proposals/list.d.ts +3 -3
- package/dist/commands/proposals/list.js +7 -7
- package/dist/commands/spaces/auto-executor/compare.js +1 -1
- package/dist/commands/spaces/auto-executor/runs.js +1 -1
- package/dist/commands/spaces/heartbeats/list.js +2 -2
- package/dist/commands/spaces/index.js +2 -2
- package/dist/commands/spaces/list.d.ts +1 -1
- package/dist/commands/spaces/list.js +1 -1
- package/dist/commands/spaces/loops/migrate.d.ts +1 -1
- package/dist/commands/spaces/loops/migrate.js +1 -1
- package/dist/commands/spaces/loops/release.d.ts +1 -1
- package/dist/commands/spaces/loops/release.js +10 -10
- package/dist/commands/spaces/notebook.d.ts +2 -2
- package/dist/commands/spaces/notebook.js +2 -2
- package/dist/commands/spaces/proposals/discard.js +1 -1
- package/dist/commands/spaces/proposals/keep.js +1 -1
- package/dist/commands/spaces/triggers/show.js +3 -3
- package/dist/commands/spaces/write-policy/set.js +1 -1
- package/dist/commands/store/uninstall.js +2 -2
- package/dist/commands/subscriptions/health.d.ts +2 -2
- package/dist/commands/subscriptions/health.js +2 -2
- package/dist/commands/subscriptions/status.js +2 -2
- package/dist/commands/subscriptions/subscribe.js +4 -4
- package/dist/commands/tasks/create.d.ts +20 -1
- package/dist/commands/tasks/create.js +44 -3
- package/dist/commands/tasks/list.d.ts +7 -1
- package/dist/commands/tasks/list.js +2 -1
- package/dist/commands/tokens/create.d.ts +3 -4
- package/dist/commands/tokens/create.js +20 -7
- package/dist/commands/triggers/preflight.js +9 -2
- package/dist/generated/agent-guides.json +496 -496
- package/dist/generated/managed-instruction-guides.json +2 -2
- package/dist/hooks/command-not-found.d.ts +1 -1
- package/dist/hooks/command-not-found.js +1 -1
- package/dist/lib/agent-chat-start.js +2 -1
- package/dist/lib/agent-model-check.js +3 -1
- package/dist/lib/agent-trigger-listing.d.ts +4 -4
- package/dist/lib/agent-trigger-listing.js +7 -7
- package/dist/lib/agentic-stream.js +6 -7
- package/dist/lib/always-on-command-result.d.ts +8 -1
- package/dist/lib/always-on-command-result.js +11 -2
- package/dist/lib/auth-failure.js +1 -1
- package/dist/lib/balance.d.ts +5 -2
- package/dist/lib/balance.js +26 -0
- package/dist/lib/capability-matrix.d.ts +3 -3
- package/dist/lib/capability-matrix.js +9 -9
- package/dist/lib/command-hygiene.js +6 -6
- package/dist/lib/command-miss.js +1 -1
- package/dist/lib/compass-refusals.d.ts +1 -1
- package/dist/lib/compass-refusals.js +1 -1
- package/dist/lib/compasses.d.ts +5 -5
- package/dist/lib/compasses.js +15 -15
- package/dist/lib/config.d.ts +1 -1
- package/dist/lib/config.js +1 -0
- package/dist/lib/dedicated-machines.js +2 -1
- package/dist/lib/dedicated-power.js +2 -0
- package/dist/lib/{commitments.d.ts → duties.d.ts} +198 -198
- package/dist/lib/{commitments.js → duties.js} +282 -282
- package/dist/lib/{commitment-analytics.d.ts → duty-analytics.d.ts} +18 -18
- package/dist/lib/{commitment-analytics.js → duty-analytics.js} +12 -12
- package/dist/lib/{commitment-attention-copy.d.ts → duty-attention-copy.d.ts} +6 -6
- package/dist/lib/{commitment-attention-copy.js → duty-attention-copy.js} +8 -8
- package/dist/lib/{commitment-endpoints.d.ts → duty-endpoints.d.ts} +6 -6
- package/dist/lib/{commitment-endpoints.js → duty-endpoints.js} +10 -10
- package/dist/lib/{commitment-event-wakes.d.ts → duty-event-wakes.d.ts} +2 -2
- package/dist/lib/{commitment-event-wakes.js → duty-event-wakes.js} +2 -2
- package/dist/lib/{commitment-ledgers.js → duty-ledgers.js} +3 -3
- package/dist/lib/{commitment-loop-status.d.ts → duty-loop-status.d.ts} +11 -11
- package/dist/lib/{commitment-loop-status.js → duty-loop-status.js} +22 -22
- package/dist/lib/{commitment-product.d.ts → duty-product.d.ts} +6 -6
- package/dist/lib/{commitment-product.js → duty-product.js} +5 -5
- package/dist/lib/{commitment-terms.d.ts → duty-terms.d.ts} +9 -9
- package/dist/lib/{commitment-terms.js → duty-terms.js} +21 -21
- package/dist/lib/entity-open.d.ts +1 -1
- package/dist/lib/entity-open.js +1 -1
- package/dist/lib/format.d.ts +1 -1
- package/dist/lib/grants.d.ts +3 -3
- package/dist/lib/grants.js +2 -2
- package/dist/lib/harness-labels.d.ts +1 -0
- package/dist/lib/harness-labels.js +4 -0
- package/dist/lib/harnesses.d.ts +35 -0
- package/dist/lib/harnesses.js +8 -0
- package/dist/lib/initiatives.js +4 -4
- package/dist/lib/machines.d.ts +2 -1
- package/dist/lib/machines.js +2 -2
- package/dist/lib/node-adapter.js +1 -1
- package/dist/lib/northstars.d.ts +13 -13
- package/dist/lib/northstars.js +56 -56
- package/dist/lib/open-target.js +1 -1
- package/dist/lib/preflight-copy.js +5 -5
- package/dist/lib/proactiveApi.d.ts +4 -4
- package/dist/lib/proposals.js +16 -16
- package/dist/lib/publicEndpoints.generated.d.ts +4 -0
- package/dist/lib/publicEndpoints.generated.js +4 -0
- package/dist/lib/responsibility-controls.d.ts +1 -1
- package/dist/lib/responsibility-controls.js +6 -6
- package/dist/lib/roles.d.ts +1 -1
- package/dist/lib/schedule.d.ts +6 -5
- package/dist/lib/schedule.js +5 -5
- package/dist/lib/session-task-write.d.ts +1 -1
- package/dist/lib/session-task-write.js +2 -2
- package/dist/lib/space-loop-migration.js +6 -6
- package/dist/lib/space-notebook.js +2 -2
- package/dist/lib/space-write-policy.js +2 -2
- package/dist/lib/stewardship-output.js +2 -2
- package/dist/lib/task-spec-verification.js +1 -1
- package/dist/lib/tasks.d.ts +1 -1
- package/dist/lib/tasks.js +8 -8
- package/dist/lib/triggers.d.ts +5 -5
- package/dist/lib/triggers.js +25 -16
- package/dist/lib/update-check.d.ts +1 -1
- package/dist/lib/update-check.js +12 -8
- package/dist/lib/usage-discovery.js +2 -4
- package/dist/lib/web-url.d.ts +6 -6
- package/dist/lib/web-url.js +13 -13
- package/dist/lib/workspaces.d.ts +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/{commitmentExecutionContract.d.ts → dutyExecutionContract.d.ts} +7 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/{commitmentExecutionContract.js → dutyExecutionContract.js} +22 -22
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceipt.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/executorStopReceiptV2.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +9 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +5 -5
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionRevocation.js +4 -4
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/types.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/workspaceIsolationProbeWire.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/{commitmentExecutionContract.d.ts → dutyExecutionContract.d.ts} +7 -7
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/{commitmentExecutionContract.js → dutyExecutionContract.js} +16 -16
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceipt.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/executorStopReceiptV2.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/profilePorts.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +9 -9
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -8
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.d.ts +2 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionRevocation.js +6 -6
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/types.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/workspaceIsolationProbeWire.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/workspaceIsolationProbeWire.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/package.json +6 -6
- package/dist/node_modules/@skrr-ai/data-provider/index.js +8295 -8283
- package/docs/v1/lookback-plans.md +1 -1
- package/oclif.manifest.json +5356 -5333
- package/package.json +16 -16
- package/dist/commands/commitments/cadence-decisions.js +0 -41
- package/dist/commands/commitments/complete.js +0 -40
- package/dist/commands/commitments/goals/link.js +0 -41
- package/dist/commands/commitments/goals/unlink.js +0 -37
- package/dist/commands/commitments/lineage.js +0 -43
- package/dist/commands/commitments/observation/summary.js +0 -31
- package/dist/commands/commitments/restore.js +0 -46
- package/dist/commands/commitments/resume.js +0 -37
- package/dist/commands/commitments/roster.js +0 -39
- package/dist/commands/commitments/status.js +0 -41
- /package/dist/lib/{commitment-ledgers.d.ts → duty-ledgers.d.ts} +0 -0
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.DUTY_CLI_EVALUATORS = exports.DUTY_CREATE_KEYS = exports.DUTY_REMEDIATION_ACTIONS = exports.DUTY_FEEDBACK_KINDS = exports.dutyApi = exports.dutyPackApi = exports.MAX_DUTY_INTERVAL_MS = exports.MIN_DUTY_INTERVAL_MS = exports.DUTY_EXECUTION_ISOLATION_MODES = exports.DUTY_AUTHORABLE_CADENCE_MODES = exports.DUTY_KIND_VALUES = exports.DUTY_STATUSES = exports.DUTY_CADENCE_MAX_TIMES = exports.DUTY_CADENCE_TIME_PATTERN = exports.DUTY_CADENCE_MODES = exports.DUTY_TEMPLATE_IDS = exports.DUTY_WATCHED_SOURCES = void 0;
|
|
4
4
|
exports.activationRefusalLines = activationRefusalLines;
|
|
5
5
|
exports.gateRefusesActivation = gateRefusesActivation;
|
|
6
6
|
exports.permissionLines = permissionLines;
|
|
7
7
|
exports.scheduleIssueLines = scheduleIssueLines;
|
|
8
8
|
exports.retiredFieldsLine = retiredFieldsLine;
|
|
9
|
-
exports.
|
|
9
|
+
exports.readDutyAgentDirective = readDutyAgentDirective;
|
|
10
10
|
exports.unrecognizedCreateKeys = unrecognizedCreateKeys;
|
|
11
11
|
exports.ignoredCreateKeys = ignoredCreateKeys;
|
|
12
12
|
exports.ignoredCreateKeysWarning = ignoredCreateKeysWarning;
|
|
13
13
|
exports.normalizeCreateBody = normalizeCreateBody;
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
14
|
+
exports.parseDutyConcurrencyLimit = parseDutyConcurrencyLimit;
|
|
15
|
+
exports.dutyConcurrencyEnvelopePatch = dutyConcurrencyEnvelopePatch;
|
|
16
16
|
exports.describeEvidenceGate = describeEvidenceGate;
|
|
17
|
-
exports.
|
|
17
|
+
exports.describeDutyConcurrency = describeDutyConcurrency;
|
|
18
18
|
exports.parseIntervalToMs = parseIntervalToMs;
|
|
19
19
|
exports.normalizeWatchedSourceDeclarations = normalizeWatchedSourceDeclarations;
|
|
20
20
|
exports.buildWatchedSources = buildWatchedSources;
|
|
@@ -24,7 +24,7 @@ exports.buildSuccessCriteria = buildSuccessCriteria;
|
|
|
24
24
|
exports.pendingCadenceRequestLines = pendingCadenceRequestLines;
|
|
25
25
|
exports.eventBackstopNote = eventBackstopNote;
|
|
26
26
|
exports.cadenceLabel = cadenceLabel;
|
|
27
|
-
exports.
|
|
27
|
+
exports.renderDutyList = renderDutyList;
|
|
28
28
|
exports.extractStandstillFromCheck = extractStandstillFromCheck;
|
|
29
29
|
exports.standstillFixForRead = standstillFixForRead;
|
|
30
30
|
exports.describeExecutorBlocked = describeExecutorBlocked;
|
|
@@ -33,65 +33,65 @@ exports.describeOperation = describeOperation;
|
|
|
33
33
|
exports.describeOperationFix = describeOperationFix;
|
|
34
34
|
exports.describeStoppedBy = describeStoppedBy;
|
|
35
35
|
exports.withLiveAssessment = withLiveAssessment;
|
|
36
|
-
exports.
|
|
37
|
-
exports.
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
36
|
+
exports.dutyWriteWarnings = dutyWriteWarnings;
|
|
37
|
+
exports.renderDutyWriteWarnings = renderDutyWriteWarnings;
|
|
38
|
+
exports.describeDutyRevision = describeDutyRevision;
|
|
39
|
+
exports.describeDutyPriority = describeDutyPriority;
|
|
40
40
|
exports.describeBoundCompass = describeBoundCompass;
|
|
41
41
|
exports.explainCompassLines = explainCompassLines;
|
|
42
|
-
exports.
|
|
42
|
+
exports.renderDutySummary = renderDutySummary;
|
|
43
43
|
exports.describeWakeDecision = describeWakeDecision;
|
|
44
44
|
exports.renderCheckList = renderCheckList;
|
|
45
|
-
exports.
|
|
46
|
-
exports.
|
|
45
|
+
exports.renderDutyLedger = renderDutyLedger;
|
|
46
|
+
exports.renderDutyTrace = renderDutyTrace;
|
|
47
47
|
exports.renderProactivenessScorecard = renderProactivenessScorecard;
|
|
48
|
-
exports.
|
|
48
|
+
exports.formatDutyCycles = formatDutyCycles;
|
|
49
49
|
exports.hypothesisRefusalLines = hypothesisRefusalLines;
|
|
50
50
|
exports.wakeOutcomeLines = wakeOutcomeLines;
|
|
51
|
-
exports.
|
|
51
|
+
exports.formatDutyExplanation = formatDutyExplanation;
|
|
52
52
|
exports.renderListPageHint = renderListPageHint;
|
|
53
53
|
exports.describeObservationArtifacts = describeObservationArtifacts;
|
|
54
54
|
exports.observationLegend = observationLegend;
|
|
55
|
-
exports.
|
|
56
|
-
exports.
|
|
57
|
-
exports.
|
|
58
|
-
exports.
|
|
55
|
+
exports.renderDutyObservations = renderDutyObservations;
|
|
56
|
+
exports.renderDutyHypotheses = renderDutyHypotheses;
|
|
57
|
+
exports.renderDutyLineage = renderDutyLineage;
|
|
58
|
+
exports.renderDutyMetrics = renderDutyMetrics;
|
|
59
59
|
exports.costRuleCell = costRuleCell;
|
|
60
|
-
exports.
|
|
61
|
-
exports.
|
|
62
|
-
exports.
|
|
63
|
-
exports.
|
|
60
|
+
exports.renderDutyCases = renderDutyCases;
|
|
61
|
+
exports.renderDutyCaseDetail = renderDutyCaseDetail;
|
|
62
|
+
exports.renderDutyRemediationProposals = renderDutyRemediationProposals;
|
|
63
|
+
exports.renderDutyRemediationProposal = renderDutyRemediationProposal;
|
|
64
64
|
const node_util_1 = require("node:util");
|
|
65
65
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
68
|
-
* (`/api/
|
|
67
|
+
* duties.ts — request-based client for the Duties subsystem
|
|
68
|
+
* (`/api/duties/*`).
|
|
69
69
|
*
|
|
70
70
|
* Mirrors the `triggerApi` / `scheduleApi` pattern: these endpoints are not
|
|
71
71
|
* exposed as `dataService.*` functions, so the CLI talks to them through the
|
|
72
72
|
* shared `request` transport.
|
|
73
73
|
*
|
|
74
|
-
* Concept: a **
|
|
74
|
+
* Concept: a **Duty** is a durable, agent-scoped contract —
|
|
75
75
|
* "hold this outcome true, and watch these sources on this cadence". It is NOT a
|
|
76
76
|
* unit of work. It sits ABOVE goals/tasks (which it watches as sensors) and runs
|
|
77
|
-
* its own closed control loop: a fast `
|
|
77
|
+
* its own closed control loop: a fast `duty_check` (sense → project open
|
|
78
78
|
* loops → decide a posture → route actions) and a slower reflection that retunes
|
|
79
|
-
* the
|
|
79
|
+
* the duty's own cadence from realized outcomes.
|
|
80
80
|
*
|
|
81
81
|
* Two `kind`s: `achieve` (bounded, deadline-bearing) and `maintain` (perpetual
|
|
82
82
|
* "hold this state", derived from a Compass invariant — not authored here).
|
|
83
83
|
*/
|
|
84
84
|
const data_provider_2 = require("@skrr-ai/data-provider");
|
|
85
|
-
Object.defineProperty(exports, "
|
|
86
|
-
Object.defineProperty(exports, "
|
|
87
|
-
Object.defineProperty(exports, "
|
|
88
|
-
Object.defineProperty(exports, "
|
|
89
|
-
Object.defineProperty(exports, "
|
|
90
|
-
Object.defineProperty(exports, "
|
|
91
|
-
Object.defineProperty(exports, "
|
|
92
|
-
Object.defineProperty(exports, "
|
|
93
|
-
const
|
|
94
|
-
const
|
|
85
|
+
Object.defineProperty(exports, "DUTY_WATCHED_SOURCES", { enumerable: true, get: function () { return data_provider_2.DUTY_WATCHED_SOURCES; } });
|
|
86
|
+
Object.defineProperty(exports, "DUTY_TEMPLATE_IDS", { enumerable: true, get: function () { return data_provider_2.DUTY_TEMPLATE_IDS; } });
|
|
87
|
+
Object.defineProperty(exports, "DUTY_CADENCE_MODES", { enumerable: true, get: function () { return data_provider_2.DUTY_CADENCE_MODES; } });
|
|
88
|
+
Object.defineProperty(exports, "DUTY_CADENCE_TIME_PATTERN", { enumerable: true, get: function () { return data_provider_2.DUTY_CADENCE_TIME_PATTERN; } });
|
|
89
|
+
Object.defineProperty(exports, "DUTY_CADENCE_MAX_TIMES", { enumerable: true, get: function () { return data_provider_2.DUTY_CADENCE_MAX_TIMES; } });
|
|
90
|
+
Object.defineProperty(exports, "DUTY_EXECUTION_ISOLATION_MODES", { enumerable: true, get: function () { return data_provider_2.DUTY_EXECUTION_ISOLATION_MODES; } });
|
|
91
|
+
Object.defineProperty(exports, "DUTY_STATUSES", { enumerable: true, get: function () { return data_provider_2.DUTY_STATUSES; } });
|
|
92
|
+
Object.defineProperty(exports, "DUTY_KIND_VALUES", { enumerable: true, get: function () { return data_provider_2.DUTY_KIND_VALUES; } });
|
|
93
|
+
const duty_product_1 = require("./duty-product");
|
|
94
|
+
const duty_attention_copy_1 = require("./duty-attention-copy");
|
|
95
95
|
const instruction_input_1 = require("./instruction-input");
|
|
96
96
|
const format_1 = require("./format");
|
|
97
97
|
const triggers_1 = require("./triggers");
|
|
@@ -101,16 +101,16 @@ const STANDSTILL_FIX_FOR_READ_RE = /^[A-Za-z0-9_-]{1,80}$/;
|
|
|
101
101
|
const DESCRIBE_OPERATION_RE = /^lifecycle_([a-z_]+)$/;
|
|
102
102
|
/** Derived from the installed compatibility vocabulary so the CLI remains
|
|
103
103
|
* safe even while data-provider and CLI packages roll out separately. */
|
|
104
|
-
exports.
|
|
104
|
+
exports.DUTY_AUTHORABLE_CADENCE_MODES = data_provider_2.DUTY_CADENCE_MODES.filter((mode) => mode !== 'sampled');
|
|
105
105
|
/**
|
|
106
106
|
* Interval bounds for `cadence.intervalMs`.
|
|
107
107
|
*
|
|
108
|
-
* The Trigger schedule and
|
|
108
|
+
* The Trigger schedule and Duty contract now share the same one-year
|
|
109
109
|
* upper bound. Keep the CLI aligned so a valid long-interval contract does not
|
|
110
110
|
* get rejected only at this surface.
|
|
111
111
|
*/
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
112
|
+
exports.MIN_DUTY_INTERVAL_MS = 60_000;
|
|
113
|
+
exports.MAX_DUTY_INTERVAL_MS = 365 * 24 * 60 * 60 * 1000;
|
|
114
114
|
/**
|
|
115
115
|
* The lines preflight prints when the server says activation would be refused (OSK-21258). The gate
|
|
116
116
|
* list marks an advisory gate `info (advisory: does not stop a run)`, which is true of a run and false
|
|
@@ -147,7 +147,7 @@ function gateRefusesActivation(activation, gate) {
|
|
|
147
147
|
(!blocker.reason || !gate.reason || blocker.reason === gate.reason));
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
|
-
* The lines every
|
|
150
|
+
* The lines every Duty read surface prints for "whose permissions does a
|
|
151
151
|
* run use?" — `show`, `effective-policy` and `preflight` share it so the three
|
|
152
152
|
* cannot phrase it three ways (OSK-12065). The sentence and the warnings are
|
|
153
153
|
* the server's; this only lays them out. `null` (an older server that does not
|
|
@@ -189,60 +189,60 @@ function retiredFieldsLine(retired, reason) {
|
|
|
189
189
|
return `Retired fields (no effect): ${retired.join(', ')}${reason ? ` — ${reason}` : ''}`;
|
|
190
190
|
}
|
|
191
191
|
function base(id) {
|
|
192
|
-
return `/api/
|
|
192
|
+
return `/api/duties/${encodeURIComponent(id)}`;
|
|
193
193
|
}
|
|
194
194
|
function packBase(id) {
|
|
195
|
-
return `/api/
|
|
195
|
+
return `/api/duty-packs/${encodeURIComponent(id)}`;
|
|
196
196
|
}
|
|
197
|
-
exports.
|
|
198
|
-
list: () => data_provider_2.request.get('/api/
|
|
199
|
-
plan: (body) => data_provider_2.request.post('/api/
|
|
200
|
-
bind: (body) => data_provider_2.request.post('/api/
|
|
197
|
+
exports.dutyPackApi = {
|
|
198
|
+
list: () => data_provider_2.request.get('/api/duty-packs'),
|
|
199
|
+
plan: (body) => data_provider_2.request.post('/api/duty-packs/plan', body),
|
|
200
|
+
bind: (body) => data_provider_2.request.post('/api/duty-packs/bind', body),
|
|
201
201
|
preflight: (id, nextRunCount) => data_provider_2.request.post(`${packBase(id)}/preflight`, {
|
|
202
202
|
...(typeof nextRunCount === 'number' ? { nextRunCount } : {}),
|
|
203
203
|
}),
|
|
204
204
|
activate: (id) => data_provider_2.request.post(`${packBase(id)}/activate`, {}),
|
|
205
205
|
};
|
|
206
|
-
exports.
|
|
206
|
+
exports.dutyApi = {
|
|
207
207
|
/**
|
|
208
208
|
* The lib owns every URL in this domain, and the parity spec depends on that:
|
|
209
|
-
* a command that builds its own `/api/
|
|
209
|
+
* a command that builds its own `/api/duties/...` string is invisible to
|
|
210
210
|
* the coverage check, which is how an endpoint ends up unreachable without
|
|
211
211
|
* anything failing.
|
|
212
212
|
*/
|
|
213
|
-
list: (query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/
|
|
213
|
+
list: (query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/duties', query)),
|
|
214
214
|
/**
|
|
215
215
|
* Fleet-level liveness sweep health (OSK-10958): when the reconciler last
|
|
216
216
|
* swept, how stale that is, and the tally it last persisted. Aggregate only.
|
|
217
217
|
*/
|
|
218
|
-
livenessSweep: () => data_provider_2.request.get('/api/
|
|
219
|
-
/** One agent's
|
|
220
|
-
roster: (agentId) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/
|
|
221
|
-
/** Is this
|
|
218
|
+
livenessSweep: () => data_provider_2.request.get('/api/duties/liveness/sweep'),
|
|
219
|
+
/** One agent's Duties, system roles included, each with its loop status. */
|
|
220
|
+
roster: (agentId) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/duties/roster', { agentId })),
|
|
221
|
+
/** Is this Duty's loop installed and working. */
|
|
222
222
|
loopStatus: (id) => data_provider_2.request.get(`${base(id)}/loop-status`),
|
|
223
223
|
manifest: (id) => data_provider_2.request.get(`${base(id)}/manifest`),
|
|
224
|
-
import: (body) => data_provider_2.request.post('/api/
|
|
224
|
+
import: (body) => data_provider_2.request.post('/api/duties/import', body),
|
|
225
225
|
fork: (id, body) => data_provider_2.request.post(`${base(id)}/fork`, body),
|
|
226
|
-
// GET /:id returns `{
|
|
226
|
+
// GET /:id returns `{ duty, latestCheck }` — NOT a bare contract.
|
|
227
227
|
// Unwrap before rendering, or every field reads as undefined.
|
|
228
228
|
get: (id) => data_provider_2.request.get(base(id)),
|
|
229
229
|
controlPreview: (id, query) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/control-preview`, query)),
|
|
230
230
|
applyControl: (id, body) => data_provider_2.request.post(`${base(id)}/control`, body),
|
|
231
231
|
controlReceipt: (id, controlId) => data_provider_2.request.get(`${base(id)}/control/${encodeURIComponent(controlId)}`),
|
|
232
232
|
workPlan: (id) => data_provider_2.request.get(`${base(id)}/work-plan`),
|
|
233
|
-
observationSummary: (query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/
|
|
234
|
-
draftObservationProbe: (body) => data_provider_2.request.post('/api/
|
|
233
|
+
observationSummary: (query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)('/api/duties/observation-summary', query)),
|
|
234
|
+
draftObservationProbe: (body) => data_provider_2.request.post('/api/duties/observation-probe', body),
|
|
235
235
|
observationProbe: (id, body = {}) => data_provider_2.request.post(`${base(id)}/observation-probe`, body),
|
|
236
236
|
verifyReadiness: (id, body) => data_provider_2.request.post(`${base(id)}/readiness-receipt`, body),
|
|
237
237
|
readinessReceipt: (id, receiptId) => data_provider_2.request.get(`${base(id)}/readiness-receipt/${encodeURIComponent(receiptId)}`),
|
|
238
|
-
create: (body) => data_provider_2.request.post('/api/
|
|
238
|
+
create: (body) => data_provider_2.request.post('/api/duties', body),
|
|
239
239
|
update: (id, body) => data_provider_2.request.patch(base(id), body),
|
|
240
|
-
draftPreflight: (body) => data_provider_2.request.post('/api/
|
|
240
|
+
draftPreflight: (body) => data_provider_2.request.post('/api/duties/preflight', body),
|
|
241
241
|
workLinks: (id, includeInactive = false) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/links`, { ...(includeInactive ? { includeInactive: true } : {}) })),
|
|
242
242
|
createWorkLink: (id, body) => data_provider_2.request.post(`${base(id)}/links`, body),
|
|
243
243
|
updateWorkLink: (id, linkId, body) => data_provider_2.request.patch(`${base(id)}/links/${encodeURIComponent(linkId)}`, body),
|
|
244
244
|
detachWorkLink: (id, linkId) => data_provider_2.request.delete(`${base(id)}/links/${encodeURIComponent(linkId)}`),
|
|
245
|
-
plan: (body) => data_provider_2.request.post('/api/
|
|
245
|
+
plan: (body) => data_provider_2.request.post('/api/duties/plan', body),
|
|
246
246
|
checkNow: (id) => data_provider_2.request.post(`${base(id)}/check-now`, {}),
|
|
247
247
|
checks: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/checks`, query)),
|
|
248
248
|
actionHistory: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/action-history`, query)),
|
|
@@ -255,7 +255,7 @@ exports.commitmentApi = {
|
|
|
255
255
|
* headless operator could only ever REACT to proposals the server made — an
|
|
256
256
|
* asymmetry that leaves the domain half-usable in exactly the way the parity
|
|
257
257
|
* rule exists to catch. A locally-running agent that has investigated a
|
|
258
|
-
*
|
|
258
|
+
* duty and knows what should be done had no way to say so.
|
|
259
259
|
*/
|
|
260
260
|
proposeActionProposal: (id, body) => data_provider_2.request.post(`${base(id)}/action-proposals`, body),
|
|
261
261
|
decideActionProposal: (id, proposalId, decision, snapshot) => data_provider_2.request.post(`${base(id)}/action-proposals/${encodeURIComponent(proposalId)}/decision`, {
|
|
@@ -273,10 +273,10 @@ exports.commitmentApi = {
|
|
|
273
273
|
}),
|
|
274
274
|
effectivePolicy: (id) => data_provider_2.request.get(`${base(id)}/effective-policy`),
|
|
275
275
|
/**
|
|
276
|
-
* Executor rebind — `POST /api/
|
|
276
|
+
* Executor rebind — `POST /api/duties/:id/executor` (impl contract B4,
|
|
277
277
|
* docs/architecture/execution-handover-2026-09-17.md P4).
|
|
278
278
|
*
|
|
279
|
-
* `
|
|
279
|
+
* `duty.agentId` is single-valued by design, so moving it is an
|
|
280
280
|
* explicit recorded act: the server appends an `executorHandovers` entry
|
|
281
281
|
* rather than letting a bare PATCH rewrite who owns the loop without a trail.
|
|
282
282
|
*/
|
|
@@ -289,12 +289,12 @@ exports.commitmentApi = {
|
|
|
289
289
|
receiptQuarterlyMetrics: (id, year, quarter) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/receipt-metrics/quarterly`, { year, quarter })),
|
|
290
290
|
deliveryPatch: (id, taskId) => data_provider_2.request.get(`${base(id)}/delivery/${encodeURIComponent(taskId)}/patch`),
|
|
291
291
|
deliveryBundle: (id, taskId) => data_provider_2.request.get(`${base(id)}/delivery/${encodeURIComponent(taskId)}/bundle`),
|
|
292
|
-
operatingReview: (agentId) => data_provider_2.request.get(`/api/
|
|
292
|
+
operatingReview: (agentId) => data_provider_2.request.get(`/api/duties/agents/${encodeURIComponent(agentId)}/operating-review`),
|
|
293
293
|
reflection: (id) => data_provider_2.request.get(`${base(id)}/reflection`),
|
|
294
294
|
decideReflectionProposal: (id, proposalKey, decision) => data_provider_2.request.post(`${base(id)}/reflection/proposals/${encodeURIComponent(proposalKey)}/decision`, {
|
|
295
295
|
decision,
|
|
296
296
|
}),
|
|
297
|
-
/** Case and remediation-proposal reads make a
|
|
297
|
+
/** Case and remediation-proposal reads make a duty's open loop inspectable. */
|
|
298
298
|
cases: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/cases`, query)),
|
|
299
299
|
caseDetail: (id, caseId) => data_provider_2.request.get(`${base(id)}/cases/${encodeURIComponent(caseId)}`),
|
|
300
300
|
remediationProposals: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/remediation-proposals`, query)),
|
|
@@ -308,18 +308,18 @@ exports.commitmentApi = {
|
|
|
308
308
|
* Observability and lineage
|
|
309
309
|
*
|
|
310
310
|
* These four answer questions the contract alone cannot: what the scheduler
|
|
311
|
-
* ACTUALLY has for this
|
|
311
|
+
* ACTUALLY has for this duty (`triggerStatus`), what work it produced
|
|
312
312
|
* (`workLineage`), what its durable runs did (`ledger`), and which wakes an
|
|
313
313
|
* Agent is even allowed to pick (`wakeCapabilities`). Each has a distinct
|
|
314
314
|
* authority, which is why none of them is a field on `show`.
|
|
315
315
|
* ------------------------------------------------------------------------ */
|
|
316
316
|
triggerStatus: (id, limit) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/trigger-status`, { limit })),
|
|
317
317
|
workLineage: (id, limit) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/work-lineage`, { limit })),
|
|
318
|
-
/** One ordered explanation surface across the immutable
|
|
318
|
+
/** One ordered explanation surface across the immutable duty ledgers. */
|
|
319
319
|
/**
|
|
320
320
|
* Soft delete: the contract drops out of every read while the ledgers that
|
|
321
321
|
* reference it stay resolvable. Refused for an active or system-managed
|
|
322
|
-
*
|
|
322
|
+
* duty — see DutyControl.deleteDuty.
|
|
323
323
|
*/
|
|
324
324
|
remove: (id, reason, opts = {}) => data_provider_2.request.delete((0, triggers_1.withQuery)(base(id), {
|
|
325
325
|
...(reason ? { reason } : {}),
|
|
@@ -329,7 +329,7 @@ exports.commitmentApi = {
|
|
|
329
329
|
})),
|
|
330
330
|
/** What a delete would leave behind. Read-only. */
|
|
331
331
|
deletionPreview: (id) => data_provider_2.request.get(`${base(id)}/deletion-preview`),
|
|
332
|
-
/** Un-delete. Returns the
|
|
332
|
+
/** Un-delete. Returns the Duty PAUSED, never active. */
|
|
333
333
|
restore: (id) => data_provider_2.request.post(`${base(id)}/restore`, {}),
|
|
334
334
|
trace: (id, query = {}) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/trace`, query)),
|
|
335
335
|
/** One Cycle per Check, newest first — the unit a person reads (D8). */
|
|
@@ -346,8 +346,8 @@ exports.commitmentApi = {
|
|
|
346
346
|
* Every other read on this object is retrospective. This one stops at the
|
|
347
347
|
* DecisionEnvelope → Arbiter boundary — no Check row, no budget debit, no
|
|
348
348
|
* delivery gate, no contract write — so it is the only way to answer "what is
|
|
349
|
-
* this
|
|
350
|
-
* the same reason `trigger-status` is: when a
|
|
349
|
+
* this duty about to do" before it does it. Worth its own command for
|
|
350
|
+
* the same reason `trigger-status` is: when a duty is about to nudge
|
|
351
351
|
* somebody and nobody can say why, the posture and its policy trail are the
|
|
352
352
|
* answer, and re-running a real check to find out changes the thing you are
|
|
353
353
|
* trying to observe.
|
|
@@ -356,14 +356,14 @@ exports.commitmentApi = {
|
|
|
356
356
|
/**
|
|
357
357
|
* The accounting SHADOW readout behind allowance accounting.
|
|
358
358
|
*
|
|
359
|
-
* WORKSPACE-scoped despite hanging off one
|
|
359
|
+
* WORKSPACE-scoped despite hanging off one duty's id: it aggregates
|
|
360
360
|
* every closed daily metric in the workspace, because the question it answers
|
|
361
361
|
* is "does this workspace have enough closed evidence to activate" rather than
|
|
362
|
-
* "what has this
|
|
362
|
+
* "what has this duty spent". `cost` is the per-duty question.
|
|
363
363
|
*/
|
|
364
364
|
accountingReadout: (id) => data_provider_2.request.get(`${base(id)}/accounting-readout`),
|
|
365
365
|
/**
|
|
366
|
-
* Closed-period spend for ONE
|
|
366
|
+
* Closed-period spend for ONE duty over a UTC day window.
|
|
367
367
|
*
|
|
368
368
|
* `costStatus` is the load-bearing field, not the dollar figure: `partial` and
|
|
369
369
|
* `unavailable` mean some runs carried no cost attribution at all, so the
|
|
@@ -373,7 +373,7 @@ exports.commitmentApi = {
|
|
|
373
373
|
*/
|
|
374
374
|
cost: (id, window) => data_provider_2.request.get((0, triggers_1.withQuery)(`${base(id)}/cost`, window)),
|
|
375
375
|
/**
|
|
376
|
-
* What this
|
|
376
|
+
* What this duty's RUNS claim to have seen (agent-as-sensor).
|
|
377
377
|
*
|
|
378
378
|
* Distinct from every other read on this object: it is the only one whose
|
|
379
379
|
* rows the control plane did not gather itself, so each carries
|
|
@@ -417,20 +417,20 @@ exports.commitmentApi = {
|
|
|
417
417
|
unlinkGoal: (id, goalId) => data_provider_2.request.delete(`${base(id)}/goals/${encodeURIComponent(goalId)}`),
|
|
418
418
|
};
|
|
419
419
|
/** One-tap check feedback. `handled` means "I dealt with it", not "good nudge". */
|
|
420
|
-
exports.
|
|
420
|
+
exports.DUTY_FEEDBACK_KINDS = ['useful', 'noisy', 'wrong', 'handled'];
|
|
421
421
|
/**
|
|
422
422
|
* Bounded remediation actions. This is a CLOSED set on purpose: remediation is
|
|
423
|
-
* the "this
|
|
423
|
+
* the "this duty is misbehaving, calm it down" lever, and a free-form
|
|
424
424
|
* contract edit would defeat the point of having one.
|
|
425
425
|
*/
|
|
426
|
-
exports.
|
|
427
|
-
'
|
|
426
|
+
exports.DUTY_REMEDIATION_ACTIONS = [
|
|
427
|
+
'pause_duty',
|
|
428
428
|
'mute_user_nudges',
|
|
429
429
|
'reduce_nudge_frequency',
|
|
430
430
|
'mark_noop',
|
|
431
431
|
];
|
|
432
432
|
/** The only keys `createBodySchema` (a `z.strictObject`) accepts. */
|
|
433
|
-
exports.
|
|
433
|
+
exports.DUTY_CREATE_KEYS = [
|
|
434
434
|
'mode',
|
|
435
435
|
'agentId',
|
|
436
436
|
'kind',
|
|
@@ -453,14 +453,14 @@ exports.COMMITMENT_CREATE_KEYS = [
|
|
|
453
453
|
'createdVia',
|
|
454
454
|
];
|
|
455
455
|
/**
|
|
456
|
-
* Read the per-
|
|
456
|
+
* Read the per-Duty domain policy from an inline flag or a text file.
|
|
457
457
|
*
|
|
458
458
|
* This deliberately uses a separate pair of names from Agent-level instruction
|
|
459
|
-
* commands: the result configures one
|
|
459
|
+
* commands: the result configures one Duty run, not the Agent's global
|
|
460
460
|
* prompt. The explicit error also keeps shell users from accidentally masking
|
|
461
461
|
* a reviewed file with a short inline experiment.
|
|
462
462
|
*/
|
|
463
|
-
async function
|
|
463
|
+
async function readDutyAgentDirective({ directive, file, }) {
|
|
464
464
|
if (directive !== undefined && file !== undefined) {
|
|
465
465
|
throw new Error('Use either --agent-directive or --agent-directive-file, not both.');
|
|
466
466
|
}
|
|
@@ -515,7 +515,7 @@ function editDistance(a, b) {
|
|
|
515
515
|
* of a real one is a `typo`; the rest are `ignored`. A server-owned dump field is neither.
|
|
516
516
|
*/
|
|
517
517
|
function unrecognizedCreateKeys(src) {
|
|
518
|
-
const known = exports.
|
|
518
|
+
const known = exports.DUTY_CREATE_KEYS;
|
|
519
519
|
const typos = [];
|
|
520
520
|
const ignored = [];
|
|
521
521
|
for (const key of Object.keys(src || {})) {
|
|
@@ -545,13 +545,13 @@ function ignoredCreateKeysWarning(keys) {
|
|
|
545
545
|
if (keys.length === 0)
|
|
546
546
|
return null;
|
|
547
547
|
return (`--from-json: ${keys.map((key) => `"${key}"`).join(', ')} ${keys.length === 1 ? 'is' : 'are'} not sent ` +
|
|
548
|
-
'(the CLI does not forward it), so the
|
|
548
|
+
'(the CLI does not forward it), so the Duty is built without it.');
|
|
549
549
|
}
|
|
550
550
|
/**
|
|
551
551
|
* Normalize a `--from-json` body into something the create endpoint accepts.
|
|
552
552
|
*
|
|
553
553
|
* Two real hazards this removes:
|
|
554
|
-
* 1. `skrr
|
|
554
|
+
* 1. `skrr duties plan --json` emits the ENVELOPE `{proposal, message, …}` —
|
|
555
555
|
* unwrap `proposal` so the documented plan → create pipe works unedited.
|
|
556
556
|
* 2. `createBodySchema` is a `z.strictObject`, so any extra key is a 400. A
|
|
557
557
|
* contract dumped from `list --json` carries id/version/state/ownerUserId/…
|
|
@@ -567,29 +567,29 @@ function normalizeCreateBody(input) {
|
|
|
567
567
|
? envelope.proposal
|
|
568
568
|
: input || {};
|
|
569
569
|
// Dropping a key the body does not declare is deliberate for what a dumped contract carries (id, version,
|
|
570
|
-
// state, ...). It is not for a typo of a real field: `cadance` was dropped and the
|
|
570
|
+
// state, ...). It is not for a typo of a real field: `cadance` was dropped and the Duty created with
|
|
571
571
|
// the default manual cadence, exit 0, while the same body over REST is a 400 (dogfood
|
|
572
|
-
// df-261031-
|
|
572
|
+
// df-261031-duty-authoring, OSK-21246).
|
|
573
573
|
const { typos } = unrecognizedCreateKeys(src);
|
|
574
574
|
if (typos.length > 0) {
|
|
575
575
|
throw new Error(`--from-json has ${typos.length === 1 ? 'a field' : 'fields'} the API does not know: ` +
|
|
576
576
|
`${typos.map((t) => `"${t.key}" (did you mean "${t.suggestion}"?)`).join(', ')}. ` +
|
|
577
|
-
'Nothing was sent: the API refuses unknown fields, and dropping them here would create the
|
|
577
|
+
'Nothing was sent: the API refuses unknown fields, and dropping them here would create the Duty without them.');
|
|
578
578
|
}
|
|
579
579
|
const out = {};
|
|
580
|
-
for (const key of exports.
|
|
580
|
+
for (const key of exports.DUTY_CREATE_KEYS) {
|
|
581
581
|
if (src[key] !== undefined)
|
|
582
582
|
out[key] = src[key];
|
|
583
583
|
}
|
|
584
584
|
const delivery = out.delivery;
|
|
585
585
|
if (delivery?.reviewPolicy !== undefined)
|
|
586
|
-
(0,
|
|
586
|
+
(0, duty_product_1.normalizeTaskReviewPolicy)(delivery.reviewPolicy);
|
|
587
587
|
if (out.status !== 'draft') {
|
|
588
588
|
delete out.status;
|
|
589
589
|
}
|
|
590
590
|
return out;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function parseDutyConcurrencyLimit(input) {
|
|
593
593
|
if (input === undefined)
|
|
594
594
|
return undefined;
|
|
595
595
|
const raw = String(input).trim().toLowerCase();
|
|
@@ -601,8 +601,8 @@ function parseCommitmentConcurrencyLimit(input) {
|
|
|
601
601
|
}
|
|
602
602
|
return value;
|
|
603
603
|
}
|
|
604
|
-
function
|
|
605
|
-
const value =
|
|
604
|
+
function dutyConcurrencyEnvelopePatch({ rawValue, reason, autonomous = process.env.OVERSKY_AUTONOMOUS_SESSION === '1', }) {
|
|
605
|
+
const value = parseDutyConcurrencyLimit(rawValue);
|
|
606
606
|
const normalizedReason = reason?.trim();
|
|
607
607
|
if (value === undefined) {
|
|
608
608
|
if (normalizedReason) {
|
|
@@ -611,7 +611,7 @@ function commitmentConcurrencyEnvelopePatch({ rawValue, reason, autonomous = pro
|
|
|
611
611
|
return undefined;
|
|
612
612
|
}
|
|
613
613
|
if (autonomous && value !== null) {
|
|
614
|
-
throw new Error('An autonomous Agent may suggest a finite
|
|
614
|
+
throw new Error('An autonomous Agent may suggest a finite Duty concurrency cap, but cannot activate owner policy. Omit the field or use unlimited; an owner can set the cap later.');
|
|
615
615
|
}
|
|
616
616
|
if (value !== null && !normalizedReason) {
|
|
617
617
|
throw new Error('A finite --max-concurrent-runs value requires --concurrency-reason.');
|
|
@@ -622,18 +622,18 @@ function commitmentConcurrencyEnvelopePatch({ rawValue, reason, autonomous = pro
|
|
|
622
622
|
};
|
|
623
623
|
}
|
|
624
624
|
/**
|
|
625
|
-
* What `policy.evidenceGate.requireMaterialEvidenceForAutonomousRun` does to this
|
|
625
|
+
* What `policy.evidenceGate.requireMaterialEvidenceForAutonomousRun` does to this Duty's
|
|
626
626
|
* scheduled runs, in a line `show` can print (OSK-15417). It existed only in `show --json`: nothing
|
|
627
627
|
* in help, docs or any text view said whether a run on an unchanged day would be held back.
|
|
628
628
|
*/
|
|
629
|
-
function describeEvidenceGate(
|
|
630
|
-
const gate =
|
|
629
|
+
function describeEvidenceGate(duty) {
|
|
630
|
+
const gate = duty.policy?.evidenceGate;
|
|
631
631
|
return gate?.requireMaterialEvidenceForAutonomousRun === true
|
|
632
632
|
? 'an autonomous run is held back unless the check found material evidence (a scheduled run on an unchanged day does not start)'
|
|
633
633
|
: 'off — an autonomous run is not held back for lack of material evidence';
|
|
634
634
|
}
|
|
635
|
-
function
|
|
636
|
-
const envelope =
|
|
635
|
+
function describeDutyConcurrency(duty) {
|
|
636
|
+
const envelope = duty.policy?.executionBudget;
|
|
637
637
|
const limit = envelope?.maxConcurrentRuns;
|
|
638
638
|
const decision = envelope?.maxConcurrentRunsDecision;
|
|
639
639
|
if (limit == null) {
|
|
@@ -649,11 +649,11 @@ function describeCommitmentConcurrency(commitment) {
|
|
|
649
649
|
* Parse a human interval ("15m", "6h", "1d", or a bare number of minutes) into
|
|
650
650
|
* milliseconds. Throws on unparseable input, on trailing junk, and on values
|
|
651
651
|
* outside the API's `cadence.intervalMs` bounds — silently clamping a cadence is
|
|
652
|
-
* dangerous on an active
|
|
652
|
+
* dangerous on an active duty.
|
|
653
653
|
*/
|
|
654
654
|
// Longest-first alternation, and the FULL pattern is anchored so the ENTIRE
|
|
655
655
|
// string must be consumed. Without that anchor "1 month" matches `1` + `m` and
|
|
656
|
-
// silently means ONE MINUTE — catastrophic on an active
|
|
656
|
+
// silently means ONE MINUTE — catastrophic on an active duty.
|
|
657
657
|
const INTERVAL_UNIT = '(?:weeks?|w|days?|d|hours?|hrs?|h|minutes?|mins?|m)';
|
|
658
658
|
const INTERVAL_FULL = new RegExp(`^(?:\\d+(?:\\.\\d+)?\\s*${INTERVAL_UNIT}\\s*)+$`);
|
|
659
659
|
const INTERVAL_TOKEN = new RegExp(`(\\d+(?:\\.\\d+)?)\\s*(${INTERVAL_UNIT})`, 'g');
|
|
@@ -692,7 +692,7 @@ function parseIntervalToMs(input) {
|
|
|
692
692
|
const ms = Math.round(minutes * 60_000);
|
|
693
693
|
// Throw rather than clamp: silently turning a requested 90d cadence into 30d
|
|
694
694
|
// (or 0 into 1m) hides a real misconfiguration on a live control loop.
|
|
695
|
-
if (ms < exports.
|
|
695
|
+
if (ms < exports.MIN_DUTY_INTERVAL_MS || ms > exports.MAX_DUTY_INTERVAL_MS) {
|
|
696
696
|
throw new Error(`Interval "${input}" is out of range — must be between 1m and 365d (got ${describeIntervalMs(ms)}).`);
|
|
697
697
|
}
|
|
698
698
|
return ms;
|
|
@@ -844,9 +844,9 @@ function describeEvidenceHealth(health, criteriaCount) {
|
|
|
844
844
|
// so telling its owner to rewrite "the criteria below" points to a list
|
|
845
845
|
// that does not exist and hides the only viable next action.
|
|
846
846
|
if (criteriaCount === 0 && reasons.includes('no_outcome_measure')) {
|
|
847
|
-
return `${state}${detail} — this
|
|
847
|
+
return `${state}${detail} — this duty has no success criteria or Measure, so its health remains unknown; add a --criterion with --evaluator metric --measure <measure-id>`;
|
|
848
848
|
}
|
|
849
|
-
return `unevidenceable_criteria${detail} — the criteria below cannot be judged from what this
|
|
849
|
+
return `unevidenceable_criteria${detail} — the criteria below cannot be judged from what this duty observes; rewrite them or attach a Measure`;
|
|
850
850
|
}
|
|
851
851
|
if (state === 'degraded_observability') {
|
|
852
852
|
return `degraded_observability${detail} — ${describeDegradedObservability(reasons)}`;
|
|
@@ -864,7 +864,7 @@ function describeEvidenceHealth(health, criteriaCount) {
|
|
|
864
864
|
*
|
|
865
865
|
* The state is a catch-all on the server (anything that is not purely an
|
|
866
866
|
* authoring problem lands here), so the copy used to assert "an evaluator
|
|
867
|
-
* could not run; this is a fault" for every case — including a
|
|
867
|
+
* could not run; this is a fault" for every case — including a duty
|
|
868
868
|
* whose first run had simply not reported yet (OSK-15989). Only the
|
|
869
869
|
* `*_evidence_unavailable` reasons say an evaluator could not run; the rest
|
|
870
870
|
* say which part of the reading was missing, and that is what this names.
|
|
@@ -875,15 +875,15 @@ function describeDegradedObservability(reasons) {
|
|
|
875
875
|
return 'an evaluator could not run; this is a fault, not a criteria problem';
|
|
876
876
|
}
|
|
877
877
|
if (has('access_issues') || has('source_warning_or_error') || has('no_healthy_source')) {
|
|
878
|
-
return 'not every configured source could be read on the last check (`skrr
|
|
878
|
+
return 'not every configured source could be read on the last check (`skrr duties doctor <id>` names the next step)';
|
|
879
879
|
}
|
|
880
880
|
if (has('evidence_stale')) {
|
|
881
|
-
return "the freshest evidence is older than this
|
|
881
|
+
return "the freshest evidence is older than this duty's freshness expectation";
|
|
882
882
|
}
|
|
883
883
|
if (has('evidence_awaiting_first_report')) {
|
|
884
884
|
return 'no evidence yet: the first run has not reported';
|
|
885
885
|
}
|
|
886
|
-
return 'the last check could not see everything it needs to judge this
|
|
886
|
+
return 'the last check could not see everything it needs to judge this duty';
|
|
887
887
|
}
|
|
888
888
|
/** Render an interval back as a compact human string. */
|
|
889
889
|
function describeIntervalMs(ms) {
|
|
@@ -905,11 +905,11 @@ function describeIntervalMs(ms) {
|
|
|
905
905
|
* `source_state` belongs HERE rather than with those three: its config is one
|
|
906
906
|
* string naming a watched source, which is exactly as spellable as `metric`'s
|
|
907
907
|
* `--measure`. It is also the evaluator built for a source-watching Guardian,
|
|
908
|
-
* the one shape of
|
|
908
|
+
* the one shape of duty that previously had no evaluator available to it
|
|
909
909
|
* at all — so leaving it JSON-only would mean the CLI could not express the
|
|
910
|
-
* criterion its own `sky
|
|
910
|
+
* criterion its own `sky duties show` tells the user to add.
|
|
911
911
|
*/
|
|
912
|
-
exports.
|
|
912
|
+
exports.DUTY_CLI_EVALUATORS = ['manual', 'metric', 'source_state'];
|
|
913
913
|
/**
|
|
914
914
|
* Build the `target.successCriteria` array from CLI flags, assigning the
|
|
915
915
|
* client-supplied `id` the API requires (its absence is the 400 the finding
|
|
@@ -929,7 +929,7 @@ function buildSuccessCriteria(labels, opts = {}) {
|
|
|
929
929
|
throw new Error('--measure only applies to --evaluator metric.');
|
|
930
930
|
}
|
|
931
931
|
// Named rather than defaulted: the evaluator reads the status of ONE watched
|
|
932
|
-
// source, and guessing which one when a
|
|
932
|
+
// source, and guessing which one when a duty watches several would make
|
|
933
933
|
// the criterion silently judge something the author did not choose.
|
|
934
934
|
if (evaluator === 'source_state' && !source) {
|
|
935
935
|
throw new Error('--evaluator source_state requires --source <watched-source>.');
|
|
@@ -952,8 +952,8 @@ function buildSuccessCriteria(labels, opts = {}) {
|
|
|
952
952
|
* The cadence changes an Agent has proposed and nobody has decided. `cadence-requests decide` needs a request
|
|
953
953
|
* id, and `show` listed none, so a person could not find the id to pass (OSK-15422).
|
|
954
954
|
*/
|
|
955
|
-
function pendingCadenceRequestLines(
|
|
956
|
-
const state =
|
|
955
|
+
function pendingCadenceRequestLines(duty) {
|
|
956
|
+
const state = duty?.state;
|
|
957
957
|
const requests = Array.isArray(state?.pendingCadenceRequests) ? state.pendingCadenceRequests : [];
|
|
958
958
|
const pending = requests.filter((item) => !!item &&
|
|
959
959
|
typeof item === 'object' &&
|
|
@@ -962,7 +962,7 @@ function pendingCadenceRequestLines(commitment) {
|
|
|
962
962
|
if (!pending.length)
|
|
963
963
|
return [];
|
|
964
964
|
return [
|
|
965
|
-
'Pending cadence requests (decide with `
|
|
965
|
+
'Pending cadence requests (decide with `duties cadence-requests decide <id> <request-id> --approve|--reject`):',
|
|
966
966
|
...pending.map((item) => {
|
|
967
967
|
const from = item.basis?.intervalMs;
|
|
968
968
|
const to = item.requestedIntervalMs;
|
|
@@ -971,8 +971,8 @@ function pendingCadenceRequestLines(commitment) {
|
|
|
971
971
|
}),
|
|
972
972
|
];
|
|
973
973
|
}
|
|
974
|
-
function baseCadenceLabel(
|
|
975
|
-
const cadence =
|
|
974
|
+
function baseCadenceLabel(duty) {
|
|
975
|
+
const cadence = duty.cadence;
|
|
976
976
|
if (!cadence || !cadence.mode || cadence.mode === 'manual')
|
|
977
977
|
return 'manual';
|
|
978
978
|
// `daily` cannot be described by an interval — that is the entire reason the
|
|
@@ -990,26 +990,26 @@ function baseCadenceLabel(commitment) {
|
|
|
990
990
|
/**
|
|
991
991
|
* What `event+<interval>` promises, in one sentence. A watched-source event is an accelerator: it
|
|
992
992
|
* makes a check happen sooner, and one that is lost on the way is not replayed. The interval is what
|
|
993
|
-
* recovers: at each one the
|
|
994
|
-
* would have reported. It does not replay the event, and it runs only while the
|
|
993
|
+
* recovers: at each one the Duty re-checks current state, which finds what the missed event
|
|
994
|
+
* would have reported. It does not replay the event, and it runs only while the Duty is running.
|
|
995
995
|
*/
|
|
996
996
|
function eventBackstopNote(intervalMs) {
|
|
997
997
|
const every = describeIntervalMs(intervalMs);
|
|
998
998
|
return `Events make a check come sooner; a missed event is not replayed. Every ${every} it re-checks current state instead, which finds what the event would have reported (only while it is running).`;
|
|
999
999
|
}
|
|
1000
|
-
function cadenceLabel(
|
|
1001
|
-
const base = baseCadenceLabel(
|
|
1002
|
-
const window = (0, data_provider_1.
|
|
1000
|
+
function cadenceLabel(duty) {
|
|
1001
|
+
const base = baseCadenceLabel(duty);
|
|
1002
|
+
const window = (0, data_provider_1.describeDutyCadenceWindow)(duty.cadence);
|
|
1003
1003
|
return window
|
|
1004
|
-
? `${base} ${window}${
|
|
1004
|
+
? `${base} ${window}${duty.cadence?.mode !== 'daily' ? ` (${duty.cadence?.timezone || 'UTC'})` : ''}`
|
|
1005
1005
|
: base;
|
|
1006
1006
|
}
|
|
1007
|
-
function
|
|
1008
|
-
if (
|
|
1009
|
-
log('No
|
|
1007
|
+
function renderDutyList(duties, log) {
|
|
1008
|
+
if (duties.length === 0) {
|
|
1009
|
+
log('No duties.');
|
|
1010
1010
|
return;
|
|
1011
1011
|
}
|
|
1012
|
-
(0, format_1.renderTable)(
|
|
1012
|
+
(0, format_1.renderTable)(duties.map((o) => ({
|
|
1013
1013
|
id: o.id ?? '-',
|
|
1014
1014
|
title: o.title ?? '-',
|
|
1015
1015
|
status: o.status ?? '-',
|
|
@@ -1031,7 +1031,7 @@ function renderCommitmentList(commitments, log) {
|
|
|
1031
1031
|
{ key: 'operation', header: 'OPERATION', maxWidth: 12 },
|
|
1032
1032
|
{ key: 'cadence', header: 'CADENCE', maxWidth: 10 },
|
|
1033
1033
|
{ key: 'agent', header: 'AGENT', verbatim: true },
|
|
1034
|
-
//
|
|
1034
|
+
// Duty ids are routinely pasted into `check-now`, so this column
|
|
1035
1035
|
// is never clipped. Widening the guess (28 → 44) fixed today's
|
|
1036
1036
|
// 40-character ids and would break on the next longer prefix.
|
|
1037
1037
|
{ key: 'id', header: 'ID', verbatim: true },
|
|
@@ -1039,30 +1039,30 @@ function renderCommitmentList(commitments, log) {
|
|
|
1039
1039
|
// The OPERATION column says `blocked` and no more; the reason was only in `--json` and `show`.
|
|
1040
1040
|
// Name each reason we can put in words once, with how many rows it covers (OSK-22417).
|
|
1041
1041
|
const blockedByReason = new Map();
|
|
1042
|
-
for (const
|
|
1043
|
-
const assessment =
|
|
1042
|
+
for (const duty of duties) {
|
|
1043
|
+
const assessment = duty.assessment;
|
|
1044
1044
|
if (assessment?.operation !== 'blocked' || !operationReasonWords(assessment.operationReason)) {
|
|
1045
1045
|
continue;
|
|
1046
1046
|
}
|
|
1047
1047
|
const reason = assessment.operationReason;
|
|
1048
1048
|
blockedByReason.set(reason, (blockedByReason.get(reason) ?? 0) + 1);
|
|
1049
1049
|
}
|
|
1050
|
-
const notRead =
|
|
1050
|
+
const notRead = duties.filter((duty) => duty.assessment?.operationReason ===
|
|
1051
1051
|
'operation_read_unavailable').length;
|
|
1052
1052
|
if (notRead) {
|
|
1053
1053
|
log('');
|
|
1054
1054
|
log(`${notRead} not read yet: no status is recorded for the current contract, which is not a failure. ` +
|
|
1055
|
-
'`skrr
|
|
1055
|
+
'`skrr duties show <id>` reads it live.');
|
|
1056
1056
|
}
|
|
1057
1057
|
for (const [reason, count] of blockedByReason) {
|
|
1058
1058
|
log('');
|
|
1059
|
-
log(`${count} blocked (${reason}): ${operationReasonWords(reason)}. \`skrr
|
|
1059
|
+
log(`${count} blocked (${reason}): ${operationReasonWords(reason)}. \`skrr duties show <id>\` names the fix.`);
|
|
1060
1060
|
}
|
|
1061
1061
|
}
|
|
1062
1062
|
/**
|
|
1063
|
-
* A `
|
|
1063
|
+
* A `duty_standstill` policyTrace entry, extracted from the latest
|
|
1064
1064
|
* check's decision. The arbiter appends it whenever a quiet posture is the
|
|
1065
|
-
* ANSWER to "why nothing is happening" (`
|
|
1065
|
+
* ANSWER to "why nothing is happening" (`DutyControl/index.js` around
|
|
1066
1066
|
* the `record_only`/empty-action-plan branch). Every field except `reason` is
|
|
1067
1067
|
* optional, and old checks lack the entry entirely — so a missing entry means
|
|
1068
1068
|
* "the loop had nothing standstill-worthy to say", not "we don't know".
|
|
@@ -1077,7 +1077,7 @@ function extractStandstillFromCheck(check) {
|
|
|
1077
1077
|
if (!entry || typeof entry !== 'object')
|
|
1078
1078
|
continue;
|
|
1079
1079
|
const e = entry;
|
|
1080
|
-
if (e.rule !== '
|
|
1080
|
+
if (e.rule !== 'duty_standstill')
|
|
1081
1081
|
continue;
|
|
1082
1082
|
const reason = typeof e.reason === 'string' ? e.reason : '';
|
|
1083
1083
|
if (!reason)
|
|
@@ -1098,23 +1098,23 @@ function extractStandstillFromCheck(check) {
|
|
|
1098
1098
|
* The fix to print beside a standstill, as `stopForRead` resolves a stop's on
|
|
1099
1099
|
* the server. The check's own stored sentence is the answer for a reason that
|
|
1100
1100
|
* still occurs. A reason only a pre-2026-10-09 Check carries stored a fix that
|
|
1101
|
-
* names a retired
|
|
1102
|
-
* instead, with `<
|
|
1101
|
+
* names a retired Duty mode (OSK-18146), so its current copy is printed
|
|
1102
|
+
* instead, with `<duty>` bound to this Duty when its id is a plain
|
|
1103
1103
|
* token.
|
|
1104
1104
|
*
|
|
1105
1105
|
* Exported for tests.
|
|
1106
1106
|
*/
|
|
1107
|
-
function standstillFixForRead(standstill,
|
|
1107
|
+
function standstillFixForRead(standstill, dutyId) {
|
|
1108
1108
|
if (!(0, data_provider_2.isLegacyStandstillReason)(standstill.reason))
|
|
1109
1109
|
return standstill.fix;
|
|
1110
1110
|
const fix = (0, data_provider_2.describeStandstill)(standstill.reason).fix ?? undefined;
|
|
1111
|
-
if (!fix || !
|
|
1111
|
+
if (!fix || !dutyId || !STANDSTILL_FIX_FOR_READ_RE.test(dutyId))
|
|
1112
1112
|
return fix;
|
|
1113
|
-
return fix.split('<
|
|
1113
|
+
return fix.split('<duty>').join(dutyId);
|
|
1114
1114
|
}
|
|
1115
1115
|
/**
|
|
1116
1116
|
* The `Autonomy:` line — the stated mode, annotated when the latest check
|
|
1117
|
-
* actually ran at a STRICTER one (OSK-4881). Without the caveat, a
|
|
1117
|
+
* actually ran at a STRICTER one (OSK-4881). Without the caveat, a duty
|
|
1118
1118
|
* created `auto_run_limited` whose every check the workspace clamped to
|
|
1119
1119
|
* `suggestions_only` reads as though it were acting when it is only suggesting,
|
|
1120
1120
|
* and only `preflight --json` reveals otherwise.
|
|
@@ -1122,7 +1122,7 @@ function standstillFixForRead(standstill, commitmentId) {
|
|
|
1122
1122
|
* Exported for tests.
|
|
1123
1123
|
*/
|
|
1124
1124
|
/**
|
|
1125
|
-
* One-line rendering of `
|
|
1125
|
+
* One-line rendering of `duty.executorBlocked` — the B4/A7 signal that
|
|
1126
1126
|
* the executor's targets are all unusable: `{reason:'quota'|'offline'|'waiting_for_machine', until?,
|
|
1127
1127
|
* provider?}`.
|
|
1128
1128
|
*
|
|
@@ -1130,8 +1130,8 @@ function standstillFixForRead(standstill, commitmentId) {
|
|
|
1130
1130
|
* is the normal case and means "no information", not "not blocked". Returns
|
|
1131
1131
|
* null rather than printing a guess.
|
|
1132
1132
|
*/
|
|
1133
|
-
function describeExecutorBlocked(
|
|
1134
|
-
const blocked =
|
|
1133
|
+
function describeExecutorBlocked(duty) {
|
|
1134
|
+
const blocked = duty.executorBlocked;
|
|
1135
1135
|
if (!blocked || typeof blocked !== 'object')
|
|
1136
1136
|
return null;
|
|
1137
1137
|
const b = blocked;
|
|
@@ -1173,32 +1173,32 @@ function describeStoppedMachine(wake) {
|
|
|
1173
1173
|
return `${base}.${STOPPED_MACHINE_ISOLATION_NOTE}`;
|
|
1174
1174
|
}
|
|
1175
1175
|
/**
|
|
1176
|
-
* The Operation line's wording for a
|
|
1176
|
+
* The Operation line's wording for a Duty that is not running because of its lifecycle.
|
|
1177
1177
|
*
|
|
1178
|
-
* The assessment reports `waiting` with reason `lifecycle_<status>` for a
|
|
1178
|
+
* The assessment reports `waiting` with reason `lifecycle_<status>` for a Duty a person
|
|
1179
1179
|
* paused, and `show` printed that verbatim ("waiting — lifecycle_paused"): the word "waiting" and a
|
|
1180
1180
|
* raw code, indistinguishable from one waiting on a machine or an approval (OSK-15423). Any other
|
|
1181
1181
|
* operation and reason is printed as it always was.
|
|
1182
1182
|
*/
|
|
1183
1183
|
/**
|
|
1184
|
-
* A blocked-operation reason in words. `blocked —
|
|
1184
|
+
* A blocked-operation reason in words. `blocked — runtime_duty_contract_unavailable` was all a
|
|
1185
1185
|
* list or `show` said about the system loops of an Agent on the cloud Agent Worker, and nothing in it
|
|
1186
1186
|
* names what is wrong or what to change (OSK-22417). Only reasons whose meaning is certain are here;
|
|
1187
1187
|
* any other reason is printed as the code, as before.
|
|
1188
1188
|
*/
|
|
1189
1189
|
const OPERATION_REASON_WORDS = {
|
|
1190
|
-
|
|
1190
|
+
runtime_duty_contract_unavailable: 'its Agent runs on the cloud Agent Worker, which cannot enforce a bounded Duty; it needs a Hosted Machine or a local harness',
|
|
1191
1191
|
};
|
|
1192
1192
|
function operationReasonWords(reason) {
|
|
1193
1193
|
return typeof reason === 'string' ? OPERATION_REASON_WORDS[reason] : undefined;
|
|
1194
1194
|
}
|
|
1195
1195
|
function describeOperation(operation, reason) {
|
|
1196
1196
|
// "Cannot tell" travels as `blocked` + this reason (the server's `storedOperation`: no status
|
|
1197
|
-
// recorded yet for this version of the contract, or the recorded one expired). A
|
|
1197
|
+
// recorded yet for this version of the contract, or the recorded one expired). A Duty that
|
|
1198
1198
|
// was turned on a moment ago is in exactly that state, and `blocked` read as a refused activation
|
|
1199
1199
|
// while `show` said `ready` seconds later (OSK-21105).
|
|
1200
1200
|
if (reason === 'operation_read_unavailable')
|
|
1201
|
-
return 'not read yet — no status is recorded for the current contract, which is not a failure; `skrr
|
|
1201
|
+
return 'not read yet — no status is recorded for the current contract, which is not a failure; `skrr duties show` reads it live';
|
|
1202
1202
|
const lifecycle = typeof reason === 'string' ? DESCRIBE_OPERATION_RE.exec(reason) : null;
|
|
1203
1203
|
if (!lifecycle) {
|
|
1204
1204
|
const words = operationReasonWords(reason);
|
|
@@ -1227,10 +1227,10 @@ function lastRunLabel(liveness, besideBlocker) {
|
|
|
1227
1227
|
? 'Last run (before the contract changed)'
|
|
1228
1228
|
: 'Last run (earlier observation)';
|
|
1229
1229
|
}
|
|
1230
|
-
function describeOperationFix(
|
|
1230
|
+
function describeOperationFix(duty, operation) {
|
|
1231
1231
|
if (operation === 'ready' || operation === 'working')
|
|
1232
1232
|
return [];
|
|
1233
|
-
const blocker =
|
|
1233
|
+
const blocker = duty.firstActionableBlocker;
|
|
1234
1234
|
const lines = [];
|
|
1235
1235
|
let remediation = '';
|
|
1236
1236
|
if (blocker) {
|
|
@@ -1248,17 +1248,17 @@ function describeOperationFix(commitment, operation) {
|
|
|
1248
1248
|
lines.push({ label: 'Fix', text: `${remediation}${who ? ` (${who})` : ''}` });
|
|
1249
1249
|
}
|
|
1250
1250
|
// What refused the last Run is a second fact, not an alternative to the
|
|
1251
|
-
// blocker: a paused
|
|
1251
|
+
// blocker: a paused Duty whose Run was refused needs both a resume and
|
|
1252
1252
|
// the fix, or resuming only fails again (OSK-15389). The sentence is the
|
|
1253
1253
|
// server's, derived on read from the failure code.
|
|
1254
1254
|
//
|
|
1255
1255
|
// It is printed even when the stored liveness verdict is superseded. A
|
|
1256
|
-
// supersession says the stored OPERATION no longer describes the
|
|
1256
|
+
// supersession says the stored OPERATION no longer describes the Duty
|
|
1257
1257
|
// (it was paused, its contract was edited since); the last Run's refusal and
|
|
1258
1258
|
// its remedy are facts about that Run and stay true. Dropping them was
|
|
1259
1259
|
// exactly the case being fixed: paused after a refusal, contract edited since.
|
|
1260
1260
|
// The label says which Run the sentence is about instead.
|
|
1261
|
-
const liveness =
|
|
1261
|
+
const liveness = duty.state?.liveness;
|
|
1262
1262
|
const lastRunFix = liveness && typeof liveness.diagnosisFix === 'string' ? liveness.diagnosisFix.trim() : '';
|
|
1263
1263
|
if (lastRunFix && lastRunFix !== remediation) {
|
|
1264
1264
|
lines.push({ label: lastRunLabel(liveness, lines.length > 0), text: lastRunFix });
|
|
@@ -1266,11 +1266,11 @@ function describeOperationFix(commitment, operation) {
|
|
|
1266
1266
|
return lines;
|
|
1267
1267
|
}
|
|
1268
1268
|
/**
|
|
1269
|
-
* Who stopped a
|
|
1270
|
-
* `show` printed neither (OSK-15423), so a
|
|
1269
|
+
* Who stopped a Duty, and when and why, in one line. The server stores it as `stoppedBy`;
|
|
1270
|
+
* `show` printed neither (OSK-15423), so a Duty you paused did not say you had.
|
|
1271
1271
|
*/
|
|
1272
|
-
function describeStoppedBy(
|
|
1273
|
-
const stoppedBy =
|
|
1272
|
+
function describeStoppedBy(duty) {
|
|
1273
|
+
const stoppedBy = duty.stoppedBy;
|
|
1274
1274
|
if (!stoppedBy || typeof stoppedBy !== 'object')
|
|
1275
1275
|
return null;
|
|
1276
1276
|
const who = stoppedBy.kind === 'user'
|
|
@@ -1280,19 +1280,19 @@ function describeStoppedBy(commitment) {
|
|
|
1280
1280
|
: stoppedBy.kind
|
|
1281
1281
|
? 'the platform'
|
|
1282
1282
|
: 'someone';
|
|
1283
|
-
const status = stoppedBy.status ||
|
|
1283
|
+
const status = stoppedBy.status || duty.status || 'stopped';
|
|
1284
1284
|
return (`${status} by ${who}${stoppedBy.at ? ` on ${stoppedBy.at}` : ''}` +
|
|
1285
1285
|
`${stoppedBy.reason ? `: ${stoppedBy.reason}` : ''}`);
|
|
1286
1286
|
}
|
|
1287
1287
|
/**
|
|
1288
|
-
* The
|
|
1288
|
+
* The duty `show` should render: its stored contract, with the
|
|
1289
1289
|
* assessment replaced by the one the operating state recomputed for this read
|
|
1290
|
-
* when the server sent one (OSK-15989). The stored `
|
|
1290
|
+
* when the server sent one (OSK-15989). The stored `duty.assessment` is
|
|
1291
1291
|
* what the LAST check wrote; while a run is in flight it can still say
|
|
1292
1292
|
* `blocked`, and printing it above "Agent is working" made the header
|
|
1293
1293
|
* contradict the rest of the page. `doctor` already reads the live one first.
|
|
1294
1294
|
*/
|
|
1295
|
-
function withLiveAssessment(
|
|
1295
|
+
function withLiveAssessment(duty, operatingState) {
|
|
1296
1296
|
const live = operatingState?.assessment;
|
|
1297
1297
|
// The remediation for a blocked operation lives on the operating state's
|
|
1298
1298
|
// first actionable blocker; the header printed only the code (OSK-16212).
|
|
@@ -1302,30 +1302,30 @@ function withLiveAssessment(commitment, operatingState) {
|
|
|
1302
1302
|
: {};
|
|
1303
1303
|
// The operating state also knows the executor's machine is stopped (`waiting_for_machine`),
|
|
1304
1304
|
// which the stored contract never carries; `show` printed neither (OSK-15423).
|
|
1305
|
-
const executorBlocked = !
|
|
1305
|
+
const executorBlocked = !duty.executorBlocked &&
|
|
1306
1306
|
operatingState?.executorBlocked &&
|
|
1307
1307
|
typeof operatingState.executorBlocked === 'object'
|
|
1308
1308
|
? { executorBlocked: operatingState.executorBlocked }
|
|
1309
1309
|
: {};
|
|
1310
1310
|
if (!live || typeof live !== 'object') {
|
|
1311
1311
|
return Object.keys(executorBlocked).length + Object.keys(blocker).length > 0
|
|
1312
|
-
? { ...
|
|
1313
|
-
:
|
|
1312
|
+
? { ...duty, ...executorBlocked, ...blocker }
|
|
1313
|
+
: duty;
|
|
1314
1314
|
}
|
|
1315
1315
|
return {
|
|
1316
|
-
...
|
|
1316
|
+
...duty,
|
|
1317
1317
|
...executorBlocked,
|
|
1318
1318
|
...blocker,
|
|
1319
1319
|
assessment: live,
|
|
1320
1320
|
};
|
|
1321
1321
|
}
|
|
1322
1322
|
/**
|
|
1323
|
-
* The first line of `
|
|
1323
|
+
* The first line of `duties update` text output. An update that changed
|
|
1324
1324
|
* nothing says so and names the version it left alone (OSK-16199); a server
|
|
1325
1325
|
* that predates the receipt is reported as updated, exactly as before.
|
|
1326
1326
|
*/
|
|
1327
1327
|
/**
|
|
1328
|
-
* The warnings a
|
|
1328
|
+
* The warnings a Duty write deserves (OSK-17003): what the replacement
|
|
1329
1329
|
* removed (a watched source, its settings, daily times), what now reads
|
|
1330
1330
|
* differently (daily times in a new timezone) and what stores without effect
|
|
1331
1331
|
* (an `agent_run` source with no declared keys, collaborator agents).
|
|
@@ -1334,41 +1334,41 @@ function withLiveAssessment(commitment, operatingState) {
|
|
|
1334
1334
|
* server sends none, so the CLI derives the same list locally from the contract
|
|
1335
1335
|
* it read and the payload it sent — one derivation, `@skrr-ai/data-provider`'s.
|
|
1336
1336
|
*/
|
|
1337
|
-
function
|
|
1337
|
+
function dutyWriteWarnings(response, fallback) {
|
|
1338
1338
|
if (response &&
|
|
1339
1339
|
typeof response === 'object' &&
|
|
1340
1340
|
Array.isArray(response.warnings)) {
|
|
1341
|
-
return (0, data_provider_1.
|
|
1341
|
+
return (0, data_provider_1.readDutyAuthoringWarnings)(response);
|
|
1342
1342
|
}
|
|
1343
1343
|
const changedFields = Object.keys(fallback.payload).filter((key) => key !== 'expectedVersion');
|
|
1344
|
-
return (0, data_provider_1.
|
|
1344
|
+
return (0, data_provider_1.deriveDutyAuthoringWarnings)({
|
|
1345
1345
|
before: fallback.before ?? null,
|
|
1346
1346
|
after: { ...(fallback.before ?? {}), ...fallback.payload },
|
|
1347
1347
|
changedFields: fallback.before ? changedFields : null,
|
|
1348
1348
|
});
|
|
1349
1349
|
}
|
|
1350
1350
|
/** One `Warning:` line per authoring warning, after the write's own output. */
|
|
1351
|
-
function
|
|
1351
|
+
function renderDutyWriteWarnings(warnings, warn) {
|
|
1352
1352
|
for (const warning of warnings)
|
|
1353
1353
|
warn(warning.message);
|
|
1354
1354
|
}
|
|
1355
|
-
function
|
|
1355
|
+
function describeDutyRevision(revision) {
|
|
1356
1356
|
if (!revision || typeof revision.changed !== 'boolean')
|
|
1357
|
-
return 'Updated
|
|
1357
|
+
return 'Updated duty:';
|
|
1358
1358
|
if (!revision.changed) {
|
|
1359
|
-
return `No change: the
|
|
1359
|
+
return `No change: the duty already matches; it stays at version ${revision.version}.`;
|
|
1360
1360
|
}
|
|
1361
|
-
return `Updated
|
|
1361
|
+
return `Updated duty (version ${revision.previousVersion} -> ${revision.version}):`;
|
|
1362
1362
|
}
|
|
1363
1363
|
/**
|
|
1364
|
-
* A
|
|
1364
|
+
* A duty's priority, as one line: `high · weight 70 · from northstar`.
|
|
1365
1365
|
*
|
|
1366
|
-
* Linking a
|
|
1366
|
+
* Linking a duty to a northstar rewrites its priority (`source: northstar`) and a governor
|
|
1367
1367
|
* reprioritization changes it again, so the place a person looks to confirm either is `show`, which
|
|
1368
1368
|
* printed everything but this and sent them to `--json`. An unset priority says so rather than
|
|
1369
1369
|
* printing nothing.
|
|
1370
1370
|
*/
|
|
1371
|
-
function
|
|
1371
|
+
function describeDutyPriority(priority) {
|
|
1372
1372
|
const parts = [];
|
|
1373
1373
|
if (priority?.tier)
|
|
1374
1374
|
parts.push(priority.tier);
|
|
@@ -1381,36 +1381,36 @@ function describeCommitmentPriority(priority) {
|
|
|
1381
1381
|
return parts.length ? parts.join(' · ') : 'not set';
|
|
1382
1382
|
}
|
|
1383
1383
|
/**
|
|
1384
|
-
* The `Compass:` line of a bound
|
|
1385
|
-
* read does not carry that compass's STATUS, and an archived one governs nothing (the
|
|
1384
|
+
* The `Compass:` line of a bound duty. A duty names its compass (`compassId`) but the
|
|
1385
|
+
* read does not carry that compass's STATUS, and an archived one governs nothing (the duty
|
|
1386
1386
|
* runs on defaults), so the id alone could be read as "governed by it". Only what is known is
|
|
1387
1387
|
* stated: the id, and the command that says whether it is active (OSK-21242).
|
|
1388
1388
|
*/
|
|
1389
|
-
function describeBoundCompass(
|
|
1390
|
-
const id =
|
|
1391
|
-
const agent =
|
|
1389
|
+
function describeBoundCompass(duty) {
|
|
1390
|
+
const id = duty.compassId ?? '-';
|
|
1391
|
+
const agent = duty.agentId ?? '<agent-id>';
|
|
1392
1392
|
return `Compass: ${id} — status not shown here; an archived compass governs nothing: \`skrr compass show ${id} --agent ${agent}\``;
|
|
1393
1393
|
}
|
|
1394
1394
|
/**
|
|
1395
1395
|
* The bound Compass, as `explain` prints it (OSK-21332). `explain` is where a person asks "why does
|
|
1396
|
-
* this
|
|
1397
|
-
*
|
|
1398
|
-
* its status, so the caller reads the
|
|
1396
|
+
* this Duty behave this way", and a bound Compass (or an archived one, which runs the
|
|
1397
|
+
* Duty on defaults) is part of the answer. The explain payload names neither the Compass nor
|
|
1398
|
+
* its status, so the caller reads the Duty itself, the same read `show` renders, and hands the
|
|
1399
1399
|
* result here: the line is `describeBoundCompass`, the one `show` prints, not a second wording.
|
|
1400
1400
|
*
|
|
1401
1401
|
* `null` means that read did not come back. It is said, not skipped: a silent skip is
|
|
1402
|
-
* indistinguishable from "no Compass is bound". A
|
|
1402
|
+
* indistinguishable from "no Compass is bound". A Duty bound to none prints nothing, as in
|
|
1403
1403
|
* `show`.
|
|
1404
1404
|
*/
|
|
1405
|
-
function explainCompassLines(
|
|
1406
|
-
if (!
|
|
1405
|
+
function explainCompassLines(dutyId, duty) {
|
|
1406
|
+
if (!duty) {
|
|
1407
1407
|
return [
|
|
1408
|
-
`Compass: not shown — the
|
|
1408
|
+
`Compass: not shown — the duty could not be read just now; \`skrr duties show ${dutyId}\` prints it`,
|
|
1409
1409
|
];
|
|
1410
1410
|
}
|
|
1411
|
-
return
|
|
1411
|
+
return duty.compassId ? [describeBoundCompass(duty)] : [];
|
|
1412
1412
|
}
|
|
1413
|
-
function
|
|
1413
|
+
function renderDutySummary(duty, log,
|
|
1414
1414
|
/**
|
|
1415
1415
|
* The most recent check, when the caller has one. Optional because pause /
|
|
1416
1416
|
* complete / detach / reports render this same summary and hold only the
|
|
@@ -1423,74 +1423,74 @@ latestCheck,
|
|
|
1423
1423
|
* same reason as `latestCheck`: only `show` reads them from the server.
|
|
1424
1424
|
*/
|
|
1425
1425
|
scheduleIssues) {
|
|
1426
|
-
log(`ID: ${
|
|
1427
|
-
log(`Title: ${
|
|
1428
|
-
log(`Kind: ${
|
|
1429
|
-
log(`Status: ${
|
|
1430
|
-
const stopped = describeStoppedBy(
|
|
1431
|
-
if (
|
|
1426
|
+
log(`ID: ${duty.id ?? '-'}`);
|
|
1427
|
+
log(`Title: ${duty.title ?? '-'}`);
|
|
1428
|
+
log(`Kind: ${duty.kind ?? 'achieve'}`);
|
|
1429
|
+
log(`Status: ${duty.status ?? '-'}`);
|
|
1430
|
+
const stopped = describeStoppedBy(duty);
|
|
1431
|
+
if (duty.status !== 'active' && stopped)
|
|
1432
1432
|
log(`Stopped: ${stopped}`);
|
|
1433
|
-
log(`Agent: ${
|
|
1434
|
-
// A
|
|
1433
|
+
log(`Agent: ${duty.agentId ?? '-'}`);
|
|
1434
|
+
// A duty whose executor cannot run anywhere should say so on the
|
|
1435
1435
|
// header, not as a silent skip series — "executor cannot run until <date> —
|
|
1436
1436
|
// reassign or add a fallback target" (design doc P4).
|
|
1437
|
-
const executorBlocked = describeExecutorBlocked(
|
|
1437
|
+
const executorBlocked = describeExecutorBlocked(duty);
|
|
1438
1438
|
if (executorBlocked) {
|
|
1439
1439
|
// A stopped machine is started for the work: that is waiting, not blocked, and reassigning the
|
|
1440
|
-
//
|
|
1441
|
-
const machineWait =
|
|
1440
|
+
// Duty is not its remedy (OSK-15423).
|
|
1441
|
+
const machineWait = duty.executorBlocked?.reason ===
|
|
1442
1442
|
'waiting_for_machine';
|
|
1443
1443
|
log(`Executor: ${machineWait ? 'waiting' : 'blocked'} — ${executorBlocked}`);
|
|
1444
1444
|
if (!machineWait) {
|
|
1445
|
-
log(` Fix: reassign with \`skrr
|
|
1445
|
+
log(` Fix: reassign with \`skrr duties handover ${duty.id ?? '<id>'} --to <agent>\` or add a fallback target`);
|
|
1446
1446
|
}
|
|
1447
1447
|
}
|
|
1448
|
-
if (
|
|
1449
|
-
log(`Goal: ${
|
|
1450
|
-
if (
|
|
1451
|
-
log(`Northstar: ${
|
|
1452
|
-
if (
|
|
1453
|
-
log(describeBoundCompass(
|
|
1454
|
-
log(`Priority: ${
|
|
1455
|
-
if (
|
|
1456
|
-
log(`Outcome: ${
|
|
1457
|
-
if (
|
|
1458
|
-
log(`Deadline: ${
|
|
1459
|
-
log(`Cadence: ${cadenceLabel(
|
|
1448
|
+
if (duty.goalId)
|
|
1449
|
+
log(`Goal: ${duty.goalId}`);
|
|
1450
|
+
if (duty.northstarId)
|
|
1451
|
+
log(`Northstar: ${duty.northstarId}`);
|
|
1452
|
+
if (duty.compassId)
|
|
1453
|
+
log(describeBoundCompass(duty));
|
|
1454
|
+
log(`Priority: ${describeDutyPriority(duty.priority)}`);
|
|
1455
|
+
if (duty.target?.outcome)
|
|
1456
|
+
log(`Outcome: ${duty.target.outcome}`);
|
|
1457
|
+
if (duty.target?.deadlineAt)
|
|
1458
|
+
log(`Deadline: ${duty.target.deadlineAt}`);
|
|
1459
|
+
log(`Cadence: ${cadenceLabel(duty)}`);
|
|
1460
1460
|
// `event+1d` abbreviates a guarantee: events make a check come sooner, they are not a delivery
|
|
1461
1461
|
// receipt. Say what the interval does and does not recover (OSK-21747).
|
|
1462
|
-
if (
|
|
1463
|
-
log(` ${eventBackstopNote(
|
|
1462
|
+
if (duty.cadence?.mode === 'event_plus_interval') {
|
|
1463
|
+
log(` ${eventBackstopNote(duty.cadence.intervalMs)}`);
|
|
1464
1464
|
}
|
|
1465
1465
|
for (const line of scheduleIssueLines(scheduleIssues))
|
|
1466
1466
|
log(line);
|
|
1467
|
-
log(`Delivery: ${(0,
|
|
1468
|
-
log(`Concurrency: ${
|
|
1469
|
-
log(`Evidence gate: ${describeEvidenceGate(
|
|
1467
|
+
log(`Delivery: ${(0, duty_product_1.deliveryLabel)(duty.delivery?.mode)}${duty.delivery?.repo ? ` · ${duty.delivery.repo}` : ''}${duty.delivery?.baseBranch ? ` → ${duty.delivery.baseBranch}` : ''}`);
|
|
1468
|
+
log(`Concurrency: ${describeDutyConcurrency(duty)}`);
|
|
1469
|
+
log(`Evidence gate: ${describeEvidenceGate(duty)}`);
|
|
1470
1470
|
// How much it may interrupt the owner (OSK-21120). A server that sent no policy prints
|
|
1471
1471
|
// nothing, rather than a guess that reads as "unlimited".
|
|
1472
|
-
if (
|
|
1473
|
-
for (const line of (0,
|
|
1472
|
+
if (duty.policy) {
|
|
1473
|
+
for (const line of (0, duty_attention_copy_1.nudgeSettingLines)((0, duty_attention_copy_1.nudgeSettingsFromPolicy)(duty.policy)))
|
|
1474
1474
|
log(line);
|
|
1475
|
-
log(`Quiet hours: ${(0,
|
|
1475
|
+
log(`Quiet hours: ${(0, duty_attention_copy_1.describeQuietHours)(duty.policy.quietHours)}`);
|
|
1476
1476
|
}
|
|
1477
|
-
const criteria =
|
|
1477
|
+
const criteria = duty.target?.successCriteria || [];
|
|
1478
1478
|
const evidenceHealth = latestCheck?.inputs?.evidenceHealth;
|
|
1479
1479
|
const evidenceLine = describeEvidenceHealth(evidenceHealth, criteria.length);
|
|
1480
|
-
const assessment =
|
|
1481
|
-
? (0, data_provider_2.
|
|
1480
|
+
const assessment = duty.assessment
|
|
1481
|
+
? (0, data_provider_2.readDutyAssessment)(duty.assessment)
|
|
1482
1482
|
: undefined;
|
|
1483
1483
|
log(`Assessment: ${assessment?.label ?? 'Unknown'}`);
|
|
1484
1484
|
log(`Evidence: ${describeAssessmentEvidence(assessment?.evidence)}`);
|
|
1485
1485
|
log(`Operation: ${describeOperation(assessment?.operation, assessment?.operationReason)}`);
|
|
1486
|
-
for (const line of describeOperationFix(
|
|
1486
|
+
for (const line of describeOperationFix(duty, assessment?.operation))
|
|
1487
1487
|
log(` ${line.label}: ${line.text}`);
|
|
1488
|
-
if (
|
|
1489
|
-
log(`Checked: ${
|
|
1490
|
-
if (typeof
|
|
1491
|
-
log(`Unresolved checks in a row:${` ${
|
|
1488
|
+
if (duty.state?.lastCheckedAt)
|
|
1489
|
+
log(`Checked: ${duty.state.lastCheckedAt}`);
|
|
1490
|
+
if (typeof duty.state?.consecutiveUnresolvedChecks === 'number') {
|
|
1491
|
+
log(`Unresolved checks in a row:${` ${duty.state.consecutiveUnresolvedChecks}`}`);
|
|
1492
1492
|
}
|
|
1493
|
-
// The load-bearing signal on a
|
|
1493
|
+
// The load-bearing signal on a duty that "reports active but never
|
|
1494
1494
|
// acts": the arbiter names WHY every recent check decided to do nothing, but
|
|
1495
1495
|
// that entry sat only in `policyTrace` on each check and was never rendered.
|
|
1496
1496
|
// Read at check time, unrolled here so a person reading the header sees the
|
|
@@ -1498,10 +1498,10 @@ scheduleIssues) {
|
|
|
1498
1498
|
// already written for them.
|
|
1499
1499
|
const standstill = extractStandstillFromCheck(latestCheck);
|
|
1500
1500
|
if (standstill) {
|
|
1501
|
-
const streak =
|
|
1501
|
+
const streak = duty.state?.consecutiveUnresolvedChecks;
|
|
1502
1502
|
const streakClause = typeof streak === 'number' && streak >= 2 ? `${streak} checks in a row: ` : '';
|
|
1503
1503
|
log(`Standstill:${` ${streakClause}${(0, data_provider_2.describeStandstill)(standstill.reason).title}`}`);
|
|
1504
|
-
const fix = standstillFixForRead(standstill,
|
|
1504
|
+
const fix = standstillFixForRead(standstill, duty.id);
|
|
1505
1505
|
if (fix)
|
|
1506
1506
|
log(` Fix: ${fix}`);
|
|
1507
1507
|
if (standstill.alsoConstrained?.length) {
|
|
@@ -1517,7 +1517,7 @@ scheduleIssues) {
|
|
|
1517
1517
|
log(` Also constrained: ${also.map((reason) => (0, data_provider_2.describeStandstill)(reason).title).join(', ')}`);
|
|
1518
1518
|
}
|
|
1519
1519
|
}
|
|
1520
|
-
const sources = (
|
|
1520
|
+
const sources = (duty.watchedSources || [])
|
|
1521
1521
|
.filter((s) => s.enabled !== false)
|
|
1522
1522
|
.map((s) => s.source);
|
|
1523
1523
|
if (sources.length)
|
|
@@ -1525,7 +1525,7 @@ scheduleIssues) {
|
|
|
1525
1525
|
// The executor-rebind audit trail was recorded but never rendered — after a
|
|
1526
1526
|
// handover, `show` still read as if the original agent had always run it
|
|
1527
1527
|
// (OSK-10963).
|
|
1528
|
-
const handovers =
|
|
1528
|
+
const handovers = duty.executorHandovers || [];
|
|
1529
1529
|
if (handovers.length) {
|
|
1530
1530
|
const latest = handovers[handovers.length - 1];
|
|
1531
1531
|
const from = latest.fromAgentId ? `${latest.fromAgentId} → ` : '';
|
|
@@ -1546,9 +1546,9 @@ scheduleIssues) {
|
|
|
1546
1546
|
for (const c of criteria)
|
|
1547
1547
|
log(` - [${c.evaluator ?? 'manual'}] ${c.label}`);
|
|
1548
1548
|
}
|
|
1549
|
-
if (
|
|
1549
|
+
if (duty.state?.summary) {
|
|
1550
1550
|
log('');
|
|
1551
|
-
log(
|
|
1551
|
+
log(duty.state.summary);
|
|
1552
1552
|
}
|
|
1553
1553
|
}
|
|
1554
1554
|
/**
|
|
@@ -1561,10 +1561,10 @@ const INVOCATION_SKIP_REASONS = {
|
|
|
1561
1561
|
// NAMES THE ENVELOPE, not "autonomy", because they are different fields.
|
|
1562
1562
|
//
|
|
1563
1563
|
// The server sets this code from `executionBudget.enabled !== true`
|
|
1564
|
-
// (`WakeIntentResolver.js:35`, `
|
|
1564
|
+
// (`WakeIntentResolver.js:35`, `DutyCadenceService.js:12`). It was
|
|
1565
1565
|
// rendered as "autonomy off", which a reader maps onto `policy.autonomyMode`
|
|
1566
|
-
// — the field the CLI prints as `Autonomy:` and the one `
|
|
1567
|
-
// sets. So a
|
|
1566
|
+
// — the field the CLI prints as `Autonomy:` and the one `duties autonomy`
|
|
1567
|
+
// sets. So a duty sitting at `suggestions_only` reported "autonomy off",
|
|
1568
1568
|
// which is false about the field it appears to name, and sends the reader to
|
|
1569
1569
|
// change a setting that was never the cause.
|
|
1570
1570
|
autonomy_envelope_disabled: 'autonomy envelope off',
|
|
@@ -1576,8 +1576,8 @@ const INVOCATION_SKIP_REASONS = {
|
|
|
1576
1576
|
/**
|
|
1577
1577
|
* Whether a check woke the agent, in plain words (OSK-4884).
|
|
1578
1578
|
*
|
|
1579
|
-
* The
|
|
1580
|
-
* `rule: '
|
|
1579
|
+
* The duty control loop records its wake decision as a
|
|
1580
|
+
* `rule: 'duty_invocation'` entry in `decision.policyTrace`, but the CLI
|
|
1581
1581
|
* never surfaced it — so `checks` could not answer the first question a reader
|
|
1582
1582
|
* has: did this check start an agent run, and if not, why not? Reads the trace
|
|
1583
1583
|
* entry and renders `yes` / `no — <reason>`; `-` when the check carries no
|
|
@@ -1589,7 +1589,7 @@ function describeWakeDecision(check) {
|
|
|
1589
1589
|
const trace = check.decision?.policyTrace;
|
|
1590
1590
|
if (!Array.isArray(trace))
|
|
1591
1591
|
return '-';
|
|
1592
|
-
const entry = trace.find((e) => e && typeof e === 'object' && e.rule === '
|
|
1592
|
+
const entry = trace.find((e) => e && typeof e === 'object' && e.rule === 'duty_invocation');
|
|
1593
1593
|
if (!entry)
|
|
1594
1594
|
return '-';
|
|
1595
1595
|
const verdict = typeof entry.verdict === 'string' ? entry.verdict : '';
|
|
@@ -1602,7 +1602,7 @@ function describeWakeDecision(check) {
|
|
|
1602
1602
|
if (reason === 'posture_does_not_admit_agent_run') {
|
|
1603
1603
|
// The server names the commonest cause on the check's `stop`: nothing
|
|
1604
1604
|
// was open to act on. "record_only" alone read as a setting to change
|
|
1605
|
-
// when the remedy was to give the
|
|
1605
|
+
// when the remedy was to give the Duty some work (OSK-12090).
|
|
1606
1606
|
if (check.stop?.reason === 'no_open_loop')
|
|
1607
1607
|
return 'no — nothing open';
|
|
1608
1608
|
const posture = typeof entry.posture === 'string' ? entry.posture : '';
|
|
@@ -1616,9 +1616,9 @@ function describeWakeDecision(check) {
|
|
|
1616
1616
|
return verdict ? `(${verdict})` : '-';
|
|
1617
1617
|
}
|
|
1618
1618
|
/**
|
|
1619
|
-
* Render the
|
|
1619
|
+
* Render the duty's own decision history — one row per check. `POSTURE` is
|
|
1620
1620
|
* the loop's judgment (stay_quiet / act_silently / nudge_user / escalate …), so
|
|
1621
|
-
* this is the fastest way to see what a
|
|
1621
|
+
* this is the fastest way to see what a duty has actually been deciding.
|
|
1622
1622
|
* `WOKE` says whether the check started an agent run, and why not when it did
|
|
1623
1623
|
* not (OSK-4884).
|
|
1624
1624
|
*/
|
|
@@ -1663,7 +1663,7 @@ function renderCheckList(checks, log) {
|
|
|
1663
1663
|
// whose history is merely missing (OSK-15148).
|
|
1664
1664
|
const reasons = [
|
|
1665
1665
|
...new Set(checks
|
|
1666
|
-
.map((c) => (0, data_provider_2.
|
|
1666
|
+
.map((c) => (0, data_provider_2.describeDutyHistoryDetail)(c.historyDetail))
|
|
1667
1667
|
.filter((sentence) => Boolean(sentence))),
|
|
1668
1668
|
];
|
|
1669
1669
|
if (reasons.length > 0)
|
|
@@ -1723,8 +1723,8 @@ function describeRunCount(usage, key) {
|
|
|
1723
1723
|
return 'unknown';
|
|
1724
1724
|
return String(value);
|
|
1725
1725
|
}
|
|
1726
|
-
/** Human view for `
|
|
1727
|
-
function
|
|
1726
|
+
/** Human view for `duties ledger`; JSON remains the automation surface. */
|
|
1727
|
+
function renderDutyLedger(ledger, log) {
|
|
1728
1728
|
const checks = records(ledger.checks);
|
|
1729
1729
|
const runs = records(ledger.runs);
|
|
1730
1730
|
log(`Ledger: ${checks.length} checks, ${runs.length} runs`);
|
|
@@ -1795,7 +1795,7 @@ function renderCommitmentLedger(ledger, log) {
|
|
|
1795
1795
|
], 'No audit events recorded.', log);
|
|
1796
1796
|
}
|
|
1797
1797
|
}
|
|
1798
|
-
/** Human view for the ordered
|
|
1798
|
+
/** Human view for the ordered duty trace. */
|
|
1799
1799
|
/**
|
|
1800
1800
|
* `question:reason` for a trace event's server-derived stop — which of the six
|
|
1801
1801
|
* questions (wake, fresh, turn, think, act, reach) the wake stopped at. `none`
|
|
@@ -1816,7 +1816,7 @@ function stopCell(item) {
|
|
|
1816
1816
|
why = gate;
|
|
1817
1817
|
return why ? `${question}: ${why}` : question;
|
|
1818
1818
|
}
|
|
1819
|
-
function
|
|
1819
|
+
function renderDutyTrace(trace, log) {
|
|
1820
1820
|
const events = records(trace.events);
|
|
1821
1821
|
renderRows(events.map((item) => ({
|
|
1822
1822
|
at: text(firstValue(item, ['occurredAt', 'createdAt', 'startedAt'])),
|
|
@@ -1840,8 +1840,8 @@ function renderCommitmentTrace(trace, log) {
|
|
|
1840
1840
|
}
|
|
1841
1841
|
/*
|
|
1842
1842
|
* Display order and words for `workClassification.counts`. The names are owned
|
|
1843
|
-
* by the API scorecard (`
|
|
1844
|
-
*
|
|
1843
|
+
* by the API scorecard (`DUTY_CHECK_WORK_CLASSIFICATIONS` in
|
|
1844
|
+
* DutyProactivenessMetrics); an unknown name still prints, by its key.
|
|
1845
1845
|
*/
|
|
1846
1846
|
const WORK_CLASSIFICATION_LABELS = {
|
|
1847
1847
|
justified_source_change: 'source changed',
|
|
@@ -1967,8 +1967,8 @@ function cycleSummary(cycle) {
|
|
|
1967
1967
|
if (cycle.outcome === 'advanced') {
|
|
1968
1968
|
if (cycle.owed) {
|
|
1969
1969
|
return cycle.advancementKinds?.length
|
|
1970
|
-
? `${cycle.advancementKinds.join(', ')} — ${data_provider_2.
|
|
1971
|
-
: data_provider_2.
|
|
1970
|
+
? `${cycle.advancementKinds.join(', ')} — ${data_provider_2.DUTY_CYCLE_OWED_SENTENCE}`
|
|
1971
|
+
: data_provider_2.DUTY_CYCLE_OWED_SENTENCE;
|
|
1972
1972
|
}
|
|
1973
1973
|
return cycle.advancementKinds?.length
|
|
1974
1974
|
? cycle.advancementKinds.join(', ')
|
|
@@ -2008,11 +2008,11 @@ function platformFetchLines(cycle) {
|
|
|
2008
2008
|
}
|
|
2009
2009
|
/**
|
|
2010
2010
|
* One line per Cycle:
|
|
2011
|
-
* `09-22 12:04 ● stopped act
|
|
2011
|
+
* `09-22 12:04 ● stopped act duty_execution_budget_exhausted — Raise maxRunsPerDay…`
|
|
2012
2012
|
* A run that failed is named under its Cycle with who has to move (machine
|
|
2013
2013
|
* or model), because that is the next question every reader asks.
|
|
2014
2014
|
*/
|
|
2015
|
-
function
|
|
2015
|
+
function formatDutyCycles(page) {
|
|
2016
2016
|
const cycles = Array.isArray(page.cycles) ? page.cycles : [];
|
|
2017
2017
|
if (!cycles.length)
|
|
2018
2018
|
return ['No cycles recorded yet.'];
|
|
@@ -2064,7 +2064,7 @@ function formatCommitmentCycles(page) {
|
|
|
2064
2064
|
function formatCycleLatency(cycle) {
|
|
2065
2065
|
const latency = cycle.latency;
|
|
2066
2066
|
// One sentence for every surface, from the server's own record (OSK-15148).
|
|
2067
|
-
const historySentence = (0, data_provider_2.
|
|
2067
|
+
const historySentence = (0, data_provider_2.describeDutyHistoryDetail)(cycle.historyDetail);
|
|
2068
2068
|
const disclosure = historySentence ? [` ${historySentence}`] : [];
|
|
2069
2069
|
// A hop whose inputs were compacted away without a retained projection is
|
|
2070
2070
|
// "not retained": it may have been measured and shown before (OSK-15148).
|
|
@@ -2114,7 +2114,7 @@ function wakeOutcomeLines(run) {
|
|
|
2114
2114
|
...(wake.fix ? [` Fix: ${wake.fix}`] : []),
|
|
2115
2115
|
];
|
|
2116
2116
|
}
|
|
2117
|
-
function
|
|
2117
|
+
function formatDutyExplanation(explanation) {
|
|
2118
2118
|
const cycle = explanation.cycle;
|
|
2119
2119
|
const lines = [
|
|
2120
2120
|
cycle
|
|
@@ -2208,7 +2208,7 @@ function describeObservationArtifacts(artifacts) {
|
|
|
2208
2208
|
.map((name) => `${counts.get(name)} ${name}`)
|
|
2209
2209
|
.join(', ');
|
|
2210
2210
|
}
|
|
2211
|
-
/** The VALUE column's width in `
|
|
2211
|
+
/** The VALUE column's width in `renderDutyObservations`, which `observationLegend` checks against. */
|
|
2212
2212
|
const OBSERVATION_VALUE_WIDTH = 38;
|
|
2213
2213
|
/**
|
|
2214
2214
|
* What the observations table's terse columns mean, for the rows actually on screen (OSK-15432).
|
|
@@ -2239,7 +2239,7 @@ function observationLegend(data) {
|
|
|
2239
2239
|
if (truncated.length > 5)
|
|
2240
2240
|
lines.push(`VALUE TRUNCATED for ${truncated.length - 5} more rows; see truncation in --json.`);
|
|
2241
2241
|
if (data.some((item) => item.declared === false)) {
|
|
2242
|
-
lines.push('DECLARED no / REASON undeclared: the key is not declared on this
|
|
2242
|
+
lines.push('DECLARED no / REASON undeclared: the key is not declared on this Duty’s agent_run ' +
|
|
2243
2243
|
'source, so the reading is recorded but can never open a loop.');
|
|
2244
2244
|
}
|
|
2245
2245
|
if (data.some((item) => item.observedAtClamped === true)) {
|
|
@@ -2248,7 +2248,7 @@ function observationLegend(data) {
|
|
|
2248
2248
|
}
|
|
2249
2249
|
return lines;
|
|
2250
2250
|
}
|
|
2251
|
-
function
|
|
2251
|
+
function renderDutyObservations(response, log, options = {}) {
|
|
2252
2252
|
const data = records(response.data);
|
|
2253
2253
|
renderRows(data.map((item) => ({
|
|
2254
2254
|
at: text(firstValue(item, ['observedAt', 'createdAt', 'updatedAt'])),
|
|
@@ -2298,7 +2298,7 @@ function renderCommitmentObservations(response, log, options = {}) {
|
|
|
2298
2298
|
log(line);
|
|
2299
2299
|
}
|
|
2300
2300
|
/** Human view for causal hypotheses. */
|
|
2301
|
-
function
|
|
2301
|
+
function renderDutyHypotheses(response, log, options = {}) {
|
|
2302
2302
|
const data = records(response.data);
|
|
2303
2303
|
renderRows(data.map((item) => ({
|
|
2304
2304
|
// `proposedAt` is the domain's own "when was this recorded". Rendering
|
|
@@ -2363,11 +2363,11 @@ function renderLineageRows(label, value, log) {
|
|
|
2363
2363
|
{ key: 'summary', header: 'SUMMARY', maxWidth: 72 },
|
|
2364
2364
|
], `No ${label.toLowerCase()} recorded.`, log);
|
|
2365
2365
|
}
|
|
2366
|
-
/** Human view for the
|
|
2367
|
-
function
|
|
2368
|
-
const
|
|
2369
|
-
if (
|
|
2370
|
-
log(`
|
|
2366
|
+
/** Human view for the duty → work lineage projection. */
|
|
2367
|
+
function renderDutyLineage(lineage, log) {
|
|
2368
|
+
const duty = record(lineage.duty);
|
|
2369
|
+
if (duty) {
|
|
2370
|
+
log(`Duty: ${text(duty.title, text(duty.id))} (${text(duty.status)})`);
|
|
2371
2371
|
}
|
|
2372
2372
|
const groups = [
|
|
2373
2373
|
['Goals', lineage.goals],
|
|
@@ -2382,7 +2382,7 @@ function renderCommitmentLineage(lineage, log) {
|
|
|
2382
2382
|
renderLineageRows(label, value, log);
|
|
2383
2383
|
}
|
|
2384
2384
|
/** Human view for daily control-loop metrics. */
|
|
2385
|
-
function
|
|
2385
|
+
function renderDutyMetrics(response, log) {
|
|
2386
2386
|
const data = records(response.data);
|
|
2387
2387
|
renderRows(data.map((item) => {
|
|
2388
2388
|
const totals = record(item.totals) || {};
|
|
@@ -2421,7 +2421,7 @@ function costRuleCell(projection, closed = Boolean(projection)) {
|
|
|
2421
2421
|
return projection.current === false ? `v${version} (older)` : `v${version}`;
|
|
2422
2422
|
}
|
|
2423
2423
|
/** Human view for the case list — one row per durable problem case. */
|
|
2424
|
-
function
|
|
2424
|
+
function renderDutyCases(response, log) {
|
|
2425
2425
|
const data = records(response.data);
|
|
2426
2426
|
renderRows(data.map((item) => ({
|
|
2427
2427
|
id: text(item.id),
|
|
@@ -2453,7 +2453,7 @@ function renderCommitmentCases(response, log) {
|
|
|
2453
2453
|
* this case and what happened last" in one screen, and `--json` stays the
|
|
2454
2454
|
* opt-in for the full document.
|
|
2455
2455
|
*/
|
|
2456
|
-
function
|
|
2456
|
+
function renderDutyCaseDetail(response, log, options = {}) {
|
|
2457
2457
|
const data = record(response.data);
|
|
2458
2458
|
if (!data) {
|
|
2459
2459
|
log('Case not found.');
|
|
@@ -2500,7 +2500,7 @@ function renderCommitmentCaseDetail(response, log, options = {}) {
|
|
|
2500
2500
|
}
|
|
2501
2501
|
}
|
|
2502
2502
|
/** Human view for the remediation-proposal list. */
|
|
2503
|
-
function
|
|
2503
|
+
function renderDutyRemediationProposals(response, log) {
|
|
2504
2504
|
const advisory = record(response.executionAdvisory);
|
|
2505
2505
|
if (advisory)
|
|
2506
2506
|
log(`Advisory: ${text(advisory.code, '-')} — ${text(advisory.message, '')}`);
|
|
@@ -2524,7 +2524,7 @@ function renderCommitmentRemediationProposals(response, log) {
|
|
|
2524
2524
|
], 'No remediation proposals recorded.', log);
|
|
2525
2525
|
}
|
|
2526
2526
|
/** Human view for one frozen remediation proposal. */
|
|
2527
|
-
function
|
|
2527
|
+
function renderDutyRemediationProposal(response, log) {
|
|
2528
2528
|
const proposal = record(response.proposal) || record(response.data) || response;
|
|
2529
2529
|
log(`Proposal: ${text(proposal.id)} (${text(proposal.status)})`);
|
|
2530
2530
|
log(`Case: ${text(proposal.caseId, '-')} · revision ${text(proposal.caseRevision, '-')}`);
|