Skip to content

Refuse checkout-bound callers by their binding and sweep unregistered checkouts - #216

Merged
yansfil merged 1 commit into
mainfrom
fix/checkout-capability-followups
Sep 27, 2026
Merged

yansfil merged 1 commit into
mainfrom
fix/checkout-capability-followups

Conversation

@yansfil

@yansfil yansfil commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Related: #202, #205, agents/prd/checkout-capability/prd.md

Summary

#202 let a caller with no attestable pane (Codex 0.157's shared daemon) hold a checkout-bound Workspace credential, but two edges still spoke the pane path's language.
A checkout-bound command whose answer no longer matched its credential was refused as pane_changed with "Reconnect the pane and retry", a step that caller cannot take; it now answers checkout_not_registered with the checkout next action, chosen by the credential's own binding.
A checkout-bound capability whose project was unregistered stayed in the registry until its eight-hour lifetime ended, counting against the 64-reference cap; the five-second sweep now drops it, with a sweep-stage pane_auth record.
AGENTS.md gains the rule for /Applications/hide.app after 2026-09-27, when one session replaced the operator's app with a pre-fix build and deleted the backups beside it.

before  {"reason":"pane_changed","next_action":"Reconnect the pane and retry"}
after   {"reason":"checkout_not_registered","next_action":"Run the command from a shell inside a registered project checkout, or reconnect Hide, and retry"}

Review

  • 판단해 주세요: the installed-app rule's wording in AGENTS.md; whether "the operator asked for it in the session doing the replacing" is the authority line you want.
  • 조심해서 볼 파일: hided/src/pane_auth.rs Registry::sweep - it now asks the core once per live checkout-bound entry every 5 s (at most 64, in-process owner-thread round trips), with the registry lock released and on a spawn_blocking task, so a bootstrap or validation never waits behind it; a pane-bound entry is not re-resolved.
  • 조심해서 볼 파일: hided/src/server.rs - the two post-command context checks return cap.changed_refusal(); the validate refusal's next action is now keyed by reason.

Evidence

  • 확인한 것: scripts/verify-cargo.sh test -p hided (77 hided unit tests, including the new sweep_drops_a_checkout_capability_whose_checkout_no_longer_resolves: a claimed checkout-bound entry against a bare core is gone after one sweep and its reference file removed, a pane-bound entry stays, and the token then validates as credential_expired), verify-cargo.sh lint, cargo fmt --all --check, check-no-workstation-identity.sh, check-no-attribution.py.
  • 확인하지 못한 것: no live run on the installed app; the checkout_not_registered refusal text on a real post-command mismatch is covered by the unit-level changed_refusal mapping, not by unregistering a project under a running daemon. One hide-agent-hooks deadline test failed once under load and passed on rerun (known flake, unrelated files).

AI tooling: 대부분 AI 도구. Diff, the sweep's lock and thread placement, and the AGENTS.md wording were read by hand.

… checkouts

A checkout-bound Workspace command whose answer no longer matched its
credential was refused as pane_changed with "Reconnect the pane and
retry", a step a daemon-run caller with no pane cannot take. The refusal
now follows the credential's binding: pane_changed for a pane,
checkout_not_registered for a checkout, with one next-action sentence
shared by the CLI bootstrap, the server, and the sweep.

The five-second registry sweep drops a checkout-bound capability whose
checkout no longer resolves on its device, with a sweep-stage pane_auth
record, so an unregistered project stops counting against the
64-reference cap before its eight-hour lifetime ends. The core is asked
with the registry lock released, on a blocking task, so a bootstrap or a
validation never waits behind the sweep.

AGENTS.md gains the rule for the operator's installed app: replace
/Applications/hide.app only on the operator's request in the replacing
session, keep the previous bundle as a .bak, never delete another
session's backup, launch with HERDR_* stripped, and read the installed
version before trusting a live check.
@yansfil
yansfil merged commit 63c5240 into main Sep 27, 2026
11 of 13 checks passed
@yansfil
yansfil deleted the fix/checkout-capability-followups branch September 27, 2026 16:25
yansfil added a commit that referenced this pull request Oct 29, 2026
…d stages (#1837)

Closes with-hide/hide-private#252
Related: with-hide/hide-private#221, with-hide/hide-private#171,
with-hide/hide-private#135, with-hide/hide-private#207,
with-hide/hide-private#216

## Summary

On Windows a right-click on a terminal link also opened the link, beside
the menu: a folder link revealed its folder and an HTML link loaded its
page again.
xterm opens a link on the release of any mouse button, and on Windows
the right-click menu appears after that release; now a right-click opens
only the menu, and the primary and middle buttons open links as before.
Separately, the first page a test opens on Windows sometimes stays
`loading` for the whole 10 s `--wait`, and nothing said where it
stopped.
Each load the core asks for now logs when its route came, when it
committed and when its own load call settled, against that load alone,
with the display, the native page id and the time; the browser spec
records the native page's own state when that first wait gives up.

스크린샷 없음: the shell change is which mouse button opens a terminal link;
nothing drawn changes.

## Review

- **조심해서 볼 파일**: `web/src/terminalLinkProvider.ts` - both link paths
(detected and OSC 8) go through one `opens(event)` check, which refuses
only the right button.
- **조심해서 볼 파일**: `desktop/src/main/browser.ts` - each `load()` holds its
own `CoreLoad`; a commit counts only after its own `loadURL`, its stop
is that call's promise, a newer load or failed route ends it; three
lines per core-asked load.

### Per issue

- #252 terminal-links "terminal HTML opens a rendered page": fixed at
the cause above; the spec now also asserts one `browser_open`, which a
right-click activation adds on Windows every run.
- #221, #171, #135, #207 (browser.spec first `--wait` open stays
`loading`, status 2): cause not proven yet. Host log shows
`view_created`/`page_visible` then nothing for 10 s, no route or load
failure; core log has no stale-report refusal, so the core got `loading`
and never `loaded`. Only the first page of a fresh profile fails. This
PR adds the evidence that names the stage.
- Their older signature, `shellPage` 30 s in `fixture.ts`, is the
desktop startup flake handled by the flaky2-win-desktop change.
- #216 reveal-external (rail tool click left unpressed): last seen
2026-10-20, before the rail was rebuilt (#1552); not touched here.

## Evidence

- **확인한 것**: web unit test that a right-click's release opens no link
fails without the fix and passes with it.
- **확인한 것**: macOS desktop e2e 1/2 failed once fetching the pinned Herdr
(`curl: Failed to connect to github.com`); its rerun passed.
- **확인한 것**: desktop unit tests: a reopen waiting for its route while
the earlier load commits and stops, two checkouts' same id and load told
apart by `contents`, a failed route then a page navigation; all three
fail on the previous code.
- **확인한 것**: web unit tests: right button opens nothing, primary and
middle open; ⌘-click on macOS, Ctrl-click on Windows/Linux still open
externally.
- **확인한 것**: Windows desktop e2e 19/19, no flaky test, in three runs: PR
verify 40852660304 and nightly `lane=windows` 40857562866 on e09dc15,
PR verify 40873166675 on 1b89a27 (all jobs green).
- **확인하지 못한 것**: the stage of the stuck first load: neither Windows run
reproduced it; the issues say how to read the next failure.
- **확인하지 못한 것**: nightly 40857562866 failed `agent journey fake model
(windows)` on `guidance_memory`; untouched by this diff, passed on
main's 10-28 nightly, not checked on current main.
- **확인하지 못한 것**: the full web unit suite locally (67 failures at load
average ~300 on this Mac, not read); CI's web unit lane passed on
1b89a27.

<details><summary>Verification record</summary>

- Head 1b89a27; CI tested merge bf853d1 (1b89a27 into main
1849300), PR verify 40873166675: success, every job.
- Earlier head e09dc15: PR verify 40852660304 success after one rerun
of the macOS desktop job (github.com unreachable fetching Herdr);
nightly `lane=windows` 40857562866: desktop and web e2e green, `agent
journey fake model (windows)` failed on `guidance_memory`, outside this
diff.
- Local (this Mac, load 100-300): web and desktop typecheck and lint
pass; desktop unit 297 passed; `terminalLinkProvider.test.ts` 43 passed;
`browser.test.ts` 26 passed.
- Not run: desktop e2e locally (no build on this disk), Windows locally
(no Windows host).
- Limit: the stuck first page load did not recur in three Windows runs,
so its stage is still unproven; #221, #171, #135 and #207 stay open with
the reading guide.

</details>
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