@skrr-ai/cli 0.1.152 → 0.1.154
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commands/agent/message/send.d.ts +3 -1
- package/dist/commands/agent/message/send.js +52 -1
- package/dist/commands/agents/always-on/held-messages.d.ts +22 -0
- package/dist/commands/agents/always-on/held-messages.js +62 -0
- package/dist/commands/agents/always-on/release-run.d.ts +37 -0
- package/dist/commands/agents/always-on/release-run.js +92 -0
- package/dist/commands/agents/always-on/status.js +5 -0
- package/dist/commands/duties/create.js +24 -9
- package/dist/commands/duties/export.js +2 -1
- package/dist/commands/duties/preflight.js +17 -0
- package/dist/commands/duties/update.d.ts +1 -0
- package/dist/commands/duties/update.js +87 -66
- package/dist/commands/triggers/fire-detail.js +19 -0
- package/dist/generated/agent-guides.json +35 -35
- package/dist/lib/duties.d.ts +5 -0
- package/dist/lib/duties.js +102 -6
- package/dist/lib/duty-event-wakes.js +6 -3
- package/dist/lib/duty-loop-status.js +26 -2
- package/dist/lib/duty-product.js +16 -3
- package/dist/lib/held-messages.d.ts +11 -0
- package/dist/lib/held-messages.js +93 -0
- package/dist/lib/message-intent.d.ts +15 -0
- package/dist/lib/roles.d.ts +1 -1
- package/dist/lib/triggers.d.ts +13 -1
- package/dist/lib/triggers.js +43 -0
- package/dist/lib/update-check.js +9 -2
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.js +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.d.ts +1 -1
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.js +1 -1
- package/dist/node_modules/@skrr-ai/data-provider/index.js +6070 -6030
- package/oclif.manifest.json +191 -2
- package/package.json +4 -3
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.describeFireAuditDetail = describeFireAuditDetail;
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
5
6
|
const base_command_1 = require("../../base-command");
|
|
6
7
|
const triggers_1 = require("../../lib/triggers");
|
|
7
8
|
/**
|
|
@@ -25,6 +26,19 @@ function describeFireAuditDetail(detail, fireId, triggerId) {
|
|
|
25
26
|
lines.push(`Reason: ${reason}`);
|
|
26
27
|
if (message && message !== reason)
|
|
27
28
|
lines.push(`${reason ? 'Detail:' : 'Reason:'} ${message}`);
|
|
29
|
+
// The fire's durable Run is queued but a claim refusal is holding it back; the Run row and the fire
|
|
30
|
+
// say nothing else (OSK-22700).
|
|
31
|
+
const claimRefusal = (0, data_provider_1.describeRunClaimRefusal)(detail.claimRefusal);
|
|
32
|
+
if (claimRefusal) {
|
|
33
|
+
const runId = detail.claimRefusal.runId;
|
|
34
|
+
if (typeof runId === 'string' && runId.trim())
|
|
35
|
+
lines.push(`Run: ${runId.trim()}`);
|
|
36
|
+
lines.push(claimRefusal);
|
|
37
|
+
// The owner's way out of a Run held for an unconfirmed stop, with the generation to pass. Only for that reason (OSK-22700).
|
|
38
|
+
const release = (0, data_provider_1.describeRunClaimRefusalRelease)(detail.claimRefusal);
|
|
39
|
+
if (release)
|
|
40
|
+
lines.push(release);
|
|
41
|
+
}
|
|
28
42
|
const clockSkip = (0, triggers_1.clockSkipAuditExplanation)(detail);
|
|
29
43
|
if (clockSkip) {
|
|
30
44
|
lines.push(`Explanation: ${clockSkip.summary}. ${clockSkip.detail}`);
|
|
@@ -44,6 +58,11 @@ function describeFireAuditDetail(detail, fireId, triggerId) {
|
|
|
44
58
|
lines.push(`Inbox card: ${policyCard}`);
|
|
45
59
|
if (detail.durationMs !== undefined)
|
|
46
60
|
lines.push(`Duration: ${String(detail.durationMs)}ms`);
|
|
61
|
+
// A scheduled fire that started long after the scheduler claimed it says where that time went
|
|
62
|
+
// (OSK-22613); `--json` carries the whole breakdown as `metadata.startLag`.
|
|
63
|
+
const startLag = (0, triggers_1.scheduleStartLagSentence)(detail.metadata);
|
|
64
|
+
if (startLag)
|
|
65
|
+
lines.push(`Start lag: ${startLag}`);
|
|
47
66
|
if (detail.conversationId)
|
|
48
67
|
lines.push(`Conversation: ${String(detail.conversationId)}`);
|
|
49
68
|
const metadata = detail.metadata;
|
|
@@ -410,7 +410,7 @@
|
|
|
410
410
|
"id": "authoring",
|
|
411
411
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
412
412
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
413
|
-
"tokens":
|
|
413
|
+
"tokens": 1176,
|
|
414
414
|
"aliases": [],
|
|
415
415
|
"explains": [
|
|
416
416
|
"DUTY_MODE_RETIRED",
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
"id": "always-on",
|
|
463
463
|
"title": "Turn it on: activation and Always-On",
|
|
464
464
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
465
|
-
"tokens":
|
|
465
|
+
"tokens": 506,
|
|
466
466
|
"aliases": [],
|
|
467
467
|
"explains": [
|
|
468
468
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -709,7 +709,7 @@
|
|
|
709
709
|
]
|
|
710
710
|
}
|
|
711
711
|
],
|
|
712
|
-
"hash": "
|
|
712
|
+
"hash": "6cfdaabe1e34fb736798d208982174a369750b57806638dd32f6613dc8c5ed4e",
|
|
713
713
|
"tokens": 546
|
|
714
714
|
},
|
|
715
715
|
"routedIndex": {
|
|
@@ -1123,7 +1123,7 @@
|
|
|
1123
1123
|
"id": "authoring",
|
|
1124
1124
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
1125
1125
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
1126
|
-
"tokens":
|
|
1126
|
+
"tokens": 1176,
|
|
1127
1127
|
"aliases": [],
|
|
1128
1128
|
"explains": [
|
|
1129
1129
|
"DUTY_MODE_RETIRED",
|
|
@@ -1175,7 +1175,7 @@
|
|
|
1175
1175
|
"id": "always-on",
|
|
1176
1176
|
"title": "Turn it on: activation and Always-On",
|
|
1177
1177
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
1178
|
-
"tokens":
|
|
1178
|
+
"tokens": 506,
|
|
1179
1179
|
"aliases": [],
|
|
1180
1180
|
"explains": [
|
|
1181
1181
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -1353,7 +1353,7 @@
|
|
|
1353
1353
|
]
|
|
1354
1354
|
}
|
|
1355
1355
|
],
|
|
1356
|
-
"hash": "
|
|
1356
|
+
"hash": "8e08324a07f6b4e9a36686fe8a346262382e2dce3a195f8cce088e2c354a9b12",
|
|
1357
1357
|
"tokens": 495
|
|
1358
1358
|
},
|
|
1359
1359
|
"cards": {
|
|
@@ -1747,7 +1747,7 @@
|
|
|
1747
1747
|
"routed": true,
|
|
1748
1748
|
"aliases": [],
|
|
1749
1749
|
"body": "## Concept model\n\n| Noun | Question it answers |\n| --- | --- |\n| **Compass** | What does good look like for this Agent, and what may it never trade away? |\n| **Northstar** | Which Duties should exist, at what priority and on what budget? |\n| **Duty** | Which outcome does this Agent keep true, and how does it keep checking? |\n| **Check** | What did one wake of a Duty see, decide and do? |\n\nA Duty is not a unit of work. A **Task** is one unit of work and a **Goal** is a dated\noutcome with key results; a Duty watches both and may create Tasks, and is neither.\n\n## Decide\n\nFive mechanisms make something happen later, and the noun alone does not pick one:\n\n| Mechanism | What it is for | The signal that picks it |\n| --- | --- | --- |\n| **Follow-up** | Coming back to one thing, once or a bounded few times: a reminder, a watch, a check-in, an agreed action | The ask ends: \"look tomorrow\", \"tell me when CI is green\" |\n| **Trigger** | Running the Agent with a set prompt on a schedule, an event, once, or on demand | The person names when, and every run does the same work |\n| **Heartbeat** | Checking in on a conversation, group chat or Space at a frequency that backs off while unread | The person wants regular contact, not an outcome held |\n| **Duty** | Keeping an outcome true: watched sources, a cadence and a loop that decides when to act | \"Keep X true\", \"watch this metric\": no end, and stale evidence matters |\n| **Workflow** | Running a durable graph of Tasks in order | Repeatable work whose steps depend on each other |\n\nA one-off \"look at it tomorrow\" is a follow-up, never a Duty. Standing observation is a\nDuty with a freshness contract, not a recurring trigger or a task board left running.\n\n## Workflow\n\n### Start a Duty\n\n1. Read the Agent's Duties first, and change one rather than add a near-duplicate.\n2. Create it and turn it on in one call: the outcome, what it watches, how often it checks, where\n its work goes. Turning it on runs Preflight; a refusal keeps the draft and reports the code,\n reason and fix.\n3. Leave it a draft only when the person asked to see it first.\n4. Read it back, and tell the person what it watches, how often, and whether it is on.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Read the Duties of an Agent it can view; create one, change it and turn it on; request a check; pause one; decide whether a finding is worth telling the owner | Lift a stop a person made; set or clear a concurrency limit; choose the Task review policy; approve an action proposal or a cadence change; configure a Northstar's governance or decide its intents |\n| Person | Everything in both columns | — |\n\nA Duty grants no permission: its runs work under the Agent's own. A Check never writes an\nowner-facing message, and a Compass never creates, rewrites, pauses or archives a Duty. The\nserver cannot always tell an Agent from the person whose login it holds, so an accepted call is\nnot permission: the right-hand column stays a person's.\n\n## Live state\n\n- `skrr duties list --agent <agent-id>` — an Agent's Duties, with status and assessment.\n- `skrr duties show <duty-id>` — the contract, its next check and the last one.\n- `skrr duties roster --agent <agent-id>` — each loop: whether it is armed, its next wake, runs today.\n\n## Related guides\n\n- `tasks` — the Tasks a Duty creates or watches.\n- `spaces` — Goals, and Workflows: durable graphs of Tasks.\n- `agents` — the Agent a Duty belongs to, and where its runs execute.\n- `communication` — whether, what and how to tell the owner.",
|
|
1750
|
-
"hash": "
|
|
1750
|
+
"hash": "9261c81149ff1925f5444e7daa357dec880da4aad057578aeb4a0a4336f54056",
|
|
1751
1751
|
"tokens": 1153,
|
|
1752
1752
|
"sections": [
|
|
1753
1753
|
{
|
|
@@ -1780,7 +1780,7 @@
|
|
|
1780
1780
|
"id": "authoring",
|
|
1781
1781
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
1782
1782
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
1783
|
-
"tokens":
|
|
1783
|
+
"tokens": 1176,
|
|
1784
1784
|
"aliases": [],
|
|
1785
1785
|
"explains": [
|
|
1786
1786
|
"DUTY_MODE_RETIRED",
|
|
@@ -1832,7 +1832,7 @@
|
|
|
1832
1832
|
"id": "always-on",
|
|
1833
1833
|
"title": "Turn it on: activation and Always-On",
|
|
1834
1834
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
1835
|
-
"tokens":
|
|
1835
|
+
"tokens": 506,
|
|
1836
1836
|
"aliases": [],
|
|
1837
1837
|
"explains": [
|
|
1838
1838
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -5806,7 +5806,7 @@
|
|
|
5806
5806
|
"id": "authoring",
|
|
5807
5807
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
5808
5808
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
5809
|
-
"tokens":
|
|
5809
|
+
"tokens": 1176,
|
|
5810
5810
|
"aliases": [],
|
|
5811
5811
|
"explains": [
|
|
5812
5812
|
"DUTY_MODE_RETIRED",
|
|
@@ -5858,7 +5858,7 @@
|
|
|
5858
5858
|
"id": "always-on",
|
|
5859
5859
|
"title": "Turn it on: activation and Always-On",
|
|
5860
5860
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
5861
|
-
"tokens":
|
|
5861
|
+
"tokens": 506,
|
|
5862
5862
|
"aliases": [],
|
|
5863
5863
|
"explains": [
|
|
5864
5864
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -5922,7 +5922,7 @@
|
|
|
5922
5922
|
"id": "authoring",
|
|
5923
5923
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
5924
5924
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
5925
|
-
"tokens":
|
|
5925
|
+
"tokens": 1176,
|
|
5926
5926
|
"aliases": [],
|
|
5927
5927
|
"explains": [
|
|
5928
5928
|
"DUTY_MODE_RETIRED",
|
|
@@ -5974,7 +5974,7 @@
|
|
|
5974
5974
|
"id": "always-on",
|
|
5975
5975
|
"title": "Turn it on: activation and Always-On",
|
|
5976
5976
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
5977
|
-
"tokens":
|
|
5977
|
+
"tokens": 506,
|
|
5978
5978
|
"aliases": [],
|
|
5979
5979
|
"explains": [
|
|
5980
5980
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6040,7 +6040,7 @@
|
|
|
6040
6040
|
"id": "authoring",
|
|
6041
6041
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6042
6042
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6043
|
-
"tokens":
|
|
6043
|
+
"tokens": 1176,
|
|
6044
6044
|
"aliases": [],
|
|
6045
6045
|
"explains": [
|
|
6046
6046
|
"DUTY_MODE_RETIRED",
|
|
@@ -6092,7 +6092,7 @@
|
|
|
6092
6092
|
"id": "always-on",
|
|
6093
6093
|
"title": "Turn it on: activation and Always-On",
|
|
6094
6094
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6095
|
-
"tokens":
|
|
6095
|
+
"tokens": 506,
|
|
6096
6096
|
"aliases": [],
|
|
6097
6097
|
"explains": [
|
|
6098
6098
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6128,9 +6128,9 @@
|
|
|
6128
6128
|
"DUTY_CONCURRENCY_REQUIRES_OWNER_DECISION",
|
|
6129
6129
|
"DUTY_TASK_REVIEW_POLICY_OWNER_REQUIRED"
|
|
6130
6130
|
],
|
|
6131
|
-
"body": "Read this when you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend.\n\nA Duty starts as a draft; create and turn it on in one call unless the person asked to\nreview it first. Activation runs Preflight — a refusal keeps the draft and reports the code,\nreason and fix. An active contract spends compute on every check, so make it say exactly what\nwill be watched.\n\n- **Outcome and criteria**: the state to hold true, and how you will know it holds.\n- **Watched sources**: what each check reads. A source the platform reads itself (Tasks, a Goal,\n GitHub, metric snapshots it records) needs only its name and scope. A value only a run can read,\n such as a dashboard or an outside CI rate, is an `agent_run` key you declare.\n- **Declared keys**: the operator declares the keys, and the agent fills them. A run may report any\n key, but only a declared one can move the loop, and only as its `changeRule` says: `any` change,\n or `numeric_delta` with `minDelta`, `minRatio`, `direction` and `absoluteFloor`.\n- **Cadence**: `interval` (`1m` to `365d`), `daily` at `HH:MM` times in a timezone,\n `event_plus_interval`, or `manual`. Only `event_plus_interval` reads events, and an event is an\n accelerator, not a delivery receipt: a missed one is not replayed, and each interval re-checks\n current state, while it is running. Silence means no event was seen, not that none happened. A\n selection that cannot wake it is set aside and named by the write.\n- **Events (CLI)**: `--event-driven` sets `event_plus_interval`; `skrr triggers event-catalog --json`\n shows
|
|
6132
|
-
"hash": "
|
|
6133
|
-
"tokens":
|
|
6131
|
+
"body": "Read this when you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend.\n\nA Duty starts as a draft; create and turn it on in one call unless the person asked to\nreview it first. Activation runs Preflight — a refusal keeps the draft and reports the code,\nreason and fix. An active contract spends compute on every check, so make it say exactly what\nwill be watched.\n\n- **Outcome and criteria**: the state to hold true, and how you will know it holds.\n- **Watched sources**: what each check reads. A source the platform reads itself (Tasks, a Goal,\n GitHub, metric snapshots it records) needs only its name and scope. A value only a run can read,\n such as a dashboard or an outside CI rate, is an `agent_run` key you declare.\n- **Declared keys**: the operator declares the keys, and the agent fills them. A run may report any\n key, but only a declared one can move the loop, and only as its `changeRule` says: `any` change,\n or `numeric_delta` with `minDelta`, `minRatio`, `direction` and `absoluteFloor`.\n- **Cadence**: `interval` (`1m` to `365d`), `daily` at `HH:MM` times in a timezone,\n `event_plus_interval`, or `manual`. Only `event_plus_interval` reads events, and an event is an\n accelerator, not a delivery receipt: a missed one is not replayed, and each interval re-checks\n current state, while it is running. Silence means no event was seen, not that none happened. A\n selection that cannot wake it is set aside and named by the write.\n- **Events (CLI)**: `--event-driven` sets `event_plus_interval`; `skrr triggers event-catalog --json`\n shows `dutyWake`. Task wakes need `--goal <goal-id>` or exactly one `config.taskId`, `config.goalId`,\n or `config.keyResultId` on a `tasks` source in `--from-json`; omit `--watch` with JSON sources.\n- **Delivery**: where its work goes. `report_only` reports and changes nothing.\n- **Budgets**: `policy.executionBudget` caps runs, sensing runs and cost per day. `0` blocks; `null`\n is no limit.\n- **Event sources**: `policy.executionBudget.allowedEventSources` limits which sources may wake it.\n An empty or missing list allows every source; name sources to restrict it.\n- **Interruptions**: `policy.maxUserNudgesPerDay` caps messages to the person: `0` mutes, `null` is\n no limit. `minUserNudgeIntervalMs` is the least gap between two.\n- **Quiet hours**: `policy.quietHours` is `{enabled, start, end, timezone}`. Times are 24-hour\n `HH:MM`; `enabled: true` needs both, and they must differ. A window may cross midnight, and `end`\n is outside it. `timezone` is an IANA name; omitted means UTC, not the person's zone.\n\n## Example\n\nA daily, report-only watch on a deploy failure rate:\n\nSave this as `duty.json`:\n\n```json\n{\n \"agentId\": \"<agent-id>\",\n \"title\": \"Deploys\",\n \"status\": \"draft\",\n \"target\": { \"outcome\": \"Report a rise in deploy failures\" },\n \"cadence\": { \"mode\": \"daily\", \"times\": [\"09:00\"], \"timezone\": \"America/New_York\" },\n \"delivery\": { \"mode\": \"report_only\" },\n \"watchedSources\": [{\n \"source\": \"agent_run\",\n \"config\": { \"keys\": [{\n \"key\": \"deploys.failure_rate_7d\",\n \"changeRule\": { \"mode\": \"numeric_delta\", \"minDelta\": 0.02, \"direction\": \"up\" }\n }] }\n }],\n \"policy\": { \"executionBudget\": { \"maxRunsPerDay\": 2, \"maxObservationRunsPerDay\": 2 } }\n}\n```\n\n```bash\nskrr duties create --from-json duty.json --activate --json\n```\n\n`create` warns about inert fields, such as an `agent_run` source with no keys. `--activate` runs\nPreflight; a refusal keeps the draft. Drop `--activate` when the person wants review first;\n`skrr duties resume` turns it on later and `skrr duties update` changes it.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `DUTY_MODE_RETIRED` | The body carries `mode`; Duty modes are retired. | Leave it out: runs work under the Agent's own permissions. |\n| `DUTY_POLICY_RETIRED` | The body carries a retired permission-tier policy field. | Remove the field the refusal names. |\n| `DUTY_DELIVERY_REQUIRED` | A coding Duty names no delivery. | Choose where its work goes. |\n| `DUTY_CONCURRENCY_REQUIRES_OWNER_DECISION` | An Agent set or cleared a finite concurrency limit. | Recommend the limit; the person sets it. |\n| `DUTY_TASK_REVIEW_POLICY_OWNER_REQUIRED` | Only the owner chooses the Task review policy. | Leave it out and ask the owner. |",
|
|
6132
|
+
"hash": "e6749e26022388affd88b87f16667690b6a76d826ec98d4528bb863d4f6ac5fc",
|
|
6133
|
+
"tokens": 1176,
|
|
6134
6134
|
"sections": [
|
|
6135
6135
|
{
|
|
6136
6136
|
"id": "model",
|
|
@@ -6162,7 +6162,7 @@
|
|
|
6162
6162
|
"id": "authoring",
|
|
6163
6163
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6164
6164
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6165
|
-
"tokens":
|
|
6165
|
+
"tokens": 1176,
|
|
6166
6166
|
"aliases": [],
|
|
6167
6167
|
"explains": [
|
|
6168
6168
|
"DUTY_MODE_RETIRED",
|
|
@@ -6214,7 +6214,7 @@
|
|
|
6214
6214
|
"id": "always-on",
|
|
6215
6215
|
"title": "Turn it on: activation and Always-On",
|
|
6216
6216
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6217
|
-
"tokens":
|
|
6217
|
+
"tokens": 506,
|
|
6218
6218
|
"aliases": [],
|
|
6219
6219
|
"explains": [
|
|
6220
6220
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6278,7 +6278,7 @@
|
|
|
6278
6278
|
"id": "authoring",
|
|
6279
6279
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6280
6280
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6281
|
-
"tokens":
|
|
6281
|
+
"tokens": 1176,
|
|
6282
6282
|
"aliases": [],
|
|
6283
6283
|
"explains": [
|
|
6284
6284
|
"DUTY_MODE_RETIRED",
|
|
@@ -6330,7 +6330,7 @@
|
|
|
6330
6330
|
"id": "always-on",
|
|
6331
6331
|
"title": "Turn it on: activation and Always-On",
|
|
6332
6332
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6333
|
-
"tokens":
|
|
6333
|
+
"tokens": 506,
|
|
6334
6334
|
"aliases": [],
|
|
6335
6335
|
"explains": [
|
|
6336
6336
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6394,7 +6394,7 @@
|
|
|
6394
6394
|
"id": "authoring",
|
|
6395
6395
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6396
6396
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6397
|
-
"tokens":
|
|
6397
|
+
"tokens": 1176,
|
|
6398
6398
|
"aliases": [],
|
|
6399
6399
|
"explains": [
|
|
6400
6400
|
"DUTY_MODE_RETIRED",
|
|
@@ -6446,7 +6446,7 @@
|
|
|
6446
6446
|
"id": "always-on",
|
|
6447
6447
|
"title": "Turn it on: activation and Always-On",
|
|
6448
6448
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6449
|
-
"tokens":
|
|
6449
|
+
"tokens": 506,
|
|
6450
6450
|
"aliases": [],
|
|
6451
6451
|
"explains": [
|
|
6452
6452
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6516,7 +6516,7 @@
|
|
|
6516
6516
|
"id": "authoring",
|
|
6517
6517
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6518
6518
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6519
|
-
"tokens":
|
|
6519
|
+
"tokens": 1176,
|
|
6520
6520
|
"aliases": [],
|
|
6521
6521
|
"explains": [
|
|
6522
6522
|
"DUTY_MODE_RETIRED",
|
|
@@ -6568,7 +6568,7 @@
|
|
|
6568
6568
|
"id": "always-on",
|
|
6569
6569
|
"title": "Turn it on: activation and Always-On",
|
|
6570
6570
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6571
|
-
"tokens":
|
|
6571
|
+
"tokens": 506,
|
|
6572
6572
|
"aliases": [],
|
|
6573
6573
|
"explains": [
|
|
6574
6574
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6632,7 +6632,7 @@
|
|
|
6632
6632
|
"id": "authoring",
|
|
6633
6633
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6634
6634
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6635
|
-
"tokens":
|
|
6635
|
+
"tokens": 1176,
|
|
6636
6636
|
"aliases": [],
|
|
6637
6637
|
"explains": [
|
|
6638
6638
|
"DUTY_MODE_RETIRED",
|
|
@@ -6684,7 +6684,7 @@
|
|
|
6684
6684
|
"id": "always-on",
|
|
6685
6685
|
"title": "Turn it on: activation and Always-On",
|
|
6686
6686
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6687
|
-
"tokens":
|
|
6687
|
+
"tokens": 506,
|
|
6688
6688
|
"aliases": [],
|
|
6689
6689
|
"explains": [
|
|
6690
6690
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6718,9 +6718,9 @@
|
|
|
6718
6718
|
"DUTY_STOP_NOT_YOURS_TO_LIFT",
|
|
6719
6719
|
"DUTY_COMPASS_NOT_ACTIVE"
|
|
6720
6720
|
],
|
|
6721
|
-
"body": "Read this when a Duty must start waking on its own, or has stopped waking.\n\nA Duty that wakes on a cadence or on events needs its Agent's Always-On: while it is off,\nnothing wakes the Agent and turning the Duty on is refused. Pausing a Duty, or turning\nAlways-On off, stops new work; a turn already running may finish, and a cancelled record is not\nproof that a process stopped.\n\n## Turn a Duty on\n\n1. Read the Agent's Always-On state. A standing responsibility the person asked for covers turning\n it on for that Duty; otherwise turn it on only when the owner asked the Agent to work on\n its own.\n2. Turning it on runs Preflight, and every blocking gate must pass, so look first where you can.\n More than one can block at once, and Always-On is only the first
|
|
6722
|
-
"hash": "
|
|
6723
|
-
"tokens":
|
|
6721
|
+
"body": "Read this when a Duty must start waking on its own, or has stopped waking.\n\nA Duty that wakes on a cadence or on events needs its Agent's Always-On: while it is off,\nnothing wakes the Agent and turning the Duty on is refused. Pausing a Duty, or turning\nAlways-On off, stops new work; a turn already running may finish, and a cancelled record is not\nproof that a process stopped.\n\n## Turn a Duty on\n\n1. Read the Agent's Always-On state. A standing responsibility the person asked for covers turning\n it on for that Duty; otherwise turn it on only when the owner asked the Agent to work on\n its own.\n2. Turning it on runs Preflight, and every blocking gate must pass, so look first where you can.\n More than one can block at once, and Always-On is only the first. The cloud Agent Worker\n can run repository-independent report Duties in an isolated, per-attempt workspace.\n Repository work needs a Hosted Machine or a capable local harness. Preflight names the\n applicable runtime refusal and remedy.\n3. Turn the Duty on, then read it back: armed, and when it next wakes.\n\n```bash\nskrr agents always-on status <agent-id>\nskrr duties preflight <duty-id>\nskrr duties resume <duty-id>\nskrr duties status <duty-id>\n```\n\n`skrr agents always-on enable <agent-id>` turns Always-On on, and `reconcile` repairs a degraded\none. `skrr agents attach-harness <harness> --agent <agent-id>` moves an Agent off the cloud worker.\n`skrr duties pause <duty-id>` stops new work.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `DUTY_ACTIVATION_BLOCKED` | A blocking Preflight gate did not pass; the refusal names the first, and Preflight lists every one. | Fix each gate Preflight lists, then turn it on again. |\n| `DUTY_STOP_NOT_YOURS_TO_LIFT` | A person or the platform stopped it, and an Agent cannot lift that stop. | Ask the person to resume it. |\n| `DUTY_COMPASS_NOT_ACTIVE` | The Compass it is bound to is not active. | Ask the person to activate that Compass first. |",
|
|
6722
|
+
"hash": "2a097f06086f24958ce9586578543f57c28723519178f8966ec7d4b8562e5718",
|
|
6723
|
+
"tokens": 506,
|
|
6724
6724
|
"sections": [
|
|
6725
6725
|
{
|
|
6726
6726
|
"id": "model",
|
|
@@ -6752,7 +6752,7 @@
|
|
|
6752
6752
|
"id": "authoring",
|
|
6753
6753
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6754
6754
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6755
|
-
"tokens":
|
|
6755
|
+
"tokens": 1176,
|
|
6756
6756
|
"aliases": [],
|
|
6757
6757
|
"explains": [
|
|
6758
6758
|
"DUTY_MODE_RETIRED",
|
|
@@ -6804,7 +6804,7 @@
|
|
|
6804
6804
|
"id": "always-on",
|
|
6805
6805
|
"title": "Turn it on: activation and Always-On",
|
|
6806
6806
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6807
|
-
"tokens":
|
|
6807
|
+
"tokens": 506,
|
|
6808
6808
|
"aliases": [],
|
|
6809
6809
|
"explains": [
|
|
6810
6810
|
"DUTY_ACTIVATION_BLOCKED",
|
|
@@ -6870,7 +6870,7 @@
|
|
|
6870
6870
|
"id": "authoring",
|
|
6871
6871
|
"title": "Write a Duty: sources, keys, cadence and budgets",
|
|
6872
6872
|
"readWhen": "you draft or change a Duty's contract: what it watches, how often, where its work goes, what it may spend",
|
|
6873
|
-
"tokens":
|
|
6873
|
+
"tokens": 1176,
|
|
6874
6874
|
"aliases": [],
|
|
6875
6875
|
"explains": [
|
|
6876
6876
|
"DUTY_MODE_RETIRED",
|
|
@@ -6922,7 +6922,7 @@
|
|
|
6922
6922
|
"id": "always-on",
|
|
6923
6923
|
"title": "Turn it on: activation and Always-On",
|
|
6924
6924
|
"readWhen": "a Duty must start waking on its own, or has stopped waking",
|
|
6925
|
-
"tokens":
|
|
6925
|
+
"tokens": 506,
|
|
6926
6926
|
"aliases": [],
|
|
6927
6927
|
"explains": [
|
|
6928
6928
|
"DUTY_ACTIVATION_BLOCKED",
|
package/dist/lib/duties.d.ts
CHANGED
|
@@ -1083,6 +1083,11 @@ latestCheck?: {
|
|
|
1083
1083
|
} | null;
|
|
1084
1084
|
decision?: {
|
|
1085
1085
|
policyTrace?: Array<Record<string, unknown>>;
|
|
1086
|
+
summary?: string;
|
|
1087
|
+
whyNow?: string;
|
|
1088
|
+
userVisibleReason?: string;
|
|
1089
|
+
summaryClarification?: string;
|
|
1090
|
+
summaryClarificationFor?: string;
|
|
1086
1091
|
} | null;
|
|
1087
1092
|
} | null,
|
|
1088
1093
|
/**
|
package/dist/lib/duties.js
CHANGED
|
@@ -1187,7 +1187,7 @@ function describeStoppedMachine(wake) {
|
|
|
1187
1187
|
* any other reason is printed as the code, as before.
|
|
1188
1188
|
*/
|
|
1189
1189
|
const OPERATION_REASON_WORDS = {
|
|
1190
|
-
runtime_duty_contract_unavailable: '
|
|
1190
|
+
runtime_duty_contract_unavailable: 'the selected runtime cannot enforce this Duty; repository work needs a Hosted Machine or a capable local harness',
|
|
1191
1191
|
};
|
|
1192
1192
|
function operationReasonWords(reason) {
|
|
1193
1193
|
return typeof reason === 'string' ? OPERATION_REASON_WORDS[reason] : undefined;
|
|
@@ -1457,6 +1457,10 @@ scheduleIssues) {
|
|
|
1457
1457
|
if (duty.target?.deadlineAt)
|
|
1458
1458
|
log(`Deadline: ${duty.target.deadlineAt}`);
|
|
1459
1459
|
log(`Cadence: ${cadenceLabel(duty)}`);
|
|
1460
|
+
if (duty.cadence?.mode === 'manual' && duty.savedCadence) {
|
|
1461
|
+
log(`Saved schedule (inactive): ${JSON.stringify(duty.savedCadence)}`);
|
|
1462
|
+
log(' To restore it explicitly: `skrr duties update <id> --restore-saved-cadence`');
|
|
1463
|
+
}
|
|
1460
1464
|
// `event+1d` abbreviates a guarantee: events make a check come sooner, they are not a delivery
|
|
1461
1465
|
// receipt. Say what the interval does and does not recover (OSK-21747).
|
|
1462
1466
|
if (duty.cadence?.mode === 'event_plus_interval') {
|
|
@@ -1477,9 +1481,7 @@ scheduleIssues) {
|
|
|
1477
1481
|
const criteria = duty.target?.successCriteria || [];
|
|
1478
1482
|
const evidenceHealth = latestCheck?.inputs?.evidenceHealth;
|
|
1479
1483
|
const evidenceLine = describeEvidenceHealth(evidenceHealth, criteria.length);
|
|
1480
|
-
const assessment = duty.assessment
|
|
1481
|
-
? (0, data_provider_2.readDutyAssessment)(duty.assessment)
|
|
1482
|
-
: undefined;
|
|
1484
|
+
const assessment = duty.assessment ? (0, data_provider_2.readDutyAssessment)(duty.assessment) : undefined;
|
|
1483
1485
|
log(`Assessment: ${assessment?.label ?? 'Unknown'}`);
|
|
1484
1486
|
log(`Evidence: ${describeAssessmentEvidence(assessment?.evidence)}`);
|
|
1485
1487
|
log(`Operation: ${describeOperation(assessment?.operation, assessment?.operationReason)}`);
|
|
@@ -1549,6 +1551,14 @@ scheduleIssues) {
|
|
|
1549
1551
|
if (duty.state?.summary) {
|
|
1550
1552
|
log('');
|
|
1551
1553
|
log(duty.state.summary);
|
|
1554
|
+
const decision = latestCheck?.decision;
|
|
1555
|
+
if (decision?.summaryClarification && duty.state.summary === decision.summaryClarificationFor) {
|
|
1556
|
+
log(decision.summaryClarification);
|
|
1557
|
+
}
|
|
1558
|
+
else if (duty.state.summary ===
|
|
1559
|
+
'Its last run already covered this evidence, so no new run was started.') {
|
|
1560
|
+
log('This statement alone does not prove that the evidence was observed or the work succeeded.');
|
|
1561
|
+
}
|
|
1552
1562
|
}
|
|
1553
1563
|
}
|
|
1554
1564
|
/**
|
|
@@ -1668,6 +1678,12 @@ function renderCheckList(checks, log) {
|
|
|
1668
1678
|
];
|
|
1669
1679
|
if (reasons.length > 0)
|
|
1670
1680
|
log(`'-' = not retained. ${reasons.join(' ')}`);
|
|
1681
|
+
for (const check of checks) {
|
|
1682
|
+
if (check.decision?.summaryClarification &&
|
|
1683
|
+
(check.decision.whyNow ?? check.decision.summary) === check.decision.summaryClarificationFor) {
|
|
1684
|
+
log(`Check ${check.id ?? '-'}: ${check.decision.summaryClarification}`);
|
|
1685
|
+
}
|
|
1686
|
+
}
|
|
1671
1687
|
}
|
|
1672
1688
|
function records(value) {
|
|
1673
1689
|
return Array.isArray(value)
|
|
@@ -1695,6 +1711,30 @@ function firstValue(row, keys) {
|
|
|
1695
1711
|
function count(value) {
|
|
1696
1712
|
return String(records(value).length);
|
|
1697
1713
|
}
|
|
1714
|
+
function dutyResultBlocker(outcome) {
|
|
1715
|
+
const blocker = record(record(record(outcome)?.dutyResult)?.blocker);
|
|
1716
|
+
if (!blocker)
|
|
1717
|
+
return '';
|
|
1718
|
+
for (const value of [blocker.summary, blocker.code]) {
|
|
1719
|
+
if (typeof value === 'string' && value.trim())
|
|
1720
|
+
return value.trim();
|
|
1721
|
+
}
|
|
1722
|
+
return '';
|
|
1723
|
+
}
|
|
1724
|
+
function dutyDeliveryBlock(outcome) {
|
|
1725
|
+
const delivery = record(record(record(outcome)?.dutyResult)?.delivery);
|
|
1726
|
+
if (delivery?.status !== 'blocked')
|
|
1727
|
+
return null;
|
|
1728
|
+
return typeof delivery.reason === 'string' ? delivery.reason.trim() : '';
|
|
1729
|
+
}
|
|
1730
|
+
function renderDutyResultContext(outcome, runId, log) {
|
|
1731
|
+
const delivery = dutyDeliveryBlock(outcome);
|
|
1732
|
+
if (delivery !== null)
|
|
1733
|
+
log(`Delivery blocked (${text(runId)})${delivery ? `: ${delivery}` : ''}`);
|
|
1734
|
+
const blocker = dutyResultBlocker(outcome);
|
|
1735
|
+
if (blocker)
|
|
1736
|
+
log(`Reported blocker (${text(runId)}): ${blocker}`);
|
|
1737
|
+
}
|
|
1698
1738
|
function renderRows(rows,
|
|
1699
1739
|
// Derived from `renderTable`, not restated. A second declaration is how a
|
|
1700
1740
|
// column option (`verbatim`) exists on one surface and silently not on the
|
|
@@ -1752,6 +1792,16 @@ function renderDutyLedger(ledger, log) {
|
|
|
1752
1792
|
{ key: 'actions', header: 'ACTIONS' },
|
|
1753
1793
|
{ key: 'why', header: 'WHY', maxWidth: 48 },
|
|
1754
1794
|
], 'No checks recorded.', log);
|
|
1795
|
+
// The WHY cell is the stored sentence, cut to fit. For a deduplicated follow-through that
|
|
1796
|
+
// sentence ("Its last run already covered this evidence") reads as proof the work was seen,
|
|
1797
|
+
// so the clarification the server sends with it is printed beneath the table, as the trace
|
|
1798
|
+
// does (OSK-23051).
|
|
1799
|
+
for (const item of checks) {
|
|
1800
|
+
const clarification = record(item.decision)?.summaryClarification;
|
|
1801
|
+
if (typeof clarification === 'string' && clarification) {
|
|
1802
|
+
log(`Check ${text(item.id)}: ${clarification}`);
|
|
1803
|
+
}
|
|
1804
|
+
}
|
|
1755
1805
|
}
|
|
1756
1806
|
if (runs.length) {
|
|
1757
1807
|
log('Runs:');
|
|
@@ -1772,6 +1822,9 @@ function renderDutyLedger(ledger, log) {
|
|
|
1772
1822
|
{ key: 'reason', header: 'REASON', maxWidth: 36 },
|
|
1773
1823
|
{ key: 'finished', header: 'LAST UPDATED', maxWidth: 24 },
|
|
1774
1824
|
], 'No runs recorded.', log);
|
|
1825
|
+
for (const run of runs) {
|
|
1826
|
+
renderDutyResultContext(run.outcome, run.id, log);
|
|
1827
|
+
}
|
|
1775
1828
|
}
|
|
1776
1829
|
const wakeState = record(ledger.wakeState);
|
|
1777
1830
|
if (wakeState) {
|
|
@@ -1816,6 +1869,21 @@ function stopCell(item) {
|
|
|
1816
1869
|
why = gate;
|
|
1817
1870
|
return why ? `${question}: ${why}` : question;
|
|
1818
1871
|
}
|
|
1872
|
+
/**
|
|
1873
|
+
* Why a run that has not started is waiting (`DutyRunWait`, derived by the server): the sentence, and
|
|
1874
|
+
* for a hold the exact command that releases it. A `waiting_runtime` row says neither (OSK-23175).
|
|
1875
|
+
*/
|
|
1876
|
+
function renderRunWait(waiting, runId, log) {
|
|
1877
|
+
if (!waiting)
|
|
1878
|
+
return;
|
|
1879
|
+
const detail = text(waiting.detail, '');
|
|
1880
|
+
if (!detail)
|
|
1881
|
+
return;
|
|
1882
|
+
log(`Run ${text(runId)} is waiting: ${detail}`);
|
|
1883
|
+
const fix = text(waiting.fix, '');
|
|
1884
|
+
if (fix)
|
|
1885
|
+
log(` Fix: ${fix}`);
|
|
1886
|
+
}
|
|
1819
1887
|
function renderDutyTrace(trace, log) {
|
|
1820
1888
|
const events = records(trace.events);
|
|
1821
1889
|
renderRows(events.map((item) => ({
|
|
@@ -1831,6 +1899,19 @@ function renderDutyTrace(trace, log) {
|
|
|
1831
1899
|
{ key: 'stop', header: 'STOPPED AT', maxWidth: 48 },
|
|
1832
1900
|
{ key: 'summary', header: 'SUMMARY', maxWidth: 72 },
|
|
1833
1901
|
], 'No trace events recorded.', log);
|
|
1902
|
+
for (const event of events) {
|
|
1903
|
+
// Beta: a clarification of the summary prints for ANY trace event, so it comes before the
|
|
1904
|
+
// run-only part. Main: only an autonomous run has a result context and a wait to render.
|
|
1905
|
+
const clarification = record(event.detail)?.summaryClarification;
|
|
1906
|
+
if (typeof clarification === 'string' && clarification) {
|
|
1907
|
+
log(`Check ${text(record(event.references)?.dutyCheckId)}: ${clarification}`);
|
|
1908
|
+
}
|
|
1909
|
+
if (event.type !== 'autonomous_run')
|
|
1910
|
+
continue;
|
|
1911
|
+
const runId = record(event.references)?.autonomousRunId;
|
|
1912
|
+
renderDutyResultContext(record(event.detail)?.outcome, runId, log);
|
|
1913
|
+
renderRunWait(record(record(event.detail)?.waiting), runId, log);
|
|
1914
|
+
}
|
|
1834
1915
|
const scorecard = record(trace.proactiveness);
|
|
1835
1916
|
if (scorecard)
|
|
1836
1917
|
renderProactivenessScorecard(scorecard, log);
|
|
@@ -1975,8 +2056,18 @@ function cycleSummary(cycle) {
|
|
|
1975
2056
|
: 'applied an agent result';
|
|
1976
2057
|
}
|
|
1977
2058
|
if (cycle.outcome === 'in_flight') {
|
|
1978
|
-
const runs = cycle.runs
|
|
1979
|
-
|
|
2059
|
+
const runs = cycle.runs ?? [];
|
|
2060
|
+
if (!runs.length)
|
|
2061
|
+
return 'check still running';
|
|
2062
|
+
// A run parked for a runtime is not "still going" (OSK-23379): it has not started, and the server
|
|
2063
|
+
// says why (`waiting`), so the row says parked and names the reason once.
|
|
2064
|
+
const parked = runs.filter((run) => run.waiting);
|
|
2065
|
+
if (!parked.length)
|
|
2066
|
+
return `${runs.length} run(s) still going`;
|
|
2067
|
+
const why = [...new Set(parked.map((run) => run.waiting?.summary))].join('; ');
|
|
2068
|
+
return parked.length === runs.length
|
|
2069
|
+
? `${parked.length} run(s) parked — ${why}`
|
|
2070
|
+
: `${runs.length - parked.length} running, ${parked.length} parked — ${why}`;
|
|
1980
2071
|
}
|
|
1981
2072
|
return cycle.note || cycle.decision?.summary || cycle.decision?.posture || 'nothing to act on';
|
|
1982
2073
|
}
|
|
@@ -2029,6 +2120,11 @@ function formatDutyCycles(page) {
|
|
|
2029
2120
|
: CYCLE_GLYPH[cycle.outcome] || '?';
|
|
2030
2121
|
const word = echo ? 'recorded' : owed ? 'owed' : String(cycle.outcome);
|
|
2031
2122
|
lines.push(`${cycleTime(cycle.startedAt)} ${glyph} ${word.padEnd(9)} ${cycleWake(cycle).padEnd(18)} ${echo ? recordOnlyEchoSummary(cycle) : cycleSummary(cycle)}`);
|
|
2123
|
+
if (!echo &&
|
|
2124
|
+
cycle.decision?.summaryClarification &&
|
|
2125
|
+
cycleSummary(cycle) === cycle.decision.summary) {
|
|
2126
|
+
lines.push(` ${cycle.decision.summaryClarification}`);
|
|
2127
|
+
}
|
|
2032
2128
|
lines.push(...platformFetchLines(cycle));
|
|
2033
2129
|
lines.push(...formatCycleLatency(cycle));
|
|
2034
2130
|
for (const task of cycle.tasks || []) {
|
|
@@ -12,7 +12,7 @@ function eventWakeLines(caps) {
|
|
|
12
12
|
lines.push('Event wakes:');
|
|
13
13
|
lines.push(` requested: ${caps.requested ? 'yes' : 'no'}`);
|
|
14
14
|
lines.push(` configured sources: ${(caps.configuredSources ?? []).join(', ') || 'none'}`);
|
|
15
|
-
lines.push(` eligible
|
|
15
|
+
lines.push(` eligible in current plan: ${(caps.eligibleSources ?? []).join(', ') || 'none'}`);
|
|
16
16
|
lines.push(` materialized sources: ${(caps.materializedSources ?? []).join(', ') || 'none'}`);
|
|
17
17
|
const wakeableWhenActive = caps.wakeableWhenActive ?? [];
|
|
18
18
|
const eventless = caps.eventlessSources ?? [];
|
|
@@ -20,10 +20,13 @@ function eventWakeLines(caps) {
|
|
|
20
20
|
// The server told the causes apart (OSK-22595): a source that would wake once it is active on an
|
|
21
21
|
// event_plus_interval cadence is not the same as one that produces no events.
|
|
22
22
|
if (wakeableWhenActive.length) {
|
|
23
|
-
lines.push(`
|
|
23
|
+
lines.push(` bindings possible when active on event_plus_interval: ${wakeableWhenActive.join(', ')} (preflight checks readiness; this does not prove event delivery)`);
|
|
24
24
|
}
|
|
25
25
|
if (eventless.length) {
|
|
26
|
-
lines.push(` no
|
|
26
|
+
lines.push(` no event bindings for the current source configuration: ${eventless.join(', ')}` +
|
|
27
|
+
(caps.requested === false
|
|
28
|
+
? ' (not needed for the current cadence; check scope and `skrr triggers event-catalog` if you want event wakes)'
|
|
29
|
+
: ' (check its scope and `skrr triggers event-catalog`)'));
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
else if ((caps.dormantSources ?? []).length) {
|
|
@@ -171,9 +171,15 @@ function formatLoopSummary(status) {
|
|
|
171
171
|
: row.completeness === 'partial'
|
|
172
172
|
? 'PARTIAL read'
|
|
173
173
|
: 'needs attention';
|
|
174
|
-
|
|
174
|
+
const reason = row.source === 'tasks' && row.reason === 'no_linked_work'
|
|
175
|
+
? 'no linked tasks were visible at the last check'
|
|
176
|
+
: row.reason;
|
|
177
|
+
return `${row.source} ${access}${reason ? ` (${reason})` : ''}`;
|
|
175
178
|
});
|
|
176
179
|
lines.push(`sources: ${!watching.length ? 'none declared' : trouble.length ? trouble.join('; ') : 'all readable'}`);
|
|
180
|
+
for (const wait of waitingRuns(status)) {
|
|
181
|
+
lines.push(`waiting: ${runCount(wait.count)}: ${wait.summary}${wait.fix ? ` — ${wait.fix}` : ''}`);
|
|
182
|
+
}
|
|
177
183
|
lines.push(`today: ${runs(status)} runs · spend ${spend(status)}`);
|
|
178
184
|
if (status.readErrors?.length) {
|
|
179
185
|
lines.push(`unread: ${status.readErrors.join(', ')} could not be read; treat the above as unknown`);
|
|
@@ -211,6 +217,9 @@ function formatDutyLoopStatus(status) {
|
|
|
211
217
|
if (!watching.length)
|
|
212
218
|
lines.push(' nothing declared');
|
|
213
219
|
for (const row of watching) {
|
|
220
|
+
const reason = row.source === 'tasks' && row.reason === 'no_linked_work'
|
|
221
|
+
? 'no linked tasks were visible at the last check'
|
|
222
|
+
: row.reason;
|
|
214
223
|
const access = row.access === 'readable'
|
|
215
224
|
? row.completeness === 'partial'
|
|
216
225
|
? 'readable, PARTIAL read'
|
|
@@ -218,7 +227,7 @@ function formatDutyLoopStatus(status) {
|
|
|
218
227
|
: row.access === 'blocked'
|
|
219
228
|
? 'CANNOT READ'
|
|
220
229
|
: 'not known';
|
|
221
|
-
lines.push(` ${row.source}${row.scope ? ` (${row.scope})` : ''}: ${access}${
|
|
230
|
+
lines.push(` ${row.source}${row.scope ? ` (${row.scope})` : ''}: ${access}${reason ? ` — ${reason}` : ''}`);
|
|
222
231
|
// Optional contract field; read defensively across package builds.
|
|
223
232
|
const limitations = row.limitations;
|
|
224
233
|
if (Array.isArray(limitations) && limitations.length) {
|
|
@@ -236,6 +245,21 @@ function formatDutyLoopStatus(status) {
|
|
|
236
245
|
}
|
|
237
246
|
}
|
|
238
247
|
lines.push(` Open loops: ${count(status.pendingWork?.openLoops)} Pending runs: ${count(status.pendingWork?.pendingRuns)}`);
|
|
248
|
+
// Why the pending runs that have not started are waiting (OSK-23175): a count alone read as healthy.
|
|
249
|
+
for (const wait of waitingRuns(status)) {
|
|
250
|
+
lines.push(` Waiting: ${runCount(wait.count)}: ${wait.summary}`);
|
|
251
|
+
lines.push(` ${wait.detail}`);
|
|
252
|
+
if (wait.fix)
|
|
253
|
+
lines.push(` Fix: ${wait.fix}`);
|
|
254
|
+
}
|
|
239
255
|
lines.push(` Runs today: ${runs(status)} Spend today: ${spend(status)}`);
|
|
240
256
|
return lines;
|
|
241
257
|
}
|
|
258
|
+
/** The server's grouped reasons for runs that have not started. Empty from a server that sends none. */
|
|
259
|
+
function waitingRuns(status) {
|
|
260
|
+
const waiting = status.pendingWork?.waiting;
|
|
261
|
+
return Array.isArray(waiting) ? waiting : [];
|
|
262
|
+
}
|
|
263
|
+
function runCount(n) {
|
|
264
|
+
return `${n} run${n === 1 ? '' : 's'}`;
|
|
265
|
+
}
|