Adaptive Factory compares a Champion and a Challenger across languages and databases using one language-neutral HTTP/JSON wire contract. Both stacks emit identical ExecutionRecord, IntentRecord, and ProjectionSnapshot payloads.
Edge Capture Proxy (Rung 2)
@adaptive-factory/tap sits in front of your Champion origin as a Hono Worker or HTTP middleware:
- Injects
X-AF-Correlation-Id, W3Ctraceparent, andX-AF-Surface-Idon every forwarded request. - Masks declared PII fields before any payload leaves the host.
- Writes masked
Capturerecords (CAP-*) toPOST /api/capture/ingressoff the request path (waitUntil()), failing open with a250 mstimeout so production traffic never blocks.
Deterministic PII masking (STD-CORE-002)
Every stack (TypeScript Edge Tap, Laravel PHP, and Rust Axum) masks PII identically before egress:
- Algorithm:
HMAC-SHA256(key = tenantMaskKey, message = utf8(trim(lowercase(value)))) - Output format:
af_pii_v1_+ first 12 lowercase hex characters - Default masked fields:
email,customer_email,recipient,to,phone,phone_number,mobile,address,street,postal_code,zip,card_number,pan,cvv,cvc,ssn
All three runtimes verify byte-identical output against one shared golden test vector (packages/core/fixtures/capture-bridge-golden.json).
Laravel PHP Champion SDK (sdks/laravel)
Target: Laravel 10/11/12, PHP 8.2+. Requires zero Eloquent schema changes.
- Terminable HTTP middleware (
AfCaptureMiddleware): flushes the HTTP response to the user before postingExecutionRecordtoPOST /api/capture/execution. - Rung 3a Outbound Intents: hooks
MessageSending(mail),Http::globalMiddleware(http),JobQueued(queue), and payment wrappers withperformed: true. - Rung 3b Canonical Projections: implement
AfProjectoron watched models to emit canonical JSON snapshots in integer minor units.
Rust Challenger SDK (sdks/rust)
Target: Rust 1.80+, Axum, Tokio, Tower, Serde.
- Boot-time Shadow isolation (
STD-CORE-004):af_shadow::verify_boot_isolationrequiresAF_SHADOW_MODE=1, refuses live outbound credentials, and verifiesnetwork-noneoregress-proxyisolation before binding the listener. - Tower layer (
AfShadowLayer): extracts correlation headers, clones bounded response bodies, masks PII, and drains execution records asynchronously over a bounded channel (fail-open). - Intent recorder traits: records mail, payment, HTTP, and queue intents with
performed: falseand zero outbound network calls.
Multi-project CLI (af projects)
When operating multiple systems or repositories from one machine, register named projects and switch cleanly with --project:
af init --tenant my-app --repo org/my-app --url http://localhost:8789
af projects
af status --project my-app
af captures --project my-app