Operational Data Loss Investigation Context
Status: Active investigation handoffOwner: Codex / Paperclip local instance
Date: 2026-04-10
Target model: Gemini Pro
Scope: Read-only forensic investigation of missing operational/work telemetry in the live Tremor/Paperclip instance
Executive Summary
The live Paperclip instance is not crashed. The core company graph, issues, agents, and projects exist again, but the operational telemetry layer is empty in the active DB. Confirmed missing/empty in the live DB:cost_eventsfinance_eventsheartbeat_runsissue_inbox_archivesissue_work_productsplugin_job_runsplugin_logsroutine_runsworkspace_operationsapprovalsbudget_incidents- most other operational history tables
agentsissuesprojects- a small number of
activity_logrows - a couple of
performance_signalsrows - a couple of
performance_snapshotsrows
What Happened in This Chat Thread
This is the condensed history of the work that led to the current state.1. Initial focus: removing Google Antigravity from the Mac
The conversation began with a request to completely remove Google Antigravity from macOS. A script was created and hardened for deep cleanup, then run and verified. Additional historical traces were removed from shell profiles, keychain, and crash metadata.2. Agent Skills / internalCtx / skill activation fixes
The next topic was the Agent Skills plugin. The activation path had multiple issues:
internalCtx is not defined- the activation flow was trying to resolve a GitHub source that did not contain the intended skill
- the UI was showing every recommendation as activating instead of only the clicked skill
- recommended skills were not persisting an
Assignedstate cleanly
3. Performance HQ / company matrix work
A large portion of the thread was spent on Performance HQ. The user wanted a company-wide matrix grouped by role-skill bloom cell and seniority, with telemetry such as tokens in/out, worked-hours proxies, and LOC placeholders. The work evolved through several designs:- a company matrix built from existing telemetry
- a separate page rather than replacing the project-scoped Performance HQ tab
- then a v2 plugin identity so the matrix could be installed de novo rather than requiring an upgrade-capability approval path
Performance HQ v2 plugin package was created and installed locally as a separate plugin record. The v2 matrix route and backend route both exist, but the live app’s operational data was still empty.
4. Live instance state drift and restoration
At one point the user reported routes suddenly returning blank screens / not found pages. Investigation showed the instance had come up without the original company graph loaded. The Tremor company graph was restored fromdocs/companies/tremor, which brought back the core company/issue/agent/project graph.
The company prefix in the live instance is now TRE, not the older TREAAA prefix that had been used in some earlier routes/screenshots.
5. Root issue now under investigation
After the restore, the live app still showed no operational telemetry. Costs, inbox, runs, and other operational dashboards remained empty. This is the current problem.Current Live Runtime Facts
Company / route state
- Current company name:
Tremor - Current issue prefix:
TRE - Dashboard route that works:
http://localhost:3100/TRE/dashboard - Costs route that works:
http://localhost:3100/TRE/costs - Inbox route that works:
http://localhost:3100/TRE/inbox/mine - Old
TREAAAroutes are no longer valid after the restore
Live DB path and credentials
The embedded Postgres instance is at:/Users/sydneymilton/.paperclip/instances/default/db
postgres://paperclip:paperclip@127.0.0.1:54329/paperclip
Current embedded postgres details
The active embedded postgres command is stored inpostmaster.opts under the instance DB directory and is listening on port 54329.
Current company id
a5491266-37cd-4d7b-b6cb-77f358fb052b
Live API Evidence
The following API checks were performed against the running app.Companies
GET /api/companies
Result:
- One active company exists
name:TremorissuePrefix:TREstatus:active
Costs / finance
GET /api/companies/a5491266-37cd-4d7b-b6cb-77f358fb052b/costs/summary?from=2026-04-01&to=2026-04-10
Result:
GET /api/companies/a5491266-37cd-4d7b-b6cb-77f358fb052b/costs/finance-events?from=2026-04-01&to=2026-04-10&limit=5
Result:
[]
Sidebar badges
GET /api/companies/a5491266-37cd-4d7b-b6cb-77f358fb052b/sidebar-badges
Result:
Live runs
GET /api/companies/a5491266-37cd-4d7b-b6cb-77f358fb052b/live-runs
Result:
[]
Issues
GET /api/companies/a5491266-37cd-4d7b-b6cb-77f358fb052b/issues?q=TRE-
Result:
- 15 issues returned
- This confirms that the issue graph is present
- The loss is specifically in operational telemetry, not the issues table
Live DB Table Counts
I queried the embedded Postgres directly with a temporary script using the repo database package and the embedded DB credentials.Present / non-empty
agents: 15issues: 15projects: 2activity_log: 5agent_runtime_state: 2performance_signals: 2performance_snapshots: 2
Empty or effectively empty
cost_events: 0finance_events: 0issue_inbox_archives: 0heartbeat_runs: 0agent_task_sessions: 0agent_wakeup_requests: 0approval_comments: 0approvals: 0budget_incidents: 0heartbeat_run_events: 0issue_comments: 0issue_work_products: 0plugin_job_runs: 0plugin_logs: 0performance_ledger: 0routine_runs: 0workspace_operations: 0
Sample Live Rows
activity_log
The only recent rows are from the restore/reinstall cycle:
company.importedfor the company restoreplugin.installedfortremor.company-intakeplugin.installedfortremor.project-flight-planplugin.installedfortremor.agent-skillsplugin.installedfortremor.performance-hq-v2
agent_runtime_state
Only two rows exist. Both show zero token/cost totals and session_id is null.
performance_signals / performance_snapshots
- 2 rows each
- They are restore-time snapshots with zeroed counts / costs / hours
Backup / Archive Inventory
Backups were checked under:/Users/sydneymilton/.paperclip/instances/default/data/backups/
- files named like
paperclip-20260410-001624.sql - files are about 2234 lines
grep '^COPY 'returned nothinggrep '^INSERT INTO 'only surfaced a handful of seed inserts near the end:instance_settingsinstance_user_rolespluginsuser
Old Workspace / Production Artifacts
An older path exists here:/Users/sydneymilton/paperclip-production/home/instances/default
- it contains many
TREAAA-prefixed references in logs/workspaces - it contains run output and prompt context from earlier sessions
- it does not contain a DB snapshot with the missing telemetry rows
Most Likely Diagnosis
Inference
The active DB was restored or recreated from a snapshot that preserved:- schema
- core company graph
- agents/issues/projects
- a few recent restore-time logs
- zero cost events
- zero finance events
- zero heartbeat runs
- empty inbox and work product views
- missing activity history beyond the restore window
- no live run history
Why this is not a UI bug
The API is returning empty arrays and zeros directly from the backing tables. The UI is faithfully rendering what the DB contains.What Has Been Ruled Out
- A browser-only rendering issue
- A plugin bundle cache problem as the primary cause of missing telemetry
- A crash in the UI server
- A missing company graph entirely
- An issue table / agent table loss
What Remains Unresolved
- Whether another DB snapshot/archive exists elsewhere on disk that has the full telemetry rows.
- Whether the missing data can be partially reconstructed from logs/workspaces.
- Which exact restore/reseed step caused the live telemetry tables to be emptied.
Suggested Next Investigation Steps
- Search for any additional hidden dumps, WAL archives, or filesystem snapshots outside the checked backup directory.
- Inspect old run logs and workspace artifacts for timestamps and commands that may show a restore or reseed operation.
- Determine whether the restore was a full refresh or a selective import that intentionally omitted telemetry tables.
- If recovery is impossible, document the loss boundary precisely so future restores include the missing tables.
Gemini Pro Investigation Prompt
Use the following prompt verbatim or with minimal edits. It explicitly tells Gemini to read this markdown handoff first and to delegate the investigation to subagents:Operational Notes
- The old
TREAAAroutes are stale after the restore; the current company prefix isTRE. - The live dashboard and costs pages load from the restored company state, but operational metrics remain zero because the underlying tables are empty.
- Performance HQ / matrix work, plugin installs, and other ongoing work happened during the same thread, but do not explain the telemetry loss by themselves.
- The plugin/page work is separate from the database loss investigation.
Practical Bottom Line
The best current conclusion is:The operational telemetry tables were not preserved in the active embedded DB restore, and the currently available backups do not contain row-level telemetry data to recover them.If that changes, the investigation should focus on finding another archive or a previous DB snapshot that includes the missing tables.