Skip to content

Add compile-time interface contract assertions#77

Open
marcus wants to merge 1 commit intomainfrom
api-contract-verify
Open

Add compile-time interface contract assertions#77
marcus wants to merge 1 commit intomainfrom
api-contract-verify

Conversation

@marcus
Copy link
Copy Markdown
Owner

@marcus marcus commented Mar 27, 2026

Summary

  • Add var _ Interface = (*Type)(nil) compile-time assertions across 13 files covering all 13 interfaces and 17 implementations
  • Same-package assertions in source files: Agent (3 impls), Provider (3 impls), Reader (4 impls), CommandRunner (2 impls in agents + tmux)
  • Cross-package assertions in providers/contracts_test.go: Claude/Codex/Copilot implementing budget.* and snapshots.* interfaces (7 assertions)
  • Remove redundant runtime test TestCodexAgent_ImplementsAgentInterface now covered by compile-time check

Test plan

  • go build ./... passes — all assertions compile
  • go test ./internal/providers/ ./internal/agents/ ./internal/integrations/ ./internal/tmux/ — all tests pass
  • Pre-commit hooks (gofmt, vet, build) pass

Nightshift-Task: api-contract-verify

🤖 Generated with Claude Code


Automated by nightshift

Add var _ Interface = (*Type)(nil) assertions to catch interface
drift at compile time rather than runtime. Covers all 13 interfaces:
Agent (3 impls), Provider (3 impls), Reader (4 impls), CommandRunner
(2 impls across agents and tmux packages), and cross-package budget/
snapshots contracts in providers/contracts_test.go.

Nightshift-Task: api-contract-verify
Nightshift-Ref: https://github.com/marcus/nightshift
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant