Summary
Collapse 4 drifting contract copies → 1 zod schema; extract shared compile kernel; normalize all 7 adapters over it; move store to its own package; core becomes a re-export facade.
Plan: .agents/plans/2026-06-26-epic-a-architecture-epic-b-harden.md
Sub-tasks
Why
Single touch-point for fixes. The same RCE class is copied across 3 adapter files today. A shared kernel + single contract makes drift structurally impossible and resolves security issues #1/#14 as a side effect of routing all adapters through emitCommandHandler().
Security boundary
Codegen-class security (template-literal injection + shell:true in command handlers; nativeCopies path traversal) is resolved inside A2 as a structural consequence of routing through shared secure emit helpers.
Summary
Collapse 4 drifting contract copies → 1 zod schema; extract shared
compilekernel; normalize all 7 adapters over it; move store to its own package;corebecomes a re-export facade.Plan:
.agents/plans/2026-06-26-epic-a-architecture-epic-b-harden.mdSub-tasks
ARCHITECTURE.md— mermaid diagrams + package responsibility table@agentplugins/contract— zod schema → single source of truth; deletespec/v1/manifest.schema.json+packages/schema/src/types.ts@agentplugins/compile— shared codegen kernel;emitCommandHandler(),sanitizeName(),sanitizeJoin()— structurally kills injection bugsbuildHandlerInvocation)@agentplugins/store+corefacade; verify sibling repos still resolveWhy
Single touch-point for fixes. The same RCE class is copied across 3 adapter files today. A shared kernel + single contract makes drift structurally impossible and resolves security issues #1/#14 as a side effect of routing all adapters through
emitCommandHandler().Security boundary
Codegen-class security (template-literal injection + shell:true in command handlers; nativeCopies path traversal) is resolved inside A2 as a structural consequence of routing through shared secure emit helpers.