The 7-step Wizard protocol
Every non-trivial computation on the framework runs through this protocol. The runSevenStepWizard function in shared/api-core/src/lib/zeqWizard.ts is the canonical implementation; POST /api/zeq/wizard/compute is the wire-level entry point. The protocol is verbatim from the Zeq kernel:
1. Prime Directive — KO42 is mandatory
The metric tensioner is the substrate, not optional flavor. Every operator sequence starts with KO42. The 1.287 Hz modulation it adds:
ds^2 = g_uv dx^u dx^v + alpha sin(2 pi 1.287 t) dt^2
alpha = 1.29e-3
is what holds the ≤0.1% precision gate across the heterogeneous operator catalogue.
2. Operator Limit — 1–3 additional + KO42 (total ≤ 4)
Do not over-couple. Pick the minimum kinematic operators that close the problem. Five is too many; four is the cap; three is the sweet spot. The compute backend rejects chains of length 5+ without an explicit bridge contract.
3. Scale Principle — match operators to domain
Page work uses visual/UX operators. Math claims use QM/NM/GR operators. Don't apply quantum operators to a CSS bug. The wizard's domain inference in zeqAuthV3.ts:
"orbit"|"planet"|"gravity" → orbital-mechanics
"wave"|"ocean"|"tide" → oceanography
"spring"|"mass"|"newton" → classical-mechanics
"gene"|"dna"|"protein" → genomics
"material"|"steel"|"stress" → materials-science
default → quantum-mechanics
is one keyword pass. For programmatic users, set domain explicitly in the request body.
4. Precision Imperative — tune to ≤0.1% error
Every numeric claim from a wizard run must verify against the precision field in the response. If precision > 0.001, the run fails the gate and the result is annotated with degraded: true. Callers should refuse to ship a degraded result.
The framework's tolerance is the same one this site lives by — every constant is bit-exact, every equation verbatim.
5. Compile via Master Equation
The HULYAS master equation:
box(phi) - mu^2(r) phi - lambda phi^3 - exp(-phi/phi_c) + phi_42 sum(k=1..42, C_k(phi))
= T^u_u + beta F_uv F^uv + J_ext
is the substrate the operators compile through. Each C_k(phi) term is a kinematic-operator contribution; the sum is bounded at 42 because the phi_42 coefficient is the structural cap of the framework.
When you compose KO42 + 1–3 collaborators, the compiler:
- Looks up each id in the registry.
- Substitutes its formula into the corresponding
C_k(phi)slot. - Solves the resulting equation against your inputs.
- Returns a closed-form value plus a numeric residual.
6. Execute via Functional Equation
The functional equation:
E = P_phi * Z(M, R, delta, C, X)
is the runtime form. P_phi is the phase coefficient (sin(2 pi f t + phi_0) at the current Zeqond), Z(M, R, delta, C, X) is the partition function over mass/radius/displacement/coupling/external. The result E is the energy-equivalent value — the field expects every operator to ultimately produce one, even if the surface unit is a force, a frequency, a probability.
This is what you observe on the wire — pulseHz: 1.287, phase: 0.412, precision: 0.00071 — the runtime executing the closed-form against your inputs at this Zeqond.
Register dump — the structured output of step 6
When you call the master-equation path directly via POST /api/framework/solve or POST /api/framework/multibody, the runtime returns a register dump alongside the trajectory — the spec's name for the closed set of derived quantities the functional equation produces:
{
"registerDump": {
"phi_final": ..., "phi_range": ..., "phi_mean": ..., "phi_rms": ...,
"dphi_final": ..., "dphi_rms": ...,
"zeroCrossings": ..., "period_s": ..., "frequency_Hz": ...,
"freq_ratio_fH": ..., // frequency / 1.287 Hz
"energy_K_mean": ..., // mean ½·m·dφ²
"energy_U_mean": ..., // mean ½·m·φ²
"energy_total_mean": ..., // K + U
"momentum_final": ..., // m · dφ_final
"angular_proxy_mean": ... // mean(m·φ·dφ), scalar L analogue
},
"functionalEnergy": ..., // = P_φ · Z
"functionalEnergyTerms": { "P_phi": ..., "Z": ..., "M": ..., "R": ..., "delta": ..., "C": ..., "X": ... }
}
For multi-body runs, every body gets its own registerDump, and the response includes a pairwise interactions array with mean / final force magnitudes and separations for every pair.
The register dump is what step 7 verifies against. Two paths exist deliberately:
| Path | Returns | Use when |
|---|---|---|
/api/zeq/compute (wizard) | textbook closed-form value + zeqProof | you want a single SI-tagged number for a named formula |
/api/framework/solve | full trajectory + register dump + functional energy | you want the master-equation runtime output, not a formula lookup |
7. Verify and Troubleshoot
Diff-check the result. Screenshot-check the live behavior. Sign-off only after the precision gate passes.
For programmatic users:
curl -sS https://zeqapi.com/api/zeq/verify \
-H "Authorization: Bearer ${ZSM_KEY}" \
-H "Content-Type: application/json" \
-d '{"zeqProof": "...", "operators": ["KO42","NM21"], "R_t": 1.998e20, "zeqond": 2287439210}'
verifies a previously-issued proof. The verifier uses crypto.timingSafeEqual over the HMAC, so even a wrong-by-one-bit proof returns valid: false in constant time.
Worked example: Sun-Earth gravity
A canonical 7-step run — pick the operators, compose, verify.
Step 1. KO42 mandatory.
Step 2. One additional operator: NM21 (Newton's law of gravitation, F = G m_1 m_2 / r^2).
Step 3. Domain classical-mechanics. Match.
Step 4. Target ≤0.1% error against the CODATA G = 6.67430e-11 m^3 kg^-1 s^-2.
Step 5. Compile:
curl -sS https://zeqapi.com/api/zeq/compute \
-H "Authorization: Bearer ${ZSM_KEY}" \
-H "Content-Type: application/json" \
-d '{
"operators": ["KO42", "NM21"],
"domain": "classical-mechanics",
"inputs": {
"m1": 1.989e30,
"m2": 5.972e24,
"r": 1.496e11
}
}'
Step 6. Execute. Response (truncated):
{
"ok": true,
"value": 3.5421e22,
"unit": "N",
"operators": ["KO42", "NM21"],
"domain": "classical-mechanics",
"phase": 0.4119,
"zeqond": "2287439210",
"pulseHz": 1.287,
"precision": 0.00037,
"zeqProof": "8a34...64hex",
"_zeqKernel": { "version": "1.287.5", "url": "https://zeqapi.com/api/kernel" }
}
value: 3.5421e22 N against the published Sun-Earth gravitational force of ~3.542 × 10²² N. precision: 0.00037 — within the 0.001 gate.
Step 7. Verify:
curl -sS https://zeqapi.com/api/zeq/verify \
-H "Authorization: Bearer ${ZSM_KEY}" \
-H "Content-Type: application/json" \
-d '{"zeqProof": "8a34...", "operators": ["KO42","NM21"], "R_t": 3.5421e22, "zeqond": 2287439210}'
{ "ok": true, "valid": true, "verified_at": "2026-04-28T01:49:00Z" }
Done.
When the protocol rejects you
| Rejection | Cause | Fix |
|---|---|---|
MISSING_KO42 | step 1 violated; chain doesn't start with KO42 | prepend "KO42" |
OPERATOR_LIMIT_EXCEEDED | step 2 violated; chain length > 4 | drop to ≤3 collaborators |
DOMAIN_MISMATCH | step 3 violated; operator's domain doesn't include the requested domain | swap operator or domain |
PRECISION_BAD | step 4 violated; numeric residual > 0.001 | tighten input units, reduce composition, or accept degraded: true and document |
INVALID_OPERATOR | step 5 violated; an id isn't in the registry | use /api/operators to find a valid one |
WIZARD_ERROR | step 6 internal failure | check /api/health, retry; report security@zeq.dev if persistent |
VERIFY_FAILED | step 7 verification mismatch | the proof or one of (operators, R_t, zeqond) was tampered |
Next
- Operator catalogue — Operators
- The master equation — learn/math/master-equation
- KO42 — learn/math/ko42
- Wire-level wizard endpoint — /api/zeq/ (
POST /api/zeq/wizard/compute)