Skip to content

fix(apps): stop calling an ordinary reinstall an orphaned partial install - #31686

Merged
KiroCrewCaptain merged 1 commit into
mainfrom
fix/adoption-live-reinstall-log
Nov 7, 2026
Merged

KiroCrewCaptain merged 1 commit into
mainfrom
fix/adoption-live-reinstall-log

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: Reinstalling an app after a default uninstall no longer logs a crash-recovery warning.

A default uninstall keeps the app's folder with only data/ in it. Reinstalling the same name then logs WARNING kiro_crew.apps.manager: Removing orphaned partial install at <home>/apps/<name>, although nothing crashed and the data is kept correctly. Reproduced on origin/main with an adopted papyrus: uninstall, trust, registry reinstall, and the warning is in gateway.log every time.

Why it matters

The warning names a crash that did not happen, on the ordinary uninstall-then-reinstall path every app user can take (the adopted former built-ins of #26967 included). Someone reading the log after a reinstall is sent looking for a hard kill, and a real orphaned partial copy reads the same as a routine reinstall.

Not a goal

  • Changing what the install does with the folder: it is still removed and re-copied, and data/ is still moved aside and put back.
  • Changing what uninstall keeps.

What changed (motivation → approach → change)

Symptom: a routine reinstall logs a crash-recovery warning. Root cause: install_app in src/kiro_crew/apps/manager_install.py reaches its orphan cleanup for any app folder standing at the destination without an install record, and the cleanup logs one fixed warning, although the comment above it already names the default uninstall's leftover as one of the two cases.

At that point the install has already moved data/ aside, so an empty folder is exactly what a default uninstall leaves. It is now logged at INFO as a reinstall into the folder the uninstall kept. A folder holding anything else is still an orphaned partial copy and keeps the warning. The removal and re-copy are unchanged.

Backwards compatibility

Compatible: only a log level and its text change, for the leftover case; every install outcome is the same.

Removes nothing: no file, record, key or function is removed; the warning still fires for a real orphaned copy.

Tests

test/test_app_manager_reinstall_log.py:

  • install, write to data/, default uninstall, reinstall: no orphan warning, the INFO line is logged, and the data survives;
  • a folder holding a stray app.json besides data/ still logs the orphan warning.

Proof: PROVEN test/test_app_manager_reinstall_log.py::TestReinstallLog::test_a_reinstall_after_a_default_uninstall_is_not_crash_recovery (head da89e49)

Determinism: 20/20 at -n0, 10/10 at -n 4 --dist loadgroup --max-worker-restart=2 with test_app_manager.py and test_app_manager_installed_tree.py as co-tenants, and a shuffled order (seed 20585) green. Every test_app_manager*.py file and test_apps_routes_coverage_update_uninstall.py pass.

Manual verification

Isolated gateway from this branch (loopback, stub ACP backend, throwaway KIROCREW_HOME/HOME/XDG dirs), papyrus adopted at 6ca7bc69: POST /api/apps/papyrus/uninstall {} left apps/papyrus/ holding only data; after trust and POST /api/apps/registry/install {"name":"papyrus"} the install succeeded and gateway.log carries no Removing orphaned partial install line (the same steps on origin/main logged it on each reinstall).

Related Issues

Part of #26967

Sibling sweep

Swept: git grep -n -i "orphaned partial" -- src
Sibling: src/kiro_crew/apps/manager_install.py -- changed here
Sibling: src/kiro_crew/apps/manager_tree.py -- not affected -- a docstring naming the two cases, no log line

Pattern harvest

Not generalizable: one fixed log sentence on a branch that serves two cases its own comment already told apart.

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

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 6, 2026 19:12
@bolichen97
bolichen97 requested a review from Zedmor November 6, 2026 19:12
@bolichen97
bolichen97 enabled auto-merge (squash) November 6, 2026 19:12
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 6, 2026
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ⏭️ skipped

Revision da89e49328d23fb73a59bbb3cb249bb0ee0d4131 touches no user-facing surface (no changes under website/ or committed screenshots), so the UX review was skipped. Does not block merge.

@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

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

Design-Verdict: PASS

Nothing blocks: only the log level and text change, the reinstall path behaves exactly as before, and a test covers both the empty-folder case and the leftover-file case.

Notes

  • The check for an empty folder relies on a default uninstall leaving only data/ behind. If uninstall later starts keeping another root entry (for example .app_secret), the warning quietly comes back. The first test would catch that, so no change is needed now.

[DESIGN-REVIEWED] da89e49

Description read

[DESCRIPTION-READ] 97c2760ba65404cf27ed59147c5751078f0580633b73659fc7855c5ce605628a

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 6, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of da89e49328d23fb73a59bbb3cb249bb0ee0d4131 — 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. It is a one-branch log-level fix aimed at the misleading message, with a reproduction and a test that fails on base.

What this change ships

Inventory (2 items) — 2 justified

Intent: reinstalling an app after a default uninstall should stop logging a crash-recovery warning that never happened. FIX.

  1. Reinstalling into a folder left empty once data/ is moved aside now logs an INFO line, not the orphaned-partial-install warning — justified
  2. A folder holding anything besides data/ still logs the orphan warning — justified

[FIRST-PRINCIPLES-REVIEWED] da89e49

Description read

[DESCRIPTION-READ] 8a7927550d4763962160a3fcbdf34fd7244f2a4647d8d61fc583f23c96204b13

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 Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

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

Review details

No findings.

[OPUS-REVIEWED] da89e49

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

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

@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 da89e49328d23fb73a59bbb3cb249bb0ee0d4131 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] da89e49

False positive or not applicable? A repository writer can comment:
/ai-review override gpt da89e49328d23fb73a59bbb3cb249bb0ee0d4131 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 Nov 6, 2026
@bolichen97
bolichen97 force-pushed the fix/adoption-live-reinstall-log branch from 41c22b7 to 7d93050 Compare November 6, 2026 20:43
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto origin/main 26c8238 to pick up #31625. The only red on 41c22b7 was test/test_security_gate_liveness.py::test_the_package_stays_within_its_line_budget (Backend Tests 3.12 shard 2, Windows shard 2, and the Coverage Gate that depends on them). It fails because the security package is 34753 lines against a 34733 budget. This PR does not touch that package, and #31625 raised the budget to 34753 on main. The code is unchanged. Related app-manager tests and the budget test pass locally on 7d93050, and the Proof line was re-run for the new head. No line-level findings; Design and First Principles PASS on the previous head.

@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 6, 2026
@bolichen97
bolichen97 force-pushed the fix/adoption-live-reinstall-log branch from 7d93050 to fef7892 Compare November 6, 2026 21:54
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased onto main at 7c364bc, which carries #31803 (the fix for test/test_pull_request_target_allowlist.py::test_only_the_allowed_workflows_use_pull_request_target, the red on Backend Tests (3.12, 7) and Coverage Gate for head 7d93050; the same red was on main, not this diff). New head fef7892; related app-manager tests (4545 passed) and the touched-file gates pass locally; Proof line re-run on the new head. CI re-running.

…tall

A default uninstall keeps the app's folder with only data/ in it, so
reinstalling the same name finds that folder with no install record and
took the crash-recovery branch, logging "WARNING Removing orphaned
partial install". Seen on every reinstall of an adopted app after an
uninstall.

The install has already moved data/ aside at that point, so an empty
folder is exactly the uninstall's leftover: it is now logged at INFO as
a reinstall into the kept folder. A folder holding anything else is
still an orphaned partial copy and keeps the warning. The cleanup itself
is unchanged.

Part of #26967
@bolichen97
bolichen97 force-pushed the fix/adoption-live-reinstall-log branch from fef7892 to da89e49 Compare November 7, 2026 00:46
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in src/kiro_crew/apps/adoption-pins.json, src/kiro_crew/cli.py, test/test_builtin_adoption_pins.py since this head went green (7c364bc -> c52c1eb); CI re-running.

The previous head fef7892 had every review lane clean (GPT and Opus no findings; Design and First Principles PASS; UX skipped). Its four reds (Dependency License Gate, Build Wheel, Sensitive Change Review, Publish readiness signal) were the repo-wide installation-token rate limit and a setup-python 429, and its Windows matrix sat queued for 2.5h. The re-runs of those passed before the rebase. The diff is byte-identical to fef7892. On da89e49 the related app-manager, adoption-pin and cli app tests pass locally (314 passed), and so do the touched-file gates. The Proof line was re-run for the new head.

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

@KiroCrewCaptain KiroCrewCaptain left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Approved for the on-call. Review lanes pass on da89e49, no conflict, no open change request.

@KiroCrewCaptain
KiroCrewCaptain merged commit 50f4684 into main Nov 7, 2026
151 of 159 checks passed
@KiroCrewCaptain
KiroCrewCaptain deleted the fix/adoption-live-reinstall-log branch November 7, 2026 02:58
buluoray pushed a commit that referenced this pull request Nov 8, 2026
…tall (#31686)

A default uninstall keeps the app's folder with only data/ in it, so
reinstalling the same name finds that folder with no install record and
took the crash-recovery branch, logging "WARNING Removing orphaned
partial install". Seen on every reinstall of an adopted app after an
uninstall.

The install has already moved data/ aside at that point, so an empty
folder is exactly the uninstall's leftover: it is now logged at INFO as
a reinstall into the kept folder. A folder holding anything else is
still an orphaned partial copy and keeps the warning. The cleanup itself
is unchanged.

Part of #26967

(cherry picked from commit 50f4684)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

readiness: passed Eligible automated validation passed for the current revision

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants