@skrr-ai/cli 0.1.22 → 0.1.24

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.
Files changed (281) hide show
  1. package/README.md +83 -73
  2. package/bin/dev-fallback.js +221 -0
  3. package/bin/run.js +96 -0
  4. package/dist/base-command.d.ts +15 -0
  5. package/dist/base-command.js +145 -11
  6. package/dist/commands/agents/attach-harness.d.ts +37 -0
  7. package/dist/commands/agents/attach-harness.js +102 -3
  8. package/dist/commands/agents/chat.d.ts +69 -1
  9. package/dist/commands/agents/chat.js +202 -22
  10. package/dist/commands/agents/create.d.ts +38 -0
  11. package/dist/commands/agents/create.js +95 -2
  12. package/dist/commands/agents/schedule-trace.js +11 -0
  13. package/dist/commands/agents/show.js +29 -1
  14. package/dist/commands/api-keys/create.d.ts +24 -0
  15. package/dist/commands/api-keys/create.js +80 -0
  16. package/dist/commands/api-keys/list.d.ts +11 -0
  17. package/dist/commands/api-keys/list.js +42 -0
  18. package/dist/commands/api-keys/revoke.d.ts +14 -0
  19. package/dist/commands/api-keys/revoke.js +33 -0
  20. package/dist/commands/api-keys/rotate.d.ts +19 -0
  21. package/dist/commands/api-keys/rotate.js +42 -0
  22. package/dist/commands/balance/index.d.ts +18 -0
  23. package/dist/commands/balance/index.js +29 -0
  24. package/dist/commands/balance/show.d.ts +25 -0
  25. package/dist/commands/balance/show.js +60 -0
  26. package/dist/commands/balance/statement.d.ts +19 -0
  27. package/dist/commands/balance/statement.js +52 -0
  28. package/dist/commands/browser/doctor.d.ts +11 -0
  29. package/dist/commands/browser/doctor.js +11 -0
  30. package/dist/commands/code/jobs/approve.d.ts +25 -0
  31. package/dist/commands/code/jobs/approve.js +52 -0
  32. package/dist/commands/code/jobs/cancel.d.ts +12 -0
  33. package/dist/commands/code/jobs/cancel.js +39 -0
  34. package/dist/commands/code/jobs/index.d.ts +19 -0
  35. package/dist/commands/code/jobs/index.js +38 -0
  36. package/dist/commands/code/jobs/list.d.ts +12 -0
  37. package/dist/commands/code/jobs/list.js +87 -0
  38. package/dist/commands/code/jobs/run.d.ts +32 -0
  39. package/dist/commands/code/jobs/run.js +151 -0
  40. package/dist/commands/code/jobs/show.d.ts +12 -0
  41. package/dist/commands/code/jobs/show.js +86 -0
  42. package/dist/commands/commitments/preflight.js +18 -4
  43. package/dist/commands/commitments/receipt-metrics.d.ts +39 -0
  44. package/dist/commands/commitments/receipt-metrics.js +78 -0
  45. package/dist/commands/convos/search.js +5 -5
  46. package/dist/commands/harnesses/leases/list.d.ts +3 -0
  47. package/dist/commands/harnesses/leases/list.js +59 -12
  48. package/dist/commands/harnesses/leases/show.js +36 -0
  49. package/dist/commands/harnesses/list.d.ts +18 -0
  50. package/dist/commands/harnesses/list.js +30 -0
  51. package/dist/commands/harnesses/products.js +49 -3
  52. package/dist/commands/harnesses/quota.d.ts +16 -0
  53. package/dist/commands/harnesses/quota.js +26 -1
  54. package/dist/commands/harnesses/usage.js +17 -0
  55. package/dist/commands/inbox/index.d.ts +2 -1
  56. package/dist/commands/inbox/index.js +27 -4
  57. package/dist/commands/login.js +4 -1
  58. package/dist/commands/machines/dedicated/create.d.ts +18 -0
  59. package/dist/commands/machines/dedicated/create.js +90 -0
  60. package/dist/commands/machines/dedicated/destroy.d.ts +14 -0
  61. package/dist/commands/machines/dedicated/destroy.js +56 -0
  62. package/dist/commands/machines/dedicated/grow.d.ts +13 -0
  63. package/dist/commands/machines/dedicated/grow.js +46 -0
  64. package/dist/commands/machines/dedicated/health-check.d.ts +12 -0
  65. package/dist/commands/machines/dedicated/health-check.js +42 -0
  66. package/dist/commands/machines/dedicated/incident-close.d.ts +12 -0
  67. package/dist/commands/machines/dedicated/incident-close.js +42 -0
  68. package/dist/commands/machines/dedicated/index.d.ts +6 -0
  69. package/dist/commands/machines/dedicated/index.js +39 -0
  70. package/dist/commands/machines/dedicated/list.d.ts +11 -0
  71. package/dist/commands/machines/dedicated/list.js +58 -0
  72. package/dist/commands/machines/dedicated/restart.d.ts +12 -0
  73. package/dist/commands/machines/dedicated/restart.js +42 -0
  74. package/dist/commands/machines/dedicated/show.d.ts +12 -0
  75. package/dist/commands/machines/dedicated/show.js +58 -0
  76. package/dist/commands/machines/dedicated/snapshot.d.ts +12 -0
  77. package/dist/commands/machines/dedicated/snapshot.js +42 -0
  78. package/dist/commands/machines/dedicated/start.d.ts +12 -0
  79. package/dist/commands/machines/dedicated/start.js +42 -0
  80. package/dist/commands/machines/dedicated/stop.d.ts +12 -0
  81. package/dist/commands/machines/dedicated/stop.js +42 -0
  82. package/dist/commands/machines/hosted/index.js +4 -1
  83. package/dist/commands/machines/list.d.ts +1 -0
  84. package/dist/commands/machines/list.js +33 -5
  85. package/dist/commands/memory/approvals/issue.d.ts +18 -0
  86. package/dist/commands/memory/approvals/issue.js +63 -0
  87. package/dist/commands/memory/commit.js +5 -2
  88. package/dist/commands/memory/context.d.ts +3 -2
  89. package/dist/commands/memory/context.js +9 -11
  90. package/dist/commands/memory/delete.d.ts +1 -1
  91. package/dist/commands/memory/list.d.ts +1 -1
  92. package/dist/commands/memory/list.js +1 -1
  93. package/dist/commands/memory/mounts/resolve.d.ts +10 -0
  94. package/dist/commands/memory/mounts/resolve.js +27 -0
  95. package/dist/commands/memory/proposals/commit.d.ts +18 -0
  96. package/dist/commands/memory/proposals/commit.js +32 -0
  97. package/dist/commands/memory/proposals/create.d.ts +18 -0
  98. package/dist/commands/memory/proposals/create.js +56 -0
  99. package/dist/commands/memory/proposals/list.d.ts +13 -0
  100. package/dist/commands/memory/proposals/list.js +31 -0
  101. package/dist/commands/memory/proposals/promote.d.ts +22 -0
  102. package/dist/commands/memory/proposals/promote.js +33 -0
  103. package/dist/commands/memory/proposals/reject.d.ts +16 -0
  104. package/dist/commands/memory/proposals/reject.js +28 -0
  105. package/dist/commands/memory/rebuild-index.d.ts +20 -0
  106. package/dist/commands/memory/rebuild-index.js +25 -0
  107. package/dist/commands/memory/save.d.ts +1 -1
  108. package/dist/commands/memory/save.js +1 -1
  109. package/dist/commands/memory/search.d.ts +6 -3
  110. package/dist/commands/memory/search.js +27 -3
  111. package/dist/commands/memory/show.d.ts +1 -1
  112. package/dist/commands/memory/stores/archive.d.ts +14 -0
  113. package/dist/commands/memory/stores/archive.js +31 -0
  114. package/dist/commands/memory/stores/create.d.ts +12 -0
  115. package/dist/commands/memory/stores/create.js +30 -0
  116. package/dist/commands/memory/stores/delete.d.ts +15 -0
  117. package/dist/commands/memory/stores/delete.js +38 -0
  118. package/dist/commands/memory/stores/list.d.ts +10 -0
  119. package/dist/commands/memory/stores/list.js +29 -0
  120. package/dist/commands/memory/stores/show.d.ts +12 -0
  121. package/dist/commands/memory/stores/show.js +14 -0
  122. package/dist/commands/memory/stores/update.d.ts +15 -0
  123. package/dist/commands/memory/stores/update.js +39 -0
  124. package/dist/commands/memory/sync/delete.d.ts +13 -0
  125. package/dist/commands/memory/sync/delete.js +35 -0
  126. package/dist/commands/memory/sync/pull.d.ts +19 -0
  127. package/dist/commands/memory/sync/pull.js +52 -0
  128. package/dist/commands/memory/sync/push.d.ts +18 -0
  129. package/dist/commands/memory/sync/push.js +115 -0
  130. package/dist/commands/memory/sync/resolve.d.ts +23 -0
  131. package/dist/commands/memory/sync/resolve.js +27 -0
  132. package/dist/commands/memory/sync/status.d.ts +9 -0
  133. package/dist/commands/memory/sync/status.js +22 -0
  134. package/dist/commands/memory/topics/archive.d.ts +20 -0
  135. package/dist/commands/memory/topics/archive.js +29 -0
  136. package/dist/commands/memory/topics/create.d.ts +23 -0
  137. package/dist/commands/memory/topics/create.js +46 -0
  138. package/dist/commands/memory/topics/delete.d.ts +22 -0
  139. package/dist/commands/memory/topics/delete.js +30 -0
  140. package/dist/commands/memory/topics/forget.d.ts +22 -0
  141. package/dist/commands/memory/topics/forget.js +29 -0
  142. package/dist/commands/memory/topics/list.d.ts +13 -0
  143. package/dist/commands/memory/topics/list.js +22 -0
  144. package/dist/commands/memory/topics/move.d.ts +22 -0
  145. package/dist/commands/memory/topics/move.js +26 -0
  146. package/dist/commands/memory/topics/show.d.ts +17 -0
  147. package/dist/commands/memory/topics/show.js +21 -0
  148. package/dist/commands/memory/topics/update.d.ts +23 -0
  149. package/dist/commands/memory/topics/update.js +27 -0
  150. package/dist/commands/memory/tree.d.ts +5 -2
  151. package/dist/commands/memory/tree.js +20 -2
  152. package/dist/commands/memory/update.d.ts +1 -1
  153. package/dist/commands/memory/versions/list.d.ts +16 -0
  154. package/dist/commands/memory/versions/list.js +22 -0
  155. package/dist/commands/memory/versions/redact.d.ts +21 -0
  156. package/dist/commands/memory/versions/redact.js +22 -0
  157. package/dist/commands/memory/versions/restore.d.ts +20 -0
  158. package/dist/commands/memory/versions/restore.js +16 -0
  159. package/dist/commands/memory/versions/show.d.ts +15 -0
  160. package/dist/commands/memory/versions/show.js +17 -0
  161. package/dist/commands/messages/list.js +25 -8
  162. package/dist/commands/messages/show.js +10 -0
  163. package/dist/commands/spaces/update.js +16 -12
  164. package/dist/commands/spaces/work-sync/reconcile.d.ts +38 -0
  165. package/dist/commands/spaces/work-sync/reconcile.js +90 -0
  166. package/dist/commands/spaces/work-sync/telemetry.d.ts +29 -0
  167. package/dist/commands/spaces/work-sync/telemetry.js +96 -0
  168. package/dist/commands/store/install.js +5 -1
  169. package/dist/commands/store/releases.js +1 -1
  170. package/dist/commands/store/update.js +5 -1
  171. package/dist/commands/subscriptions/cancel.js +5 -1
  172. package/dist/commands/subscriptions/health.js +5 -1
  173. package/dist/commands/subscriptions/status.js +5 -1
  174. package/dist/commands/subscriptions/subscribe.js +5 -1
  175. package/dist/commands/tasks/activity.d.ts +2 -3
  176. package/dist/commands/tasks/activity.js +20 -6
  177. package/dist/commands/tasks/complete.d.ts +22 -150
  178. package/dist/commands/tasks/complete.js +174 -599
  179. package/dist/commands/tasks/create.d.ts +6 -0
  180. package/dist/commands/tasks/create.js +114 -4
  181. package/dist/commands/tasks/deliverable/add.d.ts +8 -0
  182. package/dist/commands/tasks/deliverable/add.js +62 -11
  183. package/dist/commands/tasks/deliverable/confirm.d.ts +5 -5
  184. package/dist/commands/tasks/deliverable/confirm.js +9 -18
  185. package/dist/commands/tasks/deliverable/list.d.ts +12 -0
  186. package/dist/commands/tasks/deliverable/list.js +58 -0
  187. package/dist/commands/tasks/events/append.d.ts +2 -0
  188. package/dist/commands/tasks/events/append.js +41 -6
  189. package/dist/commands/tasks/events/list.d.ts +1 -0
  190. package/dist/commands/tasks/events/list.js +1 -0
  191. package/dist/commands/tasks/events/tail.d.ts +1 -0
  192. package/dist/commands/tasks/events/tail.js +1 -0
  193. package/dist/commands/tasks/expectations/assess.d.ts +21 -0
  194. package/dist/commands/tasks/expectations/assess.js +103 -0
  195. package/dist/commands/tasks/expectations.js +121 -25
  196. package/dist/commands/tasks/judge.d.ts +1 -0
  197. package/dist/commands/tasks/judge.js +2 -1
  198. package/dist/commands/tasks/output.d.ts +1 -11
  199. package/dist/commands/tasks/output.js +80 -141
  200. package/dist/commands/tasks/report.d.ts +3 -3
  201. package/dist/commands/tasks/report.js +66 -41
  202. package/dist/commands/tasks/resource/add.d.ts +23 -0
  203. package/dist/commands/tasks/resource/add.js +76 -0
  204. package/dist/commands/tasks/resource/list.d.ts +13 -0
  205. package/dist/commands/tasks/resource/list.js +41 -0
  206. package/dist/commands/tasks/result/show.d.ts +13 -0
  207. package/dist/commands/tasks/result/show.js +64 -0
  208. package/dist/commands/tasks/result/submit.d.ts +26 -0
  209. package/dist/commands/tasks/result/submit.js +134 -0
  210. package/dist/commands/tasks/resume/save.d.ts +16 -0
  211. package/dist/commands/tasks/resume/save.js +69 -0
  212. package/dist/commands/tasks/resume/show.d.ts +13 -0
  213. package/dist/commands/tasks/resume/show.js +35 -0
  214. package/dist/commands/tasks/review.d.ts +17 -0
  215. package/dist/commands/tasks/review.js +54 -0
  216. package/dist/commands/tasks/runs.js +5 -0
  217. package/dist/commands/tasks/self-schedule.js +7 -4
  218. package/dist/commands/tasks/show.js +19 -0
  219. package/dist/commands/tasks/timeline.d.ts +2 -2
  220. package/dist/commands/tasks/timeline.js +19 -24
  221. package/dist/commands/tasks/updates/add.d.ts +22 -0
  222. package/dist/commands/tasks/updates/add.js +122 -0
  223. package/dist/commands/tasks/updates/list.d.ts +15 -0
  224. package/dist/commands/tasks/updates/list.js +57 -0
  225. package/dist/commands/tasks/waive.d.ts +1 -0
  226. package/dist/commands/tasks/waive.js +2 -1
  227. package/dist/lib/agentic-stream.d.ts +257 -0
  228. package/dist/lib/agentic-stream.js +490 -33
  229. package/dist/lib/balance.d.ts +8 -0
  230. package/dist/lib/commitment-product.d.ts +10 -1
  231. package/dist/lib/commitment-product.js +66 -2
  232. package/dist/lib/commitments.d.ts +2 -1
  233. package/dist/lib/commitments.js +1 -0
  234. package/dist/lib/conversation-search.d.ts +3 -0
  235. package/dist/lib/conversation-search.js +75 -0
  236. package/dist/lib/dedicated-machines.d.ts +66 -0
  237. package/dist/lib/dedicated-machines.js +161 -0
  238. package/dist/lib/execution-target.d.ts +21 -0
  239. package/dist/lib/execution-target.js +22 -6
  240. package/dist/lib/harnesses.d.ts +87 -6
  241. package/dist/lib/harnesses.js +32 -1
  242. package/dist/lib/hosted-machines.js +9 -0
  243. package/dist/lib/inbox.d.ts +2 -1
  244. package/dist/lib/machines.d.ts +17 -0
  245. package/dist/lib/machines.js +29 -0
  246. package/dist/lib/managed-agent-keys.d.ts +104 -0
  247. package/dist/lib/managed-agent-keys.js +50 -0
  248. package/dist/lib/memory-scope.d.ts +4 -3
  249. package/dist/lib/memory-scope.js +9 -9
  250. package/dist/lib/memory-sync.d.ts +114 -0
  251. package/dist/lib/memory-sync.js +730 -0
  252. package/dist/lib/message-provenance.d.ts +42 -0
  253. package/dist/lib/message-provenance.js +89 -0
  254. package/dist/lib/scoped-memory-command.d.ts +68 -0
  255. package/dist/lib/scoped-memory-command.js +183 -0
  256. package/dist/lib/session-task-endpoints.d.ts +1 -1
  257. package/dist/lib/session-task-endpoints.js +7 -0
  258. package/dist/lib/sky-code-broker.d.ts +47 -0
  259. package/dist/lib/sky-code-broker.js +50 -0
  260. package/dist/lib/sky-code-doctor.js +10 -1
  261. package/dist/lib/task-artifact-flags.d.ts +2 -0
  262. package/dist/lib/task-artifact-flags.js +7 -0
  263. package/dist/lib/task-execution.d.ts +4 -5
  264. package/dist/lib/task-execution.js +4 -5
  265. package/dist/lib/task-extras.d.ts +1 -5
  266. package/dist/lib/task-extras.js +1 -5
  267. package/dist/lib/task-legacy.d.ts +24 -0
  268. package/dist/lib/task-legacy.js +48 -0
  269. package/dist/lib/task-transcript.d.ts +5 -7
  270. package/dist/lib/task-transcript.js +8 -16
  271. package/dist/lib/tasks.d.ts +39 -21
  272. package/dist/lib/tasks.js +64 -21
  273. package/dist/lib/triggers.d.ts +39 -1
  274. package/dist/lib/triggers.js +70 -2
  275. package/dist/lib/usage-discovery.d.ts +17 -1
  276. package/dist/lib/usage-discovery.js +17 -1
  277. package/dist/lib/work-sync.d.ts +70 -0
  278. package/dist/lib/work-sync.js +29 -0
  279. package/dist/node_modules/@skrr-ai/data-provider/index.js +3760 -3621
  280. package/oclif.manifest.json +14653 -7813
  281. package/package.json +26 -5
@@ -0,0 +1,21 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class TasksExpectationsAssess extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ task: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
6
+ expectation: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ task: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
10
+ decision: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ reason: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ 'result-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ 'run-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ 'resource-link-id': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
15
+ evidence: import("@oclif/core/lib/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
16
+ 'spec-version': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
17
+ 'idempotency-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
18
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
19
+ };
20
+ run(): Promise<void>;
21
+ }
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const base_command_1 = require("../../../base-command");
6
+ const outbox_1 = require("../../../lib/outbox");
7
+ const task_resolver_1 = require("../../../lib/task-resolver");
8
+ const api_fetch_1 = require("../../../lib/api-fetch");
9
+ const session_task_endpoints_1 = require("../../../lib/session-task-endpoints");
10
+ class TasksExpectationsAssess extends base_command_1.BaseCommand {
11
+ static description = 'Assess one current Task Expectation with evidence and a reason';
12
+ // Both positionals are declared optional because oclif REJECTS an args table
13
+ // whose optional entry precedes a required one — it throws `Invalid argument
14
+ // spec` at parse time, before any network call, which made this command
15
+ // impossible to invoke in any form. Since a declared Expectation hard-gates
16
+ // closure (`TaskClosurePolicy.assertTaskMayClose`) and re-assessment is the
17
+ // only way back, that parse failure was a permanent close-deadlock for every
18
+ // Task carrying one. The two supported shapes are disambiguated in `run()`.
19
+ static args = {
20
+ task: core_1.Args.string({
21
+ required: false,
22
+ ignoreStdin: true,
23
+ description: 'Task id or ref; omit inside a task runtime',
24
+ }),
25
+ expectation: core_1.Args.string({
26
+ required: false,
27
+ ignoreStdin: true,
28
+ description: 'Expectation id',
29
+ }),
30
+ };
31
+ static flags = {
32
+ task: core_1.Flags.string({ description: 'Task id; overrides runtime context' }),
33
+ decision: core_1.Flags.string({ required: true, options: ['met', 'unmet', 'waived'] }),
34
+ reason: core_1.Flags.string({ required: true, description: 'Why this assessment is justified' }),
35
+ 'result-id': core_1.Flags.string({ description: 'Result this assessment concerns' }),
36
+ 'run-id': core_1.Flags.string({ description: 'Canonical assessor Run for a generic API call' }),
37
+ 'resource-link-id': core_1.Flags.string({ description: 'Deliverable Resource link supporting it' }),
38
+ evidence: core_1.Flags.string({
39
+ multiple: true,
40
+ description: 'Evidence reference as <kind>:<id-or-uri>',
41
+ }),
42
+ 'spec-version': core_1.Flags.integer({ description: 'Task specification version being assessed' }),
43
+ 'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
44
+ json: core_1.Flags.boolean({ description: 'Output JSON' }),
45
+ };
46
+ async run() {
47
+ this.requireAuth();
48
+ const { args, flags } = await this.parse(TasksExpectationsAssess);
49
+ // `assess <task> <expectation>` gives both; `assess <expectation>` inside a
50
+ // task runtime gives one, and it is the Expectation.
51
+ const expectationId = args.expectation ?? args.task;
52
+ if (!expectationId) {
53
+ this.error('An Expectation id is required: `tasks expectations assess <task> <expectation>`', {
54
+ exit: 1,
55
+ });
56
+ }
57
+ const task = (0, task_resolver_1.resolveTaskIdentity)({
58
+ positionalId: args.expectation ? args.task : undefined,
59
+ flagTask: flags.task,
60
+ });
61
+ const evidenceRefs = (flags.evidence || []).map((raw) => {
62
+ const split = raw.indexOf(':');
63
+ if (split < 1)
64
+ this.error('--evidence must be <kind>:<id-or-uri>', { exit: 1 });
65
+ const kind = raw.slice(0, split);
66
+ const value = raw.slice(split + 1);
67
+ return /^https?:|^file:/.test(value) ? { kind, uri: value } : { kind, id: value };
68
+ });
69
+ const payload = {
70
+ decision: flags.decision,
71
+ runId: flags['run-id'],
72
+ reason: flags.reason,
73
+ resultId: flags['result-id'],
74
+ resourceLinkId: flags['resource-link-id'],
75
+ evidenceRefs,
76
+ expectedSpecVersion: flags['spec-version'],
77
+ };
78
+ let result;
79
+ try {
80
+ const data = {
81
+ ...payload,
82
+ expectationId,
83
+ idempotencyKey: flags['idempotency-key'] ||
84
+ (0, outbox_1.idempotencyKeyFor)('task-expectation-assessment', task.id, JSON.stringify({ expectationId, ...payload })),
85
+ };
86
+ const sessionPath = await (0, session_task_endpoints_1.sessionScopedTaskPath)('assessment');
87
+ result = sessionPath
88
+ ? await (0, api_fetch_1.apiFetch)(sessionPath, { method: 'POST', body: data })
89
+ : await data_provider_1.dataService.assessTaskExpectation({
90
+ taskId: task.id,
91
+ expectationId,
92
+ data,
93
+ });
94
+ }
95
+ catch (error) {
96
+ this.handleApiError(error);
97
+ }
98
+ if (flags.json)
99
+ return this.log(JSON.stringify(result, null, 2));
100
+ this.log(`Recorded ${expectationId} as ${flags.decision}.`);
101
+ }
102
+ }
103
+ exports.default = TasksExpectationsAssess;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const data_provider_1 = require("@skrr-ai/data-provider");
5
+ const data_provider_2 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
6
7
  /**
7
8
  * `skrr tasks expectations <task>` — what this task owes, and how far each got.
@@ -21,25 +22,63 @@ const STATE_LABEL = {
21
22
  unverified: 'needs a look',
22
23
  underway: 'on its way',
23
24
  owed: 'not yet',
24
- unjudged: 'needs a person',
25
+ unassessed: 'needs assessment',
25
26
  };
27
+ /**
28
+ * The evidence gap, on the rows where a reader can act on it.
29
+ *
30
+ * `unverified` and `underway` BOTH mean "something was produced and pinned to
31
+ * this Expectation, and it is not enough yet" — they differ only in whether the
32
+ * thing has been observed as available. Printing the gap on the first and
33
+ * nothing on the second is what made the careful path unreadable: an operator
34
+ * who pinned a deliverable saw `on its way` and had no way to learn that the
35
+ * bar was `external_receipt` and their own report could never clear it.
36
+ *
37
+ * It stays off the rows where it is noise: a met or waived row has nothing
38
+ * outstanding, and an `owed`/`unassessed` row has no deliverable to compare
39
+ * against, so naming a required authority there describes a hypothetical.
40
+ */
41
+ const PINNED_STATES = new Set(['unverified', 'underway']);
42
+ function evidenceGap(expectation) {
43
+ /*
44
+ * A `met` row settled BELOW its declared bar says so.
45
+ *
46
+ * `@merged-to-main` asks for `external_receipt` and is satisfiable by a person
47
+ * typing "I checked git log". That is allowed on purpose — refusing it is the
48
+ * deadlock the ladder exists to prevent — but every surface then read as though
49
+ * a receipt had arrived: the row said `done`, the rollup said `met`, and the
50
+ * recorded gap was visible only to someone who dumped the assessment rows and
51
+ * already knew the field existed.
52
+ */
53
+ if (expectation.evidenceShortfall) {
54
+ const { provided, required } = expectation.evidenceShortfall;
55
+ return ` (vouched at ${provided}, asked for ${required})`;
56
+ }
57
+ if (!PINNED_STATES.has(expectation.state))
58
+ return '';
59
+ if (!expectation.evidenceLevel || !expectation.requiredEvidence)
60
+ return '';
61
+ if (expectation.evidenceLevel === expectation.requiredEvidence)
62
+ return '';
63
+ return ` (has ${expectation.evidenceLevel}, needs ${expectation.requiredEvidence})`;
64
+ }
26
65
  function line(expectation) {
27
66
  const label = STATE_LABEL[expectation.state] || expectation.state;
28
- // A judged expectation is stated as NOT a gate. A list that reads like a
29
- // contract while enforcing nothing is worse than no list, because it is
30
- // trusted.
31
- const gate = expectation.gating ? '' : ' (does not block completion)';
32
67
  const from = expectation.source === 'space' ? ' [space default]' : '';
33
- // Only shown when the work exists and the evidence is short — stating the
34
- // required authority on every row would be noise on the rows where it is
35
- // already satisfied or not yet relevant.
36
- const evidence = expectation.state === 'unverified'
37
- ? ` (has ${expectation.evidenceAuthority}, needs ${expectation.requiredAuthority})`
38
- : '';
39
- return ` ${expectation.id.padEnd(18)} ${label.padEnd(14)} ${expectation.sentence}${evidence}${gate}${from}`;
68
+ /*
69
+ * `sentence` before `text`.
70
+ *
71
+ * The server resolves `sentence` through `describeExpectation`, which is what
72
+ * appends a preset's destination — so `@wiki-page-published:Engineering/Deploy`
73
+ * and the same preset at `Ops/Oncall` are distinguishable. Printing `text`
74
+ * rendered the preset's fixed copy and dropped the one part that says WHICH
75
+ * thing is owed. The fallback is for a row that predates the resolved field.
76
+ */
77
+ const sentence = expectation.sentence || expectation.text;
78
+ return ` ${expectation.id.padEnd(18)} ${label.padEnd(18)} ${sentence}${evidenceGap(expectation)}${from}`;
40
79
  }
41
80
  class TasksExpectations extends base_command_1.BaseCommand {
42
- static description = 'Show what a task must produce and how far each expectation got ("Done when")';
81
+ static description = 'Show what must be true before the Task can close and the evidence-backed assessment state';
43
82
  static examples = [
44
83
  '<%= config.bin %> tasks expectations <task-id>',
45
84
  '<%= config.bin %> tasks expectations <task-id> --json',
@@ -68,7 +107,7 @@ class TasksExpectations extends base_command_1.BaseCommand {
68
107
  if (acceptance.expectations.length === 0) {
69
108
  // An empty contract is a real answer, not an unfilled field. Say so
70
109
  // plainly rather than prompting for something most tasks do not owe.
71
- this.log('Nothing durable is expected of this task.');
110
+ this.log('No Expectations were declared for this Task.');
72
111
  return;
73
112
  }
74
113
  // The evidence read fails OPEN by design, so "produced nothing" and "we
@@ -78,20 +117,44 @@ class TasksExpectations extends base_command_1.BaseCommand {
78
117
  this.warn('Could not read what this task produced — the states below may understate it. ' +
79
118
  'This is not a claim that nothing was produced.');
80
119
  }
81
- this.log('Done when:');
120
+ this.log('Expectations:');
82
121
  for (const expectation of acceptance.expectations) {
83
122
  this.log(line(expectation));
84
123
  }
85
124
  const gating = acceptance.expectations.filter((e) => e.gating);
86
- const met = gating.filter((e) => e.met).length;
125
+ // `met: true` is the GATE's answer — a waiver unblocks closure exactly as a
126
+ // pass does — but it is the wrong REPORT. Counting them together printed
127
+ // "2 of 2 met" for a Task where one expectation was dropped, which is the
128
+ // one thing a reader checking this line needs to know.
129
+ const waived = gating.filter((e) => e.state === 'waived').length;
130
+ const met = gating.filter((e) => e.met).length - waived;
87
131
  this.log('');
88
- this.log(`${met} of ${gating.length} met · overall: ${acceptance.state}`);
89
- // Only the ones actually stored on the task can be judged. A space default
90
- // is synthesised per read, so pointing at `tasks judge` for one would send
91
- // the reader at a command that can only refuse it.
92
- const settleable = acceptance.expectations.filter((e) => e.state === 'unjudged' && e.source !== 'space').length;
132
+ this.log(`${met} of ${gating.length} met${waived > 0 ? ` · ${waived} waived` : ''} · overall: ${acceptance.state}`);
133
+ // Space defaults are copied into the Task at creation. `source=space`
134
+ // remains useful provenance, but these are Task-owned Expectations now and
135
+ // are assessed exactly like explicitly declared ones.
136
+ /*
137
+ * A typed check nothing evaluates behaves exactly like `manual`.
138
+ *
139
+ * `EXPECTATION_CHECK_METHODS` declares six methods and the judge evaluates
140
+ * one: a `deliverable` check is compared against the ledger, and
141
+ * `task_state`, `goal_state`, `metric` and `llm_review` return `unassessed`
142
+ * forever. Verified against production — a `metric` check naming measureId,
143
+ * operator and target stores fine and is never looked at. The row read
144
+ * identically to a hand-written sentence, so somebody who chose
145
+ * `metric: cycle_time lt 2` had no way to learn the platform was not
146
+ * measuring it (OSK-8488).
147
+ */
148
+ const unevaluated = acceptance.expectations.filter((e) => (0, data_provider_2.declaresUnevaluatedCheck)(e));
149
+ if (unevaluated.length > 0) {
150
+ const methods = [...new Set(unevaluated.map((e) => e.check?.method).filter(Boolean))].join(', ');
151
+ this.log(`${unevaluated.length} declare${unevaluated.length === 1 ? 's' : ''} a typed check nothing ` +
152
+ `evaluates yet (${methods}) — a person settles ${unevaluated.length === 1 ? 'it' : 'them'} ` +
153
+ 'exactly as if the check said `manual`.');
154
+ }
155
+ const settleable = acceptance.expectations.filter((e) => e.state === 'unassessed').length;
93
156
  if (settleable > 0) {
94
- this.log(`${settleable} awaiting a person settle with \`${this.config.bin} tasks judge\`.`);
157
+ this.log(`${settleable} awaiting assessmentuse \`${this.config.bin} tasks expectations assess\`.`);
95
158
  }
96
159
  // Named separately from `unjudged`, and with a different command, because
97
160
  // the two look alike on the board and are not: one needs a verdict on prose,
@@ -102,9 +165,42 @@ class TasksExpectations extends base_command_1.BaseCommand {
102
165
  `\`${this.config.bin} tasks deliverable confirm\`, or lower the bar with ` +
103
166
  `\`${this.config.bin} tasks trust\`.`);
104
167
  }
105
- const inherited = acceptance.unjudged - settleable;
106
- if (inherited > 0) {
107
- this.log(`${inherited} inherited from the space default declare them on the task to settle them.`);
168
+ // `underway` had no trailer at all, which is why pinning a deliverable read
169
+ // as no progress: the row said `on its way` and nothing named the lever.
170
+ // A Deliverable is recorded `local` by default, so this is the state the
171
+ // ORDINARY `tasks deliverable add` lands in — the common case, not an edge.
172
+ const underway = acceptance.expectations.filter((e) => e.state === 'underway').length;
173
+ if (underway > 0) {
174
+ this.log(`${underway} recorded but not yet observed as available — say it arrived with ` +
175
+ `\`${this.config.bin} tasks deliverable confirm\`, or re-record it with ` +
176
+ `\`--status available\`.`);
177
+ }
178
+ // Counted separately from the unmet ones: these no longer block anything, and
179
+ // the reader's question about them is not "what do I do" but "how good is this
180
+ // record". Saying it once beats repeating the rungs on every row.
181
+ const shortfalls = acceptance.expectations.filter((e) => e.evidenceShortfall).length;
182
+ if (shortfalls > 0) {
183
+ this.log(`${shortfalls} settled below the evidence ${shortfalls === 1 ? 'bar it' : 'bars they'} ` +
184
+ `declared — allowed, and recorded as such on the assessment.`);
185
+ }
186
+ // Said once, for the whole task: `external_receipt` is the one bar no CLI
187
+ // command can clear. The only receipt producer in the platform is PR
188
+ // integration, so an operator staring at a row that needs one would
189
+ // otherwise keep looking for the command that supplies it.
190
+ const receiptBarred = acceptance.expectations.filter((e) => !e.met && e.requiredEvidence === 'external_receipt').length;
191
+ if (receiptBarred > 0) {
192
+ this.log(`${receiptBarred} ask${receiptBarred === 1 ? 's' : ''} for an external provider receipt, ` +
193
+ `which only an integration can supply — settle by hand with ` +
194
+ `\`${this.config.bin} tasks expectations assess\` (the gap is recorded), or lower the ` +
195
+ `bar with \`${this.config.bin} tasks trust\`.`);
196
+ }
197
+ // Settled, not "met" — a waiver settles an Expectation as surely as a pass,
198
+ // and splitting the two in the count above must not make this trailer fire
199
+ // on a Task where nothing is actually outstanding.
200
+ const settled = gating.filter((e) => e.met).length;
201
+ if (gating.length > settled) {
202
+ this.log('');
203
+ this.log('The current Result cannot be accepted while these Expectations remain unmet.');
108
204
  }
109
205
  }
110
206
  }
@@ -14,6 +14,7 @@ import { BaseCommand } from '../../base-command';
14
14
  * expectation is that somebody actually looked.
15
15
  */
16
16
  export default class TasksJudge extends BaseCommand {
17
+ static hidden: boolean;
17
18
  static description: string;
18
19
  static examples: string[];
19
20
  static args: {
@@ -18,7 +18,8 @@ const base_command_1 = require("../../base-command");
18
18
  * expectation is that somebody actually looked.
19
19
  */
20
20
  class TasksJudge extends base_command_1.BaseCommand {
21
- static description = 'Settle a judged expectation with a verdict and a stated reason';
21
+ static hidden = true;
22
+ static description = 'Compatibility alias for `tasks expectations assess`';
22
23
  static examples = [
23
24
  '<%= config.bin %> tasks judge <task-id> e2 --verdict met --reason "Read it end to end; a non-engineer follows it."',
24
25
  '<%= config.bin %> tasks judge <task-id> e2 --verdict unmet --reason "Still assumes the reader knows the schema."',
@@ -1,16 +1,7 @@
1
1
  import { BaseCommand } from '../../base-command';
2
- /**
3
- * "What did the agent produce for this task?" in one call.
4
- *
5
- * Answering that used to mean three commands and a jq hop: `tasks comments list`
6
- * for the canonical TASK_OUTPUT block, `tasks runs` / `execution-summary` for
7
- * whether the run even finished, and `tasks show --json | jq .conversationId`
8
- * piped into `messages list` for the agent's actual words. This command joins
9
- * them and states plainly when a piece is missing.
10
- */
11
2
  export default class TasksOutput extends BaseCommand {
3
+ static hidden: boolean;
12
4
  static description: string;
13
- static examples: string[];
14
5
  static args: {
15
6
  id: import("@oclif/core/lib/interfaces").Arg<string | undefined, Record<string, unknown>>;
16
7
  };
@@ -20,5 +11,4 @@ export default class TasksOutput extends BaseCommand {
20
11
  full: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
21
12
  };
22
13
  run(): Promise<void>;
23
- private renderHuman;
24
14
  }