@uchibeke/gallivant 0.0.0-stage → 0.2.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.
Files changed (168) hide show
  1. package/CONTRIBUTING.md +26 -0
  2. package/LICENSE +204 -0
  3. package/README.md +201 -2
  4. package/SECURITY.md +19 -0
  5. package/bin/gallivant.mjs +257 -0
  6. package/bin/package-plugin.mjs +16 -0
  7. package/bin/release-live.mjs +29 -0
  8. package/bin/release-package.mjs +23 -0
  9. package/bin/session-runtime.mjs +13 -0
  10. package/bin/task-delivery-state.mjs +12 -0
  11. package/docs/README.md +70 -0
  12. package/docs/agent-setup.md +214 -0
  13. package/docs/app.md +111 -0
  14. package/docs/architecture.md +265 -0
  15. package/docs/chains.md +102 -0
  16. package/docs/codex-cloud.md +284 -0
  17. package/docs/commands.md +620 -0
  18. package/docs/config.md +430 -0
  19. package/docs/execution.md +796 -0
  20. package/docs/guardrails.md +311 -0
  21. package/docs/install.md +338 -0
  22. package/docs/launch.md +42 -0
  23. package/docs/learning.md +369 -0
  24. package/docs/network-recovery.md +101 -0
  25. package/docs/openai-agents.md +457 -0
  26. package/docs/prd.md +246 -0
  27. package/docs/preparation.md +110 -0
  28. package/docs/release-qualification.md +196 -0
  29. package/docs/releasing.md +140 -0
  30. package/docs/runtime-environment.md +113 -0
  31. package/docs/task-delivery.md +476 -0
  32. package/docs/tasks.md +739 -0
  33. package/lib/aport.mjs +95 -0
  34. package/lib/attribution.mjs +95 -0
  35. package/lib/block.mjs +89 -0
  36. package/lib/capabilities.mjs +3 -0
  37. package/lib/chains.mjs +222 -0
  38. package/lib/codex_cloud.mjs +160 -0
  39. package/lib/codex_cloud_config.mjs +20 -0
  40. package/lib/codex_cloud_input.mjs +49 -0
  41. package/lib/codex_cloud_result.mjs +74 -0
  42. package/lib/commands/doctor.mjs +457 -0
  43. package/lib/commands/init.mjs +34 -0
  44. package/lib/commands/learn.mjs +54 -0
  45. package/lib/commands/new.mjs +47 -0
  46. package/lib/commands/ready.mjs +45 -0
  47. package/lib/commands/register.mjs +195 -0
  48. package/lib/commands/resume.mjs +224 -0
  49. package/lib/commands/serve.mjs +349 -0
  50. package/lib/commands/start.mjs +247 -0
  51. package/lib/commands/start_services.mjs +22 -0
  52. package/lib/commands/status.mjs +150 -0
  53. package/lib/commands/task.mjs +73 -0
  54. package/lib/commands/up.mjs +228 -0
  55. package/lib/commands/why.mjs +143 -0
  56. package/lib/config.mjs +461 -0
  57. package/lib/context.mjs +100 -0
  58. package/lib/control.mjs +202 -0
  59. package/lib/control_contract.mjs +16 -0
  60. package/lib/coordinator.mjs +19 -0
  61. package/lib/credential.mjs +161 -0
  62. package/lib/daemon.mjs +156 -0
  63. package/lib/deliverable.mjs +357 -0
  64. package/lib/events.mjs +261 -0
  65. package/lib/executable.mjs +31 -0
  66. package/lib/execution.mjs +631 -0
  67. package/lib/execution_contract.mjs +15 -0
  68. package/lib/execution_input.mjs +4 -0
  69. package/lib/execution_io.mjs +94 -0
  70. package/lib/execution_journal.mjs +69 -0
  71. package/lib/execution_preparation.mjs +29 -0
  72. package/lib/execution_result.mjs +266 -0
  73. package/lib/fs.mjs +133 -0
  74. package/lib/gh.mjs +289 -0
  75. package/lib/git.mjs +434 -0
  76. package/lib/harness.mjs +521 -0
  77. package/lib/harness_log.mjs +432 -0
  78. package/lib/hash.mjs +16 -0
  79. package/lib/identity.mjs +98 -0
  80. package/lib/learning.mjs +654 -0
  81. package/lib/learning_contract.mjs +2 -0
  82. package/lib/learning_data.mjs +135 -0
  83. package/lib/learning_input.mjs +111 -0
  84. package/lib/learning_qualification.mjs +67 -0
  85. package/lib/learning_signer.mjs +151 -0
  86. package/lib/learning_store.mjs +88 -0
  87. package/lib/log.mjs +53 -0
  88. package/lib/network_diagnostics.mjs +64 -0
  89. package/lib/network_recovery.mjs +42 -0
  90. package/lib/notify.mjs +58 -0
  91. package/lib/openai_agents.mjs +373 -0
  92. package/lib/openai_agents_config.mjs +14 -0
  93. package/lib/openai_agents_http.mjs +87 -0
  94. package/lib/openai_agents_input.mjs +15 -0
  95. package/lib/openai_agents_sources.mjs +112 -0
  96. package/lib/owner_delivery.mjs +443 -0
  97. package/lib/plugin_package.mjs +340 -0
  98. package/lib/prd.mjs +635 -0
  99. package/lib/preparation_agents.mjs +33 -0
  100. package/lib/preparation_codex.mjs +212 -0
  101. package/lib/probe.mjs +126 -0
  102. package/lib/prompt.mjs +238 -0
  103. package/lib/provider_health.mjs +55 -0
  104. package/lib/public-format.mjs +31 -0
  105. package/lib/public_output.mjs +49 -0
  106. package/lib/release_package.mjs +154 -0
  107. package/lib/repository_files.mjs +86 -0
  108. package/lib/run.mjs +385 -0
  109. package/lib/run_log.mjs +94 -0
  110. package/lib/runtime-environment.mjs +87 -0
  111. package/lib/runtime_dependencies.mjs +15 -0
  112. package/lib/runtime_node.mjs +107 -0
  113. package/lib/runtime_state.mjs +174 -0
  114. package/lib/sources/index.mjs +27 -0
  115. package/lib/sources/prd.mjs +50 -0
  116. package/lib/start_contract.mjs +37 -0
  117. package/lib/state.mjs +246 -0
  118. package/lib/task_allowance.mjs +31 -0
  119. package/lib/task_completion.mjs +61 -0
  120. package/lib/task_contract.mjs +450 -0
  121. package/lib/task_delivery.mjs +219 -0
  122. package/lib/task_delivery_cancel.mjs +34 -0
  123. package/lib/task_delivery_contract.mjs +61 -0
  124. package/lib/task_delivery_mcp.mjs +40 -0
  125. package/lib/task_delivery_store.mjs +43 -0
  126. package/lib/task_delivery_view.mjs +88 -0
  127. package/lib/task_environment.mjs +281 -0
  128. package/lib/task_prepare.mjs +224 -0
  129. package/lib/task_store.mjs +38 -0
  130. package/lib/tasks.mjs +513 -0
  131. package/lib/tick.mjs +1635 -0
  132. package/lib/time.mjs +36 -0
  133. package/lib/tracker/assets.mjs +43 -0
  134. package/lib/tracker/pages.mjs +320 -0
  135. package/lib/tracker/runs.mjs +102 -0
  136. package/lib/tracker/stream.mjs +74 -0
  137. package/lib/tracker_process.mjs +107 -0
  138. package/lib/verification_sandbox.mjs +181 -0
  139. package/node_modules/smol-toml/LICENSE +24 -0
  140. package/node_modules/smol-toml/README.md +605 -0
  141. package/node_modules/smol-toml/dist/date.d.ts +41 -0
  142. package/node_modules/smol-toml/dist/date.js +156 -0
  143. package/node_modules/smol-toml/dist/error.d.ts +37 -0
  144. package/node_modules/smol-toml/dist/error.js +67 -0
  145. package/node_modules/smol-toml/dist/extract.js +289 -0
  146. package/node_modules/smol-toml/dist/index.cjs +770 -0
  147. package/node_modules/smol-toml/dist/index.d.ts +44 -0
  148. package/node_modules/smol-toml/dist/index.js +34 -0
  149. package/node_modules/smol-toml/dist/parse.d.ts +73 -0
  150. package/node_modules/smol-toml/dist/parse.js +164 -0
  151. package/node_modules/smol-toml/dist/primitive.js +151 -0
  152. package/node_modules/smol-toml/dist/stringify.d.ts +32 -0
  153. package/node_modules/smol-toml/dist/stringify.js +219 -0
  154. package/node_modules/smol-toml/dist/struct.js +156 -0
  155. package/node_modules/smol-toml/dist/util.d.ts +43 -0
  156. package/node_modules/smol-toml/dist/util.js +57 -0
  157. package/node_modules/smol-toml/package.json +68 -0
  158. package/npm-shrinkwrap.json +1823 -0
  159. package/package.json +105 -4
  160. package/templates/claude-settings.json +18 -0
  161. package/templates/passport.gallivant.json +83 -0
  162. package/templates/plugin/bundled-runtime.json +26 -0
  163. package/templates/plugin/schemas/mcp.schema.json +120 -0
  164. package/templates/plugin/schemas/plugin.schema.json +65 -0
  165. package/templates/plugin/task-delivery.SKILL.md +60 -0
  166. package/templates/prd.md +32 -0
  167. package/templates/tracker/tracker.css +301 -0
  168. package/templates/tracker/tracker.js +721 -0
package/docs/chains.md ADDED
@@ -0,0 +1,102 @@
1
+ # PRD chains
2
+
3
+ **Gallivant automates delivery; humans approve integration.** A chain starts its next PRD only after GitHub confirms
4
+ that the preceding PR was merged into the planned base branch. Gallivant never merges PRs. Passing tests, an accepted
5
+ receipt, `ready-for-human`, and a finished agent session are progress toward that decision; none starts the next task.
6
+
7
+ This lets you approve a multi-hour or multi-day plan once, then review meaningful milestones as they arrive. It does
8
+ not promise uninterrupted execution while you are unavailable: a dependent chain waits for your merge. Put cohesive
9
+ implementation steps inside one PRD to keep the number of integration decisions manageable.
10
+ Research and documentation milestones work the same way when their outputs live
11
+ in the repository and have concrete verification. Natural-language task intake
12
+ can prepare individual briefs, but `chain` itself takes ready PRD paths; it does
13
+ not infer dependencies from chat or queue unfinished intake sessions. Hosted and
14
+ local implementations retain the same human merge gate, and the coordinator must
15
+ remain running to observe it.
16
+
17
+ ## Queue a plan
18
+
19
+ Create each PRD in the repository it describes and mark it ready:
20
+
21
+ ```sh
22
+ gallivant ready docs/prds/foundation.md
23
+ gallivant ready docs/prds/integration.md
24
+ gallivant ready docs/prds/launch.md
25
+ gallivant chain launch docs/prds/foundation.md docs/prds/integration.md docs/prds/launch.md
26
+ ```
27
+
28
+ A chain requires at least two ready PRDs, all in one checkout of the same repository and targeting the same base
29
+ branch. Configure that repository's [base](config.md#the-base-branch) before queueing, or pass `--base <branch>` when
30
+ creating the chain. Every task must be new to Gallivant; existing
31
+ registered runs and IDs already reserved by another chain are refused. Do not start queued PRDs separately.
32
+
33
+ Queueing records the approved order, base, and fingerprints of the PRDs and their carried `sources` files. It brings
34
+ up the existing daemon if needed. The daemon starts the first task, uses the ordinary implementation and review loop,
35
+ then waits for the merge. Each successor starts in its own checkout from the updated base. A final merge completes
36
+ the chain; closing any milestone's PR without merging stops it.
37
+
38
+ The scope is deliberately linear: one repository, one base, one active milestone per chain. There is no dependency
39
+ graph, stacked-PR mode or automatic merge. Unrelated tasks and other chains can run independently.
40
+
41
+ ## Inspect progress
42
+
43
+ ```sh
44
+ gallivant chain # list chains
45
+ gallivant chain launch # milestones and the current wait or stop
46
+ gallivant status # run status and chain progress
47
+ gallivant why your-repo#123 # details for a started milestone
48
+ ```
49
+
50
+ Merge the current PR when you accept it. There is no separate close or next-step command. The daemon checks the
51
+ actual PR state and intended base, then verifies that the successor's base contains the merge commit. A local
52
+ `done` entry alone is insufficient because it can also describe a closed, unmerged PR.
53
+
54
+ If the current task needs a correction, use the existing `say`, `recheck` or `resume` commands for that run. Its
55
+ session, checkout and review budget belong to the normal run lifecycle. Recovering that task does not require a
56
+ second chain retry; the chain continues watching its current milestone.
57
+
58
+ ## Change the remaining plan
59
+
60
+ Changing a queued PRD or a carried source pauses dispatch rather than silently accepting new instructions. Review
61
+ the changes, run `ready` for any updated brief, then explicitly approve the unstarted portion again:
62
+
63
+ ```sh
64
+ gallivant chain launch --retry --resnapshot
65
+ ```
66
+
67
+ This only reapproves briefs and sources for tasks that have not started. To update an active task, use
68
+ `gallivant resume <handle> --resnapshot` instead. The chain's order, task identities and base stay fixed; cancel and
69
+ queue a new plan if those need to change.
70
+
71
+ Keep `sources` for planning inputs that the successor should carry unchanged. Read predecessor implementations and
72
+ generated artifacts from the newly merged base. Gallivant refuses to overwrite a base file changed since queueing
73
+ with an older carried copy; reconcile the planning input before retrying. Keep the checkout containing the approved
74
+ briefs available until they have started.
75
+
76
+ ## Recover or cancel
77
+
78
+ After fixing a chain-level problem, retry its checks:
79
+
80
+ ```sh
81
+ gallivant chain launch --retry
82
+ ```
83
+
84
+ Retry does not approve edited briefs, reset iteration counts, or turn an unmerged PR into a satisfied dependency.
85
+ It applies only to a stopped chain. If you reopen a closed PR and want Gallivant to continue its review loop, register
86
+ that PR again before retrying the chain; a locally `done` run is not resumed merely by reopening its GitHub PR.
87
+ If a daemon stopped during dispatch and cannot prove whether a session started, the chain stops for inspection.
88
+ Check the chain detail, `gallivant why <handle>` when an entry exists, the run logs and `~/.gallivant/daemon.log`.
89
+ Retry never clears an ambiguous pending-start claim. Do not delete claims or worktrees merely to force another
90
+ start: an earlier process may still be working there.
91
+
92
+ To stop future dispatch:
93
+
94
+ ```sh
95
+ gallivant chain launch --cancel
96
+ ```
97
+
98
+ Cancellation preserves already started sessions, branches, PRs and checkouts. An active milestone remains under
99
+ the ordinary review loop. It does not cancel or undo work that has already started.
100
+
101
+ Chain approval and unstarted milestones live in local `state.json`; unlike an open PR's identity, they cannot be
102
+ reconstructed from GitHub. Preserve your Gallivant home when moving the daemon to another machine.
@@ -0,0 +1,284 @@
1
+ # Codex Cloud execution
2
+
3
+ **This is Codex Cloud, not local Codex or Claude Code.** New Cloud dispatch is
4
+ disabled because Gallivant cannot verify which repository the selected Cloud
5
+ environment is connected to through the supported CLI interface. Sending work
6
+ without that binding could target a different repository. Local `codex` and
7
+ `claude` execution remain available; API-backed `openai-agents` is a separate
8
+ implemented integration. See the [support table](../README.md#harness-support).
9
+ There is no bypass flag; enabling this adapter requires a supported verification
10
+ interface and qualification of the full repository/account boundary.
11
+
12
+ `codex-cloud` implements the experimental Codex CLI transport through the shared
13
+ task, execution journal, polling, GitHub gates and result writer. **New dispatch
14
+ is unavailable:** the pinned CLI cannot prove which repository is connected to
15
+ the selected environment. Read diagnostics and recovery of previously owned
16
+ tasks remain available. Its implementation is offline tested; live qualification
17
+ is **unverified**. Local Codex and `openai-agents` retain their existing defaults
18
+ and continuation behavior.
19
+
20
+ ## Trusted worker setup
21
+
22
+ Use a trusted operator or self-hosted Node 22+ worker with persistent private
23
+ state, Git/gh and the existing enforced verification sandbox. The pinned CLI
24
+ version is **0.160.0**. Newer versions require command/output requalification;
25
+ experimental compatibility is not inferred from a greater version number.
26
+ Install and sign in using the exact configured executable:
27
+
28
+ ```sh
29
+ "/absolute/path/to/codex" --version
30
+ "/absolute/path/to/codex" login
31
+ "/absolute/path/to/codex" login status
32
+ "/absolute/path/to/codex" cloud
33
+ ```
34
+
35
+ The last command is the operator's native interactive environment picker, used
36
+ to identify a published Cloud environment connected to the intended GitHub
37
+ repository. This adapter never automates that UI. Configure the environment ID
38
+ and its repository explicitly; branch/ref access is checked using the existing
39
+ scoped GitHub connection. That GitHub connection and Cloud's connected-repository
40
+ authority are separate. The filtered native listing resolves the environment and
41
+ proves read authorization, but does not prove inference eligibility or confirm
42
+ the environment's repository mapping. Neither a configured repository name nor
43
+ an operator's UI observation is a machine-verified dispatch authorization.
44
+
45
+ The registry marks Cloud unavailable, and its native access check returns
46
+ `CLOUD_ENVIRONMENT_REPOSITORY` after successful read diagnostics with
47
+ `effective.repository: null`. Normal start/resume and provider readiness refuse new work;
48
+ the transport also refuses before saving a Cloud dispatch intent or calling
49
+ `cloud exec`. Initial and successor submission use the same gate. GitHub branch
50
+ access cannot substitute for Cloud environment ownership.
51
+
52
+ The exact remedy is to qualify and implement a supported documented interface
53
+ that binds the authorized account, selected environment and connected repository
54
+ before enabling dispatch. Requalification must verify branch/revision access and
55
+ model eligibility under the existing security settings. There is no configuration
56
+ flag to bypass this gate. Do not infer proof from task listing fields or use a
57
+ private endpoint, browser automation or a trial paid submission to find the mapping.
58
+
59
+ This private `config.json` entry describes the intended setup and supports owned
60
+ task recovery; adding it does not enable dispatch or change existing selections:
61
+
62
+ ```json
63
+ {
64
+ "execution": { "deadlineMs": 20000 },
65
+ "harness": {
66
+ "codex-cloud": {
67
+ "bin": "/absolute/path/to/codex",
68
+ "account": "operator",
69
+ "authentication": "operator-chatgpt",
70
+ "mode": "trusted-worker",
71
+ "environment": "published_environment_id",
72
+ "repository": "owner/disposable-repository",
73
+ "continuation": "successor-task",
74
+ "billing_source": "chatgpt-account",
75
+ "allowance": { "remainingUsd": 1, "reservedUsd": 0.1 }
76
+ }
77
+ }
78
+ }
79
+ ```
80
+
81
+ This explicit request deadline allows bounded CLI/network and native verification
82
+ work within the shared configurable limit. It does not change package defaults
83
+ or bound the duration of remote compute. Submission, access checks, listings and
84
+ diff retrieval use the shared abort signal without a shorter subprocess timeout;
85
+ standalone diagnostic calls without a signal retain a 10-second fallback. If the
86
+ deadline expires before a submission URL is received, acceptance remains unknown
87
+ and dispatch is fenced until exact ownership can be reconciled. Stopping the
88
+ submission client does not stop remote compute.
89
+
90
+ Amounts are explicit conservative accounting reservations, not a Cloud billing
91
+ cap. Unknown usage retains reservations. Cloud uses the authorized ChatGPT
92
+ account's actual plan/credits and limits; API billing is a separate allowance.
93
+ No plan eligibility, available credits, zero cost, hard spend cap or specific
94
+ model access is inferred from sign-in. Check current account usage before live
95
+ dispatch. Exactly one best-of attempt is supported; model overrides are refused
96
+ and account defaults remain unchanged. Native CLI read checks do not call a model.
97
+
98
+ This is not a demonstrated delegated multi-user mode or generic plugin OAuth
99
+ flow. Public setup must never collect passwords, browser cookies or pasted Codex
100
+ auth files. The worker uses only its operator's native sign-in store. It does not
101
+ copy another connector's identity. Configure a capable backend when mandatory
102
+ local policy or private read-only context paths are required: Cloud refuses those
103
+ options, and completion receipts do not replace pre-action enforcement.
104
+
105
+ ## Dispatch, inspection and delivery
106
+
107
+ The shared `gallivant doctor` and provider readiness gates report Cloud's
108
+ unavailable capability and mapping remedy; start and resume use those gates.
109
+ Cloud remains a recognized provider in configuration, approved brief parsing and
110
+ saved recovery identities. Recognition does not authorize new work. An approved PRD
111
+ with `harness: codex-cloud` cannot dispatch until that boundary is qualified.
112
+ The following delivery contract is implemented and exercised by explicit offline
113
+ fixtures; it is not a live dispatch qualification. Restricted natural-language
114
+ preparation is not advertised for Cloud. The local Codex preparation adapter does
115
+ not supply a hosted Cloud preparation capability.
116
+
117
+ Before dispatch, the isolated owned task checkout must contain only committed
118
+ code and the approved brief/source overlays. The existing portable snapshot
119
+ validator refuses private paths, symlinks, unsupported modes and unrelated local
120
+ edits. Only approved overlay paths are committed. The coordinator pushes the task
121
+ branch, checks its exact remote head, and reads each approved snapshot at that
122
+ revision to compare its bytes/SHA-256. It then publishes a unique input ref
123
+ `<task-branch>-cloud-<full-input-head>` without changing the task's upstream.
124
+ The input ref is never advanced by the coordinator. Retain these refs for
125
+ recovery; after the logical task is retired, an operator can remove its recorded
126
+ input refs under the repository's retention policy. No automatic remote deletion
127
+ or force push is performed.
128
+
129
+ The implemented submission path rechecks the task/input refs and snapshot hashes
130
+ before `cloud exec --env ENV_ID --branch INPUT_REF --attempts 1`. That documented
131
+ call has no repository argument and stays blocked until environment mapping is
132
+ verified. Do not invoke it manually to bypass qualification or retry an owned
133
+ intent. Read-only diagnostics for previously acknowledged tasks are:
134
+
135
+ ```sh
136
+ "/absolute/path/to/codex" cloud list --json --env ENV_ID --limit 20
137
+ "/absolute/path/to/codex" cloud list --json --env ENV_ID --limit 20 --cursor CURSOR
138
+ "/absolute/path/to/codex" cloud status TASK_ID
139
+ "/absolute/path/to/codex" cloud diff TASK_ID --attempt 1
140
+ ```
141
+
142
+ These are native read-only examples. An exited submission command acknowledges a
143
+ URL; it does not finish remote work. Native `status` exits nonzero for non-ready tasks;
144
+ the adapter uses the JSON listing's status rather than interpreting an exit as
145
+ task failure. Every adapter inspection (including acknowledgement recovery) and
146
+ result collection checks the configured executable's exact **0.160.0** version
147
+ before reading listings or diffs, independently of the new-dispatch gate. A changed
148
+ version stops native retrieval, retains the owned task and reports `CLOUD_VERSION`;
149
+ restore the qualified executable to retry the same task. It does not reject the
150
+ result as a malformed artifact, create a successor or enable new dispatch. Already
151
+ collected, validated results are reused without another native command.
152
+ Listings paginate up to 20 pages/1 MiB with shared request deadlines,
153
+ backoff and coordinator concurrency. Every page includes the configured `--env`;
154
+ the pinned CLI resolves that environment before issuing its filtered list request.
155
+ Its list-item mapper emits a null `environment_id`, so an owned task's listing
156
+ scope comes from the successful filtered request and persisted configuration.
157
+ This scope does not prove the environment's connected repository or authorize a
158
+ new submission. The exact saved task ID, URL and single attempt remain required.
159
+ Contradictory environment metadata, missing tasks, unexpected attempts, malformed pages, cursor
160
+ loops and failed filtered requests remain unknown; there is no unfiltered fallback
161
+ or newest-task selection. Status events record the configured environment with
162
+ `environmentSource: filtered-listing`, rather than claiming a per-task field.
163
+ The CLI may also omit the attempt count when sibling metadata is unavailable.
164
+ For an owned dispatch sent with `--attempts 1`, null or omitted counts preserve
165
+ selector 1; explicit counts other than one refuse collection. Events retain the
166
+ actual reported count as `providerAttemptTotal`, including null. Missing counts
167
+ and selector 1 do not establish a native attempt ID.
168
+
169
+ Cloud `pending` remains queued/pending because this interface cannot distinguish
170
+ provisioning from execution. `ready`, `applied` and `error` observations retain
171
+ provider status, diff summaries, timestamps and the task link. Per-attempt native
172
+ IDs, token/tool transcripts, detailed provider errors, effective model and actual
173
+ per-task dollar cost are unavailable on this supported surface. The shared root
174
+ identity is the **real Cloud task ID**, not an invented provider turn ID;
175
+ `providerAttemptId` is null and `attemptSelector` is 1. A diff selector is not a
176
+ native attempt ID. Error observations enter the normalized journal; unknown cost
177
+ is null. Read-only clients consume saved state and never launch another poller.
178
+
179
+ The prompt requires the provider to verify the input head and source hashes,
180
+ make the approved change, and include `.codex-cloud-result.json` in its returned
181
+ diff. That envelope binds the run, repository, logical task branch, input head,
182
+ source hashes, neutral PR text/receipt and actual provider test records. It is
183
+ removed from the deliverable manifest. It does not authorize arbitrary actions.
184
+ The provider is instructed to leave all GitHub writing to the coordinator.
185
+
186
+ The adapter reconstructs only the saved input in a disposable directory, validates
187
+ every diff path/type/mode and checks/applies the diff there. Quoted paths, renames,
188
+ binary patches and executable-mode changes require explicit recovery rather than
189
+ lossy conversion. Wrong-base or mismatched envelopes persist a blocked collection
190
+ checkpoint. The shared result writer validates the logical task/root/base,
191
+ origin/branch, paths, modes and current head again, commits the accepted text
192
+ changes in the isolated task checkout, runs approved Verify commands in the
193
+ existing filesystem/network sandbox, and opens/updates one regular PR. Its
194
+ checkpoint reconciles already committed/pushed files and lost PR acknowledgements
195
+ without applying or verifying them twice. Provider test claims are preserved as
196
+ provider records; only coordinator-executed evidence qualifies verification.
197
+ Both hosted adapters validate each provider test record's command string, exact
198
+ input revision and integer exit status before accepting it. Empty test lists remain
199
+ empty; malformed records block collection and cannot become publication evidence.
200
+
201
+ An approved successor may return only the owned result envelope, including
202
+ `receipt`, `public-text` and explicit resume corrections.
203
+ Its empty source manifest uses the shared writer's verified pushed-revision path
204
+ at the exact input head, so verification and PR updates still require remote
205
+ head/ancestry, clean checkout and current ownership. It creates no source commit;
206
+ recovery reuses the publication checkpoint. The shared gates still decide whether
207
+ the PR text or receipt changed and whether a round made progress. Initial
208
+ dispatches still require deliverable file changes.
209
+
210
+ ## Continuation, cancellation and recovery
211
+
212
+ The pinned CLI exposes no native Cloud resume/cancel command. The implemented
213
+ review correction creates a **successor task** after its exact predecessor settles. Each
214
+ child gets approved requirements/snapshots, current pushed code, trusted feedback
215
+ and recorded decisions. The shared logical session stays the initial Cloud task
216
+ ID; each run records its child task ID, parent, input revision and continuity mode.
217
+ One task branch, PR, configured round limit, current-head gates, evaluator and
218
+ human merge boundary remain canonical. There is no provider-specific review loop
219
+ and no claim that native memory was transferred.
220
+
221
+ Stop/cancel/timeout fences future dispatch, retains the task URL, and quarantines
222
+ late results. **Remote execution may continue.** Killing the CLI is not stopping
223
+ remote compute or billing. Interrupt is unsupported and cannot create overlapping
224
+ tasks. Use the native Cloud task page for any account-side intervention it offers;
225
+ this adapter does not claim or automate an unavailable native control.
226
+
227
+ Private `<state-home>/runs/<task-slug>/cloud.json` records dispatch intent and
228
+ acknowledgement; `execution.json` owns lifecycle/reservations. Per-run `job.json`,
229
+ `events.jsonl`, `job.log`, `result.json`, `verification.json` and
230
+ `result-application.json` retain observation, delivery and publication evidence.
231
+ Use `gallivant status`, `gallivant why <task>` and the tracker to inspect saved
232
+ state. Restart the same coordinator/state namespace to reconcile acknowledged
233
+ tasks. An acknowledgement saved by the transport can repair the execution
234
+ projection. A reply lost before any exact ID is persisted **stays unknown**:
235
+ inspect the saved intent and account task listing manually, without deleting
236
+ state, adopting another task or resubmitting. Automatic ambiguity resolution is
237
+ unavailable because this CLI supplies no documented idempotency key/lookup API.
238
+
239
+ ## Verification and live qualification
240
+
241
+ `npm run test:codex-cloud` is offline. Run it alongside `npm test`, `npm run lint`,
242
+ `npm run test:execution-backends`, `npm run test:openai-agents` and
243
+ `git diff --check`. Native process locks and verification sandbox tests require
244
+ host process inspection and a functional native sandbox; they cannot be qualified
245
+ inside a sandbox that denies those OS facilities.
246
+
247
+ The live suite requires private `CODEX_CLOUD_LIVE_HOME`, `CODEX_CLOUD_LIVE_PRD`,
248
+ `CODEX_CLOUD_LIVE_REPO` and `CODEX_CLOUD_CAMPAIGN_LEDGER`. Use the single external
249
+ campaign ledger from the carried contract: `version: 1`, `limitUsd: 10`, an
250
+ `attempts` array with reconciled API reservations/costs, and a separate `cloud`
251
+ object containing `account: operator`, selected `environment`, `repo`,
252
+ `billingSource: chatgpt-account`, positive integer `remainingTasks`, current
253
+ `checkedAt`, a concrete `accountUsageEvidence` pointer, and positive `taskSeconds`
254
+ of at most 120. The ledger must stay outside this repository/public package.
255
+ The observation deadline cannot cap native remote compute. Unknown prior paid
256
+ API cost blocks dispatch. Cloud account allowance is separate from API dollars.
257
+
258
+ ```sh
259
+ npm run test:codex-cloud:live
260
+ npm run test:codex-cloud:live -- --execute --phase=implementation
261
+ # Introduce an actual current-head CI failure or trusted review finding.
262
+ # Set CODEX_CLOUD_LIVE_CORRECTION to that finding and approved decisions.
263
+ npm run test:codex-cloud:live -- --execute --phase=correction
264
+ ```
265
+
266
+ Preflight is read-only and returns unverified on missing prerequisites or the
267
+ unqualified environment mapping. With this pinned adapter, both execution phases
268
+ are blocked before account reservation or campaign dispatch intent. After a
269
+ supported mapping interface is implemented and qualified, a phase reserves one
270
+ authorized account task and persists intent before start or resume. Never repeat
271
+ an intent-bearing phase. The suite restarts the coordinator, externally verifies pushed file bytes/head, actual Verify evidence, one PR and
272
+ successor parentage, and saves `cloud-live-evidence.json` privately. Costs and
273
+ missing native attempt IDs remain unknown. Installed-plugin/browser release
274
+ evidence belongs to M5/M6; neither a CLI help check nor these fixtures qualifies it.
275
+
276
+ Command and environment references rechecked 2026-10-07; authentication checked
277
+ 2026-10-06:
278
+ [developer commands](https://learn.chatgpt.com/docs/developer-commands),
279
+ [Cloud environments](https://learn.chatgpt.com/docs/environments/cloud-environments),
280
+ [authentication](https://learn.chatgpt.com/docs/auth).
281
+ The version-specific public CLI source was also inspected for status/JSON/diff
282
+ semantics, including [environment resolution and filtered listing](https://github.com/openai/codex/blob/rust-v0.160.0/codex-rs/cloud-tasks/src/lib.rs)
283
+ and [list-item mapping](https://github.com/openai/codex/blob/rust-v0.160.0/codex-rs/cloud-tasks-client/src/http.rs).
284
+ No internal endpoint from that source is called by this adapter.