Implementation Plan: Runtime Kernel

Define and generate the kernel execution surface (ports + application orchestration) that executes “business behavior” through deterministic flows, unit-of-work boundaries, and event publication—without coupling to any particular shell (API/CLI/worker).

This plan emphasizes the port-driven kernel: shells translate inputs into commands/queries; the kernel routes and executes.

Provenance & Traceability

Architectural Decisions (ADRs)

ADR ID Decision Title Impact on This Plan
ADR-033 Kernel-Shell Architecture Kernel must be runnable/testable independent of shells.
ADR-003 Foundational Isomorphism Runtime behavior is generated from semantic flows.

Product Requirements (PRDs)

PRD ID Requirement Title Satisfied By (SDS) Acceptance Criteria
PRD-023 SEA™ Platform Integration SDS-013, SDS-048 REQ-060 (kernel independence)

Software Design Specifications (SDS)

SDS ID Service/Component Bounded Context SEA-DSL Spec File Implementation Status
SDS-013 Semantic Execution System Architecture shared N/A Designed
SDS-048 Platform UI Integration sea-api N/A Draft

Provenance Chain

graph TD
  ADR33[ADR-033: Kernel-Shell] --> PRD23[PRD-023: Platform Integration]
  PRD23 --> SDS13[SDS-013: Execution Architecture]
  PRD23 --> SDS48[SDS-048: UI Integration]

Architecture and Design

Design Principles Applied

Dependency Justification

Expected Filetree

1
2
3
4
5
6
7
/
├── libs/sea/
│   ├── domain/src/gen/**            # generated domain primitives
│   ├── ports/src/gen/**             # generated port interfaces
│   ├── application/src/gen/**       # generated use-case handlers
│   └── adapters/src/gen/**          # generated adapter wiring (shell-facing)
└── docs/specs/**                    # semantic source-of-truth

Proposed Cycles

Cycle Branch Wave Files Modified Files Created Specs Implemented
C1A cycle/p004-c1a-kernel-ports 1 docs/specs/** (kernel flows/policies) libs/sea/**/src/gen/** ADR-033 + PRD-023 REQ-060
C1B cycle/p004-c1b-uow-and-events 1 tools/schemas/* (if needed) libs/sea/**/src/gen/** Transaction + outbox semantics
C2A cycle/p004-c2a-shell-agnostic-tests 2 docs/specs/shared/tests/* or tests/* Kernel independence validation

Task Breakdown

Wave 1 (Parallel)

Wave 2 (Depends on Wave 1)


Validation & Verification

Spec Validation

Implementation Validation


Open Questions

  1. What is the canonical representation of UoW boundaries in the semantic model: Flow annotation only (@tx) or a first-class concept? @tx annotation on Flow
  2. Do we require CQRS at the kernel boundary for MVP, or allow a unified “request” abstraction? Required for MVP
  3. Where should kernel tests live (existing tests/ vs docs/specs/**/tests/) to keep drift checks clean? Collocated *.spec.ts

Risks & Mitigation

Risk Likelihood Impact Mitigation Strategy
Kernel semantics leak into shells Medium High Enforce boundaries (P000) + generate thin adapters only.
Hard-to-test generated kernel Medium Medium Generate stable test seams (ports) and test via fakes.

Rollback Strategy

  1. If kernel generation becomes too coupled, revert to generating ports only and keep orchestration in specs until mapping stabilizes.

Reference Documents

Linked Specifications

Type ID Document
SDS SDS-013 docs/specs/shared/sds/013-semantic-execution-architecture.md
SDS SDS-048 docs/specs/shared/sds/048-platform-ui-integration.md