main · last commit
13 days ago ·
7g0stsfu
ah-nyl.2 store: SQLite implementation of ports.Store
Past Stand
bd reopen ah-nyl.2
| Created by | Eugene Blikh |
| Owner | bigbes@gmail.com |
| Created | 2026-07-12T23:34:33Z |
| Started | 2026-07-12T23:55:04Z |
| Updated | 2026-07-13T00:10:13Z |
| Closed | 2026-07-13T00:10:13Z |
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.
ah-nyl.6
— wiring: httpapi + agenthubd + ahub CLIs
blocks
| 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 |
| 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 |
| 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 |
No comments.
Close reason