aca2b1e133a0b37d4d0076f8913051982c868429 diff --git a/public/sama-layers.png b/public/sama-layers.png index f5e5d26b794bd5fc96c3469efce93f0e6b040919..d41d37d14635483830c0d5ace937c52b0f0c404d 100644 Binary files a/public/sama-layers.png and b/public/sama-layers.png differ diff --git a/public/sama-layers.svg b/public/sama-layers.svg index 0fefb6e93929166b83d9ff86967217bd20d2a155..f1c29d8e81a176f67b78884cf1d8e748dbb47574 100644 --- a/public/sama-layers.svg +++ b/public/sama-layers.svg @@ -1,58 +1,57 @@ + - The four canonical layers - SAMA v2 §1.1 — frozen; no profile may add, remove, renumber, or rename them. + The four canonical layers + Imports only flow downward. + never upward · never sideways · never cyclic — SAMA v2 §1.2 the Law - - + + + - Layer 3 · Entry - main · CLI handler · HTTP route · UI mount · job entry - may import 0, 1, 2 + Layer 3 · Entry + outermost shell — main · CLI handler · HTTP route · UI mount · job entry + POST /checkout - - - + ↓ uses - - + + + - Layer 2 · Adapter - the boundary — DB · network · filesystem · framework bindings · external input parsed here - may import 0, 1 + Layer 2 · Adapter + the boundary — DB · network · filesystem · framework bindings · external input parsed here + Stripe.charges.create() - - - + ↓ uses - - + + + - Layer 1 · Core - domain logic · decisions · pure render — no network, disk, clock, framework - may import 0 + Layer 1 · Core + domain decisions — business logic · policies · pure render — no network, disk, clock, framework + applyPaymentRules() - - - + ↓ uses - - + + + - Layer 0 · Pure - types · constants · pure functions · domain models — no I/O, no side effects - imports nothing above + Layer 0 · Pure + deterministic primitives — types · constants · pure functions — no I/O, no side effects + Money(amount, currency) - - - §1.2 the Law: - imports always point to a strictly lower layer number — never upward, never sideways, never cyclic. - + + + Worked example, threaded through a checkout flow — each italic line shows what that layer would actually do. + diff --git a/src/d21_handlers_sama.ts b/src/d21_handlers_sama.ts index af4430d813e99a9c9109a585a9dbf3363c81dc5e..97f3f6c6666bf636047477109410830c2d92310a 100644 --- a/src/d21_handlers_sama.ts +++ b/src/d21_handlers_sama.ts @@ -390,7 +390,7 @@ The formal, normative spec — frozen core + profile mechanism, written so a det The verifier at **[/sama/v2/verify](/sama/v2/verify)** runs the seven §4 conformance checks against this very repository's source on every deploy. Right now it reports **✓ conforms · 7/7 checks pass**. -![The four canonical layers — Pure 0 / Core 1 / Adapter 2 / Entry 3 — stacked with downward import-direction arrows; the §1.2 Law: imports always point to a strictly lower layer number](/sama-layers.png?v=1) +![The four canonical layers — Imports only flow downward. POST /checkout → Stripe.charges.create() → applyPaymentRules() → Money(amount, currency). Color-coded warm-to-cool, volatile-to-stable: Entry 3 amber, Adapter 2 orange, Core 1 teal, Pure 0 green.](/sama-layers.png?v=2) ## the empirical chain