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>
4.8 KiB
4.8 KiB
Mizan Roadmap
v1 — Django + Multi-Framework (React, Vue, Svelte)
Done
@clientdecorator —context=,affects=,auth=,websocket=,private=,route=,methods=,rev=,cache=ReactContextclass — type-safe context/affects references with linting- Named contexts — functions sharing a context name grouped into one provider and one fetch
- Context bundling endpoint —
GET /api/mizan/ctx/<name>/returns all functions in one response - Server-driven invalidation (JSON body) — mutation responses carry
{"result": ..., "invalidate": [...]} X-Mizan-Invalidateheader — second invalidation transport for view-path responses (redirects, HTML)- Return-type branching — data return → RPC path;
HttpResponsereturn → view path - Scoped invalidation —
affects_paramslambda; runtime supports{context, params}form - Auth guards —
auth=True,auth='staff',auth='superuser',auth=callable - JWT + session auth — auto-detected, CSRF handled
- MWT — Mizan Web Token for Edge cache keying (separate secret from JWT/cache)
- Shapes — Pydantic + django-readers for typed query projections
- WebSocket channels — real-time bidirectional communication
- HMAC cache keying — origin-side cache with cross-language HMAC conformance (Python + TypeScript pin)
- Edge manifest —
python manage.py export_edge_manifest; both RPC and view-path functions - SSR bridge — Django template backend → persistent Bun subprocess via JSON-RPC
mizan-runtimekernel — framework-agnostic imperative client primitives (data/status/error owned by kernel)- Two-stage codegen — Stage 1 emits framework-agnostic protocol layer; Stage 2 emits per-framework hooks (React, Vue, Svelte)
mizan-ts— TypeScript backend adapter; proves the protocol is language-agnostic
Next (in progress)
- React adapter wrapper layer — codegen emits
MizanContextprovider,useMizanhook,DjangoErrorclass on top of themizan-runtimekernel. Equivalent wrapper layers for Vue and Svelte adapters. The harness inexamples/django-react-siteis blocked on this. - Legacy
MizanProviderremoval (A1) —mizan-react/src/context.tsx(~750 lines) replaced by codegen-emitted wrappers. Blocks v1mizan-reactpublishing. - Forms migration to kernel (A3) —
mizan-react/src/forms.ts(~1163 lines) currently consumes legacyMizanProvider. Rewrite to usemizanCallfrom the kernel. Blocks A1. - Allauth extraction (A2) —
legacy/allauth/becomesmizan-django-allauthpackage consuming Mizan's public API. - Vue/Svelte e2e validation (A4) — example apps exercising a live backend end-to-end, like
examples/django-react-sitedoes for React. - Test coverage gaps — T1–T12 in
ISSUES.md(kernel state machine, view-path purge, SSR thread safety, retry logic, cross-language HMAC pin, etc.)
Quality
- H5 — Mutation hooks expose no loading/error state
- H7 — Redis SCAN blocks request path at scale
- H8 — Svelte codegen uses Svelte 4 stores; should use Svelte 5 runes
- H9 — Svelte
destroy()not auto-called (memory leak) - H12 — Forms
triggerValidationcaptures stale data - Medium issues (M1–M18) per developer judgment
Mizan Cloud (closed-source)
Mizan Edge
Cloudflare Workers for automatic edge caching.
- Reads the edge manifest to configure cache rules
- Context GETs cached at edge, keyed by context name + params
- Reads
X-Mizan-Invalidateheader from mutation responses to purge caches - Reads JSON
invalidatekey from RPC responses for the same purpose - Resolves URL patterns from manifest to purge view pages
- Zero configuration — the manifest IS the cache policy
Mizan Render
SSR at the edge via Cloudflare Workers.
- The Bun SSR bridge, running on Cloudflare instead of colocated with Django
- Context data fetched from Django (or edge cache), rendered at the edge
- HTML response streamed to the user from the nearest PoP
Mizan Deploy
One-command deployment for Django + React apps.
- Container orchestration (AWS/Azure)
- Edge + Render auto-configured
mizan deployfrom the CLI- The Vercel experience for Django
Reference
Wire protocol shapes (context fetch, mutation call, invalidation transports) are documented in CLAUDE.md. Architectural details for specific subsystems live in docs/:
docs/AFI_ARCHITECTURE.md— package architecture, kernel model, adapter strategydocs/CACHE_KEYING.md— HMAC cache key derivationdocs/MWT_SPEC.md— Mizan Web Token formatdocs/SSR_ARCHITECTURE.md— Django template backend, Bun bridgedocs/PSR_VS_EDGE.md— protocol-level rendering vs. paid Edge layerdocs/PRODUCT_ARCHITECTURE.md— product surface and pricing tiers