Repository navigation
fix(shell): verify the Unix channel overlay like a fresh Main install and unwind it fully - #5749
Conversation
… and unwind it fully The Stable -> Main overlay verified with verify-main-sdk-composition after materializing the runtime, an action the provision script does not treat as a runtime action, so it refused the native .gentle-ai member as a "Main composition extra member". The unwind and the Main -> Stable cleanup also left the runtime/node_modules symlink behind, so every retry failed with "occupied path". - materialize through the helper the fresh Main install uses and verify with verify-main-sdk-selected; - share one list of Main paths, including runtime/node_modules, between the gate, the unwind and the Main -> Stable cleanup; - test the real action names against the provision script and the real filesystem effects, not only the seams.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Main SDK actions and composition internal/shellinstaller/user_main_bindings_unix.go, internal/shellinstaller/user_main_overlay_actions_unix_test.go |
Main SDK composition and installed-SDK verification use the userMainSDKAction boundary. Tests compare overlay composition actions with fresh Main installation actions and exercise rollback after selection or manifest-rebind failures. |
Overlay staging, cleanup, and rollback internal/shellinstaller/user_channel_overlay_unix.go, internal/shellinstaller/user_channel_overlay_unix_test.go |
Stable-to-Main staging checks all tracked Main paths and registers shared rollback cleanup. Main-to-Stable cleanup removes those paths after commit. Tests cover occupied paths, repeated channel switches, rollback, and retry. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix · Severity of issue fixed: Medium
Possibly related issues
Gentleman-Programming/gentle-ai#5738— Records the Stable-to-Main verification failure and retry obstruction from an occupiedruntime/node_modulespath addressed by these changes.
Possibly related PRs
- Gentleman-Programming/gentle-ai#5719 — Adds the Unix channel-only overlay that this PR extends with shared Main materialization, verification, and cleanup.
- Gentleman-Programming/gentle-ai#5695 — Implements in-place Stable/Main SDK switching for Windows; this PR implements related overlay behavior for Linux amd64 Unix installations.
- Gentleman-Programming/gentle-ai#5743 — Adds the
LauncherNoteresult field used by the Unix overlay result construction.
Suggested labels: type:fix
Suggested reviewers: decode2
Merge Risk: 
Minimal · up to 36c95
-
No current-head merge-blocking risk was established; the documented refusal for pre-existing residue remains a known limitation.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed -
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
…l-overlay # Conflicts: # internal/shellinstaller/user_channel_overlay_unix_test.go
Linked Issue
Refs #5738
PR Type
type:bug— Bug fix (non-breaking change that fixes an issue)Summary
On Linux amd64, switching an installed Separate target from Stable to Main preview in Manage and running "Update now" failed with
global provision refused: Main composition extra member, and every retry then failed withoccupied path.Root cause:
verify-main-sdk-compositionafter materializing the runtime.scripts/provision-gentle-shell-private-global.mjsdoes not list that action inmainRuntimeActions, so it rejects the native.gentle-aimember as an extra member.runtime/node_modulessymlink thatmaterialize-main-sdk-runtimecreates.Changes
internal/shellinstaller/user_main_bindings_unix.gouserMaterializeMainSDKhelper, used by the fresh Main install and the overlay. OneuserMainSDKSelectedActionconstant.internal/shellinstaller/user_channel_overlay_unix.goverify-main-sdk-selected, like a fresh Main install. The gate, the unwind and the cleanup share one Main path list, which includesruntime/node_modules.internal/shellinstaller/user_main_overlay_actions_unix_test.gointernal/shellinstaller/user_channel_overlay_unix_test.golinux && amd64. Round-trip and rollback-then-retry tests use the real actions.Size exception
716 changed lines (578 added / 138 removed). Most of it is test code: the action-contract emulator (
user_main_overlay_actions_unix_test.go) that reproduces the field failure against the real provision script action lists, plus the round-trip and rollback tests. The product change is about 150 lines. The emulator and the fix have to land together, because without the emulator the defect is invisible to CI again.Test Plan
TestUserUnixOverlayComposeMatchesFreshMainActionsfailed with the field messageglobal provision refused: Main composition extra member.TestUserUnixOverlayStableToMainUnwindsCompletelyfailed withoverlay residue survived the unwind: runtime/node_modules.go test -count=1 ./internal/shellinstaller/...is ok natively on darwin.CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go vet ./internal/shellinstaller/...andgo test -c: ok. The Linux-only overlay tests run in this PR's CI.shell-tui-acceptance.ymlon ubuntu-latest) follows once the registry fix lands, because scenario D reuses scenario A's verification.Known limit: installs that already carry the leftover
runtime/node_modulesfrom the old bug get an explicitalready occupiedrefusal. No auto-repair is included.Contributor Checklist
status:approvedCo-Authored-BytrailersSummary by CodeRabbit