@skrr-ai/cli 0.1.199 → 0.1.202

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 (62) hide show
  1. package/dist/commands/agents/always-on/recovery-close.d.ts +3 -4
  2. package/dist/commands/agents/always-on/recovery-close.js +5 -5
  3. package/dist/commands/agents/always-on/recovery-review.d.ts +1 -1
  4. package/dist/commands/agents/always-on/recovery-review.js +4 -3
  5. package/dist/commands/agents/create.d.ts +4 -2
  6. package/dist/commands/agents/create.js +29 -4
  7. package/dist/commands/duties/check-now.d.ts +1 -0
  8. package/dist/commands/duties/check-now.js +17 -1
  9. package/dist/commands/duties/create.js +95 -9
  10. package/dist/commands/duties/observations.d.ts +1 -0
  11. package/dist/commands/duties/observations.js +12 -3
  12. package/dist/commands/duties/operating-review.js +34 -2
  13. package/dist/commands/duties/pack/plan.d.ts +1 -0
  14. package/dist/commands/duties/pack/plan.js +30 -0
  15. package/dist/commands/duties/plan.d.ts +1 -0
  16. package/dist/commands/duties/plan.js +24 -0
  17. package/dist/commands/duties/preflight.d.ts +3 -3
  18. package/dist/commands/duties/preflight.js +36 -12
  19. package/dist/commands/duties/receipt.d.ts +1 -0
  20. package/dist/commands/duties/receipt.js +35 -11
  21. package/dist/commands/duties/roster.js +29 -6
  22. package/dist/commands/duties/status.js +19 -11
  23. package/dist/commands/duties/update.js +1 -1
  24. package/dist/commands/goals/create.js +1 -1
  25. package/dist/commands/goals/key-results/create.js +1 -1
  26. package/dist/commands/machines/computer-adoption.js +1 -1
  27. package/dist/commands/machines/dedicated/audit.js +1 -1
  28. package/dist/commands/machines/dedicated/catalog.js +1 -1
  29. package/dist/commands/machines/dedicated/current.js +1 -1
  30. package/dist/commands/machines/dedicated/git-status.js +1 -1
  31. package/dist/commands/machines/dedicated/health-check.js +1 -1
  32. package/dist/commands/machines/dedicated/logs.js +1 -1
  33. package/dist/commands/machines/dedicated/price-book.js +1 -1
  34. package/dist/commands/machines/dedicated/sign-in-status.js +1 -1
  35. package/dist/commands/machines/dedicated/stat.js +1 -1
  36. package/dist/commands/machines/services/ls.js +1 -1
  37. package/dist/commands/machines/shared.js +1 -1
  38. package/dist/commands/machines/shares.js +1 -1
  39. package/dist/commands/tasks/result/show.d.ts +1 -0
  40. package/dist/commands/tasks/result/show.js +19 -1
  41. package/dist/commands/triggers/capabilities.js +11 -2
  42. package/dist/commands/triggers/create.d.ts +1 -1
  43. package/dist/commands/triggers/create.js +15 -6
  44. package/dist/commands/triggers/fire-detail.js +7 -0
  45. package/dist/generated/agent-guides.json +36 -36
  46. package/dist/lib/daemon-setup.js +1 -1
  47. package/dist/lib/duties.d.ts +7 -5
  48. package/dist/lib/duties.js +32 -19
  49. package/dist/lib/duty-loop-status.d.ts +2 -0
  50. package/dist/lib/duty-loop-status.js +26 -1
  51. package/dist/lib/duty-product.js +52 -3
  52. package/dist/lib/task-runtime-headers.d.ts +2 -0
  53. package/dist/lib/task-runtime-headers.js +26 -9
  54. package/dist/lib/tasks.js +11 -3
  55. package/dist/lib/usage-discovery.js +2 -2
  56. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.d.ts +3 -1
  57. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/dutyExecutionContract.js +6 -2
  58. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.d.ts +3 -1
  59. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/dutyExecutionContract.js +6 -4
  60. package/dist/node_modules/@skrr-ai/data-provider/index.js +10384 -10375
  61. package/oclif.manifest.json +54 -11
  62. package/package.json +5 -2
@@ -7,8 +7,28 @@ exports.deliveryInput = deliveryInput;
7
7
  exports.renderExecutionReceipt = renderExecutionReceipt;
8
8
  exports.renderExecutionReceiptQuarterlyMetrics = renderExecutionReceiptQuarterlyMetrics;
9
9
  const data_provider_1 = require("@skrr-ai/data-provider");
10
+ const search_display_1 = require("./search-display");
10
11
  const DELIVERY_INPUT_RE = /-/g;
11
12
  const RENDER_EXECUTION_RECEIPT_RE = /^[A-Za-z0-9_.:-]+$/;
13
+ const RECEIPT_PHASE_MARKS = {
14
+ done: '✓',
15
+ working: '→',
16
+ waiting: '…',
17
+ blocked: '!',
18
+ failed: '×',
19
+ skipped: '–',
20
+ };
21
+ const PEER_VERIFICATION_LABELS = {
22
+ applied: 'Peer Duty changed · waiting for evidence',
23
+ verified: 'Peer Duty change verified',
24
+ acceptance_not_met: 'Peer Duty acceptance not met',
25
+ blocked: 'Peer Duty verification blocked',
26
+ };
27
+ const PEER_VERIFICATION_BLOCKERS = new Map([
28
+ ['peer_change_not_current', 'The target Duty is already on another revision.'],
29
+ ['peer_evidence_unproven', 'This revision still needs qualifying evidence from a target Run.'],
30
+ ['target_or_observation_unavailable', 'The target Duty or its declared observation is unavailable.'],
31
+ ]);
12
32
  exports.DUTY_DELIVERY_CHOICES = [
13
33
  'report-only',
14
34
  'local-patch',
@@ -47,6 +67,34 @@ function deliveryInput(mode, options = {}) {
47
67
  }
48
68
  function renderExecutionReceipt(receipt, log, verbose = false) {
49
69
  log(receipt.summary);
70
+ if (receipt.scope === 'exact_run')
71
+ log('This receipt covers the selected Run.');
72
+ if (receipt.decisionEvidence?.length) {
73
+ log('Agent-reported observations');
74
+ for (const observation of receipt.decisionEvidence) {
75
+ log(` ${(0, search_display_1.searchDisplayText)(observation.label)}: ${(0, search_display_1.searchDisplayText)(observation.state)}`);
76
+ }
77
+ }
78
+ if (receipt.peerVerification) {
79
+ const { status, reason, receipt: change } = receipt.peerVerification;
80
+ log(PEER_VERIFICATION_LABELS[status]);
81
+ const blocker = reason && PEER_VERIFICATION_BLOCKERS.get(reason);
82
+ if (status === 'blocked' && blocker)
83
+ log(` ${blocker}`);
84
+ if (change) {
85
+ const { targetDutyId, previousVersion, version, verification } = change;
86
+ const query = new URLSearchParams({ view: 'activity' });
87
+ if (verification) {
88
+ query.set('checkId', verification.targetCheckId);
89
+ query.set('runId', verification.targetRunId);
90
+ query.set('observationId', verification.observationId);
91
+ }
92
+ const path = `/duties/${encodeURIComponent(targetDutyId)}?${query}`;
93
+ log(` Target Duty v${previousVersion} → v${version}: ${path}`);
94
+ if (verification)
95
+ log(` Observation: ${verification.observationId}`);
96
+ }
97
+ }
50
98
  if (receipt.runtime) {
51
99
  const identity = receipt.runtime.name || receipt.runtime.id || 'the selected runtime';
52
100
  log(`Runtime: ${identity}${receipt.runtime.kind ? ` · ${receipt.runtime.kind}` : ''}${receipt.runtime.provider ? ` · ${receipt.runtime.provider}` : ''}`);
@@ -57,10 +105,11 @@ function renderExecutionReceipt(receipt, log, verbose = false) {
57
105
  // open it; different evidence stays on the phase it belongs to. The web receipt does the same.
58
106
  const printedEvidence = new Set();
59
107
  for (const phase of receipt.phases) {
60
- const mark = { done: '✓', working: '→', waiting: '…', failed: '×', skipped: '–' }[phase.status];
61
- const label = phase.phase === 'observed' && receipt.checkKind === 'follow_through'
108
+ const mark = RECEIPT_PHASE_MARKS[phase.status];
109
+ const title = phase.phase === 'delivered' && phase.status === 'blocked' ? 'delivery' : phase.phase;
110
+ const label = title === 'observed' && receipt.checkKind === 'follow_through'
62
111
  ? 'Check'
63
- : phase.phase[0].toUpperCase() + phase.phase.slice(1);
112
+ : title[0].toUpperCase() + title.slice(1);
64
113
  log(` ${mark} ${label}: ${phase.summary}${phase.at ? ` · ${phase.at}` : ''}`);
65
114
  for (const evidence of phase.evidence) {
66
115
  const location = evidence.url || evidence.path;
@@ -1,3 +1,5 @@
1
+ export declare const SPACE_REVIEW_WORK_RUNTIME_PROOF_VERSION = 1;
2
+ export declare const SPACE_REVIEW_RESULT_RUNTIME_PROOF_VERSION = 1;
1
3
  /**
2
4
  * Account Authorization decides access; a separate server-issued session
3
5
  * credential proves Agent authorship. Environment ids are selectors only.
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SPACE_REVIEW_RESULT_RUNTIME_PROOF_VERSION = exports.SPACE_REVIEW_WORK_RUNTIME_PROOF_VERSION = void 0;
3
4
  exports.withTaskRuntimeHeaders = withTaskRuntimeHeaders;
4
5
  exports.taskRuntimeRedirectOptions = taskRuntimeRedirectOptions;
5
6
  const WITH_TASK_RUNTIME_HEADERS_RE = /^\/api\/tasks(?:\/|$)/;
@@ -7,6 +8,11 @@ const WITH_TASK_RUNTIME_HEADERS_RE_2 = /^\/api\/agents\/[^/]+\/agent-actions\/[^
7
8
  const WITH_TASK_RUNTIME_HEADERS_RE_3 = /^\/api\/(?:shortcuts|task-templates)\/[^/]+\/(?:instantiate|trigger)\/?$/;
8
9
  const WITH_TASK_RUNTIME_HEADERS_RE_4 = /^\/api\/templates\/[^/]+\/(?:instantiate|fork)\/?$/;
9
10
  const WITH_TASK_RUNTIME_HEADERS_RE_5 = /^\/api\/store\/services\/[^/]+\/install\/?$/;
11
+ const KEY_RESULT_LIST = /^\/api\/goals\/[^/]+\/key-results\/?$/;
12
+ const KEY_RESULT_ASSESS = /^\/api\/goals\/[^/]+\/key-results\/[^/]+\/assessments\/?$/;
13
+ const EXACT_TASK_RESULT = /^\/api\/tasks\/[^/]+\/results\/[^/]+\/?$/;
14
+ exports.SPACE_REVIEW_WORK_RUNTIME_PROOF_VERSION = 1;
15
+ exports.SPACE_REVIEW_RESULT_RUNTIME_PROOF_VERSION = 1;
10
16
  /**
11
17
  * Account Authorization decides access; a separate server-issued session
12
18
  * credential proves Agent authorship. Environment ids are selectors only.
@@ -15,14 +21,16 @@ const WITH_TASK_RUNTIME_HEADERS_RE_5 = /^\/api\/store\/services\/[^/]+\/install\
15
21
  */
16
22
  function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env) {
17
23
  const sent = { ...headers };
18
- // A companion credential never travels on a read, another API surface,
19
- // or a caller-selected header. Preserve existing nonsecret correlation
20
- // hints outside Task authorship mutations for other APIs' provenance checks.
24
+ // A companion credential travels only on the exact managed operations below.
25
+ // Preserve nonsecret correlation hints for other APIs' provenance checks.
21
26
  for (const key of Object.keys(sent)) {
22
27
  if (key.toLowerCase() === 'x-oversky-session-authorization')
23
28
  delete sent[key];
24
29
  }
25
- if (!['POST', 'PUT', 'PATCH', 'DELETE'].includes(method.toUpperCase()))
30
+ const verb = method.toUpperCase();
31
+ const mutation = ['POST', 'PUT', 'PATCH', 'DELETE'].includes(verb);
32
+ const reviewSpace = env.OVERSKY_SPACE_REVIEW_WORK === '1' ? env.OVERSKY_SESSION_SPACE_ID : undefined;
33
+ if (!mutation && !(reviewSpace && verb === 'GET'))
26
34
  return sent;
27
35
  const refuseOrigin = () => Object.assign(new Error('Managed Task requests require their bound server origin; refusing account-attributed fallback.'), {
28
36
  code: 'SESSION_TASK_ORIGIN_MISMATCH',
@@ -39,14 +47,23 @@ function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env)
39
47
  // Some platform operations materialize Tasks outside the Task router. Keep
40
48
  // their exact POST routes here; action/library edits, picker reads and other
41
49
  // integration routes must never receive the companion credential.
42
- const taskMutation = WITH_TASK_RUNTIME_HEADERS_RE.test(target.pathname);
43
- const taskCreation = method.toUpperCase() === 'POST' && [
50
+ const { pathname } = target;
51
+ const taskMutation = mutation && WITH_TASK_RUNTIME_HEADERS_RE.test(pathname);
52
+ const attributedWrite = verb === 'POST' && [
44
53
  WITH_TASK_RUNTIME_HEADERS_RE_2,
45
54
  WITH_TASK_RUNTIME_HEADERS_RE_3,
46
55
  WITH_TASK_RUNTIME_HEADERS_RE_4,
47
56
  WITH_TASK_RUNTIME_HEADERS_RE_5,
48
- ].some((route) => route.test(target.pathname));
49
- if (!taskMutation && !taskCreation)
57
+ KEY_RESULT_ASSESS,
58
+ ].some((route) => route.test(pathname));
59
+ const spacePath = reviewSpace ? `/api/spaces/${encodeURIComponent(reviewSpace)}` : undefined;
60
+ const reviewProof = spacePath && ((verb === 'GET' && (KEY_RESULT_LIST.test(pathname) || pathname === `${spacePath}/goals` ||
61
+ (EXACT_TASK_RESULT.test(pathname) && target.searchParams.getAll('reviewSpaceId').length === 1 &&
62
+ target.searchParams.get('reviewSpaceId') === reviewSpace) ||
63
+ (pathname === '/api/tasks' && target.searchParams.getAll('spaceId').length === 1 &&
64
+ target.searchParams.get('spaceId') === reviewSpace))) ||
65
+ (verb === 'POST' && pathname === `${spacePath}/wiki/pages`));
66
+ if (!taskMutation && !attributedWrite && !reviewProof)
50
67
  return sent;
51
68
  const names = new Set(['x-oversky-agent-id', 'x-oversky-session-id', 'x-oversky-autonomous-run-id']);
52
69
  for (const key of Object.keys(sent))
@@ -65,7 +82,7 @@ function withTaskRuntimeHeaders(headers, requestUrl, method, env = process.env)
65
82
  throw refuseOrigin();
66
83
  }
67
84
  // The companion credential only travels to the managed runtime's server
68
- // and only to Task mutations/materialization. Bound routes use it as Authorization.
85
+ // and only to the attributed operations and scoped Review receipts above.
69
86
  if (target.origin !== trusted.origin)
70
87
  throw refuseOrigin();
71
88
  if (!sessionId || !token) {
package/dist/lib/tasks.js CHANGED
@@ -1106,11 +1106,19 @@ function projectMatchesId(project, ref) {
1106
1106
  }
1107
1107
  async function getCachedProject(projectId, cache) {
1108
1108
  const load = async () => {
1109
+ if ((0, projects_1.looksLikeCanonicalProjectId)(projectId) && !looksLikeStorageId(projectId)) {
1110
+ try {
1111
+ return await projects_1.projectApi.get(projectId);
1112
+ }
1113
+ catch (error) {
1114
+ if (error?.code !== 'PROJECT_LOOKUP_UNSUPPORTED') {
1115
+ throw error;
1116
+ }
1117
+ }
1118
+ }
1109
1119
  const filtered = await projects_1.projectApi.search({ q: projectId, limit: 20 });
1110
1120
  let exact = (0, projects_1.projectsFrom)(filtered).filter((project) => projectMatchesId(project, projectId));
1111
- // The cross-space endpoint's `q` contract covers title/description/ref,
1112
- // not UUID. Fall back to the bounded visible project catalog so canonical
1113
- // IDs still resolve without inventing a second project read endpoint.
1121
+ // Older servers and pasted Mongo storage ids still use the visible catalog.
1114
1122
  if (exact.length === 0) {
1115
1123
  const catalog = await projects_1.projectApi.search({ limit: 200 });
1116
1124
  exact = (0, projects_1.projectsFrom)(catalog).filter((project) => projectMatchesId(project, projectId));
@@ -140,8 +140,8 @@ function buildUsageReference(manifest, domainInput, options = {}) {
140
140
  }
141
141
  function renderUsageOverview(overview) {
142
142
  const lines = [
143
- `skrr command domains (${overview.domains.length}; manifest-derived).`,
144
- 'Read one domain at a time: skrr usage <domain>.',
143
+ `skrr command domains (${overview.domains.length}).`,
144
+ 'Read a domain with skrr usage <domain>.',
145
145
  ...overview.domains.map(({ domain }) => domain),
146
146
  ];
147
147
  return lines.join('\n');
@@ -2,6 +2,7 @@
2
2
  export declare const DUTY_EXECUTION_CONTRACT_VERSION: 3;
3
3
  export declare const DUTY_EXECUTION_CONTRACT_CAPABILITY = "duty_execution_contract_v3";
4
4
  export declare const PLATFORM_DUTY_SCRATCH_CAPABILITY = "platform_duty_scratch_v1";
5
+ export declare const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = "report_only_duty_scratch_v1";
5
6
  export interface DutyExecutionContract {
6
7
  version: 3;
7
8
  kind: 'duty' | 'task_delivery';
@@ -42,12 +43,13 @@ export interface DutyExecutionContract {
42
43
  return: 'duty_result_v1' | 'task_output';
43
44
  }
44
45
  export declare function eventRepository(event: Record<string, unknown> | null | undefined): string;
45
- /** The platform's relationship Duties use server evidence and need no checkout. */
46
+ /** Relationship Duties and unrooted reports without repository inputs can use empty scratch. */
46
47
  export declare function usesPlatformDutyScratch(input: {
47
48
  dutyId?: string;
48
49
  delivery?: DutyExecutionContract['delivery'];
49
50
  workspace?: DutyExecutionContract['workspace'];
50
51
  event?: DutyExecutionContract['event'];
52
+ unrootedReport?: boolean;
51
53
  }): boolean;
52
54
  /** One strict parser used at storage admission and at runtime admission. */
53
55
  export declare function normalizeDutyExecutionContract(value: unknown): DutyExecutionContract | null;
@@ -21,6 +21,7 @@ __export(dutyExecutionContract_exports, {
21
21
  DUTY_EXECUTION_CONTRACT_CAPABILITY: () => DUTY_EXECUTION_CONTRACT_CAPABILITY,
22
22
  DUTY_EXECUTION_CONTRACT_VERSION: () => DUTY_EXECUTION_CONTRACT_VERSION,
23
23
  PLATFORM_DUTY_SCRATCH_CAPABILITY: () => PLATFORM_DUTY_SCRATCH_CAPABILITY,
24
+ REPORT_ONLY_DUTY_SCRATCH_CAPABILITY: () => REPORT_ONLY_DUTY_SCRATCH_CAPABILITY,
24
25
  eventRepository: () => eventRepository,
25
26
  normalizeDutyExecutionContract: () => normalizeDutyExecutionContract,
26
27
  usesPlatformDutyScratch: () => usesPlatformDutyScratch
@@ -41,6 +42,7 @@ const VALID_DELIVERY_SOURCE_RE_2 = /^[a-f0-9]{40,64}$/i;
41
42
  const DUTY_EXECUTION_CONTRACT_VERSION = 3;
42
43
  const DUTY_EXECUTION_CONTRACT_CAPABILITY = "duty_execution_contract_v3";
43
44
  const PLATFORM_DUTY_SCRATCH_CAPABILITY = "platform_duty_scratch_v1";
45
+ const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = "report_only_duty_scratch_v1";
44
46
  const DELIVERY_MODES = /* @__PURE__ */ new Set([
45
47
  "report_only",
46
48
  "local_patch",
@@ -405,8 +407,9 @@ function eventRepository(event) {
405
407
  return VALID_DELIVERY_RE.test(String(value || "")) ? String(value).toLowerCase() : "";
406
408
  }
407
409
  function usesPlatformDutyScratch(input) {
408
- const { dutyId, delivery, workspace, event } = input;
409
- return typeof dutyId === "string" && /^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId) && delivery?.mode === "report_only" && !delivery.repo && !delivery.baseBranch && workspace?.kind === "ephemeral" && workspace.base === "agent_working_directory" && !workspace.fetchBase && !event?.repo && !event?.repository && !eventRepository(event);
410
+ const { dutyId, delivery, workspace, event, unrootedReport } = input;
411
+ const relationshipDuty = typeof dutyId === "string" && /^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId);
412
+ return (relationshipDuty || unrootedReport === true) && delivery?.mode === "report_only" && !delivery.repo && !delivery.baseBranch && workspace?.kind === "ephemeral" && workspace.base === "agent_working_directory" && !workspace.fetchBase && !event?.repo && !event?.repository && !eventRepository(event);
410
413
  }
411
414
  function failedGitHubCheck(event) {
412
415
  const eventType = String(event?.eventType || event?.type || "").toLowerCase();
@@ -447,6 +450,7 @@ function normalizeDutyExecutionContract(value) {
447
450
  DUTY_EXECUTION_CONTRACT_CAPABILITY,
448
451
  DUTY_EXECUTION_CONTRACT_VERSION,
449
452
  PLATFORM_DUTY_SCRATCH_CAPABILITY,
453
+ REPORT_ONLY_DUTY_SCRATCH_CAPABILITY,
450
454
  eventRepository,
451
455
  normalizeDutyExecutionContract,
452
456
  usesPlatformDutyScratch
@@ -2,6 +2,7 @@
2
2
  export declare const DUTY_EXECUTION_CONTRACT_VERSION: 3;
3
3
  export declare const DUTY_EXECUTION_CONTRACT_CAPABILITY = "duty_execution_contract_v3";
4
4
  export declare const PLATFORM_DUTY_SCRATCH_CAPABILITY = "platform_duty_scratch_v1";
5
+ export declare const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = "report_only_duty_scratch_v1";
5
6
  export interface DutyExecutionContract {
6
7
  version: 3;
7
8
  kind: 'duty' | 'task_delivery';
@@ -42,12 +43,13 @@ export interface DutyExecutionContract {
42
43
  return: 'duty_result_v1' | 'task_output';
43
44
  }
44
45
  export declare function eventRepository(event: Record<string, unknown> | null | undefined): string;
45
- /** The platform's relationship Duties use server evidence and need no checkout. */
46
+ /** Relationship Duties and unrooted reports without repository inputs can use empty scratch. */
46
47
  export declare function usesPlatformDutyScratch(input: {
47
48
  dutyId?: string;
48
49
  delivery?: DutyExecutionContract['delivery'];
49
50
  workspace?: DutyExecutionContract['workspace'];
50
51
  event?: DutyExecutionContract['event'];
52
+ unrootedReport?: boolean;
51
53
  }): boolean;
52
54
  /** One strict parser used at storage admission and at runtime admission. */
53
55
  export declare function normalizeDutyExecutionContract(value: unknown): DutyExecutionContract | null;
@@ -15,6 +15,7 @@ const VALID_DELIVERY_SOURCE_RE_2 = /^[a-f0-9]{40,64}$/i;
15
15
  export const DUTY_EXECUTION_CONTRACT_VERSION = 3;
16
16
  export const DUTY_EXECUTION_CONTRACT_CAPABILITY = 'duty_execution_contract_v3';
17
17
  export const PLATFORM_DUTY_SCRATCH_CAPABILITY = 'platform_duty_scratch_v1';
18
+ export const REPORT_ONLY_DUTY_SCRATCH_CAPABILITY = 'report_only_duty_scratch_v1';
18
19
  const DELIVERY_MODES = new Set([
19
20
  'report_only',
20
21
  'local_patch',
@@ -477,11 +478,12 @@ export function eventRepository(event) {
477
478
  const value = event.repoFullName || repository?.full_name || repository?.fullName;
478
479
  return VALID_DELIVERY_RE.test(String(value || '')) ? String(value).toLowerCase() : '';
479
480
  }
480
- /** The platform's relationship Duties use server evidence and need no checkout. */
481
+ /** Relationship Duties and unrooted reports without repository inputs can use empty scratch. */
481
482
  export function usesPlatformDutyScratch(input) {
482
- const { dutyId, delivery, workspace, event } = input;
483
- return (typeof dutyId === 'string' &&
484
- /^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId) &&
483
+ const { dutyId, delivery, workspace, event, unrootedReport } = input;
484
+ const relationshipDuty = typeof dutyId === 'string' &&
485
+ /^obj_system_(conversation_continuity|relationship_pulse|duty_incubator|open_loop_closer)_[a-f0-9]{24}$/.test(dutyId);
486
+ return ((relationshipDuty || unrootedReport === true) &&
485
487
  delivery?.mode === 'report_only' &&
486
488
  !delivery.repo &&
487
489
  !delivery.baseBranch &&