Repository navigation
feat(cli)!: move server commands under patchula remote and keep local commands local - #380
Merged
Merged
Conversation
… commands local Separate server execution from local commands by replacing --remote, --here, patchula auth, and the interactive per-checkout server prompt with a dedicated `patchula remote` namespace (`lookup`, `run`, `tui`, `login`, `logout`). - Top-level `apply`, `lookup`, `tui`, and `run` always run on this machine and never read `repositories.json` or talk to a server. - `patchula run` always targets GitHub (inferring this checkout's repository when omitted), even with `--dry-run`, removing the `pushed()` clean-tree and default-branch gate. `run --dry-run --dir <DIR>` plans from a local directory when needed (such as `corpus:check`). - `patchula remote` takes `--server <URL>` (also `PATCHULA_SERVER`), discovers and caches the server advertised by a single repository when neither is set, and never exposes local-only flags. - Move `--recheck` off global root flags onto `run` and `serve`.
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
count-patchula | 2c40243 | Commit Preview URL Branch Preview URL |
Nov 23 2026, 07:06 AM |
…ghten hints Addresses every finding from the adversarial review of PR #380: - Store remembered remote servers in `remotes.json` so legacy `repositories.json` files (with `remote: bool`) never break `patchula remote logout` or discovery. - Validate `owner/repo` slugs before API calls, resolve GitHub `/apps/{slug}` before contacting advertised hosts, and cap distinct servers probed per scan (5). - Persist newly discovered pins only after login or the remote run succeeds, with a one-line notice on stderr naming the server, App client ID, and logout command. - Attach a `patchula remote logout --server ...` hint when a remembered server is unreachable. - Stop suggesting `--default-config` when `run --dry-run --dir` lacks a config; point to `--config FILE` instead. - Move `--server <URL>` onto each `remote` subcommand so `Usage:` and CLI docs list it with accurate precedence/discovery help text. - Document remote discovery and sign-in in `docs/src/content/docs/internals/threat-model.md`. - Add unit tests for legacy `repositories.json`, checkout `login`/`logout` + failed login, `remote_target` precedence/validation, probe ordering/cap, unreachable remembered-server hints, and `run --dry-run --dir` planning.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Separates local execution from server execution by moving every server-backed command into a dedicated
patchula remotenamespace.Summary of changes
patchula remotenamespace:lookup,run [--dry-run],tui [--once],login, andlogout, each accepting--server <URL>(overridingPATCHULA_SERVER).--servernorPATCHULA_SERVERis set and a single repository is targeted (inferred from the checkout's GitHub remote or named directly),patchula remotevalidates theowner/reposlug, resolves the advertising bot's GitHub App via/apps/{slug}before contacting advertised hosts (capped at 5 distinct servers per scan), verifies the App binding, and remembers(server, app)inremotes.jsononce sign-in or the run succeeds (with a stderr notice).remotes.jsonavoids breaking upgrades from legacyrepositories.jsonfiles.patchula remote logoutforgets both the server's token and any remembered repositories using it (and can infer the server from the current checkout's remembered entry). Unreachable remembered servers hint atpatchula remote logout --server ....--cache,--config,--config-dir,--settings,--concurrency,--all-repos,--default-config,--allow-lockfile-pending,--recheck) do not exist underpatchula remote, removing thelocal_flags()conflict table.apply,lookup,tui, andrunalways run on this machine and never readremotes.jsonor prompt to switch to a server. Removed--remote,--here, and top-levelpatchula auth.patchula runalways targets GitHub: bothrunandrun --dry-runread GitHub (inferring this checkout's GitHub remote when no repository is named) with nopushed()clean-tree/default-branch check. Added--dir <DIR>(requiring--dry-run) for planning from a local directory (used bymise run corpus:check).--recheck: moved--recheck <WHEN>off global root flags ontorunandserve.crates/cli/tests/help.txtanddocs/src/content/docs/reference/cli.md, documented remote discovery and sign-in indocs/src/content/docs/internals/threat-model.md, and updated guides, reference pages,README.md,docs/agent-setup.md,skills/patchula/SKILL.md, andPatchulaSettings.pkl.Verification
cargo test --locked -p patchula-cli(96 unit tests + 17 integration tests)cargo test --locked -p patchula-server(55 tests)cargo clippy --locked -p patchula-cli -p patchula-server --all-targets -- -D warningsmise run docs:build(38 pages, all internal links valid)