~bigbes/agents-dev · parade

main · last commit 13 days ago · 7g0stsfu

← Back to the parade

ah-nyl.2 store: SQLite implementation of ports.Store Past Stand

status: closed P1 task
bd reopen ah-nyl.2
Created byEugene Blikh
Ownerbigbes@gmail.com
Created2026-07-12T23:34:33Z
Started2026-07-12T23:55:04Z
Updated2026-07-13T00:10:13Z
Closed2026-07-13T00:10:13Z
Description
Implement internal/store per docs/SPEC.md SS7 (read SPEC fully; SS5-7 normative). ports.Store on modernc.org/sqlite.

Deliverables:
- internal/store/store.go: New(path string) (*Store, error) — opens DB, applies PRAGMAs (WAL, busy_timeout=5000, foreign_keys=on), runs migrations; Close().
- Migrations: embedded schema.sql (embed package), applied under a PRAGMA user_version gate (hand-rolled, target version 1). DDL exactly per SPEC SS7.
- All ports.Store methods with the documented semantics: GetTask/LatestRun return (nil, nil) when absent; CreateRun surfaces UNIQUE(task_id, attempt) violation as a distinguishable error (exported sentinel ErrDuplicateRun); UpsertTask insert-or-update by id; timestamps RFC3339 UTC; contexts honored (database/sql *Context variants everywhere).
- Compile-time check: var _ ports.Store = (*Store)(nil).

Tests (stdlib testing only, t.TempDir() databases): round-trip every method; absent-row nil,nil; duplicate run -> ErrDuplicateRun; upsert updates fields + updated_at; ListTasks ordering deterministic (by id); events append + monotonically increasing seq; migration idempotence (New twice on same file).

Constraints: work ONLY under internal/store/. Do not modify go.mod/go.sum (deps are already there), other packages, or .beads/. Build/test ONLY your package: go build ./internal/store/... && go vet ./internal/store/... && go test ./internal/store/... . Commit with 'store: ...' staging only internal/store. Do NOT push.

Depends on

  • ah-nyl — Stage 1 MVP: poll-driven happy path parent-child closed
  • ah-nyl.1 — foundation: go module, domain, ports, config blocks closed

Depended on by

  • ah-nyl.6 — wiring: httpapi + agenthubd + ahub CLIs blocks

Unblocks — everything waiting on this, transitively

  • ah-nyl.6 — wiring: httpapi + agenthubd + ahub CLIs blocks closed
  • ah-nyl.7 — e2e: harness with fake vikunja + stub pi blocks closed
  • ah-nyl.8 — refactor: adopt go.bigb.es/auxilia (scribe/culpa/steward) where it pays blocks closed

No comments.

Close reason

landed e3749f1, green
  • Eugene Blikh added under epic ah-nyl · 2026-07-13T02:34:33Z
  • Eugene Blikh added dependency on ah-nyl.1 · 2026-07-13T02:34:33Z
  • Eugene Blikh created the issue · 2026-07-13T02:34:33Z
  • Eugene Blikh ah-nyl.6 now depends on this · 2026-07-13T02:35:54Z
  • Eugene Blikh changed status to in_progress · 2026-07-13T02:55:03Z
  • Eugene Blikh closed the issue · 2026-07-13T03:10:13Z
    landed e3749f1, green
  • Eugene Blikh added label milestone:stage-1 · 2026-07-20T03:08:46Z
  • Eugene Blikh removed label milestone:stage-1 · 2026-07-20T03:10:21Z
Stored rows — what this pane was built from, as read
issues 1 row
id ah-nyl.2
content_hash 160899e1969f48c186279e62ca24ed7aa7f362fd1b56dc90ed2247c4cf660322
title store: SQLite implementation of ports.Store
description Implement internal/store per docs/SPEC.md SS7 (read SPEC fully; SS5-7 normative). ports.Store on modernc.org/sqlite. Deliverables: - internal/store/store.go: New(path string) (*Store, error) — opens DB, applies PRAGMAs (WAL, busy_timeout=5000, foreign_keys=on), runs migrations; Close(). - Migrations: embedded schema.sql (embed package), applied under a PRAGMA user_version gate (hand-rolled, target version 1). DDL exactly per SPEC SS7. - All ports.Store methods with the documented semantics: GetTask/LatestRun return (nil, nil) when absent; CreateRun surfaces UNIQUE(task_id, attempt) violation as a distinguishable error (exported sentinel ErrDuplicateRun); UpsertTask insert-or-update by id; timestamps RFC3339 UTC; contexts honored (database/sql *Context variants everywhere). - Compile-time check: var _ ports.Store = (*Store)(nil). Tests (stdlib testing only, t.TempDir() databases): round-trip every method; absent-row nil,nil; duplicate run -> ErrDuplicateRun; upsert updates fields + updated_at; ListTasks ordering deterministic (by id); events append + monotonically increasing seq; migration idempotence (New twice on same file). Constraints: work ONLY under internal/store/. Do not modify go.mod/go.sum (deps are already there), other packages, or .beads/. Build/test ONLY your package: go build ./internal/store/... && go vet ./internal/store/... && go test ./internal/store/... . Commit with 'store: ...' staging only internal/store. Do NOT push.
design
acceptance_criteria
notes
status closed
priority 1
issue_type task
assignee NULL
estimated_minutes NULL
created_at 2026-07-12T23:34:33Z
created_by Eugene Blikh
owner bigbes@gmail.com
updated_at 2026-07-13T00:10:13Z
closed_at 2026-07-13T00:10:13Z
closed_by_session
external_ref NULL
spec_id
compaction_level 0
compacted_at NULL
compacted_at_commit NULL
original_size NULL
sender
ephemeral 0
wisp_type
pinned 0
is_template 0
mol_type
work_type
source_system
metadata �{}
source_repo
close_reason landed e3749f1, green
event_kind
actor
target
payload
await_type
await_id
timeout_ns 0
waiters
hook_bead
role_bead
agent_state
last_activity NULL
role_type
rig
due_at NULL
defer_until NULL
no_history 0
started_at 2026-07-12T23:55:04Z
is_blocked 0
dependencies 3 rows
id 59871114-15bb-5366-b566-391271557370
issue_id ah-nyl.2
type parent-child
created_at 2026-07-13T02:34:33Z
created_by Eugene Blikh
metadata �{}
thread_id
depends_on_issue_id ah-nyl
depends_on_wisp_id NULL
depends_on_external NULL
id 88746210-a4d8-50b8-a409-5b64c0bd8f45
issue_id ah-nyl.6
type blocks
created_at 2026-07-13T02:35:54Z
created_by Eugene Blikh
metadata �{}
thread_id
depends_on_issue_id ah-nyl.2
depends_on_wisp_id NULL
depends_on_external NULL
id a7480fd4-e1a1-5f90-8fba-f35f368fa473
issue_id ah-nyl.2
type blocks
created_at 2026-07-13T02:34:33Z
created_by Eugene Blikh
metadata �{}
thread_id
depends_on_issue_id ah-nyl.1
depends_on_wisp_id NULL
depends_on_external NULL
events 5 rows
id 019f58ae-b83d-752c-8b26-9aba0aaeb237
issue_id ah-nyl.2
event_type created
actor Eugene Blikh
old_value
new_value
comment NULL
created_at 2026-07-13T02:34:33Z
id 019f58c1-7e91-7947-accb-8220e4be6b23
issue_id ah-nyl.2
event_type status_changed
actor Eugene Blikh
old_value {"id":"ah-nyl.2","title":"store: SQLite implementation of ports.Store","description":"Implement internal/store per docs/SPEC.md SS7 (read SPEC fully; SS5-7 normative). ports.Store on modernc.org/sqlite.\n\nDeliverables:\n- internal/store/store.go: New(path string) (*Store, error) — opens DB, applies PRAGMAs (WAL, busy_timeout=5000, foreign_keys=on), runs migrations; Close().\n- Migrations: embedded schema.sql (embed package), applied under a PRAGMA user_version gate (hand-rolled, target version 1). DDL exactly per SPEC SS7.\n- All ports.Store methods with the documented semantics: GetTask/LatestRun return (nil, nil) when absent; CreateRun surfaces UNIQUE(task_id, attempt) violation as a distinguishable error (exported sentinel ErrDuplicateRun); UpsertTask insert-or-update by id; timestamps RFC3339 UTC; contexts honored (database/sql *Context variants everywhere).\n- Compile-time check: var _ ports.Store = (*Store)(nil).\n\nTests (stdlib testing only, t.TempDir() databases): round-trip every method; absent-row nil,nil; duplicate run -\u003e ErrDuplicateRun; upsert updates fields + updated_at; ListTasks ordering deterministic (by id); events append + monotonically increasing seq; migration idempotence (New twice on same file).\n\nConstraints: work ONLY under internal/store/. Do not modify go.mod/go.sum (deps are already there), other packages, or .beads/. Build/test ONLY your package: go build ./internal/store/... \u0026\u0026 go vet ./internal/store/... \u0026\u0026 go test ./internal/store/... . Commit with 'store: ...' staging only internal/store. Do NOT push.\n","status":"open","priority":1,"issue_type":"task","owner":"bigbes@gmail.com","created_at":"2026-07-12T23:34:33Z","created_by":"Eugene Blikh","updated_at":"2026-07-12T23:34:33Z"}
new_value {"status":"in_progress"}
comment NULL
created_at 2026-07-13T02:55:03Z
id 019f58cf-605f-708c-829a-468110db6471
issue_id ah-nyl.2
event_type closed
actor Eugene Blikh
old_value
new_value landed e3749f1, green
comment NULL
created_at 2026-07-13T03:10:13Z
id 019f7cda-9089-71cc-aba2-c732b6a8d836
issue_id ah-nyl.2
event_type label_added
actor Eugene Blikh
old_value NULL
new_value NULL
comment Added label: milestone:stage-1
created_at 2026-07-20T03:08:46Z
id 019f7cdc-02af-7537-a9a4-079a9fd2d62f
issue_id ah-nyl.2
event_type label_removed
actor Eugene Blikh
old_value NULL
new_value NULL
comment Removed label: milestone:stage-1
created_at 2026-07-20T03:10:21Z