[repository-quality] 🎯 Repository Quality Improvement Report - Compile-Time Interface Compliance Gap (2026-07-13) #45268
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
🎯 Repository Quality Improvement Report - Compile-Time Interface Compliance Gap
Analysis Date: 2026-07-13
Focus Area: Compile-Time Interface Compliance Gap — Missing
var _ Interface = (*ConcreteType)(nil)AssertionsStrategy Type: Custom
Custom Area: Yes — the repository has 22 interfaces and 9+ concrete implementors but zero compile-time satisfaction checks anywhere in
pkg/orcmd/.Executive Summary
The
pkg/workflowpackage defines 22 Go interfaces — including the criticalEngine,CodingAgentEngine,FileCreationTracker,ToolConfig,SHAResolver,CommandProvider, andLogAnalysisfamilies — all without a singlevar _ Interface = (*ConcreteType)(nil)compile-time assertion. Nine concrete engine structs (ClaudeEngine,CopilotEngine,CodexEngine,GeminiEngine,AntigravityEngine,OpenCodeEngine,CrushEngine,PiEngine,UniversalLLMConsumerEngine) embedBaseEngineand add their own methods, creating a silent risk: any future addition to an interface silently breaks the contract at link-time or only at the call site rather than at the declaration site.The
CodingAgentEngineinterface is composed of 8 sub-interfaces (Engine,CapabilityProvider,WorkflowExecutor,MCPConfigProvider,LogParser,SecurityProvider,ModelEnvVarProvider,ConfigRenderer). A single missing method addition to any one of these cascades to all 9 engine structs with no early signal to developers.Adding
var _ CodingAgentEngine = (*ClaudeEngine)(nil)style assertions is a zero-cost, widely-adopted Go idiom that turns silent runtime incompatibilities into hard compile errors. This is quick work (one line per concrete type) and is already standard practice in similarly structured codebases.Full Analysis Report
Focus Area: Compile-Time Interface Compliance Gap
Current State Assessment
Metrics Collected:
pkg/var _ Interface = (...)assertionsCodingAgentEngineimplementorsCodingAgentEngineFindings
Strengths
BaseEnginewhich provides default implementations for shared methods, reducing partial-implementation risk.agentic_engine.go.CodingAgentEngineuses interface composition cleanly — changes to any sub-interface are centralised.Areas for Improvement
var _ CodingAgentEngine = (*XxxEngine)(nil)assertions for 9 engine structs — silent contract breakage risk on any interface change.FileCreationTrackerhas 1 production implementor (cli.FileTracker) and 2 test mocks — none has a compile-time check.ToolConfig(implemented byMapToolConfig) andLogAnalysis/MutableLogAnalysis(implemented byFirewallAnalysis,DomainAnalysis) lack assertions.CommandProvider(alias for*cobra.Command) is used in shell completion but the interface is never asserted against*cobra.Command.SHAResolverinpkg/actionpinsis re-exported as a type alias inpkg/workflow; the aliasing file lacks any verification that the underlying type still satisfies the interface.Detailed Analysis
Engine family (
pkg/workflow/agentic_engine.go):Implementors:
ClaudeEngine,CopilotEngine,CodexEngine,GeminiEngine,AntigravityEngine,OpenCodeEngine,CrushEngine,PiEngine,UniversalLLMConsumerEngine— none has avar _ CodingAgentEngine = (*XxxEngine)(nil).FileCreationTracker (
pkg/workflow/compiler_types.go):cli.FileTrackeris the sole production implementor. Assertion missing inpkg/cli/file_tracker.go.ToolConfig (
pkg/workflow/mcp_config_types.go):MapToolConfigis the only concrete implementation; no assertion.LogAnalysis / MutableLogAnalysis (
pkg/cli/log_aggregation.go):FirewallAnalysisandDomainAnalysisimplementMutableLogAnalysis; no assertions in either file.🤖 Tasks for Copilot Agent
NOTE TO PLANNER AGENT: Split the following tasks into individual work items.
Improvement Tasks
Task 1: Add Compile-Time Assertions for All 9 CodingAgentEngine Implementors
Priority: High
Estimated Effort: Small
Focus Area: Compile-Time Interface Compliance Gap
Description: Add one
var _ workflow.CodingAgentEngine = (*XxxEngine)(nil)assertion at the package level in each of the 9 engine source files. This turns any future missing-method error from a silent link-time or call-site failure into an immediate compile error pinpointing the affected type.Acceptance Criteria:
claude_engine.go,copilot_engine.go,codex_engine.go,gemini_engine.go,antigravity_engine.go,opencode_engine.go,crush_engine.go,pi_engine.go,universal_llm_consumer_engine.go) contains exactly onevar _ CodingAgentEngine = (*XxxEngine)(nil)assertion at the top of the file (after the package declaration and imports).make buildpasses without errors.make lintpasses without errors.Code Region:
pkg/workflow/*_engine.goTask 2: Add Compile-Time Assertions for Engine Sub-Interfaces in BaseEngine
Priority: High
Estimated Effort: Small
Focus Area: Compile-Time Interface Compliance Gap
Description:
BaseEngineprovides default implementations for all sub-interfaces that composeCodingAgentEngine(Engine,CapabilityProvider,WorkflowExecutor,MCPConfigProvider,LogParser,SecurityProvider,ModelEnvVarProvider,ConfigRenderer,HarnessProvider,LLMProviderResolver,AgentFileProvider,ConfigRenderer). Add compile-time assertions forBaseEngineagainst each of these sub-interfaces inagentic_engine.go.Acceptance Criteria:
pkg/workflow/agentic_engine.gocontains avar _ XxxInterface = (*BaseEngine)(nil)assertion for every sub-interface thatBaseEngineprovides method implementations for.make buildpasses.make lintpasses.Code Region:
pkg/workflow/agentic_engine.goTask 3: Add Compile-Time Assertions for FileCreationTracker and ToolConfig
Priority: Medium
Estimated Effort: Small
Focus Area: Compile-Time Interface Compliance Gap
Description:
cli.FileTracker(inpkg/cli/file_tracker.go) is the production implementor ofworkflow.FileCreationTracker.MapToolConfig(inpkg/workflow/mcp_config_types.go) is the concrete implementor ofToolConfig. Both lack compile-time assertions.Acceptance Criteria:
pkg/cli/file_tracker.gocontainsvar _ workflow.FileCreationTracker = (*FileTracker)(nil).pkg/workflow/mcp_config_types.gocontainsvar _ ToolConfig = MapToolConfig(nil)(or the appropriate zero value for a map type).make buildpasses.Code Region:
pkg/cli/file_tracker.go,pkg/workflow/mcp_config_types.goTask 4: Add Compile-Time Assertions for LogAnalysis and MutableLogAnalysis
Priority: Medium
Estimated Effort: Small
Focus Area: Compile-Time Interface Compliance Gap
Description:
FirewallAnalysis(inpkg/cli/firewall_log.go) andDomainAnalysis(inpkg/cli/access_log.go) both implementMutableLogAnalysis. Neither has a compile-time assertion. Adding assertions here ensures that theAddMetrics(other LogAnalysis)method signature stays in sync.Acceptance Criteria:
pkg/cli/firewall_log.gocontainsvar _ MutableLogAnalysis = (*FirewallAnalysis)(nil).pkg/cli/access_log.gocontainsvar _ MutableLogAnalysis = (*DomainAnalysis)(nil).make buildpasses.make lintpasses.Code Region:
pkg/cli/firewall_log.go,pkg/cli/access_log.goTask 5: Add a Custom Linter Rule Requiring Interface Compliance Assertions
Priority: Low
Estimated Effort: Medium
Focus Area: Compile-Time Interface Compliance Gap
Description: The pattern of missing
var _ Interface = (*Impl)(nil)will reoccur as new interfaces and implementors are added. Create a new Go analysis linter (pkg/linters/missinginterfaceassert/) that warns when a concrete struct implements an interface (via method set analysis) but no correspondingvar _ Interface = (*Struct)(nil)assertion exists in the same package. This prevents regression of the compliance gap.Acceptance Criteria:
pkg/linters/missinginterfaceassert/withAnalyzer,doc.go, and testdata.pkg/linters/doc.goand the spec test.make lintpasses.make testpasses.Code Region:
pkg/linters/missinginterfaceassert/📊 Historical Context
Previous Focus Areas
🎯 Recommendations
Immediate Actions (This Week)
var _ CodingAgentEngineassertions in all 9 engine files — Priority: HighShort-term Actions (This Month)
FileCreationTracker,ToolConfig,LogAnalysisimplementors — Priority: MediumBaseEnginesub-interface assertions — Priority: HighLong-term Actions (This Quarter)
missinginterfaceassertlinter to prevent regression — Priority: Low📈 Success Metrics
Next Steps
References:
Generated by Repository Quality Improvement Agent
Beta Was this translation helpful? Give feedback.
All reactions