Category: Code Smell / Architectural Issue
Problem
StubRuntime (583 lines) and StubMcpRuntime live in packages/powerline/src/runtimes/, registered alongside production runtimes in main():
registerRuntime(new StubRuntime()); // Test double
registerRuntime(new StubMcpRuntime()); // Test double
registerRuntime(new GenAIScriptRuntime()); // Real runtime
registerRuntime(new ClaudeCodeRuntime()); // Real runtime
Consequences:
- A client requesting
provider: "stub" gets a test harness, not an error
- Stub MCP integration logic is tangled with scenario-execution logic
- 583 lines of test doubles ship in the production bundle
- Test runtimes are indistinguishable from production runtimes to PowerLine's handlers
Proposed Fix
- Move to
packages/powerline/test-fixtures/ or a separate @grackle-ai/runtime-stub package
- Make registration conditional:
if (process.env.GRACKLE_ENABLE_TEST_RUNTIMES) {
registerRuntime(new StubRuntime());
}
- Document that
stub is for testing only
Impact
Low — works fine today, but test code in prod is a maintenance and security smell.
Category: Code Smell / Architectural Issue
Problem
StubRuntime(583 lines) andStubMcpRuntimelive inpackages/powerline/src/runtimes/, registered alongside production runtimes inmain():Consequences:
provider: "stub"gets a test harness, not an errorProposed Fix
packages/powerline/test-fixtures/or a separate@grackle-ai/runtime-stubpackagestubis for testing onlyImpact
Low — works fine today, but test code in prod is a maintenance and security smell.