Skip to content

fix(apps): let Update move a local-only grant to the app's repository - #30979

Merged
bolichen97 merged 1 commit into
mainfrom
pearcekieser/app-update-local-trust
Nov 8, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
pearcekieser/app-update-local-trust

Conversation

@Pearcekieser

@Pearcekieser Pearcekieser commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Update on an app installed from a local folder does the same thing on every App Store surface, and its local-only trust refusal offers a button that trusts the app's repository and finishes the update.

An app installed from a local folder, which a registry also lists at a newer version, shows Update in two places that disagree. The detail page's Update runs the registry update, and the gateway refuses it with app_trust_local_only and a sentence telling the user to uninstall the app and install it again from the App Store. The Library tile's Update re-copies the local folder and reports success, so the listed version never lands.

Why it matters

Anyone who installs an app from a folder and later gets it from a registry hits this on every new version: the only way forward was to uninstall and reinstall, and the Library's Update said it had worked when it had not.

Not a goal

  • Changing what the consent dialog grants for any other refusal (app_execution_denied, app_trust_repository_mismatch).
  • Showing Sync beside Update for a folder install that a registry lists. Sync still shows whenever no registry update is pending.
  • A trust button on the Updates page. A local-only refusal on a row hands it to the detail page, which carries the button, and Update All names the app and that button.

What changed (motivation → approach → change)

The two buttons share a label but not a rule. useAppUpdates.runUpdate picked the action from the recorded source alone, so a folder install always took the folder re-copy, while the detail page's Update button runs the registry install. The fix makes Update mean "install the registry version" everywhere, so every surface meets the same refusal, and then gives that refusal a way forward.

Where Before After
Library tile, folder install with a registry update re-copies the folder, says it updated opens the detail page, which runs the registry update
Updates row and Update All, same app re-copy the folder send source: registry:<name>; a local-only refusal on a row opens the detail page, and Update All names the app and the trust step
Detail page refusal tells the user to uninstall and reinstall says in plain words that the app came from a folder and names the repository the newer version is published at, with a "Trust the repository and update" button beside the agent hand-off
POST /api/apps/{name}/update no consent field accepts trustRepository with source: registry:<name>

The refusal now carries trustRepository, the normalized, credential-free coordinate of the row the install resolved; its sentence names no coordinate. The detail page shows that refusal in its error notice with its own translated sentence, naming the app and the repository, instead of the server's sentence. The notice keeps the agent hand-off and the journaled report, and carries the trust button in its footer. The button opens the existing consent dialog (appstore/TrustAppModal.tsx) on that repository. The dialog adds one line, above the list of what trust allows, saying the folder copy is replaced and the app's data is kept, and its confirm button uses the banner button's words. Confirming sends one update request with the repository as consent proof (api/client/apps.ts gains that argument), and the dialog writes no grant of its own. The notice (pages/AppDetailPageLocalOnlyNotice.tsx) and that hand-off (pages/appDetailPageLocalSwitch.ts) are their own modules, which keeps AppDetailPage.tsx under the 2,000-line cap. After the update, the success message says the app was updated from its repository.

The update route does the switch under the app's lifecycle lock (apps/local_trust_switch.py). Before the install starts, it checks that the app holds a grant with no repository binding over local installed code, with or without the local marker that newer grants carry, and that the proof matches the row the install will use. Otherwise it answers app_trust_switch_not_applicable or app_trust_repository_mismatch and changes nothing. It then writes the grant the consent dialog writes for a fresh install, so no repository code runs under the folder's grant. The write checks the local grant again under the config lock. If the update fails, raises or is cancelled while the local copy is still installed, the route puts the grant back in its original shape, unless the operator changed the binding meanwhile. Since #32213 the app goes down only at the copy, so the revert runs through a new after_failure hook on _reinstall_from_registry, before that helper restarts the old app, and the old backend starts trusted. The old app keeps running through the clone and build, and the health watch can stop it there because the repository grant does not cover its local code. So a failure before the copy puts the grant back and then starts the old backend again. Each step writes a security.trusted_apps.grant audit row. The owner-only gate is unchanged, so an app token cannot switch its own trust.

Specs updated in docs/system-specs/modules/app-kit-platform.md and docs/system-specs/modules/security.md. Six new strings are translated in every locale under website/src/i18n/locales.

Backwards compatibility

Compatible: the update route gains one optional field and requests without it run as before; the refusal keeps its code and gains one field.

Removes nothing: no route, field, key or export is removed, and the folder re-copy stays available as Sync whenever no registry update is pending.

Tests

  • test/test_app_update_local_trust_switch.py pins the switch: the repository grant is in place when the install runs and stays on success; a refused, raising or stop-raising update restores the local grant before the old app starts, and a refusal before the copy restores it and then starts the old backend again; a grant without the local marker switches and is restored without one; a request cancelled mid-write reverts the grant that landed; a grant revoked between the check and the write is not put back; a failed revert still restores the app; a failure reported after the repository version was installed keeps the repository grant; a binding changed mid-update is left alone; a stale proof, a grant that is not local-only, malformed consent and an app token are each refused before anything stops, with config unchanged. Determinism: 5 repeats and 3 shuffled orders (seeds 11, 23, 47), all green; the flake-pattern ratchet passes.
  • test/test_apps_registry_coverage_install.py pins the refusal's new field, normalized and without clone credentials, and that the coordinate stays out of the audited sentence.
  • useAppUpdates.test.tsx, backendRefused.test.tsx, DiscoverPage.updatesTab.test.tsx, AppsPageW3Coverage.test.tsx and LibraryPageLaunchpad.test.tsx pin the routing: a folder install with a registry update opens the detail page from the Library, updates from the registry in place on the Updates row and in Update All, a local-only refusal on a row opens the detail page, and Update All names each app that needs repository trust and the step that grants it, instead of reporting it as failed; a folder install with nothing pending still syncs in place. These replace tests that pinned the folder re-copy for that case.
  • AppDetailPageAutoAction.test.tsx pins the detail page: the Update navigation runs the registry install, the refusal shows the plain-words sentence with the repository address, the button and no empty install log, confirming sends one update with the proof and no separate grant, a failed switch reports the not-saved state, and other failures get no button.
  • TrustAppModal.test.tsx pins localOnlyTrustRepository: it reads the code, not the field, and drops a credential-bearing value.

Proof: PROVEN test/test_app_update_local_trust_switch.py::test_switch_binds_the_repository_before_the_install_and_keeps_it, test/test_app_update_local_trust_switch.py::test_a_legacy_local_grant_switches_and_keeps_the_repository_binding, test/test_app_update_local_trust_switch.py::test_a_failed_legacy_switch_restores_the_grant_without_a_local_marker, test/test_app_update_local_trust_switch.py::test_a_failed_update_puts_the_local_grant_back_before_the_old_app_starts[refused], test/test_app_update_local_trust_switch.py::test_a_failed_update_puts_the_local_grant_back_before_the_old_app_starts[refused-early] (head 0a921dd88b19)

Manual verification

Rendered the built SPA with dummy data (one app installed from a folder, a registry row at a newer version) and every /api/** call answered from fixtures, then walked Update All, an Updates row's Update into the detail page, the refusal notice, the consent dialog and the confirmed update. The harness asserts the request each step sends. Screenshots below.

Screenshots / video

The Library tile menu offers Update for a folder install that a registry lists at a newer version (dummy app "Field Notes").

Library tile menu with Update

Update All on the Updates page names the app that needs repository trust and the step that grants it, instead of reporting a failure:

Update All naming the trust step

An Updates row's Update opens the detail page, which shows the refusal in plain words with the trust button and the agent hand-off. Dark, light and phone width:

Refusal notice on the detail page, reached from the Updates row, dark

Refusal notice on the detail page, light

Refusal notice on the detail page, phone

The consent dialog says the folder copy is replaced before the list of what trust allows, and its confirm button uses the notice button's words:

Consent dialog for the repository, phone

More: dialog on desktop, and the updated app

Consent dialog, dark

Updated from its repository, dark

Related Issues

Fixes #30978

Sibling sweep

Swept: git grep -n "isRegistrySourced(" -- website/src, and git grep -n "updateApp(" -- website/src, excluding tests
Sibling: website/src/pages/apps/useAppUpdates.ts -- changed here
Sibling: website/src/pages/AppDetailPage.tsx -- changed here
Sibling: website/src/pages/apps/DiscoverPage.tsx -- not affected -- its Update navigates to the detail page, whose routing this PR changes

Pattern harvest

Rule candidate: review-prompt
Pattern: a control whose label is chosen by one predicate (an update is available) dispatches on a different one (the recorded source), so one word runs two actions

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 9cff5ac

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd false-positive: <reason, 20 to 500 characters>

@github-actions github-actions Bot added the readiness: action required A blocking check or review needs attention label Nov 6, 2026
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/app-update-local-trust branch 2 times, most recently from 0b336c2 to ff57cdc Compare November 7, 2026 03:14
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 7, 2026
@Pearcekieser

Pearcekieser commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=9487b5903595
self-added: yes
mechanism: local-to-repository trust revert after a failed registry update

  • Preserve repository trust when installation already committed

fixed in ff57cdc: restore_local_grant undoes the repository binding only while the installed record's provenance is still positively local (_trust_grant_would_stay_local, checked inside the locked trust write).
When update_app has already written the repository sourceUrl, the binding stays over the repository code and the revert is audited as revert_skipped.
test_a_failed_result_after_repository_provenance_keeps_the_repository_grant covers a failed result after repository provenance is recorded.

@Pearcekieser

Pearcekieser commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=4f71418ab9db
self-added: yes
mechanism: trust switch eligibility check

  • Accept supported legacy local grants in the switch

fixed in ff57cdc: the switch accepts an unbound name-only grant over positively local installed code, with or without the apps_trusted_local marker, in the preflight and again in the locked write.
The write records whether the marker existed, and a rollback restores exactly that shape, so a legacy grant comes back without a marker.
Two tests cover the legacy switch, on success and on a failed update.

@Pearcekieser

Pearcekieser commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=e63d9418f6e0
self-added: yes
mechanism: consent dialog state after a failed switched update

  • Report retained trust when server-side rollback fails

Rebutted: the state needs three failures in a row (the bind lands, the update fails, then the rollback config write fails, which restore_local_grant catches and logs).
It fails closed: the repository binding left over the local code does not cover that code, so admission refuses the app and never widens its trust.
The dialog then says trust was not saved about a grant that admits nothing, and the next click is refused with app_trust_switch_not_applicable and a refresh prompt.
Adjudication downgraded it to Low; exposing persisted trust state on failed updates is new API surface this PR does not need.

@Pearcekieser

Pearcekieser commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor Author

span=3748f099c3b9
self-added: yes
mechanism: cancellation test synchronization

  • Bound the cancellation test's prerequisite wait

fixed in ff57cdc: every wait in the cancellation test has a deadline from kiro_crew.testing.wait (await_until, and asyncio.wait bounded by FALLBACK_TIMEOUT_SECS).
The start barrier fails at once if the request finished first, and a finally block releases and settles both tasks.
Five repeats and three shuffled orders pass, and the flake-pattern ratchet passes.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the consent proof is checked against the resolved row under the lifecycle lock, the grant is written before any repository code runs, it is put back on every failure path, and the owner gate is unchanged.

Notes

  • Losing the folder re-copy is a real trade-off. Once a registry lists a newer version, a developer working on a folder install can no longer re-copy their folder: Update now means the registry version and Sync is hidden ("Showing Sync beside Update… Not a goal"). It is reversible, but expect someone to report it.
  • During clone and build, the old app keeps running under a repository grant that does not cover its code. The health watch may stop it, and the route then restarts it after the revert. A successful update closes this gap; a failed one means the app goes down briefly, not just a warning.

[DESIGN-REVIEWED] 9cff5ac

Description read

[DESCRIPTION-READ] f2b982973ebe7d538df53e8375b2be5e6fa55476fa4cffb42853004ca420a86b

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

The blind reader read the main control, "Trust the repository and update", correctly and expected a confirmation, which it gets. The reluctance it reported is the consent dialog working as designed. The rough spots below are friction, not blockers.

Notes

  • Two Update buttons on one page: the blue Update button stays enabled under the local-only banner. Clicking it runs the same refused update again. The blind reader "can't tell which one works" (shots 3–5). Disable it while localOnlyRepo is set, the way the page already does for the desktop build-step banner.
  • Updates tab gives no way to the fix: update_needs_repository_trust says "Open its details and choose…" but offers nothing to click (shot 2). The reader noticed: "it tells me to 'open its details' but gives me nothing to click." Put a link to that app's detail page in the notice.
  • Phone dialog hides the reassurance: on a phone (shot 6), the new local_source_switch paragraph pushes "You can take this back at any time in Settings…" below the fold. The reader declined there ("Trust no"), but at full width (shot 7), after seeing that line, said "maybe". Shorten that paragraph to one sentence so the take-back line stays on screen without scrolling.

[UX-REVIEWED] 9cff5ac

Description read

[DESCRIPTION-READ] bf4ee1c220d6df5059a4ddf7a00140c594a5116fd8208eb6e8038107207143f3

That sha256 names everything this verdict read: the PR description, plus the 11 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 9cff5ac

Verdict parsed from the review's SHA-scoped output markers for commit 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 9cff5ac6a2b0db4ce5fd5a4a4518312349b0f6bd — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks. Each item answers the reported dead end: an Update that either told the user to reinstall or claimed success it never had.

Notes

  • Item 6 — one consumer, generalized: _reinstall_from_registry(..., after_failure=Callable[[bool], Awaitable[None]]) has exactly one caller that passes it (routes_install.py:194). routes_registry.py:212,382 never pass it. Subtraction: none smaller is available, because the revert has to run inside the helper before it restarts the old app. Keep it as one private kwarg and do not grow it into a hook list.

What this change ships

Inventory (8 items) — 8 justified

Intent: Update an app first installed from a local folder to the registry version without uninstalling it first. This is a FIX.

  1. Update on a Library tile for a folder install with a pending registry update now opens the detail page instead of re-copying the folder — justified
  2. Updates row and Update All send the registry source for that app; a local-only refusal on a row opens the detail page — justified
  3. Update All names each app that needs repository trust instead of counting it as failed — justified
  4. The detail-page refusal shows a plain sentence naming the repository, plus a "Trust the repository and update" button — justified
  5. The consent dialog adds a line saying the folder copy is replaced and data is kept; its confirm label changes for this case — justified
  6. The update route accepts an optional trustRepository and switches the grant before install, then reverts it on failure or cancellation — justified
  7. The app_trust_local_only refusal now carries a normalized, credential-free trustRepository — justified
  8. A new refusal code, app_trust_switch_not_applicable, and an invalid_repository_consent 400 — justified

The notification-bridge Discord sink files in the patch come from #32871, which is already on main. They are not inventoried here.

[FIRST-PRINCIPLES-REVIEWED] 9cff5ac

Description read

[DESCRIPTION-READ] a1b279d9fbb4012d162154f198451a733bc74d4afb4c63cf63b14d69f2ead48e

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed readiness: checking Automated validation is still running labels Nov 7, 2026
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/app-update-local-trust branch from ff57cdc to 7531d43 Compare November 8, 2026 01:00
@Pearcekieser

Pearcekieser commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

span=1c4acca4f7da
self-added: yes
mechanism: the local-only banner and its consent dialog

  • The new button reads as a risky, unexplained step

fixed in 7531d43: the banner now shows a translated sentence in plain words that names the app and its repository, in place of the server text. The dialog's confirm button uses the same words as the banner button, "Trust the repository and update". The sentence about replacing the folder copy now comes before the list of what trust allows. Screenshots 02 to 04 in the body show this head.

@Pearcekieser

Pearcekieser commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

span=e63d9418f6e0
self-added: yes
mechanism: the consent dialog's error after a failed update

  • Recognize retained trust when the repository update already committed

Rebutted: the dialog says that trust was not saved only when the update failed and the server's rollback write then failed too, after the repository files were already committed. That takes three failures in a row. The result fails closed, because the repository grant stays and covers the code that is installed, and nothing gets wider trust. The GPT lane's own adjudication downgraded this to Low on this head. A fix needs a new response field that this PR does not otherwise need.

@github-actions github-actions Bot added merge conflict Branch has merge conflicts with its base — author must resolve before merge and removed merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Nov 8, 2026
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/app-update-local-trust branch from 7531d43 to 718267f Compare November 8, 2026 02:30
@Pearcekieser

Pearcekieser commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

span=1427aa057fad
self-added: yes
mechanism: Update All's handling of the local-only trust refusal

  • Update All now fails, with no reason given, for an app installed from a local folder

fixed in 718267f: updateAll now keeps an app refused with app_trust_local_only out of the failed list. The batch keeps going, and afterwards it shows one line per such app that names the detail page's "Trust the repository and update" step. The line is a new string, pages.appsPage.update_needs_repository_trust, in all 13 locales. A new test in useAppUpdates.test.tsx runs a batch with one such app and one ordinary update. It checks that the notice names the trust step and not a failure, that the other update still ran, and that the batch does not navigate away. The test fails against the old catch.

@Pearcekieser

Pearcekieser commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

span=9487b5903595
self-added: yes
mechanism: the trust revert when a gateway shutdown cancels an update mid-copy

  • Settle the installation worker before reverting cancelled updates

Rebutted: this needs a gateway shutdown to cancel the request while the copy runs in its worker thread. The revert then puts the local grant back, and the worker can still commit the repository version. The result fails closed, because the next start refuses the app and nothing gets wider trust. One grant from the trusted-apps settings, which binds to the installed repository, clears it. The fix would need a new ordering contract between this route, the registry install and the trust switch, only for that shutdown window. The GPT lane's adjudication downgraded this to Low for the same reason.

@github-actions github-actions Bot removed the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Nov 8, 2026
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/app-update-local-trust branch from 718267f to 15381d1 Compare November 8, 2026 03:45
@Pearcekieser

Pearcekieser commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

span=898c6cff5962
self-added: yes
mechanism: the local-only refusal's notice and the copy around its trust button

  • The main button reads as a risky fix for an error

fixed in 15381d1: the detail page now shows this refusal in a neutral status notice, AppDetailPageLocalOnlyNotice.tsx, in place of the red error box. The notice has an info icon, a shield-check icon on the button and a dismiss control. Its sentence no longer says "its trust covers". It now reads: "Field Notes was installed from a folder on this computer. A newer version is published at . To update, trust that repository. Updating replaces the folder copy and keeps the app's data." After the update, the success message says "Updated Field Notes from its repository", so the notice, the button and the success all use the word repository. Update All's line now says the app was not updated because its newer version comes from a repository the user has not trusted yet. All 13 locales are updated. The body has new screenshots of the Update All notice, of the detail page reached from an Updates row in dark, light and phone widths, of the dialog and of the success.

An app installed from a local folder that a registry row offers a newer
version of showed Update on both the Library tile and its detail page, but
the two did different things. The tile re-copied the folder and reported
success; the detail page ran the registry update, which the folder-only
grant refuses with app_trust_local_only and a sentence telling the user to
uninstall and reinstall.

Update now installs the registry version on every surface (tile, Updates
row, Update All, detail page), so each one reaches the same refusal. The
refusal carries the repository it resolved, and the detail page's banner
offers to trust that repository in the consent dialog. Confirming sends the
registry update with that repository as consent proof; the update route
checks the proof against the row the install resolves and that the grant is
exactly the local one, records the repository grant before any repository
code runs, and puts the local grant back if the update fails, before the
old app restarts.
@Pearcekieser
Pearcekieser force-pushed the pearcekieser/app-update-local-trust branch from 15381d1 to 9cff5ac Compare November 8, 2026 04:17
@Pearcekieser

Pearcekieser commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor Author

span=904770182ef4
self-added: yes
mechanism: the error surface for the local-only refusal on the detail page

  • Preserve the shared error surface for refused updates

fixed in 9cff5ac: AppDetailPageLocalOnlyNotice now renders ErrorNotice in place of the hand-made status box. The notice gets the page's journaled errorReport, the askAgent hand-off and onDismiss, and the "Trust the repository and update" button sits in its footer. The page holds no unsaved draft here, so the hand-off is on. The plain-words sentence from the UX round stays. AppDetailPageAutoAction.test.tsx now checks that the sentence is inside the alert region and that the alert offers the agent hand-off. The detail-page screenshots in the body are recaptured from this head.

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 8, 2026

@bolichen97 bolichen97 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving head 9cff5ac. The gate shows 97 checks passed, none red or pending.

What I checked in apps/local_trust_switch.py and the update route:

  • The switch needs the owner's fresh consent and writes nothing on a mismatch. check_switch refuses unless the name holds exactly an unbound grant over positively local code (_grant_is_local_only) and the consent proof equals the freshly resolved row's normalized clone target. A stale proof is app_trust_repository_mismatch, as the grant endpoint already answers. The coordinates are compared only and never echoed into responses or audit rows.
  • The grant is re-checked under the trust writer's lock. bind_repository repeats the check inside mutate_trust_settings, so a grant revoked or rebound meanwhile raises GrantChanged and writes nothing. The binding lands before any repository bytes are fetched, in the same shape the consent dialog records for a fresh install.
  • A failed update fails closed. restore_local_grant puts the local grant back only while the binding still names that repository and provenance is still local, and leaves an operator's own change alone. If that write fails, the repository grant that remains does not cover the restored local code, so the app is refused rather than widened. switch_cancel_safe reverts a write that lands after a cancelled request.
  • Every step is audited under the existing grant operation.

This gives the owner a path the app_trust_local_only refusal had no way to offer. It does not widen any grant beyond what the consent dialog already records. No product regex and no new restriction.

@bolichen97
bolichen97 merged commit e9cbb5b into main Nov 8, 2026
97 of 98 checks passed
@bolichen97
bolichen97 deleted the pearcekieser/app-update-local-trust branch November 8, 2026 05:17
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 8, 2026
Pearcekieser added a commit that referenced this pull request Nov 12, 2026
…l to the trust step

Follow-ups from the UX review of #30979 (issue #35913).

- The detail page disables its plain Update while the local-only notice
  is up, with a title naming the notice's trust button. Pressing it only
  reran the refused update.
- Update All's repository-trust and chat-control consent lines carry an
  "Open <app> details" button per named app, shown only while that notice
  is on screen. A trust app's button reruns the update on the detail page;
  a consent app's button only opens the page, since its update landed.
- A trust retry that meets the local-only refusal hands off to the detail
  page, as a first refusal does.
- The consent dialog's take-back line renders second, under the scope
  line, on every path. On a 390x844 phone it ended 283 px below the
  footer on the switch dialog and 139 px below it on the enable dialog;
  it now ends above both.
Pearcekieser added a commit that referenced this pull request Nov 12, 2026
…l to the trust step

Follow-ups from the UX review of #30979 (issue #35913).

- The detail page hides its plain Update while the local-only notice is
  up, so the notice's trust button is the only Update on screen. Pressing
  the plain Update only reran the refused update, and a disabled copy kept
  its blue fill and still read as ready to press.
- Update All's repository-trust and chat-control consent lines carry an
  "Open <app> details" button per named app, shown only while that notice
  is on screen. A trust app's button reruns the update on the detail page;
  a consent app's button only opens the page, since its update landed.
- A trust retry that meets the local-only refusal hands off to the detail
  page, as a first refusal does.
- The consent dialog's take-back line renders second, under the scope
  line, on every path. On a 390x844 phone it ended 283 px below the
  footer on the switch dialog and 139 px below it on the enable dialog;
  it now ends above both.
iamwhatever pushed a commit that referenced this pull request Nov 17, 2026
…l to the trust step

Follow-ups from the UX review of #30979 (issue #35913).

- The detail page hides its plain Update while the local-only notice is
  up, so the notice's trust button is the only Update on screen. Pressing
  the plain Update only reran the refused update, and a disabled copy kept
  its blue fill and still read as ready to press.
- Update All's repository-trust and chat-control consent lines carry an
  "Open <app> details" button per named app, shown only while that notice
  is on screen. A trust app's button reruns the update on the detail page;
  a consent app's button only opens the page, since its update landed.
- A trust retry that meets the local-only refusal hands off to the detail
  page, as a first refusal does.
- The consent dialog's take-back line renders second, under the scope
  line, on every path. On a 390x844 phone it ended 283 px below the
  footer on the switch dialog and 139 px below it on the enable dialog;
  it now ends above both.
Pearcekieser added a commit that referenced this pull request Nov 18, 2026
…l to the trust step (#35990)

* fix(apps): hold Update under the local-only notice and link Update All to the trust step

Follow-ups from the UX review of #30979 (issue #35913).

- The detail page hides its plain Update while the local-only notice is
  up, so the notice's trust button is the only Update on screen. Pressing
  the plain Update only reran the refused update, and a disabled copy kept
  its blue fill and still read as ready to press.
- Update All's repository-trust and chat-control consent lines carry an
  "Open <app> details" button per named app, shown only while that notice
  is on screen. A trust app's button reruns the update on the detail page;
  a consent app's button only opens the page, since its update landed.
- A trust retry that meets the local-only refusal hands off to the detail
  page, as a first refusal does.
- The consent dialog's take-back line renders second, under the scope
  line, on every path. On a 390x844 phone it ended 283 px below the
  footer on the switch dialog and 139 px below it on the enable dialog;
  it now ends above both.

* test(apps): count the Update buttons that hide under the local-only notice

The detail page's two Update buttons now carry an `!updateHidden` guard, so
the locations test's line filter found none. Accept the guard.

---------

Co-authored-by: EC2 Default User <ec2-user@ip-172-31-10-71.ec2.internal>
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.

Update on a folder-installed app with a registry update does different things in the Library and on its detail page

2 participants