Releases: jcfischer/supertag-cli
Releases · jcfischer/supertag-cli
Supertag CLI v2.5.7
Fixed
- Reference-type field values returned empty string —
tana_query,tana_tagged, and any code path throughFieldResolverreturned""for fields whose value is a reference to another node (e.g.,"Context": ""where Context pointed toPr MB2). Root cause: Tana stores inline references as empty<span data-inlineref-node="NODE_ID"></span>tags; the resolver ranstripHtml()which removed the span, leaving the empty content behind. The resolver now parses those spans, looks up the referenced node's name (batched, single SQL query per unique set), and substitutes the resolved display text before stripping residual HTML. Also resolvesdata-inlineref-datespans to theirdateTimeStringvalue.
Supertag CLI v2.5.6
Fixed
- Delta-sync was silently a no-op after first run (CRITICAL) — Tana Local API interprets
edited.sinceas seconds since epoch, but supertag-cli was passing milliseconds. The API resolved the ms value to a far-future timestamp (~year 58,000) and returned 0 results, so every delta-sync after the initial one did nothing. Fixed by converting ms → seconds at the API boundary inDeltaSyncService.fetchChangedNodes(). The watermark remains in ms internally for backward compat with existing databases. This explains most reported staleness — delta-sync now actually catches Tana-originated edits.
Known limitation (still present after this fix)
- Field-value-only changes may still not surface in delta-sync. Investigation showed that modifying only a field value on a node does not appear to bump the parent's
edited.sincetimestamp in Tana's index. A proper fix requires a per-supertag rescan (planned for v2.6). Until then, a nightlysupertag sync index(full reindex) remains required for field-filtered query correctness.
Supertag CLI v2.5.5
Fixed
- Delta-sync hangs indefinitely on Windows 11 —
LocalApiClientnow wraps everyfetch()with anAbortSignal-based timeout (default 30s, override viaSUPERTAG_LOCAL_API_TIMEOUT_MS). A wedged Tana Desktop process used to hang the entire sync forever; it now surfaces as a retryableTIMEOUTerror after the configured timeout and retries with exponential backoff.
Added
tana_statsexposes index freshness — Response now includeslastFullSync,lastDeltaSync,lastDeltaNodesCount,secondsSinceLastSync, andisStale(with astaleReasonmessage when stale). Lets AI callers detect a stale index before trusting query results.tana_queryemits staleness warnings — Responses now include an optionalwarningsfield when the local index is stale or when a field-filtered query runs against a database with no full sync. Thresholds configurable viaSUPERTAG_STALE_DELTA_MINUTES(default 60) andSUPERTAG_STALE_FULL_HOURS(default 168).
Documentation
- Field-filtered queries require a recent full sync — Documented that delta-sync clears
field_valuesfor touched nodes without repopulating them (by design — delta-sync has no tuple context). Any query filtering on a non-core field must therefore run against a recently full-synced index; delta-sync alone is insufficient for field-value correctness. A proper fix requires a deeper redesign (see #sync-correctness).
Supertag CLI v2.5.4
Fixed
selectwithfields.*still returns null/empty — Replaced generic nested-path projection with explicit field extraction that directly reads resolved field values. Field resolution now always uses'*'wildcard (no SQL field-name matching), and projection constructs the output fields object explicitly with case-insensitive key lookup. Eliminates all SQL matching, encoding, and generic-projection fragility.tana_queryignoresselectclause —tana_querynever applied projection, returning all core fields (parentId, nodeType, doneAt) regardless ofselect. Now explicitly filters to requested fields.- Field name matching now case-insensitive — Both SQL field resolution (
COLLATE NOCASE) and field projection match field names case-insensitively, sofields.statuscorrectly resolvesStatus. sync statusfails on Windows junctions —findLatestExport()silently returned null when the export directory was a Windows junction (e.g., to Google Drive). Now resolves the canonical path viarealpathSyncbefore reading, with improved diagnostic logging.- Delta sync does not clear stale field values — When field values are changed or cleared in Tana and delta sync detects the node update, the old field values in
field_valuestable were never removed. Delta sync now clears field_values for updated nodes. A subsequent full sync (sync index) re-populates them from the export.
Supertag CLI v2.5.3
Fixed
selectwithfields.*still returns null/empty — Root cause: field resolution used exact SQLfield_name IN (...)matching which failed silently on case/encoding mismatches. Now resolves ALL fields with wildcard and lets JS projection handle filtering — eliminates any SQL matching fragility.tana_queryignoresselectclause —tana_querynever applied projection, returning all core fields (parentId, nodeType, doneAt) regardless ofselect. Now appliesapplyProjectionToArraylike all other MCP tools.- Field name matching now case-insensitive — Both SQL field resolution (
COLLATE NOCASE) and JS projection (getNestedValue) now match field names case-insensitively, sofields.statuscorrectly resolvesStatus. sync statusfails on Windows junctions —findLatestExport()silently returned null when the export directory was a Windows junction (e.g., to Google Drive). Now resolves the canonical path viarealpathSyncbefore reading, with improved diagnostic logging.
Supertag CLI v2.5.2
Fixed
selectwithfields.*prefix returns null —tana_queryandtana_taggedwithselect: ["fields.Status", ...]returned empty/null field values because thefields.prefix was passed directly to the database query instead of being stripped. Field values now resolve correctly with both"fields.Status"and bare"Status"formats.tana_taggedmissing field values —tana_taggedtool never loaded field values from the database, so anyselectreferencingfields.*paths found nothing to project. Field values are now resolved viaFieldResolverbefore projection.sync statusalways showslatestExport: null—getStatus()returned a cached null value without ever searching the export directory. Now eagerly callsfindLatestExport()so the actual latest export file is reported.- Silent
sync indexfailure diagnostics — When no matching export files are found, the error now reports which directory was searched and lists any JSON files present that didn't match the expected*@YYYY-MM-DD.jsonpattern.
Supertag CLI v2.5.0
Added
- MCP idle auto-exit — Server self-terminates after 30 minutes without tool calls, preventing zombie process accumulation across Claude Code sessions. Configurable via
SUPERTAG_MCP_IDLE_TIMEOUTenv var (set0to disable). - SQLite connection health check —
DeltaSyncServicetests its database connection before each sync and auto-reconnects if stale, resolving "database or disk is full" errors caused by long-lived processes. - busy_timeout on all DeltaSyncService connections —
PRAGMA busy_timeout = 5000configured on both initial and reconnected connections for better concurrent access resilience.
Fixed
- Idle timer NaN guard — Invalid
SUPERTAG_MCP_IDLE_TIMEOUTvalues (e.g., non-numeric strings) now fall back to the 30-minute default instead of causing immediate server exit. - Idle timer sync race — Timer now checks if a sync is in progress before exiting, deferring shutdown until the sync completes.
Supertag CLI v2.4.2
Performance
- 47% faster JSON parse + graph build — Replaced per-node Zod validation with fast structural check, merged 5 iteration passes into single-pass with deferred resolution. 5.3s → 2.8s on 360MB / 1.68M node export.
- 97% faster sync index — Skip all work when 0 changes detected, only upsert checksums for changed nodes, skip full metadata rebuild for small change sets (<5%). 232s → 6s on real database.
Fixed
Supertag CLI v2.4.1
Fixed
- WAL checkpoint on close — SQLite WAL files could grow unbounded (44GB+) because write connections never checkpointed. Added passive WAL checkpoint before every write-connection close in
withDatabase,withTransaction,TanaIndexer, andDeltaSyncService.
Supertag CLI v2.4.0
Added
-
Watch Mode (F-103) — Continuous monitoring of Tana changes with hook-based automation
supertag sync watchpolls Tana Local API for changes at configurable intervals (default: 30s)- Shell hooks:
--on-change,--on-create,--on-modify,--on-deleteexecute commands on lifecycle events --filter-tag <tag>to watch only specific supertags--event-log <path>for JSONL event audit trail--dry-runto detect changes without executing hooks- Exponential backoff on failures, configurable
--max-failureslimit - Pre/post snapshot diffing around delta-sync for reliable change detection
-
PAI Memory Integration (F-108) — Tana graph as persistent AI memory store for cross-session learning
-
Graph Query DSL (F-102) - Declarative graph query language for traversing typed relationships
supertag gqueryCLI command with DSL syntax:FIND <type> WHERE <filter> CONNECTED TO <type> RETURN <fields>FINDclause selects nodes by supertag typeWHEREclause filters on name or field values with operators:=,!=,>,<,~(contains),LIKECONNECTED TOclause traverses graph relationships to related nodesVIA <field>modifier for traversal through specific typed edgesRETURNclause projects specific fields including dot-notation (person.name)- Multi-hop traversal: chain
CONNECTED TOclauses for complex graph queries --explainflag shows execution plan without running the query--format json|csv|tableoutput formats,--limitfor result cappingtana_graph_queryMCP tool with same capabilities for AI agents- Available in all modes (full, slim, lite)
- 4-stage pipeline: Tokenizer → Parser → Planner (validates tags/fields) → Executor
- Contextual error messages with fuzzy-matched suggestions for typos
-
Embedding Maintenance & Diagnostics (F-106) - Tools for managing embedding health at scale
embed maintain compact— merge fragmented LanceDB storage for faster queriesembed maintain stale— detect and remove orphaned embeddings for deleted nodesembed maintain rebuild— full reindex from scratchembed stats— detailed embedding statistics (count, staleness, fragmentation, model info)embed stats --format jsonfor machine-readable diagnostics- Integrated into
embed maintainumbrella command for one-step maintenance
-
Graph-Aware Embeddings (F-104) - Enrich embeddings with supertag type and field context
embed generate --graph-aware(default: enabled) prepends[Type: #tag] [Field: value]to node text before embeddingembed generate --no-graph-awareto use legacy ancestor-based contextualizationembed generate --enrichment-preview <nodeId>to preview enriched text for a single nodesearch --semantic --type-hint <tag>enriches queries with type prefix for better typed resultstana_semantic_searchMCP tool gainstypeHintparameter- Token-aware truncation keeps enriched text within BGE-M3's 512 token limit
- Per-supertag customization via
~/.config/supertag/embed-enrichment.json - Backward compatible: existing embeddings work, re-generate to benefit from enrichment
-
Schema Analysis (F-101) - Detect schema quality issues across supertag definitions
supertag schema auditCLI command with --severity, --detector, --tag, --format- 7 built-in detectors: orphan-tags, low-usage, duplicate-fields, type-mismatch, unused-fields, fill-rate, missing-inheritance
- Severity levels: critical, warning, info — filter with
--severity warning tana_schema_auditMCP tool for AI-driven schema analysis