Skip to content

Epic A: Architecture re-shape — ports/adapters compiler pipeline + single contract kernel #42

Description

@espetro

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

  • A0: ARCHITECTURE.md — mermaid diagrams + package responsibility table
  • A1: @agentplugins/contract — zod schema → single source of truth; delete spec/v1/manifest.schema.json + packages/schema/src/types.ts
  • A2: @agentplugins/compile — shared codegen kernel; emitCommandHandler(), sanitizeName(), sanitizeJoin() — structurally kills injection bugs
  • A3: Normalize all 7 adapters over the kernel (pimono 1105L split; remove dup buildHandlerInvocation)
  • A4: @agentplugins/store + core facade; verify sibling repos still resolve
  • A5: Fix 2 failing opencode tests (stale Bun.$ assertions)

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions