@skrr-ai/cli 0.1.93 → 0.1.94

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 (60) hide show
  1. package/dist/commands/agents/operating-plan.d.ts +11 -0
  2. package/dist/commands/agents/operating-plan.js +54 -0
  3. package/dist/commands/agents/roles/example.d.ts +11 -0
  4. package/dist/commands/agents/roles/example.js +30 -0
  5. package/dist/commands/{commitments/mode.d.ts → agents/roles/export.d.ts} +5 -5
  6. package/dist/commands/agents/roles/export.js +81 -0
  7. package/dist/commands/agents/roles/install.d.ts +12 -0
  8. package/dist/commands/agents/roles/install.js +48 -0
  9. package/dist/commands/agents/roles/list.d.ts +11 -0
  10. package/dist/commands/agents/roles/list.js +36 -0
  11. package/dist/commands/agents/roles/preview.d.ts +14 -0
  12. package/dist/commands/agents/roles/preview.js +49 -0
  13. package/dist/commands/agents/roles/withdraw.d.ts +13 -0
  14. package/dist/commands/agents/roles/withdraw.js +43 -0
  15. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.d.ts +5 -7
  16. package/dist/commands/commitments/{autonomy-requests → cadence-requests}/decide.js +13 -15
  17. package/dist/commands/commitments/cost.d.ts +1 -1
  18. package/dist/commands/commitments/cost.js +1 -1
  19. package/dist/commands/commitments/create.d.ts +0 -7
  20. package/dist/commands/commitments/create.js +9 -98
  21. package/dist/commands/commitments/delivery.js +3 -21
  22. package/dist/commands/commitments/doctor.js +28 -27
  23. package/dist/commands/commitments/effective-policy.js +5 -36
  24. package/dist/commands/commitments/evaluations.d.ts +15 -0
  25. package/dist/commands/commitments/evaluations.js +54 -0
  26. package/dist/commands/commitments/pack/activate.d.ts +11 -0
  27. package/dist/commands/commitments/pack/activate.js +22 -0
  28. package/dist/commands/commitments/pack/bind.js +1 -1
  29. package/dist/commands/commitments/remediate.js +2 -5
  30. package/dist/commands/commitments/show.js +1 -1
  31. package/dist/commands/commitments/update.js +9 -9
  32. package/dist/commands/commitments/wake-capabilities.d.ts +1 -3
  33. package/dist/commands/commitments/wake-capabilities.js +5 -21
  34. package/dist/lib/commitment-product.d.ts +0 -6
  35. package/dist/lib/commitment-product.js +1 -30
  36. package/dist/lib/commitments.d.ts +9 -45
  37. package/dist/lib/commitments.js +24 -95
  38. package/dist/lib/northstars.js +1 -1
  39. package/dist/lib/roles.d.ts +98 -0
  40. package/dist/lib/roles.js +45 -0
  41. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.d.ts +45 -0
  42. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/commitmentExecutionContract.js +550 -0
  43. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.d.ts +7 -44
  44. package/dist/node_modules/@skrr-ai/auth-core/dist/cjs/sessionPermissionAuthority.js +8 -47
  45. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.d.ts +45 -0
  46. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/commitmentExecutionContract.js +545 -0
  47. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.d.ts +7 -44
  48. package/dist/node_modules/@skrr-ai/auth-core/dist/esm/sessionPermissionAuthority.js +8 -47
  49. package/dist/node_modules/@skrr-ai/auth-core/package.json +11 -1
  50. package/dist/node_modules/@skrr-ai/data-provider/index.js +7316 -7203
  51. package/dist/node_modules/@skrr-ai/data-provider/package.json +2 -2
  52. package/oclif.manifest.json +22528 -22170
  53. package/package.json +5 -2
  54. package/dist/commands/commitments/autonomy.d.ts +0 -30
  55. package/dist/commands/commitments/autonomy.js +0 -67
  56. package/dist/commands/commitments/mode.js +0 -58
  57. package/dist/commands/commitments/pack/promote.d.ts +0 -19
  58. package/dist/commands/commitments/pack/promote.js +0 -46
  59. package/dist/commands/commitments/pack/shadow.d.ts +0 -20
  60. package/dist/commands/commitments/pack/shadow.js +0 -42
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hasEventCapableWatchedSource = hasEventCapableWatchedSource;
4
4
  exports.assertEventDrivenWatchedSource = assertEventDrivenWatchedSource;
5
5
  exports.createCadenceFromFlags = createCadenceFromFlags;
6
- exports.autonomyStagingNotice = autonomyStagingNotice;
7
6
  const core_1 = require("@oclif/core");
8
7
  const base_command_1 = require("../../base-command");
9
8
  const web_url_1 = require("../../lib/web-url");
@@ -145,30 +144,6 @@ function createCadenceFromFlags({ eventDriven, cadence: cadenceInput, cadenceMod
145
144
  * be said out loud at the CLI boundary; otherwise a successful create response
146
145
  * reads like the requested autonomy is live when something else is running.
147
146
  */
148
- function autonomyStagingNotice({ payload, commitment, bin, }) {
149
- const requestedPolicy = payload.policy && typeof payload.policy === 'object' && !Array.isArray(payload.policy)
150
- ? payload.policy
151
- : {};
152
- const returnedPolicy = commitment.policy && typeof commitment.policy === 'object' && !Array.isArray(commitment.policy)
153
- ? commitment.policy
154
- : {};
155
- const requested = typeof payload.mode === 'string'
156
- ? payload.mode
157
- : typeof requestedPolicy.autonomyMode === 'string'
158
- ? requestedPolicy.autonomyMode
159
- : '';
160
- const admitted = typeof returnedPolicy.autonomyMode === 'string' ? returnedPolicy.autonomyMode : '';
161
- if (!requested ||
162
- (0, commitment_product_1.productMode)(requested) === (0, commitment_product_1.productMode)(admitted || 'suggestions_only') ||
163
- requested === 'off') {
164
- return undefined;
165
- }
166
- const id = typeof commitment.id === 'string' ? commitment.id : '<commitment-id>';
167
- return [
168
- `Requested mode ${(0, commitment_product_1.productModeLabel)(requested)} was not applied; this commitment is running as ${(0, commitment_product_1.productModeLabel)(admitted || 'suggestions_only')}.`,
169
- `To set it explicitly: ${bin} commitments mode ${id} ${(0, commitment_product_1.productMode)(requested)}`,
170
- ].join('\n');
171
- }
172
147
  /**
173
148
  * `skrr commitments create` — author a durable commitment contract.
174
149
  *
@@ -187,7 +162,7 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
187
162
  '<%= config.bin %> commitments create --agent <agent-id> --title "SLA" --outcome "p95 under 200ms" --criterion "p95 latency confirmed" --evaluator metric --measure <measure-id>',
188
163
  '<%= config.bin %> commitments create --agent <agent-id> --title "AWS cost watch" --outcome "Cost regressions are investigated" --agent-directive-file ./aws-cost-policy.md',
189
164
  '<%= config.bin %> commitments create --from-json commitment.json --json',
190
- '<%= config.bin %> commitments create --agent <agent-id> --title "Keep CI healthy" --outcome "Failed checks are repaired" --watch github --github-event check_run_failed --event-driven --mode execute --delivery draft-pr --repo owner/repo --base main --status draft',
165
+ '<%= config.bin %> commitments create --agent <agent-id> --title "Keep CI healthy" --outcome "Failed checks are repaired" --watch github --github-event check_run_failed --event-driven --delivery draft-pr --repo owner/repo --base main --status draft',
191
166
  ];
192
167
  static flags = {
193
168
  json: core_1.Flags.boolean({ description: 'Output the created commitment as JSON' }),
@@ -269,25 +244,12 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
269
244
  options: [...commitments_1.COMMITMENT_AUTHORABLE_CADENCE_MODES],
270
245
  }),
271
246
  timezone: core_1.Flags.string({ description: 'IANA timezone for the cadence' }),
272
- mode: core_1.Flags.string({
273
- description: 'How the commitment progresses (default Monitor)',
274
- options: [...commitment_product_1.COMMITMENT_PRODUCT_MODES],
275
- }),
276
247
  delivery: core_1.Flags.string({
277
- description: 'Where Prepare or Execute coding work is delivered; Monitor is report-only',
248
+ description: 'Requested delivery artifact or destination',
278
249
  options: [...commitment_product_1.COMMITMENT_DELIVERY_CHOICES],
279
250
  }),
280
251
  repo: core_1.Flags.string({ description: 'Delivery repository, owner/repo' }),
281
252
  base: core_1.Flags.string({ description: 'Delivery target branch' }),
282
- autonomy: core_1.Flags.string({
283
- // `--help` is where someone decides what to type, so the ceiling that can
284
- // still bind has to be stated HERE and not only in the notice that
285
- // corrects them afterwards. `commitments autonomy --mode` learned the
286
- // same lesson: what it must not keep is the silence.
287
- description: 'Compatibility flag. Prefer --mode monitor|prepare|execute. Workspace administrator rules remain binding.',
288
- options: [...commitments_1.COMMITMENT_AUTONOMY_MODES],
289
- hidden: true,
290
- }),
291
253
  isolation: core_1.Flags.string({
292
254
  // Omitting this is not the same as passing `shared`: an omitted value
293
255
  // leaves the daemon's own isolation heuristic in force, while `shared` is
@@ -311,7 +273,6 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
311
273
  this.requireAuth();
312
274
  const { flags } = await this.parse(CommitmentsCreate);
313
275
  let payload;
314
- let deliveryNormalizedForMonitor = false;
315
276
  try {
316
277
  // `createBodySchema` is a z.strictObject, so unwrap a `plan --json`
317
278
  // envelope and drop any key it does not declare (a contract dumped from
@@ -392,12 +353,6 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
392
353
  ? payload.policy
393
354
  : {};
394
355
  const policy = { ...existingPolicy };
395
- if (flags.autonomy)
396
- policy.autonomyMode = flags.autonomy;
397
- if (flags.mode && flags.autonomy)
398
- throw new Error('Use --mode or the compatibility --autonomy flag, not both.');
399
- if (flags.mode)
400
- payload.mode = (0, commitment_product_1.productMode)(flags.mode);
401
356
  if (flags.delivery)
402
357
  payload.delivery = (0, commitment_product_1.deliveryInput)(flags.delivery, flags);
403
358
  else if (flags.repo || flags.base)
@@ -411,45 +366,28 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
411
366
  reason: flags['concurrency-reason'],
412
367
  });
413
368
  if (concurrencyPatch) {
414
- const existingEnvelope = policy.autonomyEnvelope &&
415
- typeof policy.autonomyEnvelope === 'object' &&
416
- !Array.isArray(policy.autonomyEnvelope)
417
- ? policy.autonomyEnvelope
369
+ const existingEnvelope = policy.executionBudget &&
370
+ typeof policy.executionBudget === 'object' &&
371
+ !Array.isArray(policy.executionBudget)
372
+ ? policy.executionBudget
418
373
  : {};
419
- policy.autonomyEnvelope = { ...existingEnvelope, ...concurrencyPatch };
374
+ policy.executionBudget = { ...existingEnvelope, ...concurrencyPatch };
420
375
  }
421
376
  if (Object.keys(policy).length)
422
377
  payload.policy = policy;
423
- const payloadPolicy = payload.policy && typeof payload.policy === 'object' && !Array.isArray(payload.policy)
424
- ? payload.policy
425
- : {};
426
- const selectedMode = typeof payload.mode === 'string'
427
- ? payload.mode
428
- : typeof payloadPolicy.autonomyMode === 'string'
429
- ? payloadPolicy.autonomyMode
430
- : 'monitor';
431
- if (payload.delivery &&
432
- typeof payload.delivery === 'object' &&
433
- !Array.isArray(payload.delivery)) {
434
- const declared = payload.delivery;
435
- const coherent = (0, commitment_product_1.deliveryForProductMode)(selectedMode, declared);
436
- deliveryNormalizedForMonitor =
437
- (0, commitment_product_1.productMode)(selectedMode) === 'monitor' && declared.mode !== 'report_only';
438
- payload.delivery = coherent;
439
- }
440
378
  if (payload.createdVia === undefined) {
441
379
  payload.createdVia = process.env.OVERSKY_AUTONOMOUS_SESSION === '1' ? 'agent_cli' : 'cli';
442
380
  }
443
381
  // `--from-json` is intentionally powerful, but it must not be an escape
444
382
  // hatch around the same authoring decision the explicit flag enforces.
445
- const envelope = policy.autonomyEnvelope;
383
+ const envelope = policy.executionBudget;
446
384
  if (envelope && Object.prototype.hasOwnProperty.call(envelope, 'maxConcurrentRuns')) {
447
385
  const value = envelope.maxConcurrentRuns;
448
386
  if (process.env.OVERSKY_AUTONOMOUS_SESSION === '1' && value != null) {
449
387
  throw new Error('An autonomous Agent cannot activate a finite Commitment concurrency cap from --from-json. Omit it or set it to null; an owner may set it later.');
450
388
  }
451
389
  if (value != null && !String(envelope.maxConcurrentRunsReason || '').trim()) {
452
- throw new Error('A finite policy.autonomyEnvelope.maxConcurrentRuns in --from-json requires maxConcurrentRunsReason.');
390
+ throw new Error('A finite policy.executionBudget.maxConcurrentRuns in --from-json requires maxConcurrentRunsReason.');
453
391
  }
454
392
  }
455
393
  }
@@ -478,37 +416,10 @@ class CommitmentsCreate extends base_command_1.BaseCommand {
478
416
  }
479
417
  if (flags.json) {
480
418
  this.log(JSON.stringify((0, web_url_1.withCommitmentUrl)(this.cliConfig.baseURL, commitment), null, 2));
481
- const notice = autonomyStagingNotice({
482
- payload,
483
- commitment: commitment,
484
- bin: this.config.bin,
485
- });
486
- if (notice)
487
- this.warn(notice);
488
- if (deliveryNormalizedForMonitor) {
489
- this.warn('Monitor is report-only, so the requested code-delivery destination was not stored. Use --mode prepare or --mode execute to deliver code.');
490
- }
491
419
  return;
492
420
  }
493
421
  this.log('Created commitment:');
494
422
  (0, commitments_1.renderCommitmentSummary)(commitment, (line) => this.log(line));
495
- const notice = autonomyStagingNotice({
496
- payload,
497
- commitment: commitment,
498
- bin: this.config.bin,
499
- });
500
- if (notice) {
501
- this.log('');
502
- this.log(notice);
503
- }
504
- if (deliveryNormalizedForMonitor) {
505
- this.log('');
506
- this.log('Monitor is report-only, so delivery was set to Report only. Choose Prepare or Execute to deliver code.');
507
- }
508
- if (commitment.status === 'draft') {
509
- this.log('');
510
- this.log(`Activate it with: ${this.config.bin} commitments resume ${commitment.id}`);
511
- }
512
423
  }
513
424
  }
514
425
  exports.default = CommitmentsCreate;
@@ -6,7 +6,7 @@ const commitments_1 = require("../../lib/commitments");
6
6
  const commitment_product_1 = require("../../lib/commitment-product");
7
7
  const web_url_1 = require("../../lib/web-url");
8
8
  class CommitmentsDelivery extends base_command_1.BaseCommand {
9
- static description = 'Declare where Prepare or Execute delivers work; Monitor is always report-only';
9
+ static description = 'Declare the destination for Commitment work';
10
10
  static examples = [
11
11
  '<%= config.bin %> commitments delivery <id> draft-pr --repo owner/repo --base main',
12
12
  ];
@@ -15,7 +15,7 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
15
15
  mode: core_1.Args.string({
16
16
  required: true,
17
17
  ignoreStdin: true,
18
- description: 'Delivery destination. Code destinations require Prepare or Execute (or a Pack Shadow promotion target).',
18
+ description: 'Delivery destination.',
19
19
  options: [
20
20
  ...commitment_product_1.COMMITMENT_DELIVERY_CHOICES,
21
21
  ...commitment_product_1.COMMITMENT_DELIVERY_CHOICES.map((mode) => mode.replace(/-/g, '_')),
@@ -34,18 +34,6 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
34
34
  try {
35
35
  const current = (await commitments_1.commitmentApi.get(args.id)).commitment;
36
36
  const requested = (0, commitment_product_1.deliveryInput)(args.mode, flags);
37
- const stagingForPromotion = current.pack?.phase === 'shadow';
38
- const targetPolicy = stagingForPromotion
39
- ? current.pack?.policyBeforeShadow || current.policy
40
- : current.policy;
41
- const productContract = targetPolicy?.workPromotionModel === 'monitor_prepare_execute_v1';
42
- if (productContract &&
43
- (0, commitment_product_1.productMode)(targetPolicy?.autonomyMode) === 'monitor' &&
44
- requested.mode !== 'report_only') {
45
- throw new Error(stagingForPromotion
46
- ? 'This Pack promotion target is Monitor, so its delivery must be report-only. Set the commitment mode to Prepare or Execute before staging code delivery.'
47
- : 'Monitor is report-only. Set the commitment mode to Prepare or Execute before selecting code delivery.');
48
- }
49
37
  const delivery = { ...current.delivery, ...requested };
50
38
  const result = await commitments_1.commitmentApi.delivery(args.id, {
51
39
  delivery,
@@ -55,13 +43,7 @@ class CommitmentsDelivery extends base_command_1.BaseCommand {
55
43
  const linked = (0, web_url_1.withCommitmentUrl)(this.cliConfig.baseURL, result);
56
44
  if (flags.json)
57
45
  return this.log(JSON.stringify(linked, null, 2));
58
- const renderedDelivery = stagingForPromotion
59
- ? result.pack?.deliveryBeforeShadow || delivery
60
- : result.delivery;
61
- this.log(`${stagingForPromotion ? 'Promotion delivery staged' : 'Delivery'}: ${(0, commitment_product_1.deliveryLabel)(renderedDelivery?.mode)}${renderedDelivery?.repo ? ` · ${renderedDelivery.repo}` : ''}${renderedDelivery?.baseBranch ? ` → ${renderedDelivery.baseBranch}` : ''}`);
62
- if (stagingForPromotion) {
63
- this.log('Live Shadow delivery remains Report only until explicit promotion.');
64
- }
46
+ this.log(`Delivery: ${(0, commitment_product_1.deliveryLabel)(result.delivery?.mode)}${result.delivery?.repo ? ` · ${result.delivery.repo}` : ''}${result.delivery?.baseBranch ? ` → ${result.delivery.baseBranch}` : ''}`);
65
47
  this.log(`URL: ${linked.url}`);
66
48
  }
67
49
  catch (error) {
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.doctorVerdict = doctorVerdict;
4
4
  const core_1 = require("@oclif/core");
5
+ const data_provider_1 = require("@skrr-ai/data-provider");
5
6
  const base_command_1 = require("../../base-command");
6
7
  const commitments_1 = require("../../lib/commitments");
7
8
  function doctorVerdict(input) {
@@ -22,7 +23,7 @@ function doctorVerdict(input) {
22
23
  next: 'Retry doctor; one or more operating-state projections are unavailable',
23
24
  };
24
25
  }
25
- const autonomy = operatingState.autonomy;
26
+ const autonomy = operatingState.execution;
26
27
  const budget = autonomy?.budget;
27
28
  const concurrentRuns = budget?.concurrentRuns;
28
29
  const decision = concurrentRuns?.decision;
@@ -32,30 +33,34 @@ function doctorVerdict(input) {
32
33
  next: 'Confirm the cap with --max-concurrent-runs <n> --concurrency-reason "...", or remove it with --max-concurrent-runs unlimited',
33
34
  };
34
35
  }
35
- if (operatingState.status && commitment.status === 'active') {
36
- const status = String(operatingState.status);
37
- const healthy = ['on_track', 'healthy'].includes(status);
38
- // Where the latest cycle stopped, as the server words it. "Read the raw
39
- // trace" was the only next step an unhealthy Commitment was ever given,
40
- // even when the stop already named the fix (OSK-12120).
41
- const latestCheck = operatingState.latestCheck;
42
- const stop = latestCheck?.stop;
43
- const fix = typeof stop?.fix === 'string' && stop.fix ? stop.fix : undefined;
44
- const why = typeof stop?.detail === 'string' && stop.detail ? stop.detail : undefined;
36
+ if (commitment.status !== 'active')
45
37
  return {
46
- verdict: healthy ? 'active_healthy' : status,
47
- next: !healthy && fix ? fix : 'skrr commitments trace <id> --limit 50',
48
- ...(!healthy && why ? { why } : {}),
38
+ verdict: 'inactive',
39
+ next: 'Inspect the lifecycle before resuming this responsibility',
49
40
  };
50
- }
51
- if (commitment.status !== 'active')
52
- return { verdict: 'blocked', next: 'skrr commitments resume <id>' };
53
- if (preflight.verdict === 'blocked')
54
- return { verdict: 'blocked', next: 'skrr commitments preflight <id> --json' };
55
- const attention = preflight.attention;
56
- if (attention?.allowed === false)
57
- return { verdict: 'attention_suppressed', next: 'skrr commitments effective-policy <id>' };
58
- return { verdict: 'active_healthy', next: 'skrr commitments trace <id> --limit 50' };
41
+ const raw = (operatingState.assessment || commitment.assessment);
42
+ const assessment = raw ? (0, data_provider_1.readCommitmentAssessment)(raw) : undefined;
43
+ if (!assessment)
44
+ return { verdict: 'unknown', next: 'Run a Check to evaluate current criterion evidence' };
45
+ const verified = assessment.outcome === 'satisfied' &&
46
+ assessment.evidence === 'fresh' &&
47
+ assessment.operation === 'ready';
48
+ if (verified)
49
+ return {
50
+ verdict: 'active_healthy',
51
+ next: 'No work is needed while the criterion evidence remains fresh',
52
+ };
53
+ const latestCheck = operatingState.latestCheck;
54
+ const stop = latestCheck?.stop;
55
+ return {
56
+ verdict: assessment.operation === 'blocked' || assessment.operation === 'failed'
57
+ ? assessment.operation
58
+ : assessment.outcome,
59
+ next: typeof stop?.fix === 'string' && stop.fix
60
+ ? stop.fix
61
+ : 'Review current criterion evidence and the pending operation',
62
+ ...(typeof stop?.detail === 'string' && stop.detail ? { why: stop.detail } : {}),
63
+ };
59
64
  }
60
65
  class CommitmentsDoctor extends base_command_1.BaseCommand {
61
66
  static description = 'Summarize commitment readiness and the next operator action';
@@ -97,10 +102,6 @@ class CommitmentsDoctor extends base_command_1.BaseCommand {
97
102
  if (diagnosis.why)
98
103
  this.log(`Why: ${diagnosis.why}`);
99
104
  this.log(`Next: ${diagnosis.next.replace('<id>', args.id)}`);
100
- const autonomy = operatingState.autonomy;
101
- if (autonomy) {
102
- this.log(`Mode: ${(0, commitments_1.commitmentAutonomyLabel)(String(autonomy.declaredMode || ''))} → ${(0, commitments_1.commitmentAutonomyLabel)(String(autonomy.effectiveMode || ''))}`);
103
- }
104
105
  this.log(`Concurrency: ${(0, commitments_1.describeCommitmentConcurrency)(commitment)}`);
105
106
  const approvals = operatingState.approvals;
106
107
  if (approvals?.pendingCount)
@@ -14,7 +14,7 @@ const RUN_LIMIT_BINDING_LABELS = {
14
14
  function effectivePolicyLines(policy) {
15
15
  const governance = policy.governance || {};
16
16
  const owner = policy.owner || {};
17
- const lines = [`Mode in force: ${(0, commitment_product_1.productModeLabel)(governance.effectiveAutonomyMode)}`];
17
+ const lines = [];
18
18
  // Whose permissions a run uses (OSK-11975), directly under the mode it can
19
19
  // contradict — an Execute Commitment on a plan-mode Agent (OSK-12065).
20
20
  lines.push(...(0, commitments_1.permissionLines)(policy.permissions));
@@ -24,16 +24,6 @@ function effectivePolicyLines(policy) {
24
24
  else {
25
25
  lines.push('Workspace status: allowed');
26
26
  }
27
- if (governance.workspaceMaxMode) {
28
- lines.push(`Workspace Mode ceiling: ${(0, commitment_product_1.productModeLabel)(governance.workspaceMaxMode)}`);
29
- }
30
- if (Array.isArray(governance.workspaceModeOverrides)) {
31
- for (const override of governance.workspaceModeOverrides) {
32
- if (override?.effectiveMode) {
33
- lines.push(`Workspace override: ${(0, commitment_product_1.productModeLabel)(override.effectiveMode)} — ${override.policy || 'configured administrator rule'}${override.configuredValue ? ` (${override.configuredValue})` : ''}`);
34
- }
35
- }
36
- }
37
27
  if (Array.isArray(governance.allowedCommitmentDeliveryModes)) {
38
28
  lines.push(`Workspace delivery allowlist: ${governance.allowedCommitmentDeliveryModes.length ? governance.allowedCommitmentDeliveryModes.map(commitment_product_1.deliveryLabel).join(', ') : 'none'}`);
39
29
  }
@@ -55,29 +45,8 @@ function effectivePolicyLines(policy) {
55
45
  if (cost?.effectiveCostLimitUsd != null) {
56
46
  lines.push(`Effective daily cost limit: $${Number(cost.effectiveCostLimitUsd).toFixed(2)}`);
57
47
  }
58
- // What a sensing turn's fence holds (OSK-11978). The shell line carries the
59
- // part that is NOT enforced, because that is the one an operator granting
60
- // it has to see.
61
- const observation = policy.observation;
62
- if (observation?.sensing && observation.retired) {
63
- // OSK-11975 retired the sensing fence: printing "granted — read-only" for
64
- // a grant that no longer fences anything is the claim this must not make.
65
- const recorded = [
66
- observation.shell?.granted ? 'shell' : null,
67
- observation.browser?.granted ? 'browser' : null,
68
- ].filter(Boolean);
69
- lines.push(`Sensing runs: the Agent's own permissions${recorded.length
70
- ? ` (recorded ${recorded.join(' and ')} grant is retired and has no effect)`
71
- : ''}`);
72
- }
73
- else if (observation?.sensing) {
74
- lines.push(`Sensing shell: ${observation.shell?.granted
75
- ? 'granted — read-only filesystem on the Hosted Machine; network NOT fenced (a command can still change remote state); withheld on your own machine'
76
- : 'not granted'}`);
77
- lines.push(`Sensing browser: ${observation.browser?.granted
78
- ? 'granted — read-only, enforced by your machine'
79
- : 'not granted'}`);
80
- }
48
+ if (policy.observation?.sensing)
49
+ lines.push("Sensing runs: the Agent's own permissions");
81
50
  return lines;
82
51
  }
83
52
  /** Show the policy actually governing a Commitment without changing it. */
@@ -92,7 +61,7 @@ class CommitmentsEffectivePolicy extends base_command_1.BaseCommand {
92
61
  };
93
62
  static flags = {
94
63
  json: core_1.Flags.boolean({ description: 'Output the complete effective policy as JSON' }),
95
- verbose: core_1.Flags.boolean({ description: 'Append raw compatibility and diagnostic policy JSON' }),
64
+ verbose: core_1.Flags.boolean({ description: 'Append diagnostic policy JSON' }),
96
65
  };
97
66
  async run() {
98
67
  this.requireAuth();
@@ -113,7 +82,7 @@ class CommitmentsEffectivePolicy extends base_command_1.BaseCommand {
113
82
  for (const line of effectivePolicyLines(policy))
114
83
  this.log(` ${line}`);
115
84
  if (flags.verbose) {
116
- this.log('\nRaw compatibility diagnostics:');
85
+ this.log('\nRaw policy diagnostics:');
117
86
  this.log(JSON.stringify(policy, null, 2));
118
87
  }
119
88
  }
@@ -0,0 +1,15 @@
1
+ import { BaseCommand } from '../../base-command';
2
+ /** One domain surface for prospective evaluations and durable learning retries. */
3
+ export default class CommitmentEvaluations extends BaseCommand {
4
+ static description: string;
5
+ static args: {
6
+ commitmentId: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
7
+ };
8
+ static flags: {
9
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
10
+ file: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
+ 'retry-learning': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
12
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
13
+ };
14
+ run(): Promise<void>;
15
+ }
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const node_fs_1 = require("node:fs");
5
+ const base_command_1 = require("../../base-command");
6
+ const commitments_1 = require("../../lib/commitments");
7
+ /** One domain surface for prospective evaluations and durable learning retries. */
8
+ class CommitmentEvaluations extends base_command_1.BaseCommand {
9
+ static description = 'List or register forward evaluations of actions and judgments';
10
+ static args = { commitmentId: core_1.Args.string({ required: true, ignoreStdin: true }) };
11
+ static flags = {
12
+ json: core_1.Flags.boolean({ description: 'Output the complete evaluation records as JSON' }),
13
+ file: core_1.Flags.string({
14
+ description: 'Register an evaluation from a JSON contract',
15
+ exclusive: ['retry-learning'],
16
+ }),
17
+ 'retry-learning': core_1.Flags.string({
18
+ description: 'Retry the learning handoff for a schedule ID',
19
+ exclusive: ['file'],
20
+ }),
21
+ limit: core_1.Flags.integer({ min: 1, max: 100, description: 'Maximum schedules to list' }),
22
+ };
23
+ async run() {
24
+ this.requireAuth();
25
+ const { args, flags } = await this.parse(CommitmentEvaluations);
26
+ try {
27
+ if (flags.file) {
28
+ const body = JSON.parse((0, node_fs_1.readFileSync)(flags.file, 'utf8'));
29
+ const result = await commitments_1.commitmentApi.createEvaluation(args.commitmentId, body);
30
+ this.log(JSON.stringify(result, null, 2));
31
+ return;
32
+ }
33
+ if (flags['retry-learning']) {
34
+ this.log(JSON.stringify(await commitments_1.commitmentApi.retryEvaluationLearning(args.commitmentId, flags['retry-learning']), null, 2));
35
+ return;
36
+ }
37
+ const response = await commitments_1.commitmentApi.evaluations(args.commitmentId, { limit: flags.limit });
38
+ if (flags.json) {
39
+ this.log(JSON.stringify(response, null, 2));
40
+ return;
41
+ }
42
+ for (const row of response.data) {
43
+ const learning = row.learning;
44
+ this.log(`${row.id} ${row.status} next: ${row.nextCheckAt || 'settled'}${learning?.status === 'pending' ? ' learning pending' : ''}`);
45
+ }
46
+ if (!response.data.length)
47
+ this.log('No evaluations registered.');
48
+ }
49
+ catch (error) {
50
+ this.handleApiError(error);
51
+ }
52
+ }
53
+ }
54
+ exports.default = CommitmentEvaluations;
@@ -0,0 +1,11 @@
1
+ import { BaseCommand } from '../../../base-command';
2
+ export default class CommitmentPackActivate extends BaseCommand {
3
+ static description: string;
4
+ static args: {
5
+ id: import("@oclif/core/lib/interfaces").Arg<string, Record<string, unknown>>;
6
+ };
7
+ static flags: {
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ };
10
+ run(): Promise<void>;
11
+ }
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const base_command_1 = require("../../../base-command");
5
+ const commitments_1 = require("../../../lib/commitments");
6
+ class CommitmentPackActivate extends base_command_1.BaseCommand {
7
+ static description = 'Activate a prepared Pack with the Agent permissions';
8
+ static args = { id: core_1.Args.string({ required: true, ignoreStdin: true }) };
9
+ static flags = { json: core_1.Flags.boolean() };
10
+ async run() {
11
+ this.requireAuth();
12
+ const { args, flags } = await this.parse(CommitmentPackActivate);
13
+ try {
14
+ const result = await commitments_1.commitmentPackApi.activate(args.id);
15
+ this.log(flags.json ? JSON.stringify(result, null, 2) : `Pack active: ${result.commitment.id}`);
16
+ }
17
+ catch (error) {
18
+ this.handleApiError(error);
19
+ }
20
+ }
21
+ }
22
+ exports.default = CommitmentPackActivate;
@@ -82,7 +82,7 @@ class CommitmentsPackBind extends base_command_1.BaseCommand {
82
82
  });
83
83
  if (url)
84
84
  this.log(`URL: ${url}`);
85
- this.log('\nNext: `skrr commitments pack preflight <id>`, then `pack shadow`, then `pack promote`.');
85
+ this.log('\nNext: `skrr commitments pack preflight <id>`, then `pack activate`.');
86
86
  }
87
87
  }
88
88
  exports.default = CommitmentsPackBind;
@@ -29,11 +29,8 @@ class CommitmentsRemediate extends base_command_1.BaseCommand {
29
29
  static flags = {
30
30
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
31
31
  action: core_1.Flags.string({
32
- description: 'Remediation action. Change work authority with commitments mode; Workspace approval rules belong in Workspace governance.',
33
- // `tighten_policy` remains a REST compatibility value for legacy rows. It
34
- // is deliberately absent from the product CLI: v2 authority changes are
35
- // explicit Mode changes, never a hidden risk/approval tier.
36
- options: commitments_1.COMMITMENT_REMEDIATION_ACTIONS.filter((action) => action !== 'tighten_policy'),
32
+ description: 'Adjust lifecycle or reporting. Agent permissions and Workspace administration have their own controls.',
33
+ options: commitments_1.COMMITMENT_REMEDIATION_ACTIONS,
37
34
  required: true,
38
35
  }),
39
36
  reason: core_1.Flags.string({ description: 'Why (recorded on the boundary-change ledger)' }),
@@ -52,7 +52,7 @@ class CommitmentsShow extends base_command_1.BaseCommand {
52
52
  (0, commitments_1.renderCommitmentSummary)(response.commitment, (line) => this.log(line), response.latestCheck);
53
53
  // Whose permissions a run uses (OSK-11975) — read from the operating state,
54
54
  // which carries the same projection preflight reports (OSK-12065).
55
- const autonomy = response.operatingState?.autonomy;
55
+ const autonomy = response.operatingState?.execution;
56
56
  for (const line of (0, commitments_1.permissionLines)(autonomy?.permissions))
57
57
  this.log(line);
58
58
  // `show` is the first surface a person reaches after linking something, and
@@ -264,22 +264,22 @@ class CommitmentsUpdate extends base_command_1.BaseCommand {
264
264
  if (flags.isolation)
265
265
  nextPolicy.executionIsolation = flags.isolation;
266
266
  if (concurrencyPatch) {
267
- const existingEnvelope = nextPolicy.autonomyEnvelope &&
268
- typeof nextPolicy.autonomyEnvelope === 'object' &&
269
- !Array.isArray(nextPolicy.autonomyEnvelope)
270
- ? nextPolicy.autonomyEnvelope
267
+ const existingEnvelope = nextPolicy.executionBudget &&
268
+ typeof nextPolicy.executionBudget === 'object' &&
269
+ !Array.isArray(nextPolicy.executionBudget)
270
+ ? nextPolicy.executionBudget
271
271
  : {};
272
- nextPolicy.autonomyEnvelope = { ...existingEnvelope, ...concurrencyPatch };
272
+ nextPolicy.executionBudget = { ...existingEnvelope, ...concurrencyPatch };
273
273
  }
274
274
  payload.policy = nextPolicy;
275
275
  }
276
276
  const finalPolicy = payload.policy && typeof payload.policy === 'object' && !Array.isArray(payload.policy)
277
277
  ? payload.policy
278
278
  : undefined;
279
- const finalEnvelope = finalPolicy?.autonomyEnvelope &&
280
- typeof finalPolicy.autonomyEnvelope === 'object' &&
281
- !Array.isArray(finalPolicy.autonomyEnvelope)
282
- ? finalPolicy.autonomyEnvelope
279
+ const finalEnvelope = finalPolicy?.executionBudget &&
280
+ typeof finalPolicy.executionBudget === 'object' &&
281
+ !Array.isArray(finalPolicy.executionBudget)
282
+ ? finalPolicy.executionBudget
283
283
  : undefined;
284
284
  if (process.env.OVERSKY_AUTONOMOUS_SESSION === '1' &&
285
285
  finalEnvelope &&
@@ -1,7 +1,5 @@
1
1
  import { BaseCommand } from '../../base-command';
2
- export declare function wakePolicyHeadline(result: {
3
- workPromotionModel?: string;
4
- }): string;
2
+ export declare function wakePolicyHeadline(_result?: unknown): string;
5
3
  /**
6
4
  * `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
7
5
  *
@@ -5,15 +5,8 @@ const core_1 = require("@oclif/core");
5
5
  const base_command_1 = require("../../base-command");
6
6
  const commitments_1 = require("../../lib/commitments");
7
7
  const format_1 = require("../../lib/format");
8
- function wakePolicyHeadline(result) {
9
- return result.workPromotionModel === 'monitor_prepare_execute_v1'
10
- ? 'Wake behavior: configured Commitment sources may wake it automatically; there is no separate permission level.'
11
- : // The Commitment's Monitor/Prepare/Execute mode is a different field —
12
- // this policy predates the current wake contract, which is why a
13
- // Commitment already in `execute` mode can still carry the legacy
14
- // marker. Naming the field avoids the "migrate to what it already is"
15
- // contradiction.
16
- 'Wake behavior: this Commitment predates the current wake contract and runs the compatibility policy. Re-saving its mode (Monitor, Prepare, or Execute) stamps the current policy.';
8
+ function wakePolicyHeadline(_result) {
9
+ return 'Wake behavior: configured sources may wake the Agent within lifecycle and execution budgets.';
17
10
  }
18
11
  /**
19
12
  * `skrr commitments wake-capabilities <id>` — which wakes an Agent may pick.
@@ -38,7 +31,7 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
38
31
  };
39
32
  static flags = {
40
33
  json: core_1.Flags.boolean({ description: 'Output as JSON' }),
41
- verbose: core_1.Flags.boolean({ description: 'Include raw legacy wake-policy values' }),
34
+ verbose: core_1.Flags.boolean({ description: 'Include wake-source diagnostics' }),
42
35
  };
43
36
  async run() {
44
37
  this.requireAuth();
@@ -54,16 +47,7 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
54
47
  this.log(JSON.stringify(result, null, 2));
55
48
  return;
56
49
  }
57
- const productModel = result.workPromotionModel === 'monitor_prepare_execute_v1';
58
- this.log(wakePolicyHeadline(result));
59
- const selected = result.selectedCapabilityIds;
60
- if (flags.verbose) {
61
- this.log(`Raw compatibility mode: ${result.mode}`);
62
- this.log(selected === undefined
63
- ? 'Raw allowlist: not configured'
64
- : `Raw allowlist: ${selected.length ? selected.join(', ') : '(empty)'}`);
65
- }
66
- this.log('');
50
+ this.log(wakePolicyHeadline());
67
51
  const visible = new Set(result.visibleCapabilities.map((item) => item.id));
68
52
  (0, format_1.renderTable)(result.eligibleCapabilities.map((item) => ({
69
53
  id: item.id,
@@ -74,7 +58,7 @@ class CommitmentsWakeCapabilities extends base_command_1.BaseCommand {
74
58
  { key: 'id', header: 'CAPABILITY' },
75
59
  { key: 'kind', header: 'KIND' },
76
60
  { key: 'source', header: 'SOURCE' },
77
- { key: 'offered', header: productModel ? 'ACTIVE' : 'OFFERED' },
61
+ { key: 'offered', header: 'ACTIVE' },
78
62
  ], (line) => this.log(line));
79
63
  }
80
64
  }