prospector/docs/MIGRATION_FROM_LP.md
Natalie bcbd558e9d
Some checks are pending
CI / verify (push) Waiting to run
refactor!: drop Swift/native macOS app, unify on the PWA
Remove all Swift/legacy artifacts — no native app, no swift-react UI, no
tech debt. The Chrome PWA (web/) on the NestJS backend (src/) + MCP server
is the sole way forward.

Removed:
- @packages/prospector-client, @packages/prospector-ui (Swift packages)
- Sources/ (QuinnProspector, QuinnProspectorCore), Config/, project.yml,
  QuinnProspector.xcodeproj, Resources/
- PLAN.md (stale my/-port plan, superseded)

Rewired:
- .forgejo/workflows/ci.yml → Node CI (npm ci → typecheck/test/build for
  backend + web + MCP) instead of Swift build/test
- .gitignore → drop .build/, *.xcodeproj/

Unified definition:
- docs/PROSPECTOR.md — new single source of truth (architecture, surfaces,
  invariants, dependencies, build/deploy)
- README.md, CLAUDE.md, docs/README.md, src/README.md → PWA-forward,
  point at docs/PROSPECTOR.md, no Swift/legacy references

designs/ kept intact as the authoritative UI/behavior spec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 11:59:04 -04:00

5.9 KiB

Migration from LP (lilith-platform) to Dedicated @prospector App

Date: 2026-06-29
Status: Core implemented (UI fused per designs + inbox-ops + LP tabs; bilingual data+UI; MCP extended for full parity; data foundation; builds green). Backend has substantial parity (prospects/audit/classify/runner/engine partials already); remaining heavy ports (full qualif, engine_drafts cache/pair, prompt-revs, backfill jobs, dual LLM, structural facts, full runner process) documented for Phase 2 follow-up or proxy via clients to LP until cutover.

What Was Migrated / Implemented Here

  • UI (Phase 1):
    • Bilingual: columns in prospect_drafts (0006 migration), types in service/api, dual render in Triage (roster + toggle + badges), Detail (bubbles), Reports (toggle + notes).
    • Triage: toolbar (Classify GPU, MR visible, Refresh Pastebin), sidebar (TODAY'S FUNNEL from reports + mini RUNNER QUEUE 4 from held + backend GPU info + links), counts, bi dual, "PROSPECTS • BAND (N)" header. Matches designs/main-view + inbox-ops + Stream.
    • Reports: 4 fused sections (1 Cross-Provider/Funnel, 2 Warm/Volume, 3 Auto-Qual+Draft bi demo with links, 4 Marketplace/ByBand/Backlog) + bi toggle. Folds LP Experiments/Patterns/Actions/Overview.
    • Queue: tabs (Queued/History), filters, Simulate Runner Tick + log (handoff steps), preserved release UX. Matches designs/queued + LP owed/backfill.
    • Pastebin: Sync button + note (macsync pushes).
    • Control: PWA install button (beforeinstallprompt capture + instructions). Matches designs PWA + handoff.
    • Detail/Pastebin/Markets/Campaigns/Control base enhanced with bi/links.
    • PWA: manifest/sw/standalone already; install affordance added.
  • MCP (Phase 3): Extended @packages/mcp-prospector with draft, send, thread (getProspect), list, pastebin, reports, mr, markets + existing (submit, activity, held, digest, correction, mode, classify). Full coverage for legacy cockpit_* + new unified. Thin REST adapter.
  • Data/Backend foundation: Bilingual columns + capture in inbound/audit/prospects (original/translated default to text for back-compat; real ES from macsync). Existing engine/runner/classify/inbound/pastebin/reports/corrections/campaigns/markets/settings cover core (fast-classify, scam, gates, decide, macsync outbox, etc.).
  • Docs/Deploy: deploy.md updated with 0006 migrate + notes; this MIGRATION_FROM_LP.md; see docs/PROSPECTOR.md (unified definition).

Remaining for Full Parity (per plan Phase 2/4)

  • Agent-prospector helpers (ARCHETYPES, computeScore/deriveArchetype/lint/structural facts) — port or dep.
  • Full prospect-qualification (10 slots JSONB, repo getOrCreate/apply/setReady/rate, decay/selector/triggers/mr-gate/of-redirect etc.).
  • Engine_drafts full (table/brief/pair/patch/summarize/patterns for cache/teach/funnel).
  • Prompt-revisions + listWithWinRate (for Experiments).
  • Full announce/backfill/warm (jobs/status/coverage since-6/22 + macsync warm + pastebin).
  • Structural-facts (macsync calls + compute).
  • Full runner process (owed + addressbook gate + OF render).
  • Dual LLM client (model-boss tasks + claude fallback).
  • Full send guard/duplicate/409 + worked pair + edit→correction in all paths.
  • Actions stream, metro-demand, admin surfaces parity.
  • Live processor LISTEN (if not using inbound webhook).
  • Macsync depth: pastebin notes parse (①–⓱/Voice etc.), calls signal, markRead in classifier/runner/backfill.
  • Proxy clients for LP central (clients/qualif for roster/funnel if not migrating tables).

Data ownership: Prefer proxies (extend clients/ for LP /engine/ /admin/ /my/prospects via service token) first. App owns prospect_drafts rollups + bi + campaigns + local settings.

LP Removal Targets (after cutover + verif)

  • mcp-prospector/ (src + package + README + quinn.mcp/deploy).
  • surfaces/my/{prospector.ts, prospect-cockpit.ts} + mounts.
  • features/prospect-{runner,classifier,draft,qualification,queue,backfill,announce,pastebin,state,structural-facts}/ + processors/prospect-classifier.
  • entities/{engine-draft,prospect-qualification,prompt-revision,correction (if exclusive),prospector-settings (if moved),snapshots,...}.
  • surfaces/admin/{prospects,engine-drafts,screening,...} + engine/drafts + assistant/qualify/experiments.
  • tests/my-prospector.test.ts + prospect-* + engine-drafts.
  • server mounts/imports/migrations/processor starts for prospector.
  • scripts/prospector-health.sh (moved/adapted here) + some provision.
  • docs/prospector*.md + handoffs updates (point here); quinn.api/mcp deploys + env (MODEL_BOSS etc.).
  • my/frontend-public prospector tabs/pages (deprecate or redirect to PWA URL e.g. the deployed prospector app).

Keep in LP: client prospect cols + listProspects/metro (for admin/roster/other), screening/reputation/people (other), shared/mac-sync (for messenger), m/qualification.

Proxies during transition: In LP quinn-api, thin forwarders for /my/prospector/* /engine/drafts /admin/prospects etc. to this app's /prospector/* (auth via service token). Update LP mcp client BASE temporarily. Dual health. Cut after Phase 7 verif.

How to Cutover

  1. Apply 0006+ migrations on prospector DB.
  2. Deploy this app (rsync, restart).
  3. Point MCP (quinn.mcp or bundled) to this BASE + TOKEN.
  4. Update any direct callers (my/ tabs, agents, quinn-desktop) to new MCP or /prospector endpoints or PWA URL.
  5. Run adapted prospector-health.sh (this app endpoints + MCP tools + bi coverage).
  6. Verif real flows (inbound via macsync webhook → classify → decide → draft/send/correct; UI Triage/Queue/Reports/MCP; runner; campaigns; markets; PWA install).
  7. Remove from LP (scoped PRs); update platform CLAUDE/handoffs/docs.
  8. Announce (PWA is the unified operator app + MCP).

See session MIGRATION-PLAN.md for full phases, verif rules (ls/grep/read designs + code + health before edits; side-by-side prototypes; atomic commits with Co-Authored-By), risks.

This app is now the canonical unified prospector (backend + PWA + MCP).

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com