Files
mizan/docs/PRODUCT_ARCHITECTURE.md
Ryth Azhur 6eca514777 Restore documentation layer — match current substrate
ROADMAP: done items moved out of "Next" (codegen rewrite, SSR bridge,
edge manifest, X-Mizan-Invalidate, return-type branching, affects_params,
kernel extraction, two-stage codegen, mizan-ts). Real "Next" in:
framework-adapter wrapper layer (MizanContext + useMizan + DjangoError
on top of the kernel) for React/Vue/Svelte; A1–A4 from ISSUES.md.

CLAUDE: 4-package layout replaced with the actual 7-package layered
architecture (backend protocol adapters + frontend kernel + framework
adapters + SSR worker). "STALE codegen" section rewritten to describe
what's emitted vs. the wrapper layer that isn't yet.

docs/ now tracked (6 files). AFI_ARCHITECTURE rewritten — replaced
the speculative `mizan-ast`/`mizan-csr`/`mizan-rpc`/`mizan-schema`
package names with the real layout, dropped KDL-schema language for
the actual schema-export format. The other 5 docs/ files were already
current and are tracked as-is.

ARCHITECTURE-REWORK.md deleted — same expert review is re-tracked in
the fresher ISSUES.md, two parallel trackers was sediment.

README.md deleted — drift was beyond surgical fixes (`mizan_clients.py`
convention, `<DjangoContext>` provider, removed `@compose` and
`context='local'`, wrong codegen output filenames, 3-package structure
vs. 7). Rewrite waits for the wrapper-layer codegen to land so
user-facing examples reflect reality.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-05 20:10:12 -04:00

1.5 KiB
Raw Blame History

Product Architecture

Revised April 2026.

Launch product: Mizan Render

$20/seat/month.

Protocol-aware Edge caching + PSR delivery via Cloudflare + render Workers + TS backend hosting via Workers for Platforms.

Developer's stack = their backend + database. Cloudflare handles read traffic, rendering, and caching.

Deferred: Mizan Deploy

Django hosting requires IaaS compliance: gVisor, KMS, NIS2, multi-state privacy. ~$58K legal costs.

Deferred until Render revenue funds it.

TS "Deploy" exists via Workers for Platforms at no additional compliance cost.

Free framework: mizan-cache (origin-side cache)

Python package implementing the full cache protocol locally — same HMAC key derivation, metadata schema, and purge semantics as Edge.

Three backends:

  • In-memory dict (default)
  • Redis
  • SQLite

Dual purpose

  1. Makes the free framework genuinely powerful (PSR + typed hooks + invalidation + caching with zero cost).
  2. Provides a unit-testable surface for all cache mechanics without Cloudflare.

Spec additions

  • @client(cache=False) — uncacheable; emits Cache-Control: no-store.
  • Cache ABI: get(key), put(key, response, metadata), purge(context, params).

Launch compliance (Render only)

Entirely Cloudflare Workers + management API (Django/Postgres):

  • GDPR DPA + privacy policy + subprocessor list — ~$5001K legal
  • DMCA — $6
  • No NIS2, no gVisor, no KMS

Invariant

All architecture decisions target the Render-only launch posture. Don't build Deploy infrastructure prematurely.