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: name deleted-record cleanup in plain language (#10280)
Adam Eivy89c7f3fa502d
diff --git a/client/src/pages/DataManager.jsx b/client/src/pages/DataManager.jsxindex 3ff0ff43a5..f21bd987a6 100644--- a/client/src/pages/DataManager.jsx+++ b/client/src/pages/DataManager.jsx@@ -92,15 +92,15 @@ function TombstoneGcSection() {if (collections) parts.push(`${collections} collection${collections === 1 ? '' : 's'}`);toast.success(`Pruned ${parts.join(' / ')}`);} else if (refusedKinds.length === 0) {- toast('No tombstones eligible for pruning');+ toast('Nothing is ready to clean up.');}if (refusedKinds.length > 0) {const refusedLabel = [...new Set(refusedKinds.map((k) => TOMBSTONE_KIND_PLURAL[k] ?? k))].join(', ');- toast.warning(`Refused: ${refusedLabel} — a snapshot-mode peer has no per-record subscription for this kind. Resolve to enable pruning.`);+ toast.warning(`Still waiting on ${refusedLabel}: open Instances, select the peer, and turn on that category under Sync Categories, or turn the peer off. Cleanup stays off so a peer that has not received the deletion cannot bring the record back.`);}setRefused(refusedKinds);return result;- }, { errorMessage: 'Tombstone sweep failed' });+ }, { errorMessage: 'Deleted-record cleanup failed' });// Every cohort refused iff `universe` (its own cohort), `series` (the// pipeline cohort representative — issues always travel with series), AND@@ -110,19 +110,20 @@ function TombstoneGcSection() {&& refused.includes('series')&& refused.includes('mediaCollection');const disabled = sweeping || refused == null || allRefused;+ const refusedLabel = [...new Set((refused ?? []).map((k) => TOMBSTONE_KIND_PLURAL[k] ?? k))].join(', ');const title = allRefused- ? 'Every kind has an enabled snapshot-mode peer with no per-record subscription — pruning would risk resurrection. Subscribe the peer or disable it to enable GC.'- : 'Prune tombstones acked by every subscribed peer (skips the 24h grace).';+ ? `Still waiting on ${refusedLabel}: open Instances, select the peer, and turn on that category under Sync Categories, or turn the peer off so a peer that has not received the deletion cannot bring the record back.`+ : 'Runs cleanup immediately instead of waiting 24 hours. It runs only for kinds every connected peer is already receiving.';return (<div className="bg-port-card border border-port-border rounded-xl p-4 space-y-3"><div><div className="flex items-center gap-2"><Trash2 size={14} className="text-gray-500" />- <h2 className="text-gray-400 uppercase tracking-wider text-[11px] font-medium">Tombstone GC</h2>+ <h2 className="text-gray-400 uppercase tracking-wider text-[11px] font-medium">Deleted-record cleanup</h2></div><p className="mt-1 text-gray-500 text-xs">- Run on demand instead of waiting for the 24h orchestrator sweep.+ Remove the leftover record of Universes, Pipeline series and issues, and Media Collections you already deleted. Automatic cleanup waits 24 hours. This runs it now.</p></div><button@@ -132,7 +133,7 @@ function TombstoneGcSection() {className="bg-port-accent hover:bg-port-accent/80 disabled:opacity-40 disabled:cursor-not-allowed text-white px-3 py-1.5 rounded text-xs font-medium transition-colors flex items-center gap-1.5"><Trash2 size={12} />- {sweeping ? 'Pruning…' : 'GC tombstones now'}+ {sweeping ? 'Cleaning up…' : 'Clean up deleted records now'}</button></div>);diff --git a/client/src/pages/DataManager.test.jsx b/client/src/pages/DataManager.test.jsxindex d4698c627f..c26ed7b376 100644--- a/client/src/pages/DataManager.test.jsx+++ b/client/src/pages/DataManager.test.jsx@@ -55,6 +55,14 @@ describe('DataManager tombstone GC peer-refusal subscription (#8110)', () => {socket.emit.mockClear();});+ it('names deleted-record cleanup in plain language (#10280)', async () => {+ render(<DataManager />);+ await waitFor(() => expect(screen.getByRole('heading', { name: 'Deleted-record cleanup' })).toBeInTheDocument());+ const button = screen.getByRole('button', { name: 'Clean up deleted records now' });+ expect(button).toHaveAttribute('title', expect.stringMatching(/24 hours/));+ expect(screen.queryByText(/tombstone|GC|orchestrator|acked|snapshot-mode/i)).not.toBeInTheDocument();+ });+it('subscribes to the instances room on mount', async () => {render(<DataManager />);await waitFor(() => expect(screen.getByText(UNKNOWN_DESCRIPTION)).toBeInTheDocument());diff --git a/scripts/gc-tombstones-now.js b/scripts/gc-tombstones-now.jsindex bdc3e29685..335d6a183f 100644--- a/scripts/gc-tombstones-now.js+++ b/scripts/gc-tombstones-now.js@@ -32,8 +32,10 @@ import { sweepTombstones, getSweepStatus } from '../server/services/sharing/tomb// Mirrors `TOMBSTONE_KIND_PLURAL` in the Instances UI so the CLI output// matches the toast wording. Dedupe handles the series/issue cohort.-const KIND_PLURAL = { universe: 'universes', series: 'series', issue: 'issues' };+const KIND_PLURAL = { universe: 'universes', series: 'series', issue: 'issues', mediaCollection: 'media collections' };+const KIND_SINGULAR = { universe: 'universe', series: 'series', issue: 'issue', mediaCollection: 'media collection' };const labelKinds = (kinds) => [...new Set(kinds.map((k) => KIND_PLURAL[k] ?? k))].join(', ');+const countPhrase = (count, key) => `${count} ${count === 1 ? KIND_SINGULAR[key] : KIND_PLURAL[key]}`;function parseArgs(argv) {const out = { apply: false };@@ -46,7 +48,7 @@ function parseArgs(argv) {async function main() {const { apply } = parseArgs(process.argv);if (!apply) {- console.log('🧪 DRY-RUN — pass --apply to actually prune tombstones\n');+ console.log('🧪 DRY-RUN — pass --apply to run deleted-record cleanup\n');} else {console.log('⚠️ --apply: STOP the server before continuing or prunes may be clobbered');console.log('⚠️ Run `pm2 stop portos-server` first, then `pm2 start portos-server` after\n');@@ -58,10 +60,10 @@ async function main() {// — too easy to misread "would prune N" as "did prune N".const status = await getSweepStatus();if (status.refused.length > 0) {- console.log(`⚠️ Refused kinds: ${labelKinds(status.refused)}`);- console.log(' (a snapshot-mode peer has no per-record subscription for this kind — resurrection risk)');+ console.log(`⚠️ Still waiting on ${labelKinds(status.refused)}: open Instances, select the peer, and turn on that category under Sync Categories, or turn the peer off.`);+ console.log(' Cleanup stays off so a peer that has not received the deletion cannot bring the record back.');} else {- console.log('✅ No refusals — every kind has an ack horizon');+ console.log('✅ No refusals — deleted-record cleanup can run for every kind');}if (!apply) {@@ -70,9 +72,15 @@ async function main() {}const result = await sweepTombstones({ graceMs: 0 });- console.log(`\n🗑️ Pruned: ${result.universes} universe(s), ${result.series} series, ${result.issues} issue(s)`);+ const parts = [+ countPhrase(result.universes, 'universe'),+ countPhrase(result.series, 'series'),+ countPhrase(result.issues, 'issue'),+ ];+ if (result.collections) parts.push(countPhrase(result.collections, 'mediaCollection'));+ console.log(`\n🗑️ Pruned ${parts.join(' / ')}`);if (result.refused.length > 0) {- console.log(`⚠️ Skipped: ${labelKinds(result.refused)} (resurrection-safety refusal)`);+ console.log(`⚠️ Skipped ${labelKinds(result.refused)}: open Instances, select the peer, and turn on that category under Sync Categories, or turn the peer off.`);}}