Softanza
StartFrançais
Softanza
Cross-cutting disciplines

Test & quality system

Narrated guards as specifications, numpy and LAPACK oracles, an adversarial gate with negative controls, one rule gate; no coverage or CI.

4 Strong · 6 Solid · 2 Partial · 0 Emerging

Measured against: pytest · Hypothesis · libFuzzer · SonarQube · Folders: base/test(opens in a new tab) · base/meta(opens in a new tab) · base/engine(opens in a new tab) · For programmers: this area's reference

a grid of assertions from one night's guards
a grid of assertions from one night's guards. drawn on 2026-10-01 by the site's script tools/areas-figurative.ring, run inside the library at commit 0e72e2e2c · the source(opens in a new tab)

Rethought from first principles

What Softanza kept from what works, and what it rethought, as the library wrote it down in its design documents and narrations.

The Softanza wayEvery expected value written down is a promise, and it counts only once a run that could have failed has kept it.

Kept from the best practice

  • Tests are scenarios in Given, When, Then form, so the output reads as a specification and a failure shows what was expected and what came. source(opens in a new tab)
  • The engine's parsers of untrusted input are fuzzed with sanitizers on, and property tests are themselves checked by mutation: deliberately broken versions must fail. source(opens in a new tab)
  • Results are pinned against an independent reference, such as values generated by NumPy for matrices and by R for statistical smoothers. source(opens in a new tab)

Rethought

  • Thousands of example lines record what they should print. Nothing compared them, so a harness now runs each file and checks those promises in order. source(opens in a new tab)
  • A check that can only pass proves nothing: each positive case gets a negative sibling, and the harness is run on deliberately wrong promises to watch it fail. source(opens in a new tab)
  • An identity is not a self-check: a formula built from one set of numbers can never fail. A real check compares two independent measurements of the same truth. source(opens in a new tab)
  • The full suite is a gate run once before each commit, not after every edit. New checks start as standalone probes, so each edit gets a verdict in seconds. source(opens in a new tab)

Softanza has no test framework as a module; it has a test-and-quality discipline spread across the estate, whose signature is that a test is a readable specification and a green checkmark is never enough. 455 narrated guards read as Given/When/Then specs, correctness is proven against independent numpy/LAPACK oracles and byte-parity ground truth, and an adversarial gate of 1,416 assertions carries 58 negative controls. Where it is thin: property/mutation is engine-only, there is no coverage instrumentation and no CI, and the classic suites carry a fidelity backlog.

What a crafter does with it, and what stands out

  • A test is a readable specification: 455 narrated Given/When/Then guards
  • Correctness proven against independent numpy/LAPACK oracles, not self-captured snapshots
  • An adversarial gate of 1,416 assertions each born from an escaped defect, with 58 negative controls
  • One rule gate collecting code, security, agent and diagram findings in a single shape

What is owed

  • A standard CI pipeline running the rule gate on every push
  • Coverage instrumentation (line/branch) for the engine and guards
  • Haro-side property testing and a shipped assertion module
  • Close the fidelity-grind backlog (1,312 #ERR in the classic suites)

The Softanza way, run

What Softanza does differently in this area, shown by code taken from its narrations and guards, and run for this page.

The checker that keeps the threat model honest is itself shown catching a fake row with no proof and a guard that does not exist.

Softanza
cFake = "## 3. Guarantees" + char(10) +
	"| G98 | a claim | code | `base/test/security/no_such_guard_narrated.ring` (5) | A01 | - |" + char(10) +
	"| G99 | an unproven claim | code | nothing here | A01 | - |" + char(10) +
	"## 4. Open risks" + char(10)
aFR = GuaranteeRows(cFake)
Then("it reads both fake rows", len(aFR), 2)
Then("it flags the row with no proof", len(RowsWithoutProof(aFR)), 1)
Then("it flags the guard that does not exist", len(MissingPaths(GuardPaths(aFR))), 1)
Output
  THEN  it reads both fake rows  [PASS]
  THEN  it flags the row with no proof  [PASS]
  THEN  it flags the guard that does not exist  [PASS]

run on 2026-10-01 21:18 inside the library at commit 0e72e2e2c; taken from base/test/security/threat_model_narrated.ring(opens in a new tab)

The lanes, one by one

Lanes and their notes are quoted as they were read at the source, on Read from the source on 2026-09-17, from a read-only main worktree -- base/test/_narrated (455 guards), base/meta/promises.py (~8,500 #--> markers), engine test blocks (151/371 files), fuzzers and props, _gen_numpy_reference.py, plot.zig, stzRuleReport + stzPredicateSet, health in base/test/_STATUS.md / _FINDINGS.md.

Narrated guards as executable spec
Strong
_narrated gives a Given/When/Then DSL across 455 *_narrated guards and 10,000+ assertions; the per-file chk() idiom is copy-pasted, not importedbase/test/_narrated
Reference oracles (numpy / LAPACK)
Strong
_gen_numpy_reference.py generates _numpy_reference / _numpy_fft_reference (eigenvalues, SVD, det, Cholesky); BERT forward matches numpy to 1.64e-7_gen_numpy_reference.py
Adversarial gate & negative controls
Strong
gg_adversarial (23,481 lines, 1,416 assertions): every assertion exists because a defect survived a green suite; 58 negative siblings, 82 discharges()gg_adversarial
The unified quality gate
Strong
stzRuleReport collects findings in one shape from 13 rule domains with IsSound(); 14 code rules + the knob gate; signable stzPredicateSet; not wired to any CIbase/graph/stzRuleReport + stzPredicateSet (.zrlz)
Byte-parity & golden / snapshot
Solid
plot.zig holds 29 byte-parity tests against pre-port ground truth; stzLLMFunction.AddGolden/RunGoldens; #--> markers; snapshots pin current, not correctengine plot.zig (29 byte-parity tests)
Fuzzing
Solid
Five UBSan-trap fuzzers (http, tls/X.509, pcre2 300k rounds, sqlite, utf8) via zig build fuzz; engine-only, random-round not coverage-guided, not continuousfuzz_{http,tls,pcre2,sqlite,utf8}.zig
Real-process & integration testing
Solid
D0-D6 cluster guards spawn genuine OS processes via uv_spawn, exchange STZM frames, perform real kills; a focused set, not a general frameworkD0-D6 cluster guards; appserver guards
Engine unit tests (Zig)
Solid
Inline test blocks in 151 of 371 engine .zig files, run by the build's test step; broad but not universal, and unmeasuredzig build test (151/371 files)
Stress & scale testing
Solid
Million-scale guards (1M-item IntSeq ~7 ms vs >60 s; 999_*_millions suites) and multilingual stress (Arabic/CJK/emoji); timed guards are load-sensitive999_*_millions suites
Test-as-documentation
Solid
Narrated guards double as specs and 135 prose narrations explain the same features; the guard <-> narration link is convention, not enforcedbase/doc/narrations
Property & mutation testing
Partial
Three prop_*.zig files (crypto with mutation-kill, http, ratebucket); engine-only, no Haro-side property testing, no generator/shrinking, no mutation frameworkprop_{crypto,http,ratebucket}.zig
Coverage, CI & suite health
Partial
Coverage is by assertion count; bespoke Python runners; no line/branch coverage, no CI config (.github absent), classic #--> suites ~41-60% green, 1,312 #ERRbase/test/_STATUS.md / _FINDINGS.md