/** * Architecture & Runtime Target * * Architecture defines the SYSTEM SHAPE — communication patterns, data ownership, * component grain, evaluation surfaces. Language/runtime agnostic. * * Runtime Target defines the COMPILATION TARGET — language, frameworks, templates, * packages. Implements an architecture in a specific stack. * * Hierarchy: * Spec (what users want) * → Architecture (what kind of system) * → Runtime Target (what language/framework) * → Generated Code */ // ─── Architecture (system shape, language-agnostic) ───────────────────────── export interface Architecture { /** Unique name, e.g., 'web-api' */ name: string; /** Human description */ description: string; /** How components communicate: 'rest', 'graphql', 'grpc', 'events', 'cli' */ communicationPattern: string; /** How data is owned: 'per-component', 'shared-db', 'event-sourced' */ dataOwnership: string; /** How to verify components: 'http-endpoints', 'unit-tests', 'cli-output' */ evaluationSurface: string; /** Architecture-level prompt: describes system shape for the LLM (no language specifics) */ systemPrompt: string; /** Available runtime targets for this architecture */ runtimeTargets: string[]; } // ─── Runtime Target (language/framework specific) ─────────────────────────── export interface RuntimeTarget { /** Unique name, e.g., 'node-typescript' */ name: string; /** Human description */ description: string; /** Language: 'typescript', 'python', 'go', etc. */ language: string; /** Production dependencies: package name → version range */ packages: Record; /** Dev dependencies */ devPackages: Record; /** Module template — the LLM fills in marked sections, structure is guaranteed */ moduleTemplate: string; /** LLM prompt extension — language/framework-specific rules */ promptExtension: string; /** Few-shot code examples showing the exact patterns */ codeExamples: string; /** Shared boilerplate files: relative path → file content */ sharedFiles: Record; /** Extra package.json / pyproject.toml fields */ packageExtras: Record; } // ─── Resolved target (what the pipeline actually uses) ────────────────────── export interface ResolvedTarget { architecture: Architecture; runtime: RuntimeTarget; }