@skrr-ai/cli 0.1.166 → 0.1.168
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/base-command.js +0 -1
- package/dist/commands/activity/scan-older.d.ts +1 -1
- package/dist/commands/activity/scan-older.js +5 -4
- package/dist/commands/agent/message/approve.d.ts +1 -0
- package/dist/commands/agent/message/approve.js +6 -2
- package/dist/commands/agent/message/decline.d.ts +1 -0
- package/dist/commands/agent/message/decline.js +6 -2
- package/dist/commands/agent/message/pending.js +5 -2
- package/dist/commands/agent/message/review.d.ts +13 -0
- package/dist/commands/agent/message/review.js +68 -0
- package/dist/commands/agents/always-on/recovery-close.d.ts +28 -0
- package/dist/commands/agents/always-on/recovery-close.js +60 -0
- package/dist/commands/agents/always-on/recovery-review.d.ts +22 -0
- package/dist/commands/agents/always-on/recovery-review.js +190 -0
- package/dist/commands/apps/installations/compatibility.js +1 -1
- package/dist/commands/apps/installations/list.js +3 -0
- package/dist/commands/apps/installations/show.js +3 -0
- package/dist/commands/duties/show.js +10 -0
- package/dist/commands/goals/key-results/assess.d.ts +2 -3
- package/dist/commands/goals/key-results/assess.js +5 -12
- package/dist/commands/harnesses/removal-references.d.ts +16 -0
- package/dist/commands/harnesses/removal-references.js +61 -0
- package/dist/commands/tasks/actionability.js +8 -3
- package/dist/commands/tasks/complete.js +35 -17
- package/dist/commands/tasks/expectations/assess.d.ts +1 -0
- package/dist/commands/tasks/expectations/assess.js +50 -21
- package/dist/commands/tasks/expectations.js +5 -2
- package/dist/commands/tasks/judge.d.ts +1 -0
- package/dist/commands/tasks/judge.js +17 -2
- package/dist/commands/tasks/result/submit.js +26 -17
- package/dist/commands/tasks/review-queue.js +2 -1
- package/dist/commands/tasks/review.d.ts +1 -0
- package/dist/commands/tasks/review.js +24 -3
- package/dist/commands/tasks/show.d.ts +13 -0
- package/dist/commands/tasks/show.js +41 -3
- package/dist/commands/tasks/updates/add.d.ts +1 -0
- package/dist/commands/tasks/updates/add.js +71 -21
- package/dist/commands/tasks/updates/list.d.ts +4 -0
- package/dist/commands/tasks/updates/list.js +3 -1
- package/dist/commands/tasks/waive.d.ts +1 -0
- package/dist/commands/tasks/waive.js +17 -2
- package/dist/generated/agent-guides.json +20 -20
- package/dist/lib/agent-activity.d.ts +3 -1
- package/dist/lib/agent-activity.js +50 -11
- package/dist/lib/appInstallations.js +1 -1
- package/dist/lib/harnesses.d.ts +24 -0
- package/dist/lib/harnesses.js +4 -0
- package/dist/lib/reference-syntax.d.ts +28 -0
- package/dist/lib/reference-syntax.js +91 -0
- package/dist/lib/runtime-context.js +6 -0
- package/dist/lib/task-closure.d.ts +1 -1
- package/dist/lib/task-closure.js +1 -1
- package/dist/lib/task-operations.d.ts +28 -6
- package/dist/lib/task-operations.js +77 -4
- package/dist/lib/task-preflight.js +8 -3
- package/dist/lib/task-write-attribution.d.ts +183 -19
- package/dist/lib/task-write-attribution.js +270 -39
- package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/daemonWire.js +63 -0
- package/dist/node_modules/@skrr-ai/auth-core/dist/esm/daemonWire.js +71 -0
- package/dist/node_modules/@skrr-ai/data-provider/index.js +11416 -11290
- package/oclif.manifest.json +395 -16
- package/package.json +2 -2
|
@@ -7,6 +7,7 @@ const base_command_1 = require("../../base-command");
|
|
|
7
7
|
const task_resolver_1 = require("../../lib/task-resolver");
|
|
8
8
|
const api_fetch_1 = require("../../lib/api-fetch");
|
|
9
9
|
const session_task_write_1 = require("../../lib/session-task-write");
|
|
10
|
+
const task_write_attribution_1 = require("../../lib/task-write-attribution");
|
|
10
11
|
class TasksReview extends base_command_1.BaseCommand {
|
|
11
12
|
static description = 'Accept or request changes on one exact Task Result';
|
|
12
13
|
static args = {
|
|
@@ -19,6 +20,7 @@ class TasksReview extends base_command_1.BaseCommand {
|
|
|
19
20
|
rationale: core_1.Flags.string({ description: 'Why this Result was accepted or needs changes' }),
|
|
20
21
|
'run-id': core_1.Flags.string({ description: 'Canonical reviewer Run for a generic API call' }),
|
|
21
22
|
'idempotency-key': core_1.Flags.string({ description: 'Stable retry key' }),
|
|
23
|
+
'confirm-as-me': task_write_attribution_1.confirmAsMeFlag,
|
|
22
24
|
json: core_1.Flags.boolean({ description: 'Output JSON' }),
|
|
23
25
|
};
|
|
24
26
|
async run() {
|
|
@@ -26,6 +28,17 @@ class TasksReview extends base_command_1.BaseCommand {
|
|
|
26
28
|
this.requireAuth();
|
|
27
29
|
const { args, flags } = await this.parse(TasksReview);
|
|
28
30
|
const task = (0, task_resolver_1.resolveTaskIdentity)({ positionalId: args.task, flagTask: flags.task });
|
|
31
|
+
// A Review is a judgement. From a coding agent in the person's own terminal it would be
|
|
32
|
+
// recorded as the person's, so ask before writing it (see `lib/task-write-attribution.ts`).
|
|
33
|
+
const refusal = (0, task_write_attribution_1.personJudgementGate)(this, {
|
|
34
|
+
confirmed: flags['confirm-as-me'],
|
|
35
|
+
judgement: flags.decision === 'accepted'
|
|
36
|
+
? `accepting Result ${flags['result-id']}`
|
|
37
|
+
: `requesting changes on Result ${flags['result-id']}`,
|
|
38
|
+
task: task.id,
|
|
39
|
+
});
|
|
40
|
+
if (refusal)
|
|
41
|
+
this.failWithCliError({ ...refusal, exit: 1, retryable: false });
|
|
29
42
|
const payload = {
|
|
30
43
|
resultId: flags['result-id'],
|
|
31
44
|
runId: flags['run-id'],
|
|
@@ -41,18 +54,26 @@ class TasksReview extends base_command_1.BaseCommand {
|
|
|
41
54
|
const sessionWrite = await (0, session_task_write_1.sessionTaskWrite)('review', task.id);
|
|
42
55
|
result = sessionWrite
|
|
43
56
|
? await (0, api_fetch_1.apiFetch)(sessionWrite.path, { method: 'POST', body: data, credential: sessionWrite.credential })
|
|
44
|
-
: await data_provider_1.dataService.reviewTaskResult({
|
|
57
|
+
: await data_provider_1.dataService.reviewTaskResult({
|
|
58
|
+
taskId: task.id,
|
|
59
|
+
// A person's write names the coding agent this shell runs inside, when one was
|
|
60
|
+
// detected. Recorded as declared, never trusted (`declaredToolSource`).
|
|
61
|
+
data: { ...data, ...(0, task_write_attribution_1.declaredToolSource)() },
|
|
62
|
+
});
|
|
45
63
|
}
|
|
46
64
|
catch (error) {
|
|
47
65
|
this.handleApiError(error);
|
|
48
66
|
}
|
|
67
|
+
const outcome = (0, task_write_attribution_1.taskWriteOutcome)(result, 'review');
|
|
49
68
|
if (flags.json)
|
|
50
|
-
return this.printJsonOperation(result, {
|
|
69
|
+
return this.printJsonOperation({ ...result, ...outcome }, {
|
|
51
70
|
resource: { kind: 'task_review', id: result?.review?.id },
|
|
52
71
|
task: { id: result?.review?.taskId },
|
|
53
72
|
...(typeof result?.idempotent === 'boolean' ? { replayed: result.idempotent } : {}),
|
|
54
73
|
});
|
|
55
|
-
|
|
74
|
+
for (const line of (0, task_write_attribution_1.taskWriteOutcomeLines)({ verb: 'Recorded', what: `Review: ${flags.decision} for Result ${flags['result-id']}` }, outcome)) {
|
|
75
|
+
this.log(line);
|
|
76
|
+
}
|
|
56
77
|
}
|
|
57
78
|
}
|
|
58
79
|
exports.default = TasksReview;
|
|
@@ -69,6 +69,19 @@ export declare function labelsLine(labelIds?: string[], nameById?: Map<string, s
|
|
|
69
69
|
* reassigning the task changes only the implied kind.
|
|
70
70
|
*/
|
|
71
71
|
export declare function taskExecutorLabel(t: Record<string, unknown>, bin?: string): string;
|
|
72
|
+
/**
|
|
73
|
+
* The `Next step:` lines for a Task that nobody has been chosen to do.
|
|
74
|
+
*
|
|
75
|
+
* `Why:` said "Choose an executor and assignee before this Task can start" (or,
|
|
76
|
+
* for a started Task, that it "has no assigned executor") and nothing said how
|
|
77
|
+
* to do that (OSK-24355). The commands come from the one action→command map
|
|
78
|
+
* (`taskActionRemedies`), keyed by the actions the server declared, with the
|
|
79
|
+
* Task's ref filled in. Only the assignment actions print here; the rest are
|
|
80
|
+
* listed by `tasks actionability`.
|
|
81
|
+
*
|
|
82
|
+
* Pure and exported so the wording is testable without an oclif runtime.
|
|
83
|
+
*/
|
|
84
|
+
export declare function nextStepLines(t: Record<string, unknown>, bin?: string): string[];
|
|
72
85
|
/**
|
|
73
86
|
* The `Resolution:` lines for any resolved Task: how it ended, the reason the
|
|
74
87
|
* closer recorded, who closed it, and what the close stood on. The reason used to
|
|
@@ -6,6 +6,7 @@ exports.completionLines = completionLines;
|
|
|
6
6
|
exports.reviewPolicyLine = reviewPolicyLine;
|
|
7
7
|
exports.labelsLine = labelsLine;
|
|
8
8
|
exports.taskExecutorLabel = taskExecutorLabel;
|
|
9
|
+
exports.nextStepLines = nextStepLines;
|
|
9
10
|
exports.resolutionLines = resolutionLines;
|
|
10
11
|
exports.recurrenceArmFailureLines = recurrenceArmFailureLines;
|
|
11
12
|
exports.taskFailureLines = taskFailureLines;
|
|
@@ -24,6 +25,7 @@ const task_economics_line_1 = require("../../lib/task-economics-line");
|
|
|
24
25
|
const format_1 = require("../../lib/format");
|
|
25
26
|
const task_recurrence_outcome_1 = require("../../lib/task-recurrence-outcome");
|
|
26
27
|
const task_recurrence_summary_1 = require("../../lib/task-recurrence-summary");
|
|
28
|
+
const task_operations_1 = require("../../lib/task-operations");
|
|
27
29
|
const record_output_1 = require("../../lib/record-output");
|
|
28
30
|
/**
|
|
29
31
|
* Where to look next — as COMMANDS, not as facts about the task.
|
|
@@ -154,6 +156,36 @@ function taskExecutorLabel(t, bin = 'skrr') {
|
|
|
154
156
|
return '-';
|
|
155
157
|
}
|
|
156
158
|
}
|
|
159
|
+
/** The server actions whose commands `tasks show` prints under `Why:`: who does the Task. */
|
|
160
|
+
const ASSIGNMENT_ACTIONS = new Set(['assign_task', 'set_execution_mode']);
|
|
161
|
+
/**
|
|
162
|
+
* The `Next step:` lines for a Task that nobody has been chosen to do.
|
|
163
|
+
*
|
|
164
|
+
* `Why:` said "Choose an executor and assignee before this Task can start" (or,
|
|
165
|
+
* for a started Task, that it "has no assigned executor") and nothing said how
|
|
166
|
+
* to do that (OSK-24355). The commands come from the one action→command map
|
|
167
|
+
* (`taskActionRemedies`), keyed by the actions the server declared, with the
|
|
168
|
+
* Task's ref filled in. Only the assignment actions print here; the rest are
|
|
169
|
+
* listed by `tasks actionability`.
|
|
170
|
+
*
|
|
171
|
+
* Pure and exported so the wording is testable without an oclif runtime.
|
|
172
|
+
*/
|
|
173
|
+
function nextStepLines(t, bin = 'skrr') {
|
|
174
|
+
const actionability = t.actionability;
|
|
175
|
+
if (!actionability || actionability.state === 'terminal')
|
|
176
|
+
return [];
|
|
177
|
+
const allowed = (Array.isArray(actionability.allowedActions) ? actionability.allowedActions : []).filter((row) => Boolean(row) && typeof row.action === 'string');
|
|
178
|
+
const actions = allowed.filter((row) => ASSIGNMENT_ACTIONS.has(row.action));
|
|
179
|
+
if (actionability.reasonCode === 'assignment_required' &&
|
|
180
|
+
!actions.some((row) => row.action === 'assign_task')) {
|
|
181
|
+
actions.unshift({ action: 'assign_task' });
|
|
182
|
+
}
|
|
183
|
+
const ref = (typeof t.identifier === 'string' && t.identifier) ||
|
|
184
|
+
(typeof t.id === 'string' && t.id) ||
|
|
185
|
+
'<task-id>';
|
|
186
|
+
const rows = (0, task_operations_1.taskActionRemedyRows)(actions.flatMap((row) => (0, task_operations_1.taskActionRemedies)(row.action, ref, row.targetId, bin, { allowedActions: allowed, task: t })));
|
|
187
|
+
return rows.map((row, index) => `${index === 0 ? 'Next step:' : ''}`.padEnd(13) + row);
|
|
188
|
+
}
|
|
157
189
|
function resolverLabel(by, names) {
|
|
158
190
|
if (!by || typeof by !== 'object' || !by.kind)
|
|
159
191
|
return null;
|
|
@@ -261,10 +293,14 @@ function taskFailureLines(t, bin = 'skrr') {
|
|
|
261
293
|
lines.push('Recorded error: none recorded on the task.');
|
|
262
294
|
}
|
|
263
295
|
const failure = t.executionFailure;
|
|
264
|
-
if (failure?.recovery &&
|
|
296
|
+
if (failure?.recovery &&
|
|
297
|
+
typeof failure.recovery === 'string' &&
|
|
298
|
+
!error.includes(failure.recovery)) {
|
|
265
299
|
lines.push(`Recovery: ${failure.recovery}`);
|
|
266
300
|
}
|
|
267
|
-
if (failure?.headline &&
|
|
301
|
+
if (failure?.headline &&
|
|
302
|
+
typeof failure.headline === 'string' &&
|
|
303
|
+
!error.includes(failure.headline)) {
|
|
268
304
|
lines.push(`Cause: ${failure.headline}`);
|
|
269
305
|
}
|
|
270
306
|
if (failure?.runId) {
|
|
@@ -490,7 +526,7 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
490
526
|
const history = await data_provider_1.dataService.listTaskResults(taskIdentity.id);
|
|
491
527
|
const review = (history?.reviews || []).find((row) => row.resultId === String(t.currentResultId));
|
|
492
528
|
if (review) {
|
|
493
|
-
const who = (0, task_closure_1.describeAssessor)(review.reviewedBy?.kind);
|
|
529
|
+
const who = (0, task_closure_1.describeAssessor)(review.reviewedBy?.kind, review.reviewedBy?.via);
|
|
494
530
|
const when = review.reviewedAt ? ` on ${String(review.reviewedAt).slice(0, 10)}` : '';
|
|
495
531
|
const why = review.rationale ? `: ${review.rationale}` : '';
|
|
496
532
|
this.log(`Review: ${review.decision} by ${who}${when}${why}`);
|
|
@@ -618,6 +654,8 @@ class TasksShow extends base_command_1.BaseCommand {
|
|
|
618
654
|
? 'Workflow: ended · no next executor'
|
|
619
655
|
: `Next action: ${actionability.nextActor ?? '-'} · ${actionability.state ?? '-'} · ${actionability.reasonCode ?? '-'}`);
|
|
620
656
|
this.log(`Why: ${actionability.reason ?? '-'}`);
|
|
657
|
+
for (const line of nextStepLines(t, this.config.bin))
|
|
658
|
+
this.log(line);
|
|
621
659
|
await this.printBlockerDetail(t, actionability);
|
|
622
660
|
}
|
|
623
661
|
const delivery = t.delivery;
|
|
@@ -16,6 +16,7 @@ export default class TasksUpdatesAdd extends BaseCommand {
|
|
|
16
16
|
'spec-version': import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
17
|
supersedes: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
reference: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
|
+
evidence: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
19
20
|
attach: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
20
21
|
'idempotency-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
21
22
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -7,7 +7,10 @@ const base_command_1 = require("../../../base-command");
|
|
|
7
7
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
8
8
|
const api_fetch_1 = require("../../../lib/api-fetch");
|
|
9
9
|
const session_task_write_1 = require("../../../lib/session-task-write");
|
|
10
|
-
const
|
|
10
|
+
const task_write_attribution_1 = require("../../../lib/task-write-attribution");
|
|
11
|
+
const reference_syntax_1 = require("../../../lib/reference-syntax");
|
|
12
|
+
/** The Update types whose `data` carries `evidenceRefs` (TASK_UPDATE_DATA_SCHEMAS on the server). */
|
|
13
|
+
const EVIDENCE_TYPES = new Set(['finding', 'verification']);
|
|
11
14
|
function parseJsonObject(value, label) {
|
|
12
15
|
if (!value)
|
|
13
16
|
return undefined;
|
|
@@ -33,9 +36,10 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
33
36
|
static examples = [
|
|
34
37
|
'<%= config.bin %> tasks updates add <task> --type progress --summary "Migration review complete" --data \'{"completedSinceLast":["Checked migrations 001-014"],"nextActions":["Review authorization"]}\'',
|
|
35
38
|
'<%= config.bin %> tasks updates add <task> --type decision --summary "Use a resource object" --data \'{"decision":"Use WorkResource","rationale":"Identity must survive URL changes"}\'',
|
|
36
|
-
'<%= config.bin %> tasks updates add <task> --type finding --summary "Cross-tenant leak" --data \'{"finding":"Space ACL is not applied on the list path","impact":"Any member can read another space","severity":"high","evidenceRefs":[]}\'',
|
|
39
|
+
'<%= config.bin %> tasks updates add <task> --type finding --summary "Cross-tenant leak" --data \'{"finding":"Space ACL is not applied on the list path","impact":"Any member can read another space","severity":"high","evidenceRefs":[{"kind":"pr","uri":"https://github.com/acme/app/pull/482","label":"repro test"}]}\'',
|
|
37
40
|
'<%= config.bin %> tasks updates add <task> --type blocker --summary "Needs a prod credential" --data \'{"cause":"No Atlas API key in this runtime","requiredAction":"Provision a read-only key","nextOwner":{"kind":"human","userId":"<user-id>"}}\'',
|
|
38
|
-
'<%= config.bin %> tasks updates add <task> --type verification --summary "Repro is gone" --data \'{"claim":"The 409 no longer reproduces","result":"passed","evidenceRefs":[]}\'',
|
|
41
|
+
'<%= config.bin %> tasks updates add <task> --type verification --summary "Repro is gone" --data \'{"claim":"The 409 no longer reproduces","result":"passed","evidenceRefs":["https://ci.example.com/runs/77"]}\'',
|
|
42
|
+
'<%= config.bin %> tasks updates add <task> --type verification --summary "Repro is gone" --data \'{"claim":"The 409 no longer reproduces","result":"passed"}\' --evidence pr:https://github.com/acme/app/pull/482 --evidence commit:3f9c2ab',
|
|
39
43
|
];
|
|
40
44
|
static args = {
|
|
41
45
|
task: core_1.Args.string({ required: false, ignoreStdin: true, description: 'Task id or ref' }),
|
|
@@ -53,10 +57,13 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
53
57
|
description: 'Kind-specific JSON payload. The server enforces one shape per --type, and the array ' +
|
|
54
58
|
'fields are required even when empty. ' +
|
|
55
59
|
'progress {completedSinceLast:[],nextActions:[],currentFocus?} · ' +
|
|
56
|
-
'finding {finding,evidenceRefs:[],impact?,severity?} · ' +
|
|
60
|
+
'finding {finding,evidenceRefs:[{kind,id|uri,label?}],impact?,severity?} · ' +
|
|
57
61
|
'decision {decision,rationale,alternativesConsidered?:[]} · ' +
|
|
58
62
|
'blocker {cause,requiredAction,nextOwner} · ' +
|
|
59
|
-
'verification {claim,result:passed|failed|inconclusive,evidenceRefs:[]}. ' +
|
|
63
|
+
'verification {claim,result:passed|failed|inconclusive,evidenceRefs:[{kind,id|uri,label?}]}. ' +
|
|
64
|
+
'An evidenceRefs entry may also be written as a URL or a "<kind>:<id-or-uri>" string, ' +
|
|
65
|
+
`${reference_syntax_1.REFERENCE_SYNTAX_EXAMPLES}; it is sent as the object. --evidence adds entries ` +
|
|
66
|
+
'without writing JSON. ' +
|
|
60
67
|
'nextOwner is a principal object like {"kind":"human","userId":"..."}, not a name. ' +
|
|
61
68
|
"Note --reference sets the Update's own references, NOT data.evidenceRefs.",
|
|
62
69
|
}),
|
|
@@ -75,7 +82,16 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
75
82
|
description: 'Task specification version this Update concerns',
|
|
76
83
|
}),
|
|
77
84
|
supersedes: core_1.Flags.string({ description: 'Update id this correction supersedes' }),
|
|
78
|
-
reference: core_1.Flags.string({
|
|
85
|
+
reference: core_1.Flags.string({
|
|
86
|
+
multiple: true,
|
|
87
|
+
description: "The Update's own reference as <kind>:<id-or-uri> or a URL (repeatable)",
|
|
88
|
+
}),
|
|
89
|
+
evidence: core_1.Flags.string({
|
|
90
|
+
multiple: true,
|
|
91
|
+
description: 'Evidence reference as <kind>:<id-or-uri> or a URL, appended to data.evidenceRefs ' +
|
|
92
|
+
'(repeatable; the array is created when --data has none). finding and verification ' +
|
|
93
|
+
'only: other types cite with --reference.',
|
|
94
|
+
}),
|
|
79
95
|
attach: core_1.Flags.string({
|
|
80
96
|
multiple: true,
|
|
81
97
|
description: 'Upload a file as a Task asset (role: evidence) and cite it in this Update — appended to ' +
|
|
@@ -99,14 +115,39 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
99
115
|
catch (error) {
|
|
100
116
|
this.error(error.message, { exit: 1 });
|
|
101
117
|
}
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
118
|
+
// Every reference is read before --attach uploads anything, so a refusal the CLI can already
|
|
119
|
+
// see never leaves stored bytes behind.
|
|
120
|
+
const carriesEvidence = EVIDENCE_TYPES.has(flags.type);
|
|
121
|
+
let references = [];
|
|
122
|
+
try {
|
|
123
|
+
references = (0, reference_syntax_1.parseReferences)(flags.reference, '--reference');
|
|
124
|
+
if (flags.evidence?.length && !carriesEvidence) {
|
|
125
|
+
throw new Error('--evidence adds to data.evidenceRefs, which only finding and verification Updates ' +
|
|
126
|
+
`carry. To cite something on a ${flags.type} Update, use --reference ` +
|
|
127
|
+
'<kind>:<id-or-uri>.');
|
|
128
|
+
}
|
|
129
|
+
const evidence = (0, reference_syntax_1.parseReferences)(flags.evidence, '--evidence');
|
|
130
|
+
if (carriesEvidence) {
|
|
131
|
+
// A hand-written entry may be a URL or `<kind>:<id-or-uri>`: send the object the server
|
|
132
|
+
// takes, rather than letting the first attempt learn the shape from a 400.
|
|
133
|
+
if (Array.isArray(data.evidenceRefs)) {
|
|
134
|
+
data = {
|
|
135
|
+
...data,
|
|
136
|
+
evidenceRefs: (0, reference_syntax_1.liftReferenceEntries)(data.evidenceRefs, 'data.evidenceRefs'),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
if (evidence.length || flags.attach?.length) {
|
|
140
|
+
if (data.evidenceRefs !== undefined && !Array.isArray(data.evidenceRefs)) {
|
|
141
|
+
throw new Error('data.evidenceRefs must be an array for --evidence or --attach to add to it.');
|
|
142
|
+
}
|
|
143
|
+
const written = data.evidenceRefs ?? [];
|
|
144
|
+
data = { ...data, evidenceRefs: [...written, ...evidence] };
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch (error) {
|
|
149
|
+
this.error(error.message, { exit: 1 });
|
|
150
|
+
}
|
|
110
151
|
// --attach: upload first so the Update can cite the asset ids. For
|
|
111
152
|
// finding/verification the citation lands in data.evidenceRefs where the
|
|
112
153
|
// evidence renderer reads it; for the other Update kinds it becomes a
|
|
@@ -124,7 +165,7 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
124
165
|
catch (err) {
|
|
125
166
|
this.error(`--attach failed: ${err.message}`, { exit: 1 });
|
|
126
167
|
}
|
|
127
|
-
if (
|
|
168
|
+
if (carriesEvidence) {
|
|
128
169
|
data = { ...data, evidenceRefs: [...data.evidenceRefs, ...refs] };
|
|
129
170
|
}
|
|
130
171
|
else {
|
|
@@ -152,22 +193,31 @@ class TasksUpdatesAdd extends base_command_1.BaseCommand {
|
|
|
152
193
|
credential: sessionWrite.credential,
|
|
153
194
|
body: payload,
|
|
154
195
|
})
|
|
155
|
-
: await data_provider_1.dataService.appendTaskUpdate({
|
|
196
|
+
: await data_provider_1.dataService.appendTaskUpdate({
|
|
197
|
+
taskId: task.id,
|
|
198
|
+
// A person's write names the coding agent this shell runs inside, when one was
|
|
199
|
+
// detected. Recorded as declared, never trusted (`declaredToolSource`).
|
|
200
|
+
data: { ...payload, ...(0, task_write_attribution_1.declaredToolSource)() },
|
|
201
|
+
});
|
|
156
202
|
}
|
|
157
203
|
catch (error) {
|
|
158
204
|
this.handleApiError(error);
|
|
159
205
|
}
|
|
206
|
+
const outcome = (0, task_write_attribution_1.taskWriteOutcome)(result, 'update');
|
|
160
207
|
if (flags.json)
|
|
161
|
-
return this.printJsonOperation(result, {
|
|
208
|
+
return this.printJsonOperation({ ...result, ...outcome }, {
|
|
162
209
|
resource: { kind: 'task_update', id: result?.update?.id },
|
|
163
210
|
task: { id: result?.update?.taskId },
|
|
164
211
|
...(typeof result?.idempotent === 'boolean' ? { replayed: result.idempotent } : {}),
|
|
165
212
|
});
|
|
166
|
-
// A replayed idempotency key answers the SAME stored record —
|
|
213
|
+
// A replayed idempotency key answers the SAME stored record — the outcome line says so,
|
|
167
214
|
// otherwise a retried write reads as a second write.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
:
|
|
215
|
+
for (const line of (0, task_write_attribution_1.taskWriteOutcomeLines)({
|
|
216
|
+
verb: 'Recorded',
|
|
217
|
+
what: `${flags.type} Update on ${task.id}${result?.resumePoint ? ' with a Resume Point' : ''}`,
|
|
218
|
+
}, outcome)) {
|
|
219
|
+
this.log(line);
|
|
220
|
+
}
|
|
171
221
|
}
|
|
172
222
|
}
|
|
173
223
|
exports.default = TasksUpdatesAdd;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { BaseCommand } from '../../../base-command';
|
|
2
|
+
/** Exported for its spec. A person's credential channel is shown when the Update recorded one. */
|
|
3
|
+
export declare function authorLabel(update: {
|
|
4
|
+
authoredBy?: Record<string, unknown>;
|
|
5
|
+
}): string;
|
|
2
6
|
export default class TasksUpdatesList extends BaseCommand {
|
|
3
7
|
static description: string;
|
|
4
8
|
static args: {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.authorLabel = authorLabel;
|
|
3
4
|
const list_output_1 = require("../../../lib/list-output");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const data_provider_1 = require("@skrr-ai/data-provider");
|
|
6
7
|
const base_command_1 = require("../../../base-command");
|
|
7
8
|
const task_resolver_1 = require("../../../lib/task-resolver");
|
|
9
|
+
/** Exported for its spec. A person's credential channel is shown when the Update recorded one. */
|
|
8
10
|
function authorLabel(update) {
|
|
9
11
|
const actor = update.authoredBy || {};
|
|
10
12
|
if (actor.kind === 'agent')
|
|
11
13
|
return `Agent ${actor.agentId}`;
|
|
12
14
|
if (actor.kind === 'human')
|
|
13
|
-
return `Human ${actor.userId}`;
|
|
15
|
+
return `Human ${actor.userId}${(0, data_provider_1.principalChannelSuffix)(actor)}`;
|
|
14
16
|
if (actor.kind === 'integration')
|
|
15
17
|
return `Integration ${actor.provider}`;
|
|
16
18
|
return `System ${actor.service || ''}`.trim();
|
|
@@ -20,6 +20,7 @@ export default class TasksWaive extends BaseCommand {
|
|
|
20
20
|
};
|
|
21
21
|
static flags: {
|
|
22
22
|
reason: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
23
|
+
'confirm-as-me': import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
23
24
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
24
25
|
};
|
|
25
26
|
run(): Promise<void>;
|
|
@@ -3,6 +3,7 @@ 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
5
|
const base_command_1 = require("../../base-command");
|
|
6
|
+
const task_write_attribution_1 = require("../../lib/task-write-attribution");
|
|
6
7
|
/**
|
|
7
8
|
* `skrr tasks waive <task> <expectation-id> --reason "<why>"`
|
|
8
9
|
*
|
|
@@ -33,27 +34,41 @@ class TasksWaive extends base_command_1.BaseCommand {
|
|
|
33
34
|
description: 'Why this is no longer required. Required — it is the record.',
|
|
34
35
|
required: true,
|
|
35
36
|
}),
|
|
37
|
+
'confirm-as-me': task_write_attribution_1.confirmAsMeFlag,
|
|
36
38
|
json: core_1.Flags.boolean({ description: 'Output as JSON' }),
|
|
37
39
|
};
|
|
38
40
|
async run() {
|
|
39
41
|
this.requireAuth();
|
|
40
42
|
const { args, flags } = await this.parse(TasksWaive);
|
|
43
|
+
// The same question `tasks expectations assess` asks (see `lib/task-write-attribution.ts`).
|
|
44
|
+
const refusal = (0, task_write_attribution_1.personJudgementGate)(this, {
|
|
45
|
+
confirmed: flags['confirm-as-me'],
|
|
46
|
+
judgement: `waiving ${args.expectation}`,
|
|
47
|
+
task: args.task,
|
|
48
|
+
});
|
|
49
|
+
if (refusal)
|
|
50
|
+
this.failWithCliError({ ...refusal, exit: 1, retryable: false });
|
|
41
51
|
let result;
|
|
42
52
|
try {
|
|
43
53
|
result = await data_provider_1.dataService.waiveTaskExpectation(args.task, {
|
|
44
54
|
expectationId: args.expectation,
|
|
45
55
|
reason: flags.reason,
|
|
56
|
+
// Recorded as declared, never trusted (`declaredToolSource`).
|
|
57
|
+
...(0, task_write_attribution_1.declaredToolSource)(),
|
|
46
58
|
});
|
|
47
59
|
}
|
|
48
60
|
catch (err) {
|
|
49
61
|
this.handleApiError(err);
|
|
50
62
|
return;
|
|
51
63
|
}
|
|
64
|
+
const outcome = (0, task_write_attribution_1.taskWriteOutcome)(result, 'assessment');
|
|
52
65
|
if (flags.json) {
|
|
53
|
-
this.log(JSON.stringify(result, null, 2));
|
|
66
|
+
this.log(JSON.stringify({ ...result, ...outcome }, null, 2));
|
|
54
67
|
return;
|
|
55
68
|
}
|
|
56
|
-
|
|
69
|
+
for (const line of (0, task_write_attribution_1.taskWriteOutcomeLines)({ verb: 'Recorded', what: `${args.expectation} as waived` }, outcome)) {
|
|
70
|
+
this.log(line);
|
|
71
|
+
}
|
|
57
72
|
}
|
|
58
73
|
}
|
|
59
74
|
exports.default = TasksWaive;
|
|
@@ -136,7 +136,7 @@
|
|
|
136
136
|
"id": "expectations",
|
|
137
137
|
"title": "Expectations",
|
|
138
138
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
139
|
-
"tokens":
|
|
139
|
+
"tokens": 996,
|
|
140
140
|
"aliases": [],
|
|
141
141
|
"explains": [
|
|
142
142
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -725,7 +725,7 @@
|
|
|
725
725
|
]
|
|
726
726
|
}
|
|
727
727
|
],
|
|
728
|
-
"hash": "
|
|
728
|
+
"hash": "991a5c2dd127fb3ac5fd0923eff6dbab9637fcf6832627ec0d58b50e5b1e5eda",
|
|
729
729
|
"tokens": 557
|
|
730
730
|
},
|
|
731
731
|
"routedIndex": {
|
|
@@ -865,7 +865,7 @@
|
|
|
865
865
|
"id": "expectations",
|
|
866
866
|
"title": "Expectations",
|
|
867
867
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
868
|
-
"tokens":
|
|
868
|
+
"tokens": 996,
|
|
869
869
|
"aliases": [],
|
|
870
870
|
"explains": [
|
|
871
871
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -1385,7 +1385,7 @@
|
|
|
1385
1385
|
]
|
|
1386
1386
|
}
|
|
1387
1387
|
],
|
|
1388
|
-
"hash": "
|
|
1388
|
+
"hash": "57110be667c5b948121bb29a19e4f106df0828f1aa204ed5886fe39bebf6fdf7",
|
|
1389
1389
|
"tokens": 506
|
|
1390
1390
|
},
|
|
1391
1391
|
"cards": {
|
|
@@ -1401,7 +1401,7 @@
|
|
|
1401
1401
|
"task-management"
|
|
1402
1402
|
],
|
|
1403
1403
|
"body": "## Concept model\n\n`skrr` is the durable record for work that must outlive this conversation.\n\n| Record | Question it answers |\n| --- | --- |\n| **Task** | What is owed, and where does it stand? |\n| **Expectation** | What must be true before the Task can close? |\n| **Update** | What meaningfully changed while the work ran? |\n| **Resume Point** | Where can an interrupted Run safely continue? |\n| **Result** | What did the work conclude or return? |\n| **Deliverable** | Which exact Resource version did the work produce? |\n| **Review** | Did another actor accept one exact Result? |\n| **Comment** | What does somebody need to answer? |\n| **Activity** | What happened, for the audit? A Run transcript is telemetry, not Activity. |\n\n## Decide\n\n- **Create a Task** without asking when work needs tracking across steps, sessions or a\n follow-up. Search first so you do not duplicate one, and create none for an action that\n finishes now.\n\nSearch with `skrr tasks list --q \"<query>\"`.\n\n- **Place it** in the Space the work clearly belongs to, or leave it unscoped. A new Space is a\n new boundary, never a home made for one Task.\n- **Update, Comment or Result**: an Update records a fact a later reader or Run needs; a Comment\n asks for a reply; the Result is the conclusion, submitted once. Never put a Result in a\n Comment, a transcript in Updates, or \"approved\" on a domain verdict such as NO-SHIP.\n\n## Workflow\n\n### Close out\n\n1. Record what exists: each Deliverable, bound to the Expectation it answers.\n2. Submit the Result. That does not close the Task.\n3. Read what is still owed: `skrr tasks expectations <task>`.\n4. Assess each Expectation you verified, citing evidence; one you could not check is `unmet`, with the reason.\n5. Read the Task back and report that state, not the one you intended.\n\nAn unmet Expectation or a `changes_requested` Review does not stop a close; it is recorded on it.\nSo if the work does not hold up, leave the Task open, say which Expectation failed, and record what\nblocks it as a `blocker` Update; its shape is in `updates`.\n\n## Authority\n\n| Actor | May do | Only a person may do |\n| --- | --- | --- |\n| Agent | Create and work Tasks; record Updates, Deliverables and Results; assess any Expectation that takes a judgement, citing evidence; review a Result another actor submitted | Waive an Expectation; confirm a Deliverable; make an attachment a Run input; close past a required Review |\n| Person | Everything in both columns | — |\n\nThe server cannot always tell an Agent from the person whose login it holds, so an accepted call\nis not permission: the right-hand column stays a person's even when the call would succeed. Never\nsupply or invent an Agent identity; the platform records who wrote each record.\nInside a Task's Run that is the Agent; in a session started with a person's login, it is that person.\n\nA required Review (`reviewPolicy` `required`) refuses a close only by a non-owner. The owner, and\nan Agent acting for the owner, can close without it, and that is the owner's decision. A non-owner\ncloses past it with `--force`, which records the override.\n\n## Live state\n\n- `skrr tasks show <task> --json` — status, Expectations, assignment and the Task URL.\n- `skrr tasks expectations <task>` — what is owed, with ids, and how far each one got.\n- `skrr tasks actionability <task>` — who can move the Task next, and why.\n- `skrr tasks review-queue --space <space-id>` — every judgement still outstanding in a Space.\n\n## Related guides\n\n- `spaces` — which Space, Project or Goal work belongs to, and who may work in a Space.\n- `agents` — which Agent you are, and where it runs.\n- `duties` — coming back to work later, and what an Agent keeps true over time.",
|
|
1404
|
-
"hash": "
|
|
1404
|
+
"hash": "0b64df0f193c5a3f3bc492dd0b60729ad2ff3f49c86d66d7f2a9c2d9436b2e41",
|
|
1405
1405
|
"tokens": 1158,
|
|
1406
1406
|
"sections": [
|
|
1407
1407
|
{
|
|
@@ -1526,7 +1526,7 @@
|
|
|
1526
1526
|
"id": "expectations",
|
|
1527
1527
|
"title": "Expectations",
|
|
1528
1528
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
1529
|
-
"tokens":
|
|
1529
|
+
"tokens": 996,
|
|
1530
1530
|
"aliases": [],
|
|
1531
1531
|
"explains": [
|
|
1532
1532
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2276,7 +2276,7 @@
|
|
|
2276
2276
|
"id": "expectations",
|
|
2277
2277
|
"title": "Expectations",
|
|
2278
2278
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2279
|
-
"tokens":
|
|
2279
|
+
"tokens": 996,
|
|
2280
2280
|
"aliases": [],
|
|
2281
2281
|
"explains": [
|
|
2282
2282
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2484,7 +2484,7 @@
|
|
|
2484
2484
|
"id": "expectations",
|
|
2485
2485
|
"title": "Expectations",
|
|
2486
2486
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2487
|
-
"tokens":
|
|
2487
|
+
"tokens": 996,
|
|
2488
2488
|
"aliases": [],
|
|
2489
2489
|
"explains": [
|
|
2490
2490
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2689,7 +2689,7 @@
|
|
|
2689
2689
|
"id": "expectations",
|
|
2690
2690
|
"title": "Expectations",
|
|
2691
2691
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2692
|
-
"tokens":
|
|
2692
|
+
"tokens": 996,
|
|
2693
2693
|
"aliases": [],
|
|
2694
2694
|
"explains": [
|
|
2695
2695
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -2906,7 +2906,7 @@
|
|
|
2906
2906
|
"id": "expectations",
|
|
2907
2907
|
"title": "Expectations",
|
|
2908
2908
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
2909
|
-
"tokens":
|
|
2909
|
+
"tokens": 996,
|
|
2910
2910
|
"aliases": [],
|
|
2911
2911
|
"explains": [
|
|
2912
2912
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3111,7 +3111,7 @@
|
|
|
3111
3111
|
"id": "expectations",
|
|
3112
3112
|
"title": "Expectations",
|
|
3113
3113
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3114
|
-
"tokens":
|
|
3114
|
+
"tokens": 996,
|
|
3115
3115
|
"aliases": [],
|
|
3116
3116
|
"explains": [
|
|
3117
3117
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3318,7 +3318,7 @@
|
|
|
3318
3318
|
"id": "expectations",
|
|
3319
3319
|
"title": "Expectations",
|
|
3320
3320
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3321
|
-
"tokens":
|
|
3321
|
+
"tokens": 996,
|
|
3322
3322
|
"aliases": [],
|
|
3323
3323
|
"explains": [
|
|
3324
3324
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3526,7 +3526,7 @@
|
|
|
3526
3526
|
"id": "expectations",
|
|
3527
3527
|
"title": "Expectations",
|
|
3528
3528
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3529
|
-
"tokens":
|
|
3529
|
+
"tokens": 996,
|
|
3530
3530
|
"aliases": [],
|
|
3531
3531
|
"explains": [
|
|
3532
3532
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3610,9 +3610,9 @@
|
|
|
3610
3610
|
"TASK_EXPECTATION_RESOURCE_MISMATCH",
|
|
3611
3611
|
"TASK_EXPECTATION_RESULT_MISMATCH"
|
|
3612
3612
|
],
|
|
3613
|
-
"body": "Read this when you write, read or assess what a Task must make true before it closes.\n\n## Write them so they can be judged\n\nAn Expectation is a sentence first; a typed check says how it can be assessed and never replaces\nthe sentence. Say what would satisfy it and how that could be checked: one written without a\nthought about verification cannot be settled honestly later. A required Deliverable is one typed\nExpectation, not a second list. When you create several across several Tasks, say how many and\nwhom they fall to.\n\nEditing an Expectation or the description advances the Task's specification and revokes every\nassessment already recorded, so fix the statement before anyone settles it.\n\n`--expect` on `tasks create` and `tasks update` takes `<kind>[/<format>][:<target>]` for a\nDeliverable, `@<preset>`, or plain words a person settles. On `tasks update` it replaces the whole list.\n\n## Assess what you verified\n\nYou may assess any Expectation that takes a judgement. The assessment records who made it, as\n`met (agent)` or `met (person)`, and a person can override it. The control is attribution, so what\nyou owe is evidence: cite what you actually checked. Assess what you verified, not what you\nintended or inferred from finishing. One you could not check is `unmet`, with the reason, because\n\"never assessed\" and \"could not verify\" send the next reader to different places. Never rewrite an\nExpectation to make it settleable, or delete one to hide that it was owed.\n\nA Deliverable Expectation settles the same way: record the Deliverable bound to it, then assess it\n`met` citing that Deliverable. Unless the Expectation names its own bar, `code` asks for a provider\nreceipt and every other kind for a person's confirmation; a `met` below the bar is accepted and the\nclose records the shortfall.\n\nA waiver says it is no longer owed, and that is a person's call. If it is the honest answer, say so\nin an Update or a Comment.\n\n```bash\nskrr tasks expectations <task-id> # what is owed, with ids, and how far each one got\nskrr tasks expectations assess <task-id> <expectation-id> \\\n --decision met \\\n --reason \"Ran the suite named in the statement; 49/49 pass\" \\\n --evidence code:<commit>\n```\n\n`--resource-link-id` cites a Deliverable and `--result-id` the Result. `--all` gives one decision to\nevery Expectation still awaiting a judgement.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `INVALID_TASK_EXPECTATION` | An Expectation written with the Task could not be read. | Fix the entry the refusal names. |\n| `TASK_EXPECTATION_NOT_FOUND` | The id is not an Expectation of the current specification. | Use an id of what is owed now. |\n| `TASK_SPEC_VERSION_MISMATCH` | The specification changed after you read it. | Read the Task again and act on the current one. |\n| `TASK_EXPECTATION_ASSESSMENT_IDEMPOTENCY_CONFLICT` | The key already names a different assessment. | Give this assessment its own key. |\n| `TASK_EXPECTATION_AUTOMATIC_EVIDENCE_REQUIRED` | An Agent assessed without citing a Result, Deliverable or evidence. | Cite what you checked. |\n| `TASK_EXPECTATION_ASSESSMENT_REASON_REQUIRED` | The reason is empty. | Say why. |\n| `TASK_EXPECTATION_WAIVER_HUMAN_REQUIRED` | An Agent tried to waive an Expectation. | Ask a person to decide. |\n| `TASK_EXPECTATION_RUN_NOT_APPLICABLE` | A person's assessment cited a Run. | Leave the Run out. |\n| `TASK_EXPECTATION_AGENT_RUN_MISMATCH` | The cited Run belongs to another Agent. | Cite your own Run. |\n| `TASK_EXPECTATION_RESOURCE_MISMATCH` | The cited Deliverable link is not on this Task. | Cite a link of this Task. |\n| `TASK_EXPECTATION_RESULT_MISMATCH` | The cited Result is not this Task's, at this specification. | Cite the current Result. |",
|
|
3614
|
-
"hash": "
|
|
3615
|
-
"tokens":
|
|
3613
|
+
"body": "Read this when you write, read or assess what a Task must make true before it closes.\n\n## Write them so they can be judged\n\nAn Expectation is a sentence first; a typed check says how it can be assessed and never replaces\nthe sentence. Say what would satisfy it and how that could be checked: one written without a\nthought about verification cannot be settled honestly later. A required Deliverable is one typed\nExpectation, not a second list. When you create several across several Tasks, say how many and\nwhom they fall to.\n\nEditing an Expectation or the description advances the Task's specification and revokes every\nassessment already recorded, so fix the statement before anyone settles it.\n\n`--expect` on `tasks create` and `tasks update` takes `<kind>[/<format>][:<target>]` for a\nDeliverable, `@<preset>`, or plain words a person settles. On `tasks update` it replaces the whole list.\n\n## Assess what you verified\n\nYou may assess any Expectation that takes a judgement. The assessment records who made it, as\n`met (agent)` or `met (person)`, and a person can override it. The control is attribution, so what\nyou owe is evidence: cite what you actually checked. Assess what you verified, not what you\nintended or inferred from finishing. One you could not check is `unmet`, with the reason, because\n\"never assessed\" and \"could not verify\" send the next reader to different places. Never rewrite an\nExpectation to make it settleable, or delete one to hide that it was owed.\n\nA Deliverable Expectation settles the same way: record the Deliverable bound to it, then assess it\n`met` citing that Deliverable. Unless the Expectation names its own bar, `code` asks for a provider\nreceipt and every other kind for a person's confirmation; a `met` below the bar is accepted and the\nclose records the shortfall.\n\nA waiver says it is no longer owed, and that is a person's call. If it is the honest answer, say so\nin an Update or a Comment.\n\nIn a session a person started by hand, your writes are recorded as their account, so an assessment\nyou make there is their judgement, not yours: it reads `met (person via CLI credential)`. Assess\nonly when they ask you to record it as theirs. Otherwise record what you checked with\n`skrr tasks updates add <task-id> --type verification` and tell them the assessment is theirs to\nmake.\n\n```bash\nskrr tasks expectations <task-id> # what is owed, with ids, and how far each one got\nskrr tasks expectations assess <task-id> <expectation-id> \\\n --decision met \\\n --reason \"Ran the suite named in the statement; 49/49 pass\" \\\n --evidence code:<commit>\n```\n\n`--resource-link-id` cites a Deliverable and `--result-id` the Result. `--all` gives one decision to\nevery Expectation still awaiting a judgement.\n\n## Refusals\n\n| Code | Cause | Fix |\n| --- | --- | --- |\n| `INVALID_TASK_EXPECTATION` | An Expectation written with the Task could not be read. | Fix the entry the refusal names. |\n| `TASK_EXPECTATION_NOT_FOUND` | The id is not an Expectation of the current specification. | Use an id of what is owed now. |\n| `TASK_SPEC_VERSION_MISMATCH` | The specification changed after you read it. | Read the Task again and act on the current one. |\n| `TASK_EXPECTATION_ASSESSMENT_IDEMPOTENCY_CONFLICT` | The key already names a different assessment. | Give this assessment its own key. |\n| `TASK_EXPECTATION_AUTOMATIC_EVIDENCE_REQUIRED` | An Agent assessed without citing a Result, Deliverable or evidence. | Cite what you checked. |\n| `TASK_EXPECTATION_ASSESSMENT_REASON_REQUIRED` | The reason is empty. | Say why. |\n| `TASK_EXPECTATION_WAIVER_HUMAN_REQUIRED` | An Agent tried to waive an Expectation. | Ask a person to decide. |\n| `TASK_EXPECTATION_RUN_NOT_APPLICABLE` | A person's assessment cited a Run. | Leave the Run out. |\n| `TASK_EXPECTATION_AGENT_RUN_MISMATCH` | The cited Run belongs to another Agent. | Cite your own Run. |\n| `TASK_EXPECTATION_RESOURCE_MISMATCH` | The cited Deliverable link is not on this Task. | Cite a link of this Task. |\n| `TASK_EXPECTATION_RESULT_MISMATCH` | The cited Result is not this Task's, at this specification. | Cite the current Result. |",
|
|
3614
|
+
"hash": "db0c8ded69dd3c96c045b24b7fcfb4a17116de13ee86f6c122c32a737eab17f2",
|
|
3615
|
+
"tokens": 996,
|
|
3616
3616
|
"sections": [
|
|
3617
3617
|
{
|
|
3618
3618
|
"id": "records",
|
|
@@ -3736,7 +3736,7 @@
|
|
|
3736
3736
|
"id": "expectations",
|
|
3737
3737
|
"title": "Expectations",
|
|
3738
3738
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3739
|
-
"tokens":
|
|
3739
|
+
"tokens": 996,
|
|
3740
3740
|
"aliases": [],
|
|
3741
3741
|
"explains": [
|
|
3742
3742
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -3944,7 +3944,7 @@
|
|
|
3944
3944
|
"id": "expectations",
|
|
3945
3945
|
"title": "Expectations",
|
|
3946
3946
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
3947
|
-
"tokens":
|
|
3947
|
+
"tokens": 996,
|
|
3948
3948
|
"aliases": [],
|
|
3949
3949
|
"explains": [
|
|
3950
3950
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -4150,7 +4150,7 @@
|
|
|
4150
4150
|
"id": "expectations",
|
|
4151
4151
|
"title": "Expectations",
|
|
4152
4152
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
4153
|
-
"tokens":
|
|
4153
|
+
"tokens": 996,
|
|
4154
4154
|
"aliases": [],
|
|
4155
4155
|
"explains": [
|
|
4156
4156
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -4350,7 +4350,7 @@
|
|
|
4350
4350
|
"id": "expectations",
|
|
4351
4351
|
"title": "Expectations",
|
|
4352
4352
|
"readWhen": "you write, read or assess what a Task must make true before it closes",
|
|
4353
|
-
"tokens":
|
|
4353
|
+
"tokens": 996,
|
|
4354
4354
|
"aliases": [],
|
|
4355
4355
|
"explains": [
|
|
4356
4356
|
"INVALID_TASK_EXPECTATION",
|
|
@@ -15,10 +15,12 @@ export interface ActivityItem {
|
|
|
15
15
|
sourceKind: string;
|
|
16
16
|
timestamp: string;
|
|
17
17
|
status: string;
|
|
18
|
+
sourceStatus?: string;
|
|
18
19
|
title: string;
|
|
19
20
|
sourceRef: ActivitySourceRef;
|
|
20
21
|
agentId?: string;
|
|
21
22
|
dutyId?: string;
|
|
23
|
+
otherWakes?: number;
|
|
22
24
|
/** Task executions only: what the ledger proves about handing the run to its executor. */
|
|
23
25
|
dispatch?: {
|
|
24
26
|
state: string;
|
|
@@ -88,7 +90,7 @@ export declare function runtimeCell(item: ActivityItem): string;
|
|
|
88
90
|
/** The activity table, shared by the feed and the older-activity scans so the two never drift. */
|
|
89
91
|
export declare function renderActivityItems(items: ActivityItem[], log: (line: string) => void): void;
|
|
90
92
|
export declare function renderAgentActivity(response: ActivityResponse, log: (line: string) => void): void;
|
|
91
|
-
export type ActivityScanSource = 'chat' | 'group-chat' | 'task';
|
|
93
|
+
export type ActivityScanSource = 'chat' | 'group-chat' | 'task' | 'trigger';
|
|
92
94
|
export interface ActivityScanResponse {
|
|
93
95
|
object: string;
|
|
94
96
|
items: ActivityItem[];
|