supertag-cli icon indicating copy to clipboard operation
supertag-cli copied to clipboard

Playwright-free full export via Local API (sync export --full)

Open jcfischer opened this issue 5 months ago • 1 comments

Context

Reported by a user (Ryan, via Claude Code) running supertag-cli under Daniel Miessler's PAI. Two related constraints make the current browser-based supertag-export a non-starter in that environment:

  1. Packaging — the supertag-export standalone binary couldn't even load Playwright (--external resolves from /$bunfs/root). Partial fix landed in fix/watch-snapshot-column-and-export-load (lazy import so --help works + clear error), but it does not make export function without Playwright.
  2. Policy — PAI's constitution bans Playwright outright (CDP is detectable, headless misses real rendering). So any Playwright-dependent path is disallowed regardless of packaging.

The opportunity

The reporter built a complete 854k-node index — attachments, references, fields, supertag schema — with the browser export never having run (sync status: Latest export: None found). Delta-sync from an empty DB effectively performs a full backfill straight from the Tana Local API.

So a browser may not be needed for full export at all.

Proposal

Add supertag sync export --full (or index --full) that pages the entire graph from the Local API to a point-in-time JSON snapshot — no Playwright, no headless Chrome, works under PAI. This would:

  • give users the legitimate snapshot file the old browser export produced, without a browser
  • make supertag-export optional / deprecatable
  • sidestep both the packaging bug and the PAI policy ban in one move

If a true browser flow is ever required again, the PAI-compatible route is Interceptor (real Chrome), not Playwright — but the Local API already exposing the full dataset suggests the browser is avoidable.

Scope / open questions

  • Snapshot format: match existing Tana JSON export schema (the schema registry already handles storeData wrapping) so downstream indexing is unchanged?
  • Paging strategy + watermark interaction with delta-sync.
  • CLI + MCP surface.
  • Deprecation path for supertag-export.

Filed from external bug report, 2026-06-08.

jcfischer avatar Jun 08 '26 20:06 jcfischer

Adding a current deployment data point in support of this direction.

In a large workspace, sync index --delta became a dead-end recovery path after a multi-day backlog. The command connected to Tana Desktop's Local API (Application Programming Interface), worked for a long time, then failed with:

Local API response validation failed: Unexpected end of JSON input

The observed effect was that no delta watermark advanced, so every retry had to replay the same oversized response. This looks like the same edited.since problem discussed in #85, but the operational consequence is broader: once delta-sync cannot establish a watermark, there is no Playwright-free full-refresh escape hatch.

That makes sync export --full useful for more than PAI (Personal AI Infrastructure) policy compatibility. It would also be the safe recovery path when delta-sync is wedged by a large backlog:

  • page the graph through the Local API with bounded request sizes
  • write a durable snapshot or checkpointed output as it progresses
  • let sync index rebuild from that snapshot without requiring Playwright
  • keep the existing browser export as optional instead of mandatory for recovery

Scale note, scrubbed: this was a macOS arm64 deployment using supertag-cli 2.5.9, Tana Desktop Local API on :8262, and a workspace in the 10^5-10^6 node range. Happy to provide sanitized logs if useful.

ryan-baum avatar Jun 15 '26 15:06 ryan-baum