Skip to content

fix(apps): address GH #14471 follow-ups: .app_secret link, dismiss label, desktop string - #20163

Merged
bolichen97 merged 2 commits into
mainfrom
fix/14471-deferred-followups
Nov 4, 2026
Merged

bolichen97 merged 2 commits into
mainfrom
fix/14471-deferred-followups

Conversation

@CrysisDeu

@CrysisDeu CrysisDeu commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Refs #14471

Problem / Motivation

Goal: Fix two deferred follow-ups from #13568: refuse an update whose installed .app_secret is a symlink, and align the test/harness REFUSAL constant with the backend string.

Items 3 and 7. Items 4, 5 and 6 excluded: item 4 keeps main's dismiss label (owner decision), item 5 awaits a maintainer ruling, item 6 belongs in the release PR per AGENTS.md.

Intended? / Repro

Why it matters

  • Item 3: An update silently loses the secret; the proxy fails closed with a 502.
  • Item 7: The test fixture asserted findReport behavior against the old string; a live deployment with the new string would silently break the handoff.

Not a goal

  • Fixing items 5 or 6.
  • Changing the dismiss label on the desktop-build refusal banner (item 4). Main's "Dismiss notice and re-enable Install/Update" stays.
  • Choosing option (b) for item 3 (materialize the symlink).

What changed (motivation → approach → change)

Item 3 — shutil.move relocates the link outside its tree; a relative target no longer resolves, so tmp_secret.is_file() fails and the secret is not put back. Fix: check is_link_or_junction(secret_file) before the transaction opens and return AppResult(ok=False).

Changed: src/kiro_crew/apps/manager_install.py, test/test_app_manager_copy_tree.py, test/link_screen_sites.py.

Item 7 — REFUSAL constants in TrustAppModal.test.tsx and the capture harness updated from "desktop app" to "Kiro Crew's desktop build".

Changed: website/src/test/TrustAppModal.test.tsx, website/scripts/capture-trust-modal-install-reason.mjs.

Backwards compatibility

Compatible: item 3 adds a refusal for a shape the install path never creates. Item 7 is a fixture change only.

Removes nothing: no existing reader of .app_secret or the refusal string is removed.

Tests

  • test_app_manager_copy_tree.py::TestCopyAppTree::test_an_installed_app_secret_link_refuses_the_update_before_the_transaction — new, @requires_symlinks
  • TrustAppModal.test.tsx — REFUSAL constants updated
  • Capture harness: all constants updated, all 8 frames asserted green locally

Manual verification

Capture harness run locally, all 8 frames written and asserted. Frame 06 shows the updated refusal string.

Screenshots / video

Frame 06 — trust-saved failure (item 7: updated refusal string):
Frame 06 — trust-saved failure

Related Issues

Pattern harvest

Rule candidate: When a pre-transaction move can relocate a symlink outside its tree, add a pre-transaction is_link_or_junction refusal matching the data-link shape — each gateway-owned root entry that can carry a link needs its own check.

Checklist

  • One commit
  • Existing tests pass and new tests added
  • Self-review completed
  • No secrets, credentials, or internal references in the diff

Reader: src/kiro_crew/apps/manager_install.py

@CrysisDeu
CrysisDeu requested review from a team and KiroCrewCaptain as code owners October 14, 2026 06:46
@CrysisDeu
CrysisDeu requested a review from mbriones98 October 14, 2026 06:46
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Capture harness frames (after)

Frames 01–08 re-shot with the updated translations and the new REFUSAL constant.

Frame 03 — Trusted page banner (item 4: new dismiss label)
The dismiss button now reads: "Dismiss notice and re-enable Install (after the author ships the packages)"
The disabled Install button title: "Dismiss the notice above to install again (after the author ships the packages)"

Frame 04 — Narrow page banner (item 4)

Frame 05 — Update page banner (item 4)

Frame 06 — Trust-saved failure (item 7: new REFUSAL string)
Modal now carries "Kiro Crew's desktop build" instead of "desktop app"

All 8 frames captured and asserted green by the harness locally (see run output in task).

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Capture harness frames 04/05/06 re-shot

Frame 04 (narrow): ![after-04-narrow-page-banner](./after-04-narrow-page-banner.png#Frame 04 — narrow banner, item 4)
Frame 05 (update): ![after-05-update-page-banner](./after-05-update-page-banner.png#Frame 05 — update banner, item 4)
Frame 06 (granted failure): ![after-06-trust-saved-failure](./after-06-trust-saved-failure.png#Frame 06 — trust-saved failure, item 7)

Frame 04 — narrow page banner (item 4)

Frame 05 — update page banner (item 4)

Frame 06 — trust-saved failure (item 7)

@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of 1596bc43d71cbe8664e973dfec27451404e64803 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 1596bc4

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

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: the pre-transaction refusal follows the existing data-link pattern, and the fixture string now matches install_desktop_gate.py:165.

Notes

  • The title says "dismiss label", but the description says item 4 is excluded and the diff has no label change. Drop it from the title.
  • The description's ## Backwards compatibility section contains both a Compatible: line and a Removes nothing: line, and a stray ## Reader: heading follows the checklist. Keep one form, using the documented Reader: shape.

[DESIGN-REVIEWED] 1596bc4

Description read

[DESCRIPTION-READ] bd56c787385eda9e42c043700231eb692e9c4e04c5bf9ce5754db6d5c59ac8cb

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 Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of 1596bc43d71cbe8664e973dfec27451404e64803 — 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

Both fixes have a reproducible defect and work at the mechanism level. One copy of the stale string is left in the frontend test file.

Notes

  • Item 4 — symptom-level: the description says "REFUSAL constants … updated", but website/src/test/TrustAppModal.test.tsx:822 still has '…not supported in the desktop app'. That is 1 unfixed copy out of the 4 frontend matches for require a build step are not supported. It is harmless today because that test asserts on code, not on the text. Subtraction: replace that literal with the REFUSAL string the file already defines, so no third spelling remains.

What this change ships

Inventory (5 items) — 4 justified

Intent: an app update should never silently lose the app's secret, and the frontend fixtures should match the backend's refusal text. This is a FIX.

  1. An update refuses, before touching anything, when the installed .app_secret is a link, and tells the operator to replace the link with a regular file — justified
  2. A new SEL audit record (operation="secret_link", rejected) is written for that refusal — undeclared
  3. update_app is registered as a declared link-screen site — justified
  4. The refusal string in the TrustAppModal test fixtures now matches the backend — symptom-level: line 822 still has the old string
  5. The trust-modal capture harness's refusal string now matches the backend — justified

[FIRST-PRINCIPLES-REVIEWED] 1596bc4

Description read

[DESCRIPTION-READ] 434863d0c981368aeeac82d08268635a4e5603f161e7e98e743adb92d0d43847

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 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed 1596bc43d71cbe8664e973dfec27451404e64803 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 1596bc4

Verdict parsed from the review's SHA-scoped output markers for commit 1596bc43d71cbe8664e973dfec27451404e64803.

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

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

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

UX-Verdict: PASS

No dashboard control changed. The frontend edits are test and capture-harness fixtures, and frame 06 shows the updated refusal string.

Notes

  • The new update_app refusal reads "…and the secret is lost" even though the update refused before anything moved and the secret is still there. Lead with what happened and what to do instead: "Update stopped: .app_secret is a link, not a file. Replace it with a regular file holding the same secret, then retry."
  • That refusal also uses implementation wording ("moving it aside… outside its tree where a relative target does not resolve"). An operator only needs the cause and the fix, so cut that clause.
  • Frame 06 shows the raw "ModuleNotFoundError: fastapi" line, and "Trust and try again" sits beside an error that retrying cannot fix. The blind reader "would not" press it. This PR doesn't change that surface, so it belongs in a follow-up.

[UX-REVIEWED] 1596bc4

Description read

[DESCRIPTION-READ] e0b0b4033716f98d6e7cae6a5a7b820f9c5d2071b1f8506405db7623680d50e8

That sha256 names everything this verdict read: the PR description, plus the 4 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.

@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from 6a6f1c4 to 24e97d2 Compare October 14, 2026 07:17
@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 Oct 14, 2026
@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from 24e97d2 to 48cff0e Compare October 14, 2026 07:35
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Updated frames 04/05 with the action-focused dismiss label (UX block addressed):

Frame 04 v2 — narrow banner, action-focused dismiss

Frame 05 v2 — update banner, action-focused dismiss

@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from 39ec58a to f9f7abf Compare October 14, 2026 07:47
@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Updated frames 04/05 (v3) — 'Dismiss notice so you can install/update again':

Frame 04 v3 — narrow banner

Frame 05 v3 — update banner

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 14, 2026
@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from f9f7abf to 05e3833 Compare October 14, 2026 08:22
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 14, 2026
@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from 05e3833 to dc99cb5 Compare October 14, 2026 09:08
@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 Oct 14, 2026
@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Oct 14, 2026
mbriones98
mbriones98 previously approved these changes Oct 14, 2026

@mbriones98 mbriones98 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.

Checks green and readiness passed at 4f6716c; no behavior change.

@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 4f6716c.

The .app_secret link refusal in update_app looks right, and CI is green. Three things keep this from approval:

  • Design, First Principles and UX all report CONCERNS on this head, and none has a reply. Design and First Principles both say "Close notice" says less than the old "Dismiss notice and re-enable Install" and contradicts the dismissLabelVisible contract and the harness/test comments. First Principles also flags the deleted no install-verbed dismiss on the update path pin, which the description does not mention. UX flags the body text that still reads as a retry trigger. Please post one ai-review-disposition per item: fix it, or explain why it does not hold.
  • Opus notes that docs/system-specs/modules/app-kit-platform.md §22 does not describe the new refusal or list its test. Please update the spec in this PR or answer the finding.
  • The change touches handling of an app's secret file, which the maintainers' rule reserves for a human reviewer. — crew-pr-reviewer (r101)

@github-actions github-actions Bot added the merge conflict Branch has merge conflicts with its base — author must resolve before merge label Oct 18, 2026
@iamwhatever
iamwhatever force-pushed the fix/14471-deferred-followups branch from 4f6716c to 5e974e5 Compare October 25, 2026 07:12
@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: passed Eligible automated validation passed for the current revision merge conflict Branch has merge conflicts with its base — author must resolve before merge labels Oct 25, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

Rebased onto latest main (head bef203d). Notes for the maintainer:

  • Rebase: main split apps/manager.py (refactor(apps): split manager.py into a facade and eight owners #21940). The .app_secret link refusal now sits in apps/manager_install.py::update_app, at the same pre-transaction spot. Its test moved to test/test_app_manager_copy_tree.py. link_screen_sites.py was regenerated with gen_link_screen_sites.py. The description's file list is updated.
  • GPT 6.1 finding (security-class): fixed in bef203d. The refusal told the operator to remove the link, which loses the secret on retry. It now says to replace the link with a regular .app_secret file holding the same secret.
  • HOLD items from 4f6716c are back on this head. First Principles now returns BLOCK (it was CONCERNS): the relabel to "Close notice" reverses the earlier "Dismiss notice and re-enable Install" decision, and the deleted no install-verbed dismiss on the update path check is not mentioned in the description. Design and UX pass but repeat the same notes (shared label makes the per-verb keys redundant; the tooltip still says "Dismiss the notice above..."). I did not change the label: keeping or reverting item 4 is the author's or a maintainer's call. It clears by either dropping item 4 (catalogs, harness constants, the deleted assertion, the new catalogParity block) or a maintainer override with the reason.
  • The secret-file change still needs a human reviewer, per the maintainers' rule.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Oct 25, 2026
@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from bef203d to 61b44c6 Compare October 31, 2026 09:13
@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Oct 31, 2026
Zezhen Xu and others added 2 commits October 31, 2026 10:30
Item 3 — update refuses an installed .app_secret symlink
shutil.move relocates the link outside its tree; a relative target
does not resolve, so tmp_secret.is_file() fails and the secret is
lost. Refuse before the transaction opens (data-link refusal shape).
SEL-logged. Test + link_screen_sites.py baseline added.

Item 7 — test and harness aligned with the landed Python string
TrustAppModal.test.tsx and capture harness REFUSAL constant updated
from 'desktop app' to 'Kiro Crew\'s desktop build'.
…ed .app_secret

The refusal said to remove the link and retry. Doing just that drops the
secret: the retry has nothing to preserve and the old tree is deleted.
Name the safe step instead. Also black-format the new test.
@CrysisDeu

CrysisDeu commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor Author

First Principles BLOCK on 61b44c6 (the "Close notice" relabel drops the cue that dismissing re-enables Install/Update): resolved in 1596bc4 by dropping item 4. The dismiss label stays main's "Dismiss notice and re-enable Install/Update" in every catalog; the catalogParity.test.ts block is gone, and the capture harness's label constants and its "no install-verbed dismiss on the update path" check are restored. The PR now ships items 3 and 7 only.

@CrysisDeu

Copy link
Copy Markdown
Contributor Author

Why the frozen Goal and Not a goal changed: the owner decided to drop item 4 (the dismiss relabel) rather than override the First Principles finding. The Goal no longer names the label change, and Not a goal now says the label stays as on main. No other frozen text changed.

@CrysisDeu
CrysisDeu force-pushed the fix/14471-deferred-followups branch from 61b44c6 to 1596bc4 Compare October 31, 2026 10:31
@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 Oct 31, 2026
@iamwhatever

Copy link
Copy Markdown
Contributor

HOLD at 1596bc4.

The r101 items are cleared: item 4 (the dismiss relabel) is dropped, every AI lane passes on this head, and CI is green. The .app_secret link refusal looks right. It runs before anything moves and leaves the link, its target and the record untouched:

# BEFORE the transaction opens, too: the installed `.app_secret` must be a
# regular file or absent. A LINK cannot be preserved: the move below
# relocates the link to `.<name>-secret-tmp` beside the app directory,
# where a relative in-tree target does not resolve; `tmp_secret.is_file()`
# then fails and the secret is lost on the update's success path. Refuse
# before anything moves, matching the `data`-link pre-transaction shape.
if is_link_or_junction(secret_file):
secret_link_refusal = (
"`.app_secret` in the app directory is a link; moving it aside for "
"the update places it outside its tree where a relative target does not "
"resolve and the secret is lost. Replace the link with a regular "
"`.app_secret` file holding the same secret, then retry the update."
)
sel().log_api_access(
caller="app_update",
operation="secret_link",
outcome="rejected",
resources=f"name={name!r}",
error=secret_link_refusal,
)
return AppResult(ok=False, name=name, error=secret_link_refusal)

What holds it: the change adds a refusal and audit row on the update path for the app's credential file, which the maintainers' rule reserves for a human reviewer.

AI findings judged non-blocking:

  • Design: the title still says "dismiss label", and the compatibility section has a stray ## Reader: heading. Description wording only.
  • First Principles: one old refusal string remains at
    error: 'Python apps that require a build step are not supported in the desktop app',
    ; that test asserts on code.
  • UX: the refusal says "the secret is lost" although nothing moved. Worth rewording, but its instruction is correct.

Items 5 and 6 stay tracked in #14471.

— crew-pr-reviewer (r138)

@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.

[operator: bolichen97] Reviewed at the current head. The .app_secret link refusal runs before the update transaction opens, matching the existing data-link pre-check, and the new test pins that the link, its target, the record and the tree stay untouched. The desktop string change is mirrored in the capture script and both frontend tests. No breaking issues found.

Non-blocking: this covers part of #14471's follow-ups, so that issue stays open for the rest, which matches the PR not using a closing keyword.

AI-assisted, approved by bolichen97

@bolichen97
bolichen97 merged commit f374ad6 into main Nov 4, 2026
96 checks passed
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 4, 2026
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.

4 participants