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
Phase 2's soft-claim adjudication (sibling issues) needs a place to persist "I'm working on issue #N in repo X" locally, 100% client-side (per the fixed architecture: all miner run-state/claim ledger is local SQLite, never required to phone home). This issue is pure foundation: schema + CRUD only, no adjudication logic and no network calls, so it's zero autonomous-write risk and independent of everything else in this phase.
Mirror the self-host infra patterns already in src/selfhost/ (e.g. migrate.ts's migration-runner shape) for the migration-file convention, but this is a NEW local SQLite file scoped to packages/gittensory-miner/, not the shared D1 migrations/ directory (that directory is for the hosted Worker's D1 schema — keep the miner's local store fully separate).
Deliverables
packages/gittensory-miner/src/claim-ledger/schema.sql (or equivalent inline schema) defining a claims table: id, repo_full_name, issue_number, claimed_at, status (active|released|expired), note
packages/gittensory-miner/src/claim-ledger/store.ts — openClaimLedger(dbPath), recordClaim(...), releaseClaim(...), listClaims(filter) — using node:sqlite or better-sqlite3 (pick whichever this package's dependency policy prefers; document the choice)
Every write path is idempotent (claiming an already-actively-claimed issue is a no-op, not a duplicate row)
Unit tests covering create/list/release/re-claim-after-release, using a temp SQLite file per test
No network calls anywhere in this module
References
src/selfhost/migrate.ts (self-host local migration-runner pattern to mirror for schema versioning)
migrations/0010_agent_orchestrator.sql (the shape of an existing agent_runs-style ledger table, for column-naming convention inspiration only — this is a SEPARATE local store, not a D1 migration)
Fixed architecture note in the phase brief: "All local miner state ... is 100% client-side (SQLite or similar) — never required to phone home for core operation"
Phase 2's soft-claim adjudication (sibling issues) needs a place to persist "I'm working on issue #N in repo X" locally, 100% client-side (per the fixed architecture: all miner run-state/claim ledger is local SQLite, never required to phone home). This issue is pure foundation: schema + CRUD only, no adjudication logic and no network calls, so it's zero autonomous-write risk and independent of everything else in this phase.
Mirror the self-host infra patterns already in
src/selfhost/(e.g.migrate.ts's migration-runner shape) for the migration-file convention, but this is a NEW local SQLite file scoped topackages/gittensory-miner/, not the shared D1migrations/directory (that directory is for the hosted Worker's D1 schema — keep the miner's local store fully separate).Deliverables
packages/gittensory-miner/src/claim-ledger/schema.sql(or equivalent inline schema) defining aclaimstable:id,repo_full_name,issue_number,claimed_at,status(active|released|expired),notepackages/gittensory-miner/src/claim-ledger/store.ts—openClaimLedger(dbPath),recordClaim(...),releaseClaim(...),listClaims(filter)— usingnode:sqliteorbetter-sqlite3(pick whichever this package's dependency policy prefers; document the choice)References
src/selfhost/migrate.ts(self-host local migration-runner pattern to mirror for schema versioning)migrations/0010_agent_orchestrator.sql(the shape of an existingagent_runs-style ledger table, for column-naming convention inspiration only — this is a SEPARATE local store, not a D1 migration)