Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS
JavaScript ai-agentsdashboarddeveloper-toolsdigital-twinquantified-selfsecond-brainself-hostedtailscale
fix: make the Git recovery agent publish pending work instead of stashing it
Adam Eivy1650e938cdce
diff --git a/client/src/components/apps/tabs/GitRecoveryAction.jsx b/client/src/components/apps/tabs/GitRecoveryAction.jsxindex 5f6e36b1b0..82fda379fe 100644--- a/client/src/components/apps/tabs/GitRecoveryAction.jsx+++ b/client/src/components/apps/tabs/GitRecoveryAction.jsx@@ -33,8 +33,9 @@ Work in this app's actual configured checkout, not a fresh worktree that hides iBefore changing anything, inspect staged, unstaged, untracked and conflicted files, local commits, stashes, and any in-progress merge/rebase. Do not interfere with active work; if ownership is unclear, preserve it and report a blocker.Create and verify recoverable local backups of all pending content (including untracked files and the index) and backup refs for local commits before resolving anything. Keep backups outside tracked files and retain them through completion. Never blindly pop/drop stashes, reset --hard, git clean, force push, or discard work based only on filenames.Fetch origin and compare each pending change against current remote history. Decide whether it is redundant because the current origin already contains an equivalent fix, or whether this app needs a PR for a unique change. Preserve the newer implementation while retaining every unique intended change. Finish only relevant work, run appropriate checks, review the diff for secrets and quality, and commit only relevant files. Push completed work normally; if branch protection requires a PR, create it and satisfy required CI/review gates before merging. Do not bypass protections.+Stashing, local backups, and local-only commits are never an acceptable resting place for unique work: a stash can be lost and nothing can recover it. Every unique pending change (dirty or untracked files, stash entries, unpushed commits) must end up on a named branch pushed to origin with an open PR (or merged). Group unrelated changes into separate branches/PRs. Never "clean up" by stashing the work. Local backups are a safety net taken before resolving, not a deliverable. Every stash entry must end resolved: either published to a branch/PR, or proven redundant against current origin with evidence, and only then dropped by its SHA (the stash list is shared with other worktrees, so never drop entries you did not account for).Resolve existing rebase/merge conflicts preserving both sides' intent. Integrate the latest origin default branch only after pending work is safely accounted for. Do not replay stale stash contents over the resolved checkout. Do not change unrelated branches or remove other worktrees.-Finally fetch again and verify the actual app checkout is on the default branch, clean including untracked work, and matches origin's latest default-branch HEAD, with all completed commits published. If blocked, retain backups and report precise remaining work; never claim success from a queued task or a local commit alone. Report preserved/discarded-as-redundant changes with evidence, tests, pushed commits/PR URLs, final Git status and backup locations locally. Do not publish private paths or app data. Do not restart the app; the user can run Update app afterward.`,+Finally fetch again and verify the actual app checkout is on the default branch, clean including untracked work, has an empty stash list, and matches origin's latest default-branch HEAD, with all unique work pushed on branches with open (or merged) PRs. If blocked, retain backups and report precise remaining work; never claim success from a queued task or a local commit alone. Report preserved/discarded-as-redundant changes with evidence, tests, pushed branches/PR URLs, final Git status and backup locations locally. Do not publish private paths or app data. Do not restart the app; the user can run Update app afterward.`,app: appId,provider: selection.providerId || activeProviderId,model: selection.model || undefined,diff --git a/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx b/client/src/components/apps/tabs/RepositorySourcePanel.test.jsxindex 2443da3a47..922d32856b 100644--- a/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx+++ b/client/src/components/apps/tabs/RepositorySourcePanel.test.jsx@@ -438,6 +438,6 @@ describe('PortOS self-update restart handoff', () => {fireEvent.change(screen.getByLabelText('Model'), { target: { value: 'example-model' } });fireEvent.click(start);await screen.findByRole('link', { name: 'Recovery queued · View agents' });- expect(api.addCosTask).toHaveBeenCalledWith(expect.objectContaining({ app: 'app-example', provider: 'example-cli', model: 'example-model', useWorktree: false, openPR: false, whenDone: 'commit-push', prompt: expect.stringContaining('including untracked files and the index') }), { silent: true });+ expect(api.addCosTask).toHaveBeenCalledWith(expect.objectContaining({ app: 'app-example', provider: 'example-cli', model: 'example-model', useWorktree: false, openPR: false, whenDone: 'commit-push', prompt: expect.stringMatching(/including untracked files and the index[\s\S]*never an acceptable resting place[\s\S]*empty stash list/) }), { silent: true });expect(useAppOperation().startUpdate).not.toHaveBeenCalled();});