Skip to content

Commit 0baa4f0

Browse files
AgentWrapperclaude
andcommitted
refactor(storage): add compile-time port guards on *Store
Re-add the blank-identifier interface assertions lost when wiring.Adapter was collapsed: *Store now directly satisfies ports.SessionStore and ports.PRWriter, so prove it at the point of definition. Drift between either port and the implementation now fails here instead of at the call sites in lifecycle_wiring or tests. Addresses greptile review comment on #60. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 28804fe commit 0baa4f0

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

backend/internal/storage/sqlite/pr_store.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"fmt"
88

99
"github.com/aoagents/agent-orchestrator/backend/internal/domain"
10+
"github.com/aoagents/agent-orchestrator/backend/internal/ports"
1011
"github.com/aoagents/agent-orchestrator/backend/internal/storage/sqlite/gen"
1112
)
1213

@@ -17,6 +18,14 @@ import (
1718
// "nothing known yet" value (matching the CHECK constraints), and ints widen to
1819
// int64.
1920

21+
// Compile-time proof that *Store satisfies both ports it is wired into, so a
22+
// drift between either interface and this implementation fails here at the point
23+
// of definition rather than later at the call sites in lifecycle_wiring / tests.
24+
var (
25+
_ ports.SessionStore = (*Store)(nil)
26+
_ ports.PRWriter = (*Store)(nil)
27+
)
28+
2029
// UpsertPR inserts or replaces the scalar PR facts for a PR URL.
2130
func (s *Store) UpsertPR(ctx context.Context, r domain.PRRow) error {
2231
s.writeMu.Lock()

0 commit comments

Comments
 (0)