Skip to main content

Architecture

Understand the registry-build lifecycle, build context, cache model, and extension boundaries.

Lifecycle

Loading diagram...

Build context

The runtime context is the shared contract between the config loader, the core phases, and every extension.

It carries:

  • resolved config
  • resolved collections
  • config path and config directory
  • output paths
  • path registry helpers
  • collected build artifacts
  • output registration records
  • a per-build ts-morph project
  • cache access
  • changed-only flags and resolved changed paths

The pipeline stays explicit — phases and extensions don't rediscover global state on their own.


Core responsibilities

Artifact model

The runner exposes two related concepts:

ConceptMeaning
artifactsIn-memory values shared between phases and extensions
outputsFiles or file groups registered as generated outputs

Typical examples:

  • artifact: collections
  • artifact: index
  • output: public/r/index.json
  • output: public/r/components/*.json
  • output: __ui_registry__/index.tsx
  • output: dist/arch/repos/core.db.json
  • output: public/r/themes.css

This split keeps extensions data-first. They read artifacts and register outputs without pretending to be part of the core phase graph.


Cache model

The cache stores:

  • file hashes
  • phase-specific manifest data

The cache is local, incremental state. Not the source of truth — always safe to delete.

What the cache is for

  • skip rehashing unchanged files
  • skip rematerializing unchanged registry items
  • skip rewriting identical generated outputs
  • support --changed-only local rebuilds

What the cache is not for

  • long-term artifact storage
  • cross-machine shared caching
  • replacing deterministic generation

Design rules