@uchibeke/gallivant 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -2,86 +2,102 @@
2
2
 
3
3
  **Give an agent a task. Let the review loop run. Go outside.**
4
4
 
5
- Gallivant turns repository tasks into reviewed pull requests. It starts an agent,
6
- watches CI and reviewer feedback, and continues the same session to fix issues.
7
- You can follow progress and send corrections from a local dashboard. **You decide
8
- what gets merged.**
9
-
10
- Use it for code, documentation, research or content that belongs in a GitHub
11
- repository. Start with a plain-language request or a written brief.
5
+ Gallivant turns a repository task into a reviewed pull request. It runs a coding
6
+ agent in a separate checkout, opens the PR, watches CI and reviewer feedback, and
7
+ continues the same session until the PR is ready for you. You decide what merges.
12
8
 
13
9
  ```text
14
10
  Your task → agent works → PR → review + CI → fixes → ready for you
15
11
  ↑___________|
16
12
  ```
17
13
 
18
- ## Install
19
-
20
- You need **macOS or Linux, Node 22+, Git, GitHub CLI and jq**. For your first run,
21
- use signed-in **Codex CLI 0.160.0+** or **Claude Code 2.1.263+**. Provider usage is
22
- billed to your own account. [Full prerequisites](docs/install.md).
14
+ ## Set up in one command
23
15
 
24
- Check the [registry version](https://www.npmjs.com/package/@uchibeke/gallivant). Once a
25
- version is available, install it with `npm install -g @uchibeke/gallivant`. If the package
26
- is not published yet, install from source:
16
+ Run this inside the Git checkout you want to work in:
27
17
 
28
18
  ```sh
29
- git clone https://github.com/uchibeke/gallivant.git
30
- cd gallivant
31
- npm ci --ignore-scripts
32
- npm link
33
- gallivant --version
19
+ npx --yes @uchibeke/gallivant init --harness codex # or: --harness claude
34
20
  ```
35
21
 
36
- [Release status and checks](docs/releasing.md).
22
+ The setup flow below requires **0.2.1 or newer**. At verification on 2026-10-20,
23
+ npm's `latest` was still 0.2.0, whose `init` only creates the config. A maintainer
24
+ must [publish 0.2.1](docs/releasing.md) before this command provides repository
25
+ registration, repeat safety and the diagnostic report described below.
37
26
 
38
- ## Set up
27
+ `init` writes a private config at `~/.gallivant/config.json`, records this
28
+ repository, creates a separate directory for task checkouts, and ends with the
29
+ same report as `gallivant doctor`: one line per check and the exact fix for each
30
+ failing one. Run it again in another repository to add that repository; nothing
31
+ else in the config changes.
39
32
 
40
- ```sh
41
- gh auth status
42
- codex login status # use Claude sign-in if you choose Claude
43
- gallivant init --harness codex # or --harness claude
44
- gallivant doctor
45
- ```
33
+ Before you run it you need:
46
34
 
47
- `init` creates local configuration and a separate task-checkout directory. It
48
- preserves existing config, credentials and global agent settings. Follow the
49
- fixes from `doctor`; [setup instructions](docs/install.md) cover authentication,
50
- harness permissions and repository protection.
35
+ | Prerequisite | Check | If it fails |
36
+ | --- | --- | --- |
37
+ | macOS or Linux, Node 22+, Git, jq | `node --version`, `git --version`, `jq --version` | install from your package manager |
38
+ | GitHub CLI signed in | `gh auth status` | `gh auth login` |
39
+ | Codex CLI 0.160.0+ signed in | `codex login status` | `codex login` |
40
+ | or Claude Code 2.1.263+ signed in | `claude auth status` | `claude auth login` |
51
41
 
52
- Enable the Codex GitHub review integration on the target repository, or choose
53
- another reviewer. If you want CI and trusted human feedback without a review bot,
54
- explicitly configure `"reviewer": null`. The default waits for Codex review.
42
+ A signed-out `gh` or harness stops `init` before it writes anything, and the
43
+ message repeats the login command above. `init` never asks for passwords, tokens
44
+ or browser cookies; sign in with each tool's own flow. Inference is billed to
45
+ your own provider account.
55
46
 
56
- **Prefer an agent to handle setup?** Give it the
57
- [setup-agent instructions](docs/agent-setup.md). They cover inspection, installation,
58
- configuration, verification and the points where your input is required.
47
+ `npx` downloads and runs the package on demand. Nothing is installed globally
48
+ and no `gallivant` command is added to your PATH. If you want one:
59
49
 
60
- ## Run your first task
50
+ ```sh
51
+ npm install -g @uchibeke/gallivant
52
+ ```
61
53
 
62
- Inside a repository you can push to. This example uses Codex; if you configured
63
- Claude, replace `--harness codex` with `--harness claude` before running it:
54
+ The rest of this page writes `gallivant`. With `npx`, read that as
55
+ `npx --yes @uchibeke/gallivant`. Contributors who want to run from a source
56
+ checkout: see [installing from source](docs/install.md#install-from-source).
57
+
58
+ ## Finish what setup cannot do for you
59
+
60
+ `doctor` names these. `init` does not do them, because each needs a decision
61
+ from you or an account with a third party.
62
+
63
+ - **Reviewer.** The default loop waits for the Codex GitHub review integration
64
+ (`chatgpt-codex-connector[bot]`). Enable it on the repository, configure
65
+ another reviewer, or set `"reviewer": null` in the config to rely on CI and
66
+ trusted human feedback. Without one of these, the first PR waits for a review
67
+ that never arrives. See [the reviewer key](docs/config.md#the-reviewer-object).
68
+ - **Branch protection.** `doctor` prints the `gh api` call that creates a
69
+ ruleset blocking direct and force pushes to the default branch. Run it
70
+ yourself. Setup never changes repository settings.
71
+ - **Harness guardrails.** The APort hook for Claude or Codex is installed by its
72
+ own `npx @aporthq/aport-agent-guardrails` command, and Codex asks you to trust
73
+ the hook inside its own interface. Setup does not install hooks.
74
+ [Guardrails](docs/guardrails.md) explains what each control covers.
75
+ - **Spend.** Defaults are 30 fix rounds per PR and a 5 USD per-run cap that
76
+ only Claude enforces natively. Review [limits](docs/config.md) before
77
+ unattended work.
78
+
79
+ ## Run a first task
64
80
 
65
81
  ```sh
66
- cd /path/to/your/repository
67
82
  gallivant task "Document how to run the existing tests in CONTRIBUTING.md. Use the commands already defined in the repository. Change documentation only." \
68
83
  --harness codex --verify 'git diff --check' --run
69
84
  gallivant start
70
85
  ```
71
86
 
72
- `task` prepares a brief and asks for missing information. `--run` authorizes
73
- implementation when that brief is ready, including after clarification. Omit it
74
- to inspect the draft first. Follow the printed `Next` action using your task's ID
75
- and revision. Preparation also uses inference.
76
-
77
- `gallivant start` opens **http://127.0.0.1:8791** and ensures the daemon is running.
78
- Without a PRD path, it does not submit another task. Closing the browser does not
79
- stop the work.
80
-
81
- With the default configuration, **ready** means the configured checks, reviewer
82
- and acceptance gate passed. Inspect status for skipped-gate warnings, review the
83
- PR and merge when you choose. Missing access, evidence or exhausted limits produce
84
- an inspectable stop instead.
87
+ What happens: `task` uses your harness to prepare a brief, which is a paid
88
+ inference call, and may ask you questions. `--run` authorizes implementation
89
+ once the brief is ready; omit it to read the draft first and follow the printed
90
+ `Next` action. The agent then works in a clone under `~/.gallivant-worktrees`,
91
+ pushes a branch, opens a PR against the default branch, and the daemon watches CI
92
+ and the reviewer, sending each round of feedback back to the same session.
93
+ `gallivant start` opens the dashboard at **http://127.0.0.1:8791** and keeps
94
+ the daemon running; closing the browser does not stop the work.
95
+
96
+ Expected outcome: a PR with a small CONTRIBUTING.md change and a completion
97
+ receipt in its body, and `gallivant status` showing the entry as **ready** once
98
+ checks, reviewer and the acceptance gate pass. You review and merge. Missing
99
+ access, failing checks or an exhausted round allowance produce an inspectable
100
+ stop instead; `gallivant why <handle>` explains it.
85
101
 
86
102
  ### Bring a written brief
87
103
 
@@ -96,6 +112,20 @@ gallivant start docs/prds/add-csv-export.md
96
112
  You do not have to write a PRD yourself. Both entry points use a validated brief
97
113
  and the same review loop. [Writing briefs](docs/prd.md) · [Task commands](docs/tasks.md).
98
114
 
115
+ ## How the review loop runs
116
+
117
+ 1. The agent implements the brief, runs the brief's verification commands and
118
+ opens the PR.
119
+ 2. Each tick (every two minutes by default) the daemon reads CI and reviewer
120
+ state. A blocking review or a failing check starts a fix round in the same
121
+ agent session, and the fix is pushed to the same PR.
122
+ 3. Rounds stop at `max_iterations` (30 by default), when the reviewer stays
123
+ silent for `stall_hours`, or when a run exceeds its timeout. Every stop is
124
+ recorded with a reason you can read with `gallivant why`.
125
+ 4. **Ready** means the configured checks, reviewer and acceptance gate passed.
126
+ Nothing merges automatically. Natural-language tasks stop at a review
127
+ handoff by default; choose `integrated` to keep watching until you merge.
128
+
99
129
  ## While it works
100
130
 
101
131
  | What you need | Action |
@@ -128,6 +158,9 @@ base. You can plan longer work while retaining the merge decision.
128
158
 
129
159
  ## Harness support
130
160
 
161
+ `init --harness` accepts `codex` and `claude`. Other adapters are configured by
162
+ hand in `config.json`; see [configuration](docs/config.md#execution-providers).
163
+
131
164
  | Harness (`harness` key) | Runs on | Prepare requests | Implementation status |
132
165
  | --- | --- | --- | --- |
133
166
  | Claude Code (`claude`) | Your host | Yes | Recommended; live usage evidence |
@@ -194,6 +227,11 @@ for the installed version's flags.
194
227
  [Commands](docs/commands.md) · [Configuration](docs/config.md) ·
195
228
  [Dashboard](docs/app.md) · [All guides](docs/README.md)
196
229
 
230
+ **Asking a coding agent to set this up?** Give it the
231
+ [setup-agent instructions](docs/agent-setup.md). They cover inspection, the
232
+ `npx` command, the points where your login or decision is required, and what a
233
+ setup run may not do on its own.
234
+
197
235
  Embedding the same workflow in another application? See
198
236
  [task delivery](docs/task-delivery.md). Installing this CLI does not deploy a
199
237
  hosted service or publish a chat plugin.
package/bin/gallivant.mjs CHANGED
@@ -15,7 +15,7 @@ import { newPrd } from "../lib/commands/new.mjs";
15
15
  import { resume } from "../lib/commands/resume.mjs";
16
16
  import { startServices } from "../lib/commands/start_services.mjs";
17
17
  import { trackerPort, stopTracker } from "../lib/tracker_process.mjs";
18
- import { init } from "../lib/commands/init.mjs";
18
+ import { init, renderInit } from "../lib/commands/init.mjs";
19
19
  import { VERSION } from "../lib/fs.mjs";
20
20
  import { hasConfig } from "../lib/config.mjs";
21
21
  import { resolveHandle } from "../lib/state.mjs";
@@ -29,7 +29,8 @@ import { safeDisplay } from "../lib/learning_data.mjs";
29
29
  const HELP = `gallivant: give an agent a task, let the review loop run, go outside.
30
30
 
31
31
  gallivant init [--harness codex|claude] [--worktrees <directory>]
32
- create a private config; never overwrite settings or sign in for you
32
+ set up the repository you are in: private config, this repo in repos,
33
+ then doctor's report. Safe to repeat; never signs in or overwrites settings
33
34
  gallivant --version print the installed version
34
35
  gallivant doctor [--send] [--probe] install checklist and health probe
35
36
  gallivant doctor --network <https-origin> [--json] bounded DNS/HTTPS diagnosis
@@ -111,9 +112,12 @@ async function dispatch(argv) {
111
112
  if (values.version) { console.log(VERSION); return 0; }
112
113
  if (values.help || !cmd || cmd === "help") { console.log(HELP); return 0; }
113
114
  if (cmd === "init") {
115
+ if (arg) throw new Error("init takes no positional argument; run it from inside the target checkout");
114
116
  const r = await init({ harness: values.harness, worktrees: values.worktrees });
115
- console.log(`Created ${r.file}\nHarness: ${r.harness}\nWorktrees: ${r.config.worktrees}\n\nNext: gallivant doctor\nComplete the harness guardrail and repository setup before starting work:\n https://github.com/uchibeke/gallivant/blob/main/docs/install.md\nPackaged templates:\n ${r.templates.passport}\n ${r.templates.sandbox}`);
116
- return 0;
117
+ const report = renderDoctor(r.doctor);
118
+ console.log(renderInit(r, report));
119
+ // Doctor's exit code, so a script or an agent reading only the status knows whether setup still has open items.
120
+ return report.exitCode;
117
121
  }
118
122
  if (values.foreground && cmd !== "serve") throw new Error("--foreground is available only with serve");
119
123
  if (values.foreground && values["no-server"]) throw new Error("--foreground cannot be combined with --no-server");
package/docs/README.md CHANGED
@@ -1,7 +1,9 @@
1
1
  # Documentation
2
2
 
3
- Start with [installation and your first run](install.md), then choose how to
4
- describe the work. [Natural-language tasks](tasks.md) prepare a reviewable brief
3
+ Start with [installation and your first run](install.md): inside the target
4
+ checkout, `npx --yes @uchibeke/gallivant init --harness codex` (or
5
+ `--harness claude`) writes the config, records the repository and prints the
6
+ setup report. Then choose how to describe the work. [Natural-language tasks](tasks.md) prepare a reviewable brief
5
7
  from your request; [hand-authored PRDs](prd.md) let you write that brief directly.
6
8
  Both use the same validation, execution, GitHub review and completion workflow.
7
9
  Code, research and documentation can all be delivered as verifiable repository
@@ -1,9 +1,10 @@
1
1
  # Let an agent set up Gallivant
2
2
 
3
- Give the prompt below to your coding agent. It can inspect prerequisites, install
4
- the CLI, create a private config and validate a first task. You handle account
5
- login and any required trust prompts. Setup does not need access to every private
6
- repository, and installing the CLI does not start a paid session.
3
+ Give the prompt below to your coding agent. It can inspect prerequisites, run
4
+ the published setup command, read the resulting report and validate a first task.
5
+ You handle account login and any required trust prompts. Setup does not need
6
+ access to every private repository, and running the setup command does not start
7
+ a paid session.
7
8
 
8
9
  Start with **Codex or Claude and one repository**. Those are the harnesses supported
9
10
  by `gallivant init`. [Hosted Agents API](openai-agents.md) uses an explicit config
@@ -24,12 +25,15 @@ CLI --help and the docs matching the installed version. Prefer an already workin
24
25
  Codex or Claude setup. Preserve existing credentials, settings, running jobs,
25
26
  worktrees and uncommitted changes. Report proposed config changes without secrets.
26
27
 
27
- Install/configure the CLI and run the setup checks. If Gallivant is not yet
28
- published on npm, use the documented source installation. Do not overwrite an
29
- existing config, weaken security settings, install global hooks, change repository
30
- protections, sign into accounts or elevate privileges without the relevant user
31
- authorization. Never ask me to paste API keys or tokens into this conversation.
32
- Use the provider's login flow or a private credential file instead.
28
+ From inside the target checkout, run the published setup command:
29
+ npx --yes @uchibeke/gallivant init --harness codex (or --harness claude), then
30
+ read its report. Do not clone the Gallivant repository or install it globally
31
+ unless I ask. If the command stops because gh or the harness is signed out, tell
32
+ me the exact login command it printed and wait; do not sign in for me. Do not
33
+ overwrite an existing config, weaken security settings, install hooks, change
34
+ repository protections or elevate privileges without my authorization. Never ask
35
+ me to paste API keys or tokens into this conversation. Use the provider's login
36
+ flow or a private credential file instead.
33
37
 
34
38
  Ask only for missing decisions: target repository and checkout, approved base
35
39
  branch, preferred available harness, first task scope, and allowed spending.
@@ -88,38 +92,45 @@ automatically commit, or switch a dirty checkout. Confirm which GitHub repositor
88
92
  and base branch the task should use; the current branch is not necessarily the
89
93
  approved PR target. Account login and Git identity belong to the user.
90
94
 
91
- ## 2. Install and initialize
95
+ ## 2. Run the setup command
92
96
 
93
- Use the [current installation instructions](install.md#1-the-command). Before
94
- the first npm publication, install from source; `npm install -g @uchibeke/gallivant` is only
95
- an option after the package is published. Avoid `sudo npm install`; use a
96
- user-owned Node installation or prefix when global installation is not writable.
97
- Do not silently replace a different installed version while its daemon is running.
98
-
99
- After GitHub and the selected harness are signed in:
97
+ Use the [current installation instructions](install.md#2-the-command). After
98
+ GitHub and the selected harness are signed in, from inside the target checkout:
100
99
 
101
100
  ```sh
102
- gallivant --version
103
- gallivant --help
104
- gallivant init --harness codex
105
- gallivant doctor
101
+ npx --yes @uchibeke/gallivant init --harness codex # or: --harness claude
106
102
  ```
107
103
 
108
- Use `--harness claude` for Claude. `init` is noninteractive; it creates a config
109
- only when none exists. It does not log in, install hooks or fix permissions.
110
- If a config exists, skip `init` and preserve its unrelated keys. The normal path
111
- is `~/.gallivant/config.json`; use `$GALLIVANT_HOME/config.json` if that variable is
112
- already set. Keep it private (mode `600`). Choose a worktrees directory outside
113
- the config home, using `init --worktrees /absolute/path` if needed.
114
-
115
- Before a real run, finish the [harness guardrail setup](install.md#6-aport-on-claude-code)
104
+ `npx` runs the published package on demand; it installs nothing globally and
105
+ does not clone this repository. `init` is noninteractive. It refuses, writing
106
+ nothing, when the directory is not a GitHub checkout, `gh` or the harness is
107
+ signed out, or the login cannot push to the repository; report the printed
108
+ command to the user instead of working around it. Otherwise it creates
109
+ `~/.gallivant/config.json` (mode 600) when none exists, records the current
110
+ repository in `repos` once, creates the worktrees directory and prints the
111
+ `doctor` report. Exit status `1` means checks remain, not that setup failed.
112
+
113
+ With an existing config, `init` keeps every key as written and adds only the
114
+ current repository. Do not edit unrelated keys. The normal path is
115
+ `~/.gallivant/config.json`; use `$GALLIVANT_HOME/config.json` if that variable is
116
+ already set. Pass `--worktrees /absolute/path` only on first creation; later
117
+ runs refuse a different directory.
118
+
119
+ If the user prefers a persistent command, `npm install -g @uchibeke/gallivant`
120
+ is the documented option; ask before installing globally. Avoid `sudo npm
121
+ install`; use a user-owned Node installation or prefix. Do not silently replace
122
+ a different installed version while its daemon is running.
123
+
124
+ Before a real run, finish the [harness guardrail setup](install.md#7-aport-on-claude-code)
116
125
  for the selected harness. Some steps require human interaction: for example,
117
126
  Codex's initial `/hooks` trust prompt cannot be automated. Report such a blocker
118
127
  instead of changing the enforcement level or bypassing it.
119
128
 
120
- Add the authorized repository to `repos` and its approved base where necessary,
121
- following [configuration](config.md#the-base-branch). Review the config diff without
122
- printing credentials. Confirm these decisions before dispatch:
129
+ `init` records the repository without a base branch; its pull requests target
130
+ the default branch unless the user chooses otherwise with `start --base` or a
131
+ `{ "repo", "base" }` entry, following [configuration](config.md#the-base-branch).
132
+ Review the config diff without printing credentials. Confirm these decisions
133
+ before dispatch:
123
134
 
124
135
  | Decision | What must be established |
125
136
  |---|---|
@@ -129,8 +140,9 @@ printing credentials. Confirm these decisions before dispatch:
129
140
  | Completion evaluator | Default APort hosted confirmation needs network access. A local evaluator is an explicit user choice, not an automatic workaround for a failure. |
130
141
  | Cost | Confirm `max_iterations`, provider budget controls and allowed spend. `max_budget_usd` is a native per-run dollar cap for Claude; other local harnesses have no equivalent enforced dollar cap. |
131
142
 
132
- Run `gallivant doctor` again and report every failure. Do not treat “signed in
133
- (API unchecked)” as proof of inference access. `doctor` without extra flags checks
143
+ Run `gallivant doctor` (or `npx --yes @uchibeke/gallivant doctor`) again and
144
+ report every failure. Do not treat “signed in (API unchecked)” as proof of
145
+ inference access. `doctor` without extra flags checks
134
146
  configuration, credentials and repository access without launching a model run.
135
147
  `doctor --probe` launches a real Claude sandbox test when Claude is configured;
136
148
  `doctor --send` sends a real notification. Use those only when authorized.
@@ -206,9 +218,11 @@ review and merge.
206
218
 
207
219
  ## What setup verification proves
208
220
 
209
- The package's `npm run test:install` smoke test installs the tarball into a
210
- throwaway directory, uses fixture CLI credentials, initializes a private config,
211
- loads the packaged PRD template, and checks an offline brief. It does not use a
212
- real account, invoke a model or certify a provider's current availability.
213
- A first authorized end-to-end task is still needed to verify the user's actual
214
- repository permissions, provider entitlement, sandbox, CI and review integration.
221
+ The package's `npm run test:install` check packs the tarball and runs the
222
+ README's `npx` setup command against it from a disposable repository, with
223
+ fixture `gh` and `codex` commands and a throwaway home. It proves which binary
224
+ ran, the config and directory permissions, repository registration, repeat
225
+ safety and the printed next steps. It does not use a real account, invoke a
226
+ model or certify a provider's current availability. A first authorized
227
+ end-to-end task is still needed to verify the user's actual repository
228
+ permissions, provider entitlement, sandbox, CI and review integration.
package/docs/commands.md CHANGED
@@ -9,7 +9,7 @@ Use `gallivant --help` (or `gallivant help`) for the installed CLI's syntax and
9
9
 
10
10
  | Intent | Command | Notes |
11
11
  |---|---|---|
12
- | Create config | `gallivant init` | Selected Codex or Claude installation; preserves existing config. |
12
+ | Set up the current repository | `gallivant init` | Private config, this repository in `repos`, then the `doctor` report; safe to repeat. |
13
13
  | Check setup/connectivity | `gallivant doctor` | `--network` tests DNS/HTTPS; `--probe` is a real Claude run. |
14
14
  | Prepare a task | `gallivant task "request"` | Uses inference; implementation requires `--run` authorization. |
15
15
  | Inspect/continue a prepared task | `gallivant task list`, `inspect`, `answer`, `resume`, `validate`, `start` | Task IDs and exact revisions; see [task operations](#task-operations). |
@@ -46,12 +46,39 @@ select the configured harness in the PRD or task preparation.
46
46
 
47
47
  ## `gallivant init [--harness codex|claude] [--worktrees <directory>]`
48
48
 
49
- Create a private config from your authenticated GitHub login and the selected
50
- installed harness (Codex by default). Creates a separate checkouts directory,
51
- disables optional notifications initially, and prints the packaged template paths.
52
- Existing configs are refused, never replaced. Does not change credentials, global
53
- harness settings, reviewer installation or repository rules. Follow `doctor` and
54
- [installation](install.md) next. `--version` prints the installed package version.
49
+ Set up the Git checkout you run it in. Published form:
50
+ `npx --yes @uchibeke/gallivant init --harness codex`.
51
+
52
+ Before writing anything it checks, in this order, that the directory is a Git
53
+ checkout whose `origin` is a github.com repository, that `gh` is signed in, that
54
+ the selected harness is installed at a supported version and signed in, and that
55
+ the resolved run credential can push to the repository. A failed check stops the
56
+ command with the exact fix (`gh auth login`, `codex login`, `claude auth login`,
57
+ or the remote or permission to correct) and leaves no state behind.
58
+ Classic credentials also need `public_repo` or `repo` scope; the account's push
59
+ role alone does not grant that scope. If the scope lookup fails, setup asks you
60
+ to retry before writing state. Fine-grained tokens have no OAuth scope header
61
+ and still require the repository permission check.
62
+
63
+ It then creates a private config from your authenticated GitHub login and the
64
+ selected installed harness (Codex by default for a new config), creates a
65
+ separate checkouts directory, disables optional notifications, records the
66
+ repository in `repos` once, and prints the `doctor` report plus the packaged
67
+ template paths. Its exit status is doctor's: `0` when every check passes, `1`
68
+ while checks remain.
69
+
70
+ Repeating it is safe. An existing config keeps every key as written; the only
71
+ change is the one `repos` entry for the current repository, never duplicated.
72
+ `--harness` adds a second supported harness without touching the first;
73
+ when both Codex and Claude are configured, pass `--harness` to choose one.
74
+ Concurrent updates use the same mutation lock as other CLI writes; if settings
75
+ change during the prerequisite checks, setup rechecks them before writing.
76
+ `--worktrees` is refused when it differs from the configured directory. `init`
77
+ does not sign in, change credentials, global harness settings, reviewer
78
+ installation or repository rules, and does not start a task. When run through
79
+ `npx` it says that nothing was installed globally and prints both the next `npx`
80
+ command and the optional `npm install -g @uchibeke/gallivant`. See
81
+ [installation](install.md). `--version` prints the installed package version.
55
82
 
56
83
  ## `gallivant doctor [--send] [--probe]`
57
84
 
@@ -217,8 +244,10 @@ Puts a PR into the loop that Gallivant did not open, or resets one that stopped.
217
244
  - A `--worktree` you pass is resolved to an absolute path first, so `.` means the directory you typed it in and not whatever directory the daemon happens to run in later. It is then checked before it is accepted: its `origin` must be the PR's repository and it must already be on the PR's head branch. A path that fails either check is an error, since the harness edits and pushes from that directory. It is never relocated or re-cloned for you, because a resumed session is keyed to the directory it ran in.
218
245
  - On an entry that already exists: reason cleared, iteration reset to zero, a marked reset comment posted on the PR (so a count rebuilt from GitHub starts from zero too), cursor set to now, watching again. This is how you restart a `needs-human` PR after you fixed the conflict or answered the question. A fresh registration instead looks at the PR's whole history, so feedback already on it gets addressed.
219
246
  - That reset comment is the reset boundary, so posting it is a precondition of the reset and not a best-effort extra. A count rebuilt from GitHub finds its marker and counts only the round comments after it; with the comment missing and `state.json` later lost, recovery reconstructs the rounds this command had just zeroed, and an entry restored at `max_iterations` stops with `iterations` on its next event having done no work in the round. If it cannot be posted, `register` refuses and changes nothing: the entry keeps its iteration, its state and its cursor, and running the same command again once GitHub answers does the whole reset in one go.
220
- - A reset with a new `--harness` or `--session` makes two durable writes to GitHub, and they are ordered so a failure between them cannot leave GitHub and the registry disagreeing about which harness or session this PR belongs to. The reset comment goes first because it is safely repeatable: a count rebuilt from GitHub takes the LAST reset marker, so a second one counts as one. The identity block goes last, because that write is what a recovery reads the harness and the session out of. So a failed block write leaves a reset comment on the PR, the registry untouched, and both sides still naming the old identity; the same command run again completes the reset.
221
- - Changing `--harness` without giving a new `--session` drops the inherited session and starts a fresh one on the next fix round. This also applies when both harnesses use UUIDs: a Claude session does not belong to Codex. An explicit `--session` must have the chosen harness's format and is used as supplied.
247
+ - A reset with a new `--harness` or `--session` makes two durable writes to GitHub. The reset comment goes first because it is safely repeatable: a count rebuilt from GitHub takes the LAST reset marker, so a second one counts as one. The identity block goes last, because that write is what a recovery reads the harness and the session out of. If a same-harness block write fails, the registry keeps its prior identity. For a cross-harness reset, the old entry is first fenced against dispatch; if the block write or ledger reservation is ambiguous, the fence remains and rerunning the same `register` command finishes the handoff after inspecting the last run. A failure before the identity write restores the prior entry.
248
+ - Changing `--harness` on an existing entry drops the inherited session and starts a fresh one on the next fix round. This also applies when both harnesses use UUIDs: a Claude session does not belong to Codex. An explicit `--session` can attach only without a harness change, and must have the chosen harness's format.
249
+
250
+ For a stopped PR whose local provider is exhausted, inspect `gallivant why widget#142` and confirm its last run has settled. Stop the coordinator with `gallivant down`, then run `gallivant register https://github.com/owner/widget/pull/142 --harness codex` and restart it with `gallivant up`. A cross-harness reset requires the coordinator's exclusive lock; it refuses while the daemon is running, so an old-provider dispatch cannot race the reset. The registration does not send a model request. The old execution ledger, result and run log remain under the same run tree. A new ledger is reserved for Codex before the registry changes, and recovery after `state.json` loss selects the latest ledger. A recorded handoff whose ledger is missing refuses dispatch until its matching backup is restored. The first fix prompt tells the new session to read the approved brief, local checkout, unpushed commits, PR and review threads, including after registry recovery. The former Claude conversation cannot be transferred. A reset starts the round count and feedback cursor from now, so earlier review comments do not trigger the new session. Post a **new** trusted PR comment beginning `/fix` with the work to continue; `@codex review` alone requests a reviewer, and `recheck` only reevaluates readiness. Do not repeat a successful `register`: each success posts another reset marker and restarts that cursor and count. A change between local harnesses refuses an unsettled run or any explicit `--session`: an ID's format cannot prove that the new provider owns that conversation. A PR with a saved brief keeps its original snapshot and acceptance criteria; the explicit register command records the new execution route separately from its original `harness:` field.
222
251
 
223
252
  When the block names a PRD that exists on the PR's branch, the daemon's own snapshot of it is taken, exactly as recovery does, because the completion gate reads that snapshot and nothing else: without it the gate is skipped and the PR can be marked ready with no acceptance criterion evaluated. A snapshot already on disk is kept rather than replaced with the copy the session could have edited, and a PRD the branch does not carry is logged and the PR watched without a gate.
224
253
 
package/docs/config.md CHANGED
@@ -9,9 +9,10 @@ while apply and key setup refuse before activation. Key paths are separate expli
9
9
  operator paths, and OpenSSH is pinned outside worker writes. See [learning](learning.md)
10
10
  for the CLI, bounds, separate extraction allowance and backup/rotation limitations.
11
11
 
12
- `~/.gallivant/config.json`, mode 600. `gallivant init` creates a local Codex or
13
- Claude configuration; `gallivant doctor` prints a suggested configuration when
14
- none exists. Set `GALLIVANT_HOME` to use another directory. Hosted providers need
12
+ `~/.gallivant/config.json`, mode 600. `gallivant init`, run inside a checkout,
13
+ creates a local Codex or Claude configuration, records that repository in `repos`
14
+ and prints the `doctor` report; repeated runs preserve every key you have edited.
15
+ `gallivant doctor` prints a suggested configuration when none exists. Set `GALLIVANT_HOME` to use another directory. Hosted providers need
15
16
  explicit configuration; they are not discovered from local executable paths.
16
17
  See [installation](install.md) for the first-run sequence.
17
18
 
@@ -82,6 +83,12 @@ an awake machine or a continuously running Node host.
82
83
  qualify its event stream and unattended permissions; it is not a supported choice.
83
84
  Provider/model selection for local harnesses remains in each harness's own
84
85
  configuration; Gallivant does not add a general per-task local model router.
86
+ Changing the native model configuration for the same local harness does not
87
+ change Gallivant's recorded harness or session ID. A later `gallivant resume`
88
+ still asks that CLI to resume its exact session, but whether the CLI applies the
89
+ new model to that conversation is native provider behavior, not a Gallivant
90
+ continuity guarantee. Gallivant does not pass a per-run `--model` flag or route
91
+ around an exhausted provider account.
85
92
 
86
93
  ## The base branch
87
94
 
package/docs/execution.md CHANGED
@@ -785,7 +785,7 @@ is live or its gates have passed. Check the linked PR and the consumer's current
785
785
  release evidence before an installation:
786
786
 
787
787
  The connected execution successor is
788
- [`aporthq/agent-passport#417`](https://github.com/aporthq/agent-passport/pull/417),
788
+ [`aporthq/agent-passport#417`](https://github.com/aporthq/agent-passport/pull/417) (not publicly readable),
789
789
  with canonical PRD `docs/prds/aport-task-delivery-workflow-integration.md` and job
790
790
  identity `aporthq/agent-passport/aport-task-delivery-workflow-integration`. It
791
791
  preserves the original T0–T9 requirements; the recorded plan requires the actual