Skip to content

fix: native Start confirmation, dead code removed, doc leftovers - #104

Merged
nniiovoo merged 3 commits into
mainfrom
fix/after-ui-landing
Nov 2, 2026
Merged

nniiovoo merged 3 commits into
mainfrom
fix/after-ui-landing

Conversation

@nniiovoo

@nniiovoo nniiovoo commented Nov 2, 2026

Copy link
Copy Markdown
Owner

The fixes from this pass's audit that had to wait for the UI branch to land.

Changes

Security

  • Start needs a real owner action (SAF-1). The owner's "explicit Start" was a button and a modal in the WebView, so a script in the page could call companion_start directly. Start now asks in an OS dialog drawn outside the WebView: a script can open it but can't answer it. Return and Escape both cancel, so the owner has to click Start. Stop stays unconfirmed.
  • The Vault is checked again after the dialog closes, and after Set up's file panels, in case it locked meanwhile.

Dead code

  • Two password checks compared a value with a copy of itself and could never fail (SIM-6). The real comparison stays in the native panel, and the strength check stays.
  • The old credential methods in AppCore are marked test-only (SIM-1). Deleting them is a later change, as the audit advised.
  • Other unused code is gone (SIM-8, SIM-9, AGT-6): CompanionView's chatgpt and per_run, a duplicate epoch and generation check, optional markers on fields Rust always sends, and Value's Seed Phrase words branch. A shown value can't be those words (ADR-0004), and the editor's peek covers only Login passwords and API keys.

Wording and docs

  • The Passphrase panel no longer says "Wallet passphrase", and stale comments match the code (CLR-6, CLR-14, SIM-10).
  • The guide says to build the Emergency Reader once while everything works, and that the terminal keeps what it prints (EAS-1, SAF-5).
  • The security model says clipboard tools, including OS history, aren't obliged to honor the private marks, and that the Reader lacks the app's wiping allocator (SAF-4, SAF-13).
  • New hand checks: Spotlight clipboard history, a long readout on scaled Windows panels, and the Start dialog (SAF-4, GAP-10).

No dependency was added. The PR doesn't change any file PR #102 changes outside companion/.

Testing

Check Result
./scripts/check.sh passes, 721 Rust tests, run before the last small test was added
New available_at test, and clippy on the app crate pass, after that run

All of this used fictional data. The tests cover the dialog's words and that only the Start button counts as a yes.

Not tested:

  • Nobody has seen the Start dialog running. It's only reachable with the helper bundled, so it needs a hand check on a Mac: Return and Escape cancel, Start starts the helper, and the Vault stays Unlocked while the dialog is open. If the dialog misbehaves, the helper doesn't start.
  • native_credential/windows.rs changed by one constant, and only CI compiles it. Windows has never been run on a real PC.
  • scripts/verify-companion.sh wasn't re-run, because no helper code or verification file changed here.

Still open

  • Windows hardening (SAF-6) needs a real Windows PC to test on.
  • Deleting the old credential path, a later change. It needs its tests moved to the native path first.
  • A no-op sed in scripts/verify-companion.sh, left until PR Combine the Agent Companion into this repository as companion/ #102 lands, because that PR changes the file.
  • The Wallet Copy sheet (CON-4) stays, by agreement with the UI work.
  • The agent account's login route (AGT-3) is the owner's decision.

🤖 Generated with Claude Code

nniiovoo and others added 3 commits November 1, 2026 20:58
The owner's "explicit Start" was a button and a modal in the WebView, so a
script in the page could call companion_start with no owner action. Start
now asks in an OS dialog drawn outside the WebView: a script can open it but
can't answer it. Return and Escape both cancel, so the owner has to click
Start. Stop stays unconfirmed.

The Vault is checked again after the dialog closes, and after Set up's file
panels, in case it locked meanwhile. The dialog is a sheet on the app's own
window, and focus changes are ignored while it's open, as with file panels.

Also drop what the screens never used: CompanionView's chatgpt and per_run
fields, the "per start" limit (60 an hour can't reach 100 in an hour), and
the optional markers on fields Rust always sends, with their fallbacks. The
fixture's types now have to match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Two password checks compared a value with a copy of itself and could
  never fail. The real comparison stays in the native panel, and the
  strength check stays.
- The old credential methods in AppCore are marked test-only. Deleting them
  is a later change.
- A duplicate epoch and generation check, a test-only wrapper and an unused
  Serialize are gone. can_unlock is test-only, so available_at, which the
  status uses, gets its own test.
- Both native panels take the 20-second reveal time from session's constant.
- A shown value can't be Seed Phrase words (ADR-0004), so Value's words
  branch is gone, with an unused style.
- Stale comments now match the code, and the Passphrase panel no longer says
  "Wallet passphrase".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…limits

- The guide says to build the Emergency Reader once while everything works,
  and that the terminal keeps what the Reader prints.
- The security model says clipboard tools, including OS history, aren't
  obliged to honor the private marks, and that the Reader lacks the app's
  wiping allocator.
- New hand checks: Spotlight clipboard history, a long readout on scaled
  Windows panels, and the Agent Companion's Start dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nniiovoo
nniiovoo merged commit 7429af7 into main Nov 2, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant