Skip to content

Architecture

The Alistigo architecture is defined in two forms:

  • Prose — human-readable constraints and rationale (this page)
  • CALM models — machine-readable JSON in @alistigo/architecture/systems/ (validated in CI)

These constraints are non-negotiable. Every package decision is evaluated against them.

#ConstraintRationale
1Browser-only — no backend required for core functionalityArtifacts must run inside AI chat iframes without server infrastructure
2Event sourcing + CQRS — mutations are append-only events; views are derived projectionsEnables undo, replay, sync, and AI-readable history
3Plugin system — capabilities are composed via plugins, not hardcodedArtifacts must be extensible without forking the core bundle
4iframe isolation — artifacts run in sandboxed iframes; no host-page DOM accessSecurity boundary between the AI chat interface and the artifact
5JSON-LD document format — canonical serialization uses JSON-LD with schema.org typesPortable, machine-readable, AI-injectable state
6CDN delivery — artifact bundles are served from jsDelivr; no npm install in AI contextsClaude artifacts cannot install packages at runtime
7Architecture as Code — CALM models define boundaries; dependency-cruiser validates in CIPrevents layer violations from accumulating silently
8TypeID entities — all domain entities use TypeID for type-safe, sortable IDsAvoids ID collisions and enables type inference from prefixes

The framework follows a strict Domain-Driven Design layer model:

  • Domain — pure business logic; no framework or infrastructure dependencies
  • Document — serialization and projection; reads the event log, emits documents
  • Application — artifact lifecycle, plugin wiring, React mounting
  • Infrastructure — storage backends, analytics, CDN loaders

Cross-layer imports are forbidden and enforced by dependency-cruiser in CI.

The @alistigo/architecture package contains CALM (Common Architecture Language Model) JSON models that define every system, interface, and relationship in the framework. The calm validate CLI runs in CI and blocks merge if models diverge from code.

See ADR 0027 for the full rationale behind adopting CALM.

The CALM pattern that every artifact must implement is on the Artifact Pattern page. The list artifact’s concrete implementation is on the List Artifact Architecture page.