Repository navigation
[Cross-machine spend 7/7] CLI: configure SSH cost hosts - #4876
salmonumbrella wants to merge 25 commits into
Conversation
Commit shared host edits on submit, focus loss, or exit so intermediate keystrokes do not revoke retained machine-spend consent. Request source subtotals only for app consumers and compare compact JSON semantically.
Keep the shared host editor available with monitoring off and show existing validator guidance for invalid committed aliases. Trim duplicate test coverage, exercise the real input path, and add the PR changelog credit.
Consolidate source-resolution cases and keep layer-specific assertions. Wait for cancelled controller tasks to finish before checking late results.
Render the collector's sanitized error in each source row's existing caption. Keep unavailable costs and partial totals while showing the next action.
Keep host changes, preference imports, and app consumption under one lock. Validate adopted host spelling and expose invalid stored tokens for removal.
Stop global help/version handling at the option terminator and permit removal of listed tokens containing control characters. Trim redundant host tests and keep validation coverage at the SSH fetch boundary.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Something went wrong. Try again later by commenting “@codex review”. ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex review: needs real behavior proof before merge. What this changesAdds macOS CLI commands to configure shared SSH hosts and spend selection, alongside on-demand machine spend collection. Example: Run
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 5 items remain Keep open: this PR adds a distinct CLI configuration capability absent from main, and the latest consent repair introduces no definite code defect found in this review. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherCLI commands and Settings share machine-local host preferences; the spend controller reads selected hosts and launches bounded SSH accounting requests through a locked consent check. flowchart TD
CLI[Host configuration CLI] --> Preferences[Canonical host preferences]
Settings[Settings editor] --> Preferences
Preferences --> Consent[Locked launch consent]
Controller[Machine spend controller] --> Consent
Consent --> SSH[System SSH process]
SSH --> Reports[Identified usage reports]
Technical reviewBest possible solution: Land an approved CLI configuration surface using the shared preferences transaction and existing SSH owner, with app-boundary and upgrade evidence. Do we have a high-confidence way to reproduce the issue? This is a feature request: main supports explicit cost collection over SSH but lacks these host-configuration subcommands and the stacked machine-detail UI. Is this the best way to solve the issue? Sharing canonical preferences and reusing the existing collector and SSH transport is a sound design; the latest projection repair preserves cancellation and real launch errors without a competing host store. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 897bff31731b. Merge-risk optionsMaintainer options:
Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: Source enforces consent at process launch, but production app authority-chain validation remains incomplete. EvidenceSecurity concerns:
What I checked:
Likely related people:
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (5 earlier review cycles)
Reviewed November 2, 2026, 9:44 AM ET / 14:44 UTC (Revision 6). |
Share host subset normalization at the transaction boundary and keep the cancellation check before each SSH host. Correct host output and lock errors.
Use per-host spend intent and shared preference errors. Name raw host tokens explicitly and show JSON options before the literal-argument delimiter.
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review Pushed The regression first failed before the guard. It pauses the first host, revokes the second while Settings is stale and no notification is delivered, then verifies the second never reaches the injected transport and no result is published. The allowed control fetches both. Final affected validation passes 22 tests in 3 suites; The PR body distinguishes that factory/Settings test from real app wiring or SSH runtime proof. The packaged CLI is byte-identical to the binary used for the recorded 31 scratch-domain fixture operations. App notification/restart traces, an actual stable-release upgrade, and the maintainer's CLI product decision are still unproved. The consent read and SSH launch are not one atomic lock. |
|
🦞👀 Re-review progress:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
What changed
codexbar config hosts list|add|removeto manage the app's manual SSH host list.--costadds or removes only a host's spend tracking.addandremoveare idempotent and reportchanged.adduses the app's host validation, so an invalid host fails with a nonzero exit and nothing is written.removeaccepts a stored token, so invalid stored entries can still be removed.--checkruns the same one-shot, noninteractive SSH probe thatcost --remoteuses. Each result is{"ok", "error"}. If a check fails, the command exits nonzero and the host stays configured.config preferences exportleaves the host keys out, and a transferred file containing them is refused.CLIHelp,docs/cli.md(including a "Set up hosts from an agent" example), and the CHANGELOG cover the new commands.Why
Setting up cross-machine spend currently means clicking through Settings on every Mac. An agent setting up a new machine has no way to add a devbox or include it in spend from a script.
CLI-configure-SSH-cost-hosts.mp4
Usage
codexbar config hosts add devbox --cost --check --format json codexbar config hosts list --check --format json --pretty codexbar config hosts remove devbox --cost # stop counting spend, keep the host codexbar config hosts remove devbox{"host":"devbox","changed":true,"costUsage":true,"check":{"ok":true,"error":null}}Validation at
bcf1a8e9a:CancellationErroris thrown, no reports or error row are published, and all three host fields update. Five authority and error cases are tested separately. 3 XCTest methods and 27 Swift Testing methods in 6 suites (42 cases) pass. These tests bypass the productionUsageStorewiring and real SSH.make checkreports 0 violations across 3168 files. The normal debug package build and signature check pass. No app was launched.list,add, andremoveeach exit 1 with the macOS-only error.Validation at
1867a6944:UsageStorewiring and real SSH.make checkreports 0 violations across 3168 files. The normal debug package build and deep strict codesign verification pass. No app was launched.list,add, andremoveeach exit 1 with the macOS-only error.Validation at
47a21c470:UsageStorewiring, so it exercises neither that wiring nor real SSH.make checkreports 0 violations across 3168 files. The normal debug package build and deep strict codesign verification pass. The bundled CLI binary is byte-identical to the one used for the138d94324CLI runs below. No app was launched.Older validation at
138d94324(CLI and Core inputs unchanged through47a21c470; shared Core changed at1867a6944; the package, Linux and CLI checks were rerun there, as listed above):24 affected tests in 3 suites pass. They cover CLI mutation, Settings projection, startup, and rereading hosts before collection with injected stores and stubs.
make checkreports 0 violations across 3168 files. The normal macOS package build and signature check pass.Linux: the source-only build and 72 documented-invocation cases pass.
list,add, andremoveeach exit 1 with the macOS-only error.All 26 packaged CLI operations pass against a scratch defaults domain and a synthetic OrbStack Ubuntu fixture. This includes six concurrent adds, cost-only and full removal, invalid-input rejection, and retaining a host after a failed check. The original remote CLI link was restored and the fixture homes and defaults were removed. No real app defaults were touched.
Five additional packaged CLI operations with preexisting host keys preserve their selections, an unrelated preference, and queued portable-import bytes. This uses synthetic saved preferences, not an app upgrade run.
Actual CLI transcript below:
devboxis the synthetic VM alias, and$SCRATCH_DOMAINreplaces the private fixture domain. Commands exit 0 unless marked otherwise.App runtime proof remains open: the scratch-domain CLI does not post the real app notification. Running-app pickup, restarted-app pickup, and actual notification delivery remain unverified. The launch check does not depend on notification delivery. Settings holds the per-user host lock only for the synchronous process launch, then releases it before waiting on SSH. That serializes a removal with the launch itself. It does not make the whole remote fetch atomic: a process that launched before the removal can keep running until the notification or normal cancellation stops it. The owner-level tests above do not establish the app runtime chain. At
47a21c470, CI passed on every job, all 236 macOS test groups passed on the first attempt, and Codex review reported no major issues. ClawSweeper confirmed the earlier P1 and theUsageStorewiring were addressed, and flagged the gap between the consent read and the SSH launch as a medium security and merge risk. The launch lock above is the repair for that gap. At1867a6944, Codex review reports no major issues. ClawSweeper reports no findings and confirms that the source closes the consent-to-launch race. It keeps five holds before merge: running-app and restarted-app pickup with allowed and revoked real SSH, final-effect security proof, merge-risk proof, a v0.83.0 upgrade that preserves settings and queued imports, and a maintainer decision. CI passed at1867a6944: lint, all Linux builds and the macOS tests succeed, with all 236 macOS test groups (1812 selections) passing on the first attempt and no retries or timeouts. Atbcf1a8e9a, ClawSweeper finds no definite code defect. It still lists one medium security concern: revocation has not been shown at the real SSH effect through the productionUsageStorepath. It keeps the same five holds before merge. CI passes on every job, with all 236 macOS test groups (1812 selections) passing on the first attempt and no retries or timeouts. Codex review reports no major issues. Runtime proof, an app-upgrade run, and a maintainer decision remain required.Refs #4833, slice 7 (CLI host setup)
Stacks on #4841