Files
orca/mobile/src/test-support
Brennan Benson 1bf1a3f6a9 Approve a repo's orca.yaml hooks once on mobile (#42935)
* Bring mobile setup trust to approve-a-repo-once

Mobile now counts any earlier approval as repo trust (one shared predicate
with desktop), offers Always trust / Run once / Don't run, stores nothing
for Run once, reads the setup of the ref a create checks out, and pins a
Run once create to the shown content's hash. Automations need Always trust.
Same-id repos on several hosts keep per-version approvals.

* Pin mobile Run once only when the host read the created branch

repo.hooks reports createSourceRead when it honored createSource. Without
it (older host, or an unreadable ref) the phone sends no hash, as before,
so a checkout read can't make the host skip setup silently.

* Recover skipped mobile setup and ask about branch-only setup

Run once always pins the shown setup. When the host skips setup because the
created branch differs (worktree.create or agent.launch), the phone shows the
branch's setup; Run once or Always trust runs it via worktree.runApprovedSetup.
Setup approval now applies whenever setup isn't skipped, reads the PR/MR start
point once, pins runtime-host automation setup, and carries an archive Run once
into Delete Anyway. Drops the createSourceRead reply flag.

* Pin empty mobile setup and keep skipped setup reportable

An untrusted create whose branch shows no shared setup pins empty content,
as desktop does, so setup the branch adds is re-asked. Pinned creates use
agent.launch only on hosts that report skipped setup there, else
worktree.create. Approved setup that fails to spawn reports spawn_failed.
The sheet creates from the start point it previewed, Tasks keeps Create
disabled until a review opens the workspace, and runtime automation pins
read the automation's base branch.

* Report approved setup that fails to start and finish Tasks reviews

Approved setup or default tabs that can't start now fail worktree.runApprovedSetup,
so every client's existing failure handling shows it. An empty setup pin keeps
agent.launch on older hosts. Tasks and the sheet open a reviewed workspace with a
setup-failed notice when approval can't run, and a cleared review no longer
leaves Create disabled.

* Pin empty setup for runtime-host automations

A runtime host can't trust the repo, so saving setup=run where the base branch
has no shared setup pins empty content, as desktop does. Setup the branch adds
later is skipped for review instead of running unprompted.

* Offer only per-version approval on mobile for a repo on several hosts

As desktop: repo-wide trust is ignored for a repo id on several hosts, so the
drawer hides Always trust and its scope line, and Run hooks is primary.

* Pin empty automation setup everywhere and report failed default tabs

Phone automation saves for an untrusted repo pin the shown setup, including
empty content, on paired desktops too; only repo trust leaves them unpinned.
An approved default tab that fails to start now fails the approved-setup run.
A double tap on a Tasks setup review approves once.

* Follow main's settings module move in the approved-setup test

* Keep setup approvals tied to what runs on mobile and in approved default tabs

Re-decided automation saves name the setup decision so the host replaces the saved pin. Work-item creates check setup trust for the repo they land in. Approved default-tab commands start as new tabs when the layout already holds the command-less ones. Tasks setup reviews stay busy and ignore other choices until the approval settles.

* Check a work item's own repo setup and skip repeat approved runs

A create landing in another repo inherits that repo's setup policy and is always trust-checked unless skipped. The Tasks trust drawer acts once per prompt even before its busy render. A base-only automation edit re-reviews setup. A repeated approval on the same worktree and content doesn't open its command tabs again.

* Send the user's setup choice on cross-repo creates and drop the approval memory

A work-item create in another repo now sends the form's own setup decision and only widens the trust check: it runs for that repo unless setup is explicitly skipped. The per-worktree approved-run memory is removed, and the mobile lockfile change is reverted to main's.

* Set the automation setup pin on every preparation path
2026-11-16 19:06:57 -08:00
..