jg-agent-hq 0.1.0 → 0.3.0

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/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ - Publish the consumer-tested package through the configured GitHub Actions trusted publisher before deploying the website. Verify release ordering and archive integrity, and safely skip identical published versions.
6
+ - Support whole-plan approval, execution, completion and revision when no milestone breakdown is needed. Preserve an absent milestone file and require explicit reconciliation when removing a sequence.
7
+ - Keep native thread execution scope on ordinary follow-ups, enforcing revocation and the single implementation owner for whole-plan execution. Preserve explicitly requested, revision-guarded feedback assessment without restoring execution authority. Keep existing-turn permission replies and session renaming separate from new execution admission.
8
+
9
+ ## 0.2.0
10
+
11
+ - Preserve coordinator-owned, revision-bound plan comparison evidence through plan operations. Expose its bounded count in status without copying review bodies into responses.
12
+ - Require the comparison collection in the coordination contract. The private coordinator owns semantic review, relevance selection and execution gates.
13
+
3
14
  ## 0.1.0
4
15
 
5
16
  - Add the shared lock API, owner-aware recovery and built-package verification.
package/README.md CHANGED
@@ -21,7 +21,7 @@ This public package provides a local controller and browser-safe contracts. Appl
21
21
 
22
22
  Use pnpm 12.4.0. Run `pnpm install`, then `pnpm check:package` to build, exercise the built API and packed consumer, typecheck and check formatting. `pnpm test:unit` and `pnpm test:integration` select their own categories after a build. The private website workspace has separate checks; install Chromium with `pnpm --dir website exec playwright install chromium`, then run `pnpm --dir website check`. `pnpm check` runs both boundaries.
23
23
 
24
- Work on `development`; reviewed changes reach `main` through a pull request. npm releases are manual and use the exact tested tarball.
24
+ Work on `development`; reviewed changes reach `main` through a pull request. After both Node checks pass on `main`, `check.yml` publishes the exact consumer-tested tarball through npm's configured trusted publisher, then deploys the website. No local npm login or token is needed. An identical published version is skipped; changed contents require a new version.
25
25
 
26
26
  ## Lock ownership
27
27
 
@@ -57,9 +57,11 @@ Use `jg-agent-hq request --state-root <directory>` with a closed HQ command on s
57
57
 
58
58
  `plan-status --directory <path>` and `plan-milestones --directory <path>` inspect a selected ordinary planning directory. No project registry is required. Mutations use the existing `request` JSON command with `kind: 'plan'`; see the [plan command reference](api/README.md#plan-coordination).
59
59
 
60
- Finalization assigns milestone UUIDs and returns the complete canonical sequence. Plan approval, sequence approval and scoped execution authorization are separate explicit operator actions. None sends native input or answers tool permissions. `coordination.json` holds current records beside the plan. SQLite retains write replay identities and a replaceable, paged milestone projection. Keep both when recovering interrupted writes. A pending write blocks further mutation until its original action is reconciled.
60
+ Finalization assigns milestone UUIDs and returns the complete canonical sequence when a breakdown exists. A plan without a breakdown remains one unit: finalization returns null content, plan approval suffices, and whole-plan execution uses an empty milestone selection with a null milestone ID. No milestone file is created merely to make a small plan executable. Plan approval, sequence approval and scoped execution authorization are separate explicit operator actions. None sends native input or answers tool permissions. `coordination.json` holds current records beside the plan. SQLite retains write replay identities and a replaceable, paged milestone projection. Keep both when recovering interrupted writes. A pending write blocks further mutation until its original action is reconciled.
61
61
 
62
- Begin a revision before native planning. HQ stops bound implementation threads and their owned background work, captures partial-work evidence, and keeps execution paused while the CLI revises the plan and regenerates milestones. The finalizer carries exact matches automatically and asks for one confirmation covering every unmatched completed or partial milestone. Equivalent rewording preserves the original completion evidence. Changed requirements remain pending. Present and approve the canonical sequence, then explicitly authorize the new execution scope and mode. Neither approval nor restart resumes implementation. See the [revision recovery contract](api/README.md#revision-and-progress-recovery).
62
+ Coordinators can retain revision-bound compatibility reviews in that same file. Core operations preserve the records without assessing them or granting authority. The integrating coordinator owns review freshness and conflict gates.
63
+
64
+ Begin a revision before native planning. HQ stops bound implementation threads and their owned background work, captures partial-work evidence, and keeps execution paused while the CLI revises the plan and regenerates milestones. The finalizer carries exact matches automatically and asks for one confirmation covering every unmatched completed or partial milestone. Equivalent rewording preserves the original completion evidence. Changed requirements remain pending. Present and approve the canonical sequence, then explicitly authorize the new execution scope and mode. Neither approval nor restart resumes implementation. Whole-plan checkpoints and completion evidence also work without a milestone file. Removing a sequence requires explicit confirmation covering its retained milestone evidence before whole-plan execution can begin. See the [revision recovery contract](api/README.md#revision-and-progress-recovery).
63
65
 
64
66
  ## Cross-provider feedback
65
67
 
@@ -85,6 +87,7 @@ Collect one completed reviewer message by its exact native turn/item reference.
85
87
  - `src/store/`: SQLite discovery metadata and the action/control ledger in one worker.
86
88
  - `src/contracts/`: browser-safe command and response contracts.
87
89
  - `scripts/package/`: build-output cleanup and packed-consumer checks.
90
+ - `scripts/release/`: registry version/integrity checks and trusted publication of the tested archive.
88
91
  - `scripts/test-support/`: disposable external CLI fixtures.
89
92
  - `vitest/`: separate unit and integration selection.
90
93
  - `api/README.md`: canonical public API reference.
package/api/README.md CHANGED
@@ -179,18 +179,22 @@ Send `{ kind: 'plan', command }` through the existing local request API. Every c
179
179
  | `reconciliation` | `target`, `collection: 'sources' \| 'drafts' \| 'evidence' \| 'correspondences'`, optional `limit` (32/128) and `cursor`. Returns retained evidence by indexed seek page. |
180
180
  | `approve` | `target`, `action`, `expected`, `scope: 'plan' \| 'sequence'`, `presentationHash`. The hash must match the exact presented plan or finalized sequence. Sequence approval also requires current plan approval. |
181
181
  | `revoke` | `target`, `action`, `expected`, `scope: 'plan' \| 'sequence' \| 'execution' \| 'all'`. Revoking a plan also revokes sequence and execution authority; revoking a sequence also revokes execution authority. |
182
- | `authorize` | `target`, `action`, `expected`, `mode: 'supervised' \| 'auto'`, selected unique `milestoneIds`. Records permission for this exact execution scope without starting an agent. |
183
- | `check-execution` | `target`, `expected`, `authorizationId`, `milestoneId`, `mode`. Rejects missing, revoked, stale, wrong-mode or out-of-scope authority. It sends no native input. |
182
+ | `authorize` | `target`, `action`, `expected`, `mode: 'supervised' \| 'auto'`, selected unique `milestoneIds` (empty only for a plan without a breakdown). Records permission for this exact execution scope without starting an agent. |
183
+ | `check-execution` | `target`, `expected`, `authorizationId`, nullable `milestoneId`, `mode`. Rejects missing, revoked, stale, wrong-mode or out-of-scope authority. It sends no native input. |
184
184
 
185
185
  `expected` is the exact `{ planDigest, breakdownDigest }` returned by inspection. Each mutating `action` has a UUID `id`, `operatorId` and `source: { kind: 'user-action' | 'user-message', reference }`. These are trusted local operator inputs. The module never infers approval from natural-language claims, an agent response or imported feedback. Its owner-only local IPC and files do not isolate hostile code executing as the same OS user. Native permissions remain separate action kinds with their own exact native request identities.
186
186
 
187
+ Milestones are optional. Finalizing a plan with no milestone file returns `content: null` and does not create a file. That unit needs plan approval and explicit execution authorization, with `milestoneIds: []`; execution checks, completion and native execution scopes select it with `milestoneId: null`. A real breakdown requires a nonempty selection of its stable IDs and its separate sequence approval. Null cannot select a milestone or bypass sequence approval. Whole-plan completion retains its exact plan contract/digest, actual check references and checkout evidence, with null shared-sequence digest. Completed work cannot be authorized again under that unchanged contract.
188
+
187
189
  A first-use sequence has one `**Milestone ID:** <uuid>` immediately below each `**Status:**` line. Blank lines may separate the heading from its status; no intervening requirement prose is allowed. The initial finalizer rejects duplicate, malformed or misplaced IDs and inconsistent framing. It refreshes existing Overview status rows and returns the complete canonical file for presentation before approval. A changed finalized contract goes through checkpoint reconciliation. A raw or changed sequence cannot inherit finalized status or sequence authority. A done marker remains visible but blocks execution without completion evidence.
188
190
 
189
191
  The milestone contract includes its stable UUID, title without its ordinal, all requirement prose, shared sequence requirements and the approval statement. Status and identity marker lines are excluded from the prose; only the derived Overview table is excluded from shared text. Prose next to that table remains contractual. Sequence order is significant. Renumbering preserves execution identity; changed requirements, dependencies, scope, reservations or order require applicable approval. Full-file hashes preserve exact UTF-8 bytes and are distinct from normalized execution revisions. Administrative frontmatter excluded by the trusted contract parser, session labels, status advancement and coordination receipts do not change execution digests.
190
192
 
191
193
  Plan and milestone artifacts are bounded to 1 MiB each; coordination evidence is bounded to 8 MiB and a sequence to 1,024 milestones. Reads do not scan planning trees. Milestone pages use ordinal seek ordering with unique ascending ordinals. Cursors bind the selected directory, page size, execution revisions and exact milestone inspection hash. Any changed artifact requires a fresh page; renumbering or status-only edits still preserve approval. A SQLite projection is rebuilt only when the selected milestone file's full hash changes. Every read verifies its source file; the projection is replaceable and never grants authority.
192
194
 
193
- Mutations hold the shared metadata lock at `<coordinationRoot>/.runtime/hq.lock` (`coordinationRoot` defaults to `stateRoot`), retain a durable action identity and intended write before changing files, sync temporary files and atomically replace each artifact. Use `serve --coordination-root <directory>` when the canonical coordination lock is separate from runtime storage. Repeating an action UUID with the identical payload never reapproves revoked work. A changed payload conflicts. An interrupted write remains blocked and can be retried with its original action only when files match the recorded baseline or exact intended output. Conflicting edits are preserved. Completed write bodies are removed from SQLite while replay identity remains. The current finalization receipt retains the operator event, execution revision, canonical file hash and timestamp independently of write recovery bodies. Status reads expose `pendingActionId` for unresolved writes; they never approve or resume work.
195
+ Mutations hold the shared metadata lock at `<coordinationRoot>/.runtime/hq.lock` (`coordinationRoot` defaults to `stateRoot`), retain a durable action identity and intended write before changing files, sync temporary files and atomically replace each artifact. Use `serve --coordination-root <directory>` when the canonical coordination lock is separate from runtime storage. Repeating an action UUID with the identical payload never reapproves revoked work. A changed payload conflicts. An interrupted write remains blocked and can be retried with its original action only when files match the recorded baseline or exact intended output. Conflicting edits are preserved. Completed write bodies are removed from SQLite while replay identity remains. The current finalization receipt retains the operator event, execution revision, nullable canonical file hash and timestamp independently of write recovery bodies. Status reads expose `pendingActionId` for unresolved writes; they never approve or resume work.
196
+
197
+ `coordination.json` includes required `comparisons`, an array bounded to 1,024 records validated by `PlanComparisonSchema`. Each record binds `sourceRevision`, `targetDirectory`, `targetRevision`, a `compatible` or `contradiction` verdict, `reason`, `reviewedAt` and reviewer provenance (`provider`, `cliVersion`, nullable observed `model`, and native message `reference`). A trusted coordinator writes these records while holding the same metadata lock. Core operations preserve them; status exposes only `comparisonCount`. They never change execution digests or grant authority. The coordinator owns relevance, freshness, semantic judgments, bounded review reads and any execution gate, including contradictions. The standalone core does not assess compatibility.
194
198
 
195
199
  The installed `plan-status` and `plan-milestones` commands accept `--state-root` and `--directory`; the latter also accepts `--limit` and `--cursor`. Use `request` for the closed JSON mutation commands. The result is a tagged `status`, `milestones`, `reconciliation`, `reconciliation-required`, `finalized` or `execution-check` object within the outer `plan` response. A retried finalization returns current status when its finalized artifact no longer exists or has changed.
196
200
 
@@ -200,11 +204,13 @@ Begin revision before invoking a planning skill. Execution admission closes unde
200
204
 
201
205
  The local host supplies checkout evidence as `{ repository, directory, claimReference, paths }`. Paths are exact relative task paths. The core streams their contents, records link targets without following them, includes missing paths as deletions, and captures the current Git branch/HEAD. It does not stage or reset files and rejects traversal, parent-link escapes, `.git` and excluded archive/backup directories. Check commands and references are trusted operator evidence; this primitive does not execute arbitrary submitted commands or treat an imported agent claim as verification.
202
206
 
203
- After native `jg-plan` removes milestones and native `jg-breakdown` regenerates them, close the planning controller before finalization. Only unique exact normalized title and complete-contract matches retain identity automatically. Every unmatched checkpoint source, including done and partial work, appears in one saved proposal. Confirmation decisions use `sourceIds`, `targetIds`, `relation` (`equivalent`, `requirements-changed`, `omitted`, `reopened`) and explicit one-to-one `retainedPairs`. One source ID cannot be assigned to multiple targets. Grouped decisions retain split/merged evidence. A complete equivalent mapping preserves verified completion or partial status; rewording does not create new checks. A changed requirement gets fresh pending identity. Explicit reopening preserves evidence while invalidating its completion credit. Unverified done markers cannot become verified through an equivalent mapping.
207
+ After native `jg-plan` revises the contract and an explicitly requested `jg-breakdown` regenerates a needed sequence, close the planning controller before finalization. Only unique exact normalized title and complete-contract matches retain identity automatically. Every unmatched checkpoint source, including done and partial work, appears in one saved proposal. Confirmation decisions use `sourceIds`, `targetIds`, `relation` (`equivalent`, `requirements-changed`, `omitted`, `reopened`) and explicit one-to-one `retainedPairs`. One source ID cannot be assigned to multiple targets. Grouped decisions retain split/merged evidence. A complete equivalent mapping preserves verified completion or partial status; rewording does not create new checks. A changed requirement gets fresh pending identity. Explicit reopening preserves evidence while invalidating its completion credit. Unverified done markers cannot become verified through an equivalent mapping.
208
+
209
+ A whole-plan checkpoint retains null milestones and an empty milestone inventory. If a revision removes a sequence because the remaining scope no longer needs one, every unmatched checkpoint milestone still requires explicit omission confirmation. Its verified evidence remains available; absence alone never resets progress or authorizes whole-plan execution.
204
210
 
205
211
  The proposal and assigned identities are persisted before the canonical file is replaced. Retry the same action and payload after a partial write; do not regenerate UUIDs or confirm a different proposal. Present the complete canonical output before sequence approval. Applicable plan and sequence approvals are required again after digest changes. Approval does not resume work: send a fresh `authorize` with the intended mode and scope. Execution authority is also bound to the current runtime epoch.
206
212
 
207
- Guided native input adds `plan: { kind: 'execution', authorizationId, milestoneId, mode, revision }` or `{ kind: 'planning', revisionId, invocationId }` to its action envelope. The controller binds this context atomically to the managed thread. Planning starts with the exact authorized native skill. A live thread cannot switch scopes; close it before an explicit resume under a different scope. Queued input retains its original scope and cannot run under stale approval or during revision. Ordinary input on a bound thread remains subject to its current gate. Native permissions are still separate exact-request replies.
213
+ Guided native input adds `plan: { kind: 'execution', authorizationId, milestoneId, mode, revision }` or `{ kind: 'planning', revisionId, invocationId }` to its action envelope. The controller binds this context atomically to the managed thread. Planning starts with the exact authorized native skill. A live thread cannot switch scopes; close it before an explicit resume under a different scope. Queued input retains its original scope and cannot run under stale approval or during revision. Ordinary input on a bound thread retains that exact scope and remains subject to its current gate, including after revocation or completion. It cannot silently become unscoped input. Renaming and explicit replies to an existing native permission/question remain separate, revision-guarded controls; neither starts a new implementation turn or restores execution authority. Native permissions still require the exact pending request.
208
214
 
209
215
  Selected status/admission/queue observations detect external contract edits or milestone deletion, persist a closed gate and request exact bound-thread interruption. These observations grant no operator authority and report uncertain in-flight effects. The finalized baseline retains identities and completion evidence for explicit reconciliation of direct CLI edits. Invalid artifacts fail explicitly. No directory scan or filesystem watcher is used. Status projects Revising, approval/breakdown requirements, Ready, In progress, Completed and Blocked independently of provider process state.
210
216
 
@@ -244,7 +250,7 @@ Creation may still be pending when its response arrives. Read `show` until its c
244
250
 
245
251
  Collection reads exactly the requested native page through the provider adapter and accepts only one non-truncated agent message from the handoff's completed reviewer turn. Finding bodies are limited to 8 KiB UTF-8, never silently shortened. To select a later page, use the same `limit`, turn filter and preceding cursor as the native items read. A different message or changed body cannot overwrite collected findings. Full histories remain with the native CLIs. Persisted reviewer references retain the exact native session, turn and item identities.
246
252
 
247
- Feedback resolves installed `jg-feedback` in the author thread and carries the selected findings with exact source, reviewer, item, revision and commit references. Source contract or selected Git HEAD changes invalidate an unsent preview. The action's optional `expectedPlan` guards the author's captured revision under the existing plan lock; explicit `null` requires an unbound thread. This guard applies only to `message` and `queue`, grants no execution scope, and cannot answer tool permissions. Known native identities cannot be reassigned; existing control admission preserves the exact author for queued feedback. Existing revision gates pause stale queued feedback. Neither handoff delivery nor a completed assessment turn means recommendations were accepted or implementation was authorized.
253
+ Feedback resolves installed `jg-feedback` in the author thread and carries the selected findings with exact source, reviewer, item, revision and commit references. Source contract or selected Git HEAD changes invalidate an unsent preview. The action's optional `expectedPlan` guards the author's captured revision under the existing plan lock; explicit `null` requires an unbound thread. This guard applies only to `message` and `queue`, grants no execution scope, and cannot answer tool permissions. An explicitly selected native `jg-feedback` skill with a matching `expectedPlan` uses a neutral revision guard, so assessment remains available after execution is revoked or completed. It preserves the thread's existing implementation binding; ordinary input still requires valid execution authority. Queued assessment keeps that same revision guard at automatic or explicit dispatch. Known native identities cannot be reassigned; existing control admission preserves the exact author for queued feedback. Existing revision gates pause stale queued feedback. Neither handoff delivery nor a completed assessment turn means recommendations were accepted or implementation was authorized.
248
254
 
249
255
  Delivery is `prepared`, `queued`, `submitted`, `delivered`, `uncertain`, `failed` or `canceled`; native `completion` is separately null, `completed`, `failed` or `interrupted`. Acknowledgement alone becomes `delivered`. Busy destinations use native next-turn queues, including while waiting for permissions; feedback is never written as a permission answer. Pending native permissions remain explicit actions on their own channels. No automatic feedback, response loop, approval or publication follows collection.
250
256
 
@@ -2,16 +2,16 @@ import { z } from 'zod';
2
2
  export declare const ActionCommandSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
3
  kind: z.ZodLiteral<"thread-create">;
4
4
  provider: z.ZodEnum<{
5
- codex: "codex";
6
5
  claude: "claude";
6
+ codex: "codex";
7
7
  }>;
8
8
  workspaceRoot: z.ZodString;
9
9
  name: z.ZodString;
10
10
  }, z.core.$strict>, z.ZodObject<{
11
11
  kind: z.ZodLiteral<"thread-adopt">;
12
12
  provider: z.ZodEnum<{
13
- codex: "codex";
14
13
  claude: "claude";
14
+ codex: "codex";
15
15
  }>;
16
16
  workspaceRoot: z.ZodString;
17
17
  nativeId: z.ZodString;
@@ -112,7 +112,7 @@ export type IActionCommand = z.infer<typeof ActionCommandSchema>;
112
112
  export declare const PlanActionScopeSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
113
113
  kind: z.ZodLiteral<"execution">;
114
114
  authorizationId: z.ZodUUID;
115
- milestoneId: z.ZodUUID;
115
+ milestoneId: z.ZodNullable<z.ZodUUID>;
116
116
  mode: z.ZodEnum<{
117
117
  supervised: "supervised";
118
118
  auto: "auto";
@@ -132,7 +132,7 @@ export declare const ActionPlanContextSchema: z.ZodObject<{
132
132
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
133
133
  kind: z.ZodLiteral<"execution">;
134
134
  authorizationId: z.ZodUUID;
135
- milestoneId: z.ZodUUID;
135
+ milestoneId: z.ZodNullable<z.ZodUUID>;
136
136
  mode: z.ZodEnum<{
137
137
  supervised: "supervised";
138
138
  auto: "auto";
@@ -158,16 +158,16 @@ export declare const ActionEnvelopeSchema: z.ZodObject<{
158
158
  command: z.ZodDiscriminatedUnion<[z.ZodObject<{
159
159
  kind: z.ZodLiteral<"thread-create">;
160
160
  provider: z.ZodEnum<{
161
- codex: "codex";
162
161
  claude: "claude";
162
+ codex: "codex";
163
163
  }>;
164
164
  workspaceRoot: z.ZodString;
165
165
  name: z.ZodString;
166
166
  }, z.core.$strict>, z.ZodObject<{
167
167
  kind: z.ZodLiteral<"thread-adopt">;
168
168
  provider: z.ZodEnum<{
169
- codex: "codex";
170
169
  claude: "claude";
170
+ codex: "codex";
171
171
  }>;
172
172
  workspaceRoot: z.ZodString;
173
173
  nativeId: z.ZodString;
@@ -267,7 +267,7 @@ export declare const ActionEnvelopeSchema: z.ZodObject<{
267
267
  plan: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
268
268
  kind: z.ZodLiteral<"execution">;
269
269
  authorizationId: z.ZodUUID;
270
- milestoneId: z.ZodUUID;
270
+ milestoneId: z.ZodNullable<z.ZodUUID>;
271
271
  mode: z.ZodEnum<{
272
272
  supervised: "supervised";
273
273
  auto: "auto";
@@ -286,7 +286,7 @@ export declare const ActionEnvelopeSchema: z.ZodObject<{
286
286
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
287
287
  kind: z.ZodLiteral<"execution">;
288
288
  authorizationId: z.ZodUUID;
289
- milestoneId: z.ZodUUID;
289
+ milestoneId: z.ZodNullable<z.ZodUUID>;
290
290
  mode: z.ZodEnum<{
291
291
  supervised: "supervised";
292
292
  auto: "auto";
@@ -354,7 +354,7 @@ export declare const ActionReceiptSchema: z.ZodObject<{
354
354
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
355
355
  kind: z.ZodLiteral<"execution">;
356
356
  authorizationId: z.ZodUUID;
357
- milestoneId: z.ZodUUID;
357
+ milestoneId: z.ZodNullable<z.ZodUUID>;
358
358
  mode: z.ZodEnum<{
359
359
  supervised: "supervised";
360
360
  auto: "auto";
@@ -430,7 +430,7 @@ export declare const ActionSummarySchema: z.ZodObject<{
430
430
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
431
431
  kind: z.ZodLiteral<"execution">;
432
432
  authorizationId: z.ZodUUID;
433
- milestoneId: z.ZodUUID;
433
+ milestoneId: z.ZodNullable<z.ZodUUID>;
434
434
  mode: z.ZodEnum<{
435
435
  supervised: "supervised";
436
436
  auto: "auto";
@@ -455,8 +455,8 @@ export type IActionSummary = z.infer<typeof ActionSummarySchema>;
455
455
  export declare const ManagedThreadSchema: z.ZodObject<{
456
456
  id: z.ZodUUID;
457
457
  provider: z.ZodEnum<{
458
- codex: "codex";
459
458
  claude: "claude";
459
+ codex: "codex";
460
460
  }>;
461
461
  nativeId: z.ZodNullable<z.ZodString>;
462
462
  name: z.ZodString;
@@ -78,7 +78,7 @@ export const PlanActionScopeSchema = z.discriminatedUnion('kind', [
78
78
  z.strictObject({
79
79
  kind: z.literal('execution'),
80
80
  authorizationId: z.uuid(),
81
- milestoneId: z.uuid(),
81
+ milestoneId: z.uuid().nullable(),
82
82
  mode: z.enum(['supervised', 'auto']),
83
83
  revision: PlanRevisionSchema,
84
84
  }),
@@ -2,8 +2,8 @@ import { z } from 'zod';
2
2
  export declare const HandoffSourceSchema: z.ZodObject<{
3
3
  threadId: z.ZodUUID;
4
4
  provider: z.ZodEnum<{
5
- codex: "codex";
6
5
  claude: "claude";
6
+ codex: "codex";
7
7
  }>;
8
8
  nativeId: z.ZodString;
9
9
  workspaceRoot: z.ZodString;
@@ -12,7 +12,7 @@ export declare const HandoffSourceSchema: z.ZodObject<{
12
12
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
13
13
  kind: z.ZodLiteral<"execution">;
14
14
  authorizationId: z.ZodUUID;
15
- milestoneId: z.ZodUUID;
15
+ milestoneId: z.ZodNullable<z.ZodUUID>;
16
16
  mode: z.ZodEnum<{
17
17
  supervised: "supervised";
18
18
  auto: "auto";
@@ -116,8 +116,8 @@ export declare const HandoffSummarySchema: z.ZodObject<{
116
116
  source: z.ZodObject<{
117
117
  threadId: z.ZodUUID;
118
118
  provider: z.ZodEnum<{
119
- codex: "codex";
120
119
  claude: "claude";
120
+ codex: "codex";
121
121
  }>;
122
122
  nativeId: z.ZodString;
123
123
  workspaceRoot: z.ZodString;
@@ -126,7 +126,7 @@ export declare const HandoffSummarySchema: z.ZodObject<{
126
126
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
127
127
  kind: z.ZodLiteral<"execution">;
128
128
  authorizationId: z.ZodUUID;
129
- milestoneId: z.ZodUUID;
129
+ milestoneId: z.ZodNullable<z.ZodUUID>;
130
130
  mode: z.ZodEnum<{
131
131
  supervised: "supervised";
132
132
  auto: "auto";
@@ -150,8 +150,8 @@ export declare const HandoffSummarySchema: z.ZodObject<{
150
150
  targetThreadId: z.ZodNullable<z.ZodUUID>;
151
151
  targetNativeId: z.ZodNullable<z.ZodString>;
152
152
  targetProvider: z.ZodEnum<{
153
- codex: "codex";
154
153
  claude: "claude";
154
+ codex: "codex";
155
155
  }>;
156
156
  creation: z.ZodObject<{
157
157
  actionId: z.ZodNullable<z.ZodUUID>;
@@ -219,8 +219,8 @@ export declare const HandoffSchema: z.ZodObject<{
219
219
  source: z.ZodObject<{
220
220
  threadId: z.ZodUUID;
221
221
  provider: z.ZodEnum<{
222
- codex: "codex";
223
222
  claude: "claude";
223
+ codex: "codex";
224
224
  }>;
225
225
  nativeId: z.ZodString;
226
226
  workspaceRoot: z.ZodString;
@@ -229,7 +229,7 @@ export declare const HandoffSchema: z.ZodObject<{
229
229
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
230
230
  kind: z.ZodLiteral<"execution">;
231
231
  authorizationId: z.ZodUUID;
232
- milestoneId: z.ZodUUID;
232
+ milestoneId: z.ZodNullable<z.ZodUUID>;
233
233
  mode: z.ZodEnum<{
234
234
  supervised: "supervised";
235
235
  auto: "auto";
@@ -253,8 +253,8 @@ export declare const HandoffSchema: z.ZodObject<{
253
253
  targetThreadId: z.ZodNullable<z.ZodUUID>;
254
254
  targetNativeId: z.ZodNullable<z.ZodString>;
255
255
  targetProvider: z.ZodEnum<{
256
- codex: "codex";
257
256
  claude: "claude";
257
+ codex: "codex";
258
258
  }>;
259
259
  creation: z.ZodObject<{
260
260
  actionId: z.ZodNullable<z.ZodUUID>;
@@ -353,8 +353,8 @@ export declare const HandoffResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
353
353
  source: z.ZodObject<{
354
354
  threadId: z.ZodUUID;
355
355
  provider: z.ZodEnum<{
356
- codex: "codex";
357
356
  claude: "claude";
357
+ codex: "codex";
358
358
  }>;
359
359
  nativeId: z.ZodString;
360
360
  workspaceRoot: z.ZodString;
@@ -363,7 +363,7 @@ export declare const HandoffResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
363
363
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
364
364
  kind: z.ZodLiteral<"execution">;
365
365
  authorizationId: z.ZodUUID;
366
- milestoneId: z.ZodUUID;
366
+ milestoneId: z.ZodNullable<z.ZodUUID>;
367
367
  mode: z.ZodEnum<{
368
368
  supervised: "supervised";
369
369
  auto: "auto";
@@ -387,8 +387,8 @@ export declare const HandoffResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
387
387
  targetThreadId: z.ZodNullable<z.ZodUUID>;
388
388
  targetNativeId: z.ZodNullable<z.ZodString>;
389
389
  targetProvider: z.ZodEnum<{
390
- codex: "codex";
391
390
  claude: "claude";
391
+ codex: "codex";
392
392
  }>;
393
393
  creation: z.ZodObject<{
394
394
  actionId: z.ZodNullable<z.ZodUUID>;
@@ -486,8 +486,8 @@ export declare const HandoffResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
486
486
  source: z.ZodObject<{
487
487
  threadId: z.ZodUUID;
488
488
  provider: z.ZodEnum<{
489
- codex: "codex";
490
489
  claude: "claude";
490
+ codex: "codex";
491
491
  }>;
492
492
  nativeId: z.ZodString;
493
493
  workspaceRoot: z.ZodString;
@@ -496,7 +496,7 @@ export declare const HandoffResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
496
496
  scope: z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
497
497
  kind: z.ZodLiteral<"execution">;
498
498
  authorizationId: z.ZodUUID;
499
- milestoneId: z.ZodUUID;
499
+ milestoneId: z.ZodNullable<z.ZodUUID>;
500
500
  mode: z.ZodEnum<{
501
501
  supervised: "supervised";
502
502
  auto: "auto";
@@ -520,8 +520,8 @@ export declare const HandoffResultSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
520
520
  targetThreadId: z.ZodNullable<z.ZodUUID>;
521
521
  targetNativeId: z.ZodNullable<z.ZodString>;
522
522
  targetProvider: z.ZodEnum<{
523
- codex: "codex";
524
523
  claude: "claude";
524
+ codex: "codex";
525
525
  }>;
526
526
  creation: z.ZodObject<{
527
527
  actionId: z.ZodNullable<z.ZodUUID>;
@@ -5,8 +5,8 @@ export { ActionCommandSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionS
5
5
  export type { IActionCommand, IActionEnvelope, IActionReceipt, IActionSummary, IManagedThread, INativeApproval, ILifecycleEvent, } from './actions/index.js';
6
6
  export { SkillIdSchema, NativeSkillInputSchema, SkillSchema, SkillPageSchema, SkillPreviewSchema, MessageInputSchema, } from './skills/index.js';
7
7
  export type { INativeSkillInput, ISkill, ISkillPage, ISkillPreview, IMessageInput, } from './skills/index.js';
8
- export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './plans/index.js';
9
- export type { IPlanRevision, IPlanMetadata, IPlanTarget, IPlanOperatorAction, IPlanCommand, IPlanCommandInput, IPlanCoordination, IPlanMilestone, IPlanStatus, IPlanResult, } from './plans/index.js';
8
+ export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanComparisonSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './plans/index.js';
9
+ export type { IPlanRevision, IPlanMetadata, IPlanTarget, IPlanOperatorAction, IPlanCommand, IPlanCommandInput, IPlanCoordination, IPlanComparison, IPlanMilestone, IPlanStatus, IPlanResult, } from './plans/index.js';
10
10
  export { PlanCheckSchema, PlanCheckoutSchema, PlanWorktreeProofSchema, PlanCompletionSchema, PlanSnapshotMilestoneSchema, PlanCorrespondenceSchema, PlanDraftMilestoneSchema, PlanProposalSchema, PlanRevisionWorkflowSchema, PlanCorrespondenceRecordSchema, PlanCoordinationSummarySchema, } from './plans/index.js';
11
11
  export type { IPlanCheckout, IPlanWorktreeProof, IPlanCompletion, IPlanSnapshotMilestone, IPlanCorrespondence, IPlanDraftMilestone, IPlanProposal, IPlanRevisionWorkflow, IPlanCorrespondenceRecord, } from './plans/index.js';
12
12
  export { PlanCheckpointSchema } from './plans/index.js';
@@ -7,7 +7,7 @@ export { ActionCommandSchema, ActionEnvelopeSchema, ActionReceiptSchema, ActionS
7
7
  // native skills and explicit message input
8
8
  export { SkillIdSchema, NativeSkillInputSchema, SkillSchema, SkillPageSchema, SkillPreviewSchema, MessageInputSchema, } from './skills/index.js';
9
9
  // plan revisions and explicit authority
10
- export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './plans/index.js';
10
+ export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanComparisonSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './plans/index.js';
11
11
  // revision checkpoints and retained verification
12
12
  export { PlanCheckSchema, PlanCheckoutSchema, PlanWorktreeProofSchema, PlanCompletionSchema, PlanSnapshotMilestoneSchema, PlanCorrespondenceSchema, PlanDraftMilestoneSchema, PlanProposalSchema, PlanRevisionWorkflowSchema, PlanCorrespondenceRecordSchema, PlanCoordinationSummarySchema, } from './plans/index.js';
13
13
  // saved revision baseline
@@ -1,5 +1,5 @@
1
- export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './types.js';
2
- export type { IPlanRevision, IPlanMetadata, IPlanTarget, IPlanOperatorAction, IPlanCommand, IPlanCommandInput, IPlanCoordination, IPlanMilestone, IPlanStatus, IPlanResult, } from './types.js';
1
+ export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanComparisonSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './types.js';
2
+ export type { IPlanRevision, IPlanMetadata, IPlanTarget, IPlanOperatorAction, IPlanCommand, IPlanCommandInput, IPlanCoordination, IPlanComparison, IPlanMilestone, IPlanStatus, IPlanResult, } from './types.js';
3
3
  export { PlanCheckSchema, PlanCheckoutSchema, PlanWorktreeProofSchema, PlanCompletionSchema, PlanSnapshotMilestoneSchema, PlanCorrespondenceSchema, PlanDraftMilestoneSchema, PlanProposalSchema, PlanRevisionWorkflowSchema, PlanCorrespondenceRecordSchema, PlanCoordinationSummarySchema, } from './types.js';
4
4
  export type { IPlanCheckout, IPlanWorktreeProof, IPlanCompletion, IPlanSnapshotMilestone, IPlanCorrespondence, IPlanDraftMilestone, IPlanProposal, IPlanRevisionWorkflow, IPlanCorrespondenceRecord, } from './types.js';
5
5
  export { PlanCheckpointSchema } from './types.js';
@@ -1,5 +1,5 @@
1
1
  // revision, provenance and plan contracts
2
- export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './types.js';
2
+ export { PlanDigestSchema, PlanRevisionSchema, PlanMetadataSchema, PlanTargetSchema, PlanOperatorActionSchema, PlanCommandSchema, PlanApprovalSchema, PlanExecutionSchema, PlanFinalizationSchema, PlanComparisonSchema, PlanCoordinationSchema, PlanMilestoneSchema, PlanStatusSchema, PlanResultSchema, } from './types.js';
3
3
  // revision checkpoints and retained verification
4
4
  export { PlanCheckSchema, PlanCheckoutSchema, PlanWorktreeProofSchema, PlanCompletionSchema, PlanSnapshotMilestoneSchema, PlanCorrespondenceSchema, PlanDraftMilestoneSchema, PlanProposalSchema, PlanRevisionWorkflowSchema, PlanCorrespondenceRecordSchema, PlanCoordinationSummarySchema, } from './types.js';
5
5
  // saved revision baseline