agent-orchestrator/backend/internal/storage/sqlite
prateek 28e1205d28 refactor(backend): collapse duplicate PR row types into one domain definition
Each PR-child table (pr / pr_checks / pr_comment) had three near-identical
structs — gen.* (generated), sqlite.*Row, and ports.* — with wiring.Adapter
copying field-by-field between them. Collapse to one shared definition per
table in domain (PRRow / PRCheckRow / PRComment), used by both the PRWriter
port and the sqlite store; gen.* stays sealed inside the storage layer.

- *sqlite.Store now satisfies ports.SessionStore + ports.PRWriter directly,
  so the entire wiring.Adapter package is deleted (lifecycle.New(store, store)).
- The bool PR state <-> single state column, int<->int64, and enum-default
  translation now lives only at the gen<->domain boundary in pr_store.go.
- WritePRObservation renamed WritePR to match the port; the integration test
  and composition root drop their adapter copies.

Net -280 lines, behaviour unchanged. go test -race ./... green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 03:40:33 +05:30
..
gen feat: add durable notification foundation 2026-06-01 00:07:55 +05:30
migrations feat: add durable notification foundation 2026-06-01 00:07:55 +05:30
queries feat: add durable notification foundation 2026-06-01 00:07:55 +05:30
changelog_store.go feat(storage,cdc): minimal 6-table schema + trigger-driven CDC (storage layer) 2026-05-31 05:42:59 +05:30
db.go feat: add durable notification foundation 2026-06-01 00:07:55 +05:30
mapping.go feat(storage,cdc): minimal 6-table schema + trigger-driven CDC (storage layer) 2026-05-31 05:42:59 +05:30
notification_store.go feat: add durable notification foundation 2026-06-01 00:07:55 +05:30
notification_store_test.go feat: add durable notification foundation 2026-06-01 00:07:55 +05:30
pr_cdc_test.go refactor(backend): collapse duplicate PR row types into one domain definition 2026-06-01 03:40:33 +05:30
pr_facts.go refactor(backend): collapse duplicate PR row types into one domain definition 2026-06-01 03:40:33 +05:30
pr_store.go refactor(backend): collapse duplicate PR row types into one domain definition 2026-06-01 03:40:33 +05:30
project_store.go feat(storage,cdc): minimal 6-table schema + trigger-driven CDC (storage layer) 2026-05-31 05:42:59 +05:30
store.go feat(storage,cdc): minimal 6-table schema + trigger-driven CDC (storage layer) 2026-05-31 05:42:59 +05:30
store_test.go refactor(backend): collapse duplicate PR row types into one domain definition 2026-06-01 03:40:33 +05:30