You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the first piece of 100%-client-side persistence: a small SQLite-backed run-state store (packages/gittensory-miner/lib/run-state.js or a TS module built alongside) tracking the miner's current state machine position (e.g. idle / discovering / planning / preparing — a small fixed enum, NOT the full discover→create→manage loop's business logic, just the persistence shape) per target repo. No network calls, no shared credentials — this is local infra only, mirroring how src/selfhost/ already hosts self-host-specific local infra modules (audit.ts, health.ts, migrate.ts) alongside the Worker-hosted code.
Deliverables
A run-state module exposing initRunStateStore(dbPath), getRunState(repoFullName), setRunState(repoFullName, state) with a small fixed RunState union type.
A local SQLite schema (single small table: repo_full_name TEXT PRIMARY KEY, state TEXT NOT NULL, updated_at TEXT NOT NULL) created idempotently on first use (CREATE TABLE IF NOT EXISTS).
Default DB path follows an XDG-style convention (~/.config/gittensory-miner/run-state.sqlite3 or $XDG_CONFIG_HOME-aware), mirroring gittensory-mcp's own configPath/cacheDir resolution pattern (env override, then XDG_CONFIG_HOME, then ~/.config).
Unit tests covering: first-run table creation, read-before-any-write (returns a sensible default/null), write-then-read round-trip, and re-opening an existing DB file without re-creating/truncating it.
Explicit doc comment stating this store is 100% local/client-side and never uploads its contents anywhere, matching the phase's no-phone-home requirement.
References
packages/gittensory-mcp/bin/gittensory-mcp.js (lines 135-141) — the configPath/cacheDir env-then-XDG-then-default resolution pattern to mirror for the run-state DB path.
src/selfhost/migrate.ts — self-host local migration/schema-application pattern to mirror for idempotent local schema setup (note: this new module is SQLite-based client tooling, distinct from the D1/Postgres migration system migrate.ts drives, but the idempotent-apply spirit is the same).
New path: packages/gittensory-miner/lib/run-state.js (or .ts, per whichever this package's build issue settled on).
Add the first piece of 100%-client-side persistence: a small SQLite-backed run-state store (
packages/gittensory-miner/lib/run-state.jsor a TS module built alongside) tracking the miner's current state machine position (e.g.idle/discovering/planning/preparing— a small fixed enum, NOT the full discover→create→manage loop's business logic, just the persistence shape) per target repo. No network calls, no shared credentials — this is local infra only, mirroring howsrc/selfhost/already hosts self-host-specific local infra modules (audit.ts,health.ts,migrate.ts) alongside the Worker-hosted code.Deliverables
run-statemodule exposinginitRunStateStore(dbPath),getRunState(repoFullName),setRunState(repoFullName, state)with a small fixedRunStateunion type.repo_full_name TEXT PRIMARY KEY, state TEXT NOT NULL, updated_at TEXT NOT NULL) created idempotently on first use (CREATE TABLE IF NOT EXISTS).~/.config/gittensory-miner/run-state.sqlite3or$XDG_CONFIG_HOME-aware), mirroringgittensory-mcp's ownconfigPath/cacheDirresolution pattern (env override, thenXDG_CONFIG_HOME, then~/.config).null), write-then-read round-trip, and re-opening an existing DB file without re-creating/truncating it.References
packages/gittensory-mcp/bin/gittensory-mcp.js(lines 135-141) — theconfigPath/cacheDirenv-then-XDG-then-default resolution pattern to mirror for the run-state DB path.src/selfhost/migrate.ts— self-host local migration/schema-application pattern to mirror for idempotent local schema setup (note: this new module is SQLite-based client tooling, distinct from the D1/Postgres migration systemmigrate.tsdrives, but the idempotent-apply spirit is the same).packages/gittensory-miner/lib/run-state.js(or.ts, per whichever this package's build issue settled on).