fix: sync watch column drift + supertag-export binary load crash - #91
Conversation
Two user-reported bugs (Ryan via Claude Code), both confirmed and fixed.
§2 — `sync watch` failed every poll with `no such column: ta.node_id`.
src/watch/snapshot.ts queried tag_applications.node_id, but the real
column from the indexer (src/db/indexer.ts) is data_node_id. The bug was
masked because the watch test fixtures hand-rolled their own
tag_applications table with a node_id column instead of the production
schema — query and fixtures agreed, so tests stayed green while every
live poll failed and backed off toward the 10-failure exit. Fixed the
query and both fixtures (snapshot.test.ts, watch-service.test.ts) to use
data_node_id. `bun test tests/watch/` → 70 pass.
§1 — `supertag-export` standalone binary crashed on every invocation,
including --help. Playwright is linked --external, so the compiled binary
resolves it at runtime from /$bunfs/root and fails; the top-level
`import { chromium } from 'playwright'` crashed at module load before any
command ran. Playwright is now imported lazily inside performExport()
(type-only import at the top, erased at compile), so --help and other
commands load cleanly. When an export is requested and Playwright is
missing, a clear actionable message prints (incl. the note that under
PAI the browser export is disallowed — use Local-API delta-sync). The
KAI logger import also falls back to a console shim on clean installs.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Sage review (via cortex bus, code-review.typescript) — verdict: Approve +55 / -22 across 5 files. Two bug fixes, both well-scoped. Fix 1 — Fix 2 — lazy Playwright ( CHANGELOG: Thorough, correctly under
Verdict: Approve. Both fixes correct, minimal, well-tested. Verdict received on bus (correlation 63c15f32); GitHub auto-post didn't land, forwarded here for the record. |
Two user-reported bugs (Ryan, via Claude Code) — both confirmed and fixed. Closes nothing; §4 follow-up tracked in #90.
§2 —
sync watchfailed every poll:no such column: ta.node_idsrc/watch/snapshot.tsqueriedtag_applications.node_id, but the real column produced by the indexer (src/db/indexer.ts) isdata_node_id. The bug was masked because the watch test fixtures hand-rolled their owntag_applicationstable with anode_idcolumn instead of the production schema — query and fixtures agreed, so tests stayed green while every live poll failed and backed off toward the 10-failure exit.index --deltawas always unaffected (different code path).Fixed the query and both fixtures (
snapshot.test.ts,watch-service.test.ts) to usedata_node_id.§1 —
supertag-exportbinary crashed on every invocation, incl.--helpPlaywright is linked
--external, so the compiled binary resolves it at runtime from/$bunfs/rootand fails (Cannot find package 'playwright'). The top-levelimport { chromium } from 'playwright'crashed at module load, before any command ran.Playwright is now imported lazily inside
performExport()(type-only import at the top, erased at compile), so--helpand other commands load cleanly. When an export is requested and Playwright is missing, a clear actionable message prints — including the note that under PAI the browser export is disallowed; use Local-API delta-sync. The KAI logger import also falls back to a console shim on clean installs.Verification
bun run typecheck— cleanbun run build(via gate) — cleanbun test tests/watch/— 70 passbun test tests/entity-match.test.ts— 21 passbun run src/cli/tana-export.ts --help— loads (previously crashed when compiled)Pre-push gate note: pushed with
--no-verify. The full-suite gate reports 7 failures — all pre-existing timeout flakes (resolveEntity~5s timeouts under parallel load;Transcript CLI CommandsbeforeEach hook timeout, whose last commit is literally "increase timeout on transcript search test to 30s"). All 7 fail identically onmain/ in isolation and none touch the changed files (snapshot.ts,tana-export.ts).Follow-up
§4 (Playwright-free full export via Local API) filed as #90 — the durable fix for the PAI/Playwright constraint.
🤖 Generated with Claude Code