@skrr-ai/cli 0.1.169 → 0.1.171

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.
@@ -8,6 +8,10 @@ import { BaseCommand } from '../../../base-command';
8
8
  * Duty re-decides at its next Check, from what it finds then. Closing says nothing about effects: anything the turn
9
9
  * already did stays done.
10
10
  *
11
+ * A Run that was applying its result under an effect boundary (OSK-24399 F4) is closed the same way, once the worker
12
+ * applying it has let its lease lapse: what it applied with a receipt stays applied and nothing more is applied. The
13
+ * ref then names the boundary, and the close records which effect classes its receipts had settled.
14
+ *
11
15
  * `--hold` is the ref `recovery-review <agent-id> <run-id>` prints. It binds the close to the hold you read: if the Run
12
16
  * was held again since, the server refuses. The server also requires you to be the Agent's owner signed in as a person
13
17
  * (`skrr login`; a personal access token never reaches the route), that you can see the review, and that the machine
@@ -12,13 +12,17 @@ const base_command_1 = require("../../../base-command");
12
12
  * Duty re-decides at its next Check, from what it finds then. Closing says nothing about effects: anything the turn
13
13
  * already did stays done.
14
14
  *
15
+ * A Run that was applying its result under an effect boundary (OSK-24399 F4) is closed the same way, once the worker
16
+ * applying it has let its lease lapse: what it applied with a receipt stays applied and nothing more is applied. The
17
+ * ref then names the boundary, and the close records which effect classes its receipts had settled.
18
+ *
15
19
  * `--hold` is the ref `recovery-review <agent-id> <run-id>` prints. It binds the close to the hold you read: if the Run
16
20
  * was held again since, the server refuses. The server also requires you to be the Agent's owner signed in as a person
17
21
  * (`skrr login`; a personal access token never reaches the route), that you can see the review, and that the machine
18
22
  * that ran the turn confirmed it stopped. Nothing about who you are is taken from the command line.
19
23
  */
20
24
  class AgentsAlwaysOnRecoveryClose extends base_command_1.BaseCommand {
21
- static description = 'Close one held Duty result as the Agent owner: the Run ends cancelled, its held result is not applied, and the Duty re-decides at its next Check. Its effects stay unknown';
25
+ static description = 'Close one held Duty result as the Agent owner: the Run ends cancelled, nothing more of its result is applied, and the Duty re-decides at its next Check. Effects without a receipt stay unknown';
22
26
  static examples = [
23
27
  '<%= config.bin %> agents always-on recovery-close <agent-id> <run-id> --hold <hold-ref>',
24
28
  '<%= config.bin %> agents always-on recovery-close <agent-id> <run-id> --hold <hold-ref> --json',
@@ -65,6 +65,9 @@ class AgentsAlwaysOnRecoveryReview extends base_command_1.BaseCommand {
65
65
  this.log(`Status: ${review.status}; generation: ${review.generation ?? 'unknown'}; attempt: ${review.attempt ?? 'unknown'}`);
66
66
  this.log(`Recovery: ${review.hold}; stored result: ${review.result}`);
67
67
  this.log(`Executor: ${review.executor}; effects: ${review.effects}`);
68
+ const receipts = receiptLine(review);
69
+ if (receipts)
70
+ this.log(receipts);
68
71
  this.log(INTEGRITY_CAVEAT);
69
72
  for (const line of closeLines(args.id, review))
70
73
  this.log(line);
@@ -138,9 +141,13 @@ exports.default = AgentsAlwaysOnRecoveryReview;
138
141
  * server, or a hold this server cannot close: no command is offered that would be refused.
139
142
  */
140
143
  function closeLines(agentId, review) {
144
+ // Only a server that names the receipts can close a Run at its effect boundary (OSK-24399 F4).
145
+ const boundary = review.effectReceipts !== undefined;
141
146
  if (review.close === 'available' && isNonEmptyString(review.holdRef)) {
142
147
  return [
143
- 'Close: available. Closing ends the Run without applying its held result; the Duty re-decides at its next Check.',
148
+ boundary
149
+ ? 'Close: available. Closing ends the Run: what it applied with a receipt stays applied, and nothing more of its result is applied. The Duty re-decides at its next Check.'
150
+ : 'Close: available. Closing ends the Run without applying its held result; the Duty re-decides at its next Check.',
144
151
  `→ skrr agents always-on recovery-close ${agentId} ${review.runId} --hold ${review.holdRef}`,
145
152
  ];
146
153
  }
@@ -151,11 +158,31 @@ function closeLines(agentId, review) {
151
158
  }
152
159
  if (review.close === 'effect_boundary') {
153
160
  return [
154
- 'Close: not available. This Run started applying its result, and closing it would hide which effects happened.',
161
+ boundary
162
+ ? 'Close: not yet. The worker applying this result may still hold the Run; read this again once its lease has lapsed (a few minutes).'
163
+ : 'Close: not available. This Run started applying its result, and closing it would hide which effects happened.',
155
164
  ];
156
165
  }
157
166
  return [];
158
167
  }
168
+ /** What the boundary's receipts settled, by class. Every class not named stays unknown, which the line says. */
169
+ function receiptLine(review) {
170
+ const receipts = review.effectReceipts;
171
+ if (!receipts)
172
+ return undefined;
173
+ const applied = Array.isArray(receipts.applied) ? receipts.applied : [];
174
+ const none = Array.isArray(receipts.none) ? receipts.none : [];
175
+ if (applied.length === 0 && none.length === 0)
176
+ return 'Receipts: none yet. Every effect of this result is unknown.';
177
+ return [
178
+ 'Receipts:',
179
+ applied.length ? `applied ${applied.join(', ')};` : '',
180
+ none.length ? `owed nothing for ${none.join(', ')}.` : '',
181
+ 'Any other effect is unknown.',
182
+ ]
183
+ .filter(Boolean)
184
+ .join(' ');
185
+ }
159
186
  /** One line per held result: what a person needs to choose which one to open. */
160
187
  function reviewLine(review) {
161
188
  const stored = review.resultCapture === 'unsealable'
@@ -0,0 +1,33 @@
1
+ /**
2
+ * localSessionImportLimits.ts — how much of one native session a local session import carries.
3
+ *
4
+ * The daemon reads a session on a person's computer and the server stores what it read. Each used
5
+ * to declare its own copy of these numbers (twelve files, each with a `MAX_EVENTS` of 10,000 and a
6
+ * `MAX_PAGES` of 400), and a number that must agree across the wire cannot be left to twelve
7
+ * declarations: raise one and the import still stops at the next, with an error that does not say
8
+ * which. They are declared here, once, and both sides import them.
9
+ *
10
+ * The values are sized from measurement, not from a guess. The twelve largest Codex sessions on one
11
+ * heavy user's machine (96 to 279 MB of rollout) project to at most 36,043 events, 80.0 MB of history
12
+ * and 361 pages, and reading one of them end to end takes under a second with 125 MB of memory. Each
13
+ * limit below is several times that, so it is a bound on what one import may cost the server, not a
14
+ * ceiling a real session is near:
15
+ *
16
+ * - events: 250,000, about 7x the largest measured;
17
+ * - bytes: 512 MiB of projected history, about 6x;
18
+ * - pages: 4,000, about 11x, and never fewer than `maxEvents / 100` (a page holds at most 100
19
+ * events), which the test pins so one cannot be raised without the other.
20
+ *
21
+ * These bound the history that is published. What the daemon will read from disk to produce it
22
+ * (file size, record count, the longest record) is the daemon's own business and stays there.
23
+ */
24
+ export declare const LOCAL_SESSION_HISTORY_LIMITS: Readonly<{
25
+ /** The most events (one per completed item) one session's history may hold. */
26
+ maxEvents: 250000;
27
+ /** The most bytes of projected history one session may hold, as the pages serialize it. */
28
+ maxBytes: number;
29
+ /** The most history pages one session may take. */
30
+ maxPages: 4000;
31
+ }>;
32
+ /** A history page holds at most this many events (the daemon's `sourcePageLimit`). */
33
+ export declare const LOCAL_SESSION_HISTORY_PAGE_EVENTS = 100;
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var localSessionImportLimits_exports = {};
20
+ __export(localSessionImportLimits_exports, {
21
+ LOCAL_SESSION_HISTORY_LIMITS: () => LOCAL_SESSION_HISTORY_LIMITS,
22
+ LOCAL_SESSION_HISTORY_PAGE_EVENTS: () => LOCAL_SESSION_HISTORY_PAGE_EVENTS
23
+ });
24
+ module.exports = __toCommonJS(localSessionImportLimits_exports);
25
+ const LOCAL_SESSION_HISTORY_LIMITS = Object.freeze({
26
+ /** The most events (one per completed item) one session's history may hold. */
27
+ maxEvents: 25e4,
28
+ /** The most bytes of projected history one session may hold, as the pages serialize it. */
29
+ maxBytes: 512 * 1024 * 1024,
30
+ /** The most history pages one session may take. */
31
+ maxPages: 4e3
32
+ });
33
+ const LOCAL_SESSION_HISTORY_PAGE_EVENTS = 100;
34
+ // Annotate the CommonJS export names for ESM import in node:
35
+ 0 && (module.exports = {
36
+ LOCAL_SESSION_HISTORY_LIMITS,
37
+ LOCAL_SESSION_HISTORY_PAGE_EVENTS
38
+ });
@@ -0,0 +1,33 @@
1
+ /**
2
+ * localSessionImportLimits.ts — how much of one native session a local session import carries.
3
+ *
4
+ * The daemon reads a session on a person's computer and the server stores what it read. Each used
5
+ * to declare its own copy of these numbers (twelve files, each with a `MAX_EVENTS` of 10,000 and a
6
+ * `MAX_PAGES` of 400), and a number that must agree across the wire cannot be left to twelve
7
+ * declarations: raise one and the import still stops at the next, with an error that does not say
8
+ * which. They are declared here, once, and both sides import them.
9
+ *
10
+ * The values are sized from measurement, not from a guess. The twelve largest Codex sessions on one
11
+ * heavy user's machine (96 to 279 MB of rollout) project to at most 36,043 events, 80.0 MB of history
12
+ * and 361 pages, and reading one of them end to end takes under a second with 125 MB of memory. Each
13
+ * limit below is several times that, so it is a bound on what one import may cost the server, not a
14
+ * ceiling a real session is near:
15
+ *
16
+ * - events: 250,000, about 7x the largest measured;
17
+ * - bytes: 512 MiB of projected history, about 6x;
18
+ * - pages: 4,000, about 11x, and never fewer than `maxEvents / 100` (a page holds at most 100
19
+ * events), which the test pins so one cannot be raised without the other.
20
+ *
21
+ * These bound the history that is published. What the daemon will read from disk to produce it
22
+ * (file size, record count, the longest record) is the daemon's own business and stays there.
23
+ */
24
+ export declare const LOCAL_SESSION_HISTORY_LIMITS: Readonly<{
25
+ /** The most events (one per completed item) one session's history may hold. */
26
+ maxEvents: 250000;
27
+ /** The most bytes of projected history one session may hold, as the pages serialize it. */
28
+ maxBytes: number;
29
+ /** The most history pages one session may take. */
30
+ maxPages: 4000;
31
+ }>;
32
+ /** A history page holds at most this many events (the daemon's `sourcePageLimit`). */
33
+ export declare const LOCAL_SESSION_HISTORY_PAGE_EVENTS = 100;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * localSessionImportLimits.ts — how much of one native session a local session import carries.
3
+ *
4
+ * The daemon reads a session on a person's computer and the server stores what it read. Each used
5
+ * to declare its own copy of these numbers (twelve files, each with a `MAX_EVENTS` of 10,000 and a
6
+ * `MAX_PAGES` of 400), and a number that must agree across the wire cannot be left to twelve
7
+ * declarations: raise one and the import still stops at the next, with an error that does not say
8
+ * which. They are declared here, once, and both sides import them.
9
+ *
10
+ * The values are sized from measurement, not from a guess. The twelve largest Codex sessions on one
11
+ * heavy user's machine (96 to 279 MB of rollout) project to at most 36,043 events, 80.0 MB of history
12
+ * and 361 pages, and reading one of them end to end takes under a second with 125 MB of memory. Each
13
+ * limit below is several times that, so it is a bound on what one import may cost the server, not a
14
+ * ceiling a real session is near:
15
+ *
16
+ * - events: 250,000, about 7x the largest measured;
17
+ * - bytes: 512 MiB of projected history, about 6x;
18
+ * - pages: 4,000, about 11x, and never fewer than `maxEvents / 100` (a page holds at most 100
19
+ * events), which the test pins so one cannot be raised without the other.
20
+ *
21
+ * These bound the history that is published. What the daemon will read from disk to produce it
22
+ * (file size, record count, the longest record) is the daemon's own business and stays there.
23
+ */
24
+ export const LOCAL_SESSION_HISTORY_LIMITS = Object.freeze({
25
+ /** The most events (one per completed item) one session's history may hold. */
26
+ maxEvents: 250_000,
27
+ /** The most bytes of projected history one session may hold, as the pages serialize it. */
28
+ maxBytes: 512 * 1024 * 1024,
29
+ /** The most history pages one session may take. */
30
+ maxPages: 4_000,
31
+ });
32
+ /** A history page holds at most this many events (the daemon's `sourcePageLimit`). */
33
+ export const LOCAL_SESSION_HISTORY_PAGE_EVENTS = 100;
@@ -357,6 +357,16 @@
357
357
  "types": "./dist/cjs/toolOperationOutcome.d.ts",
358
358
  "default": "./dist/cjs/toolOperationOutcome.js"
359
359
  }
360
+ },
361
+ "./local-session-import-limits": {
362
+ "import": {
363
+ "types": "./dist/esm/localSessionImportLimits.d.ts",
364
+ "default": "./dist/esm/localSessionImportLimits.js"
365
+ },
366
+ "require": {
367
+ "types": "./dist/cjs/localSessionImportLimits.d.ts",
368
+ "default": "./dist/cjs/localSessionImportLimits.js"
369
+ }
360
370
  }
361
371
  },
362
372
  "dependencies": {