docs / build with the engine

Testing & release gates

How the preview is tested.

Cleanup Engine is an unreleased developer preview. These guides are generated from the SDK repository, which is private for now; file paths are shown as text. Request access.

Tests protect a concrete contract: preserve input bytes on fallback, never deliver a canceled result, bound admitted work, verify assets before allocation, and never choose a remote route implicitly. Coverage is a gap-finding tool; hitting a line does not prove its behavior is correct.

Run the SDK checks

Use macOS 14+ and full Xcode with Swift 6. The root package needs neither model assets nor third-party Swift dependencies. Python 3 runs the installer tests and loopback HTTP fixture.

export DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer
python3 scripts/check.py --sanitizers --repeat 20

The runner builds Debug with coverage and warnings treated as errors, builds Release, runs Python tests, repeats lifecycle tests, and optionally runs Thread Sanitizer and Address Sanitizer in separate builds. It fails on the first failed command, bounds each command to ten minutes, and retains logs plus checks.json in a fresh /tmp/pomvox-check-* directory. It terminates fixture children on timeout. Use --build-dir /tmp/my-pomvox-check to reuse disposable caches. It does not edit CI or run model downloads.

For one focused check:

swift test --scratch-path /tmp/pomvox-core --filter LifecycleTests
python3 -m unittest discover -s scripts/tests -v

The cloud tests bind only 127.0.0.1 on an ephemeral port and use a synthetic token. Network denial for the entire root suite prevents its intentional loopback tests; apply it to local runtime checks instead.

Coverage by risk

RiskTests and evidenceAcceptance condition
Corrupted Unicode or incorrect offsets5,000 deterministic seeded pairs; every byte boundary in a mixed-script fixture; UTF-16 mapping; multiple edits; extreme integer offsetsExact UTF-8 reconstruction, invalid ranges rejected
Misleading outcomesGuard fixtures; fallback reasons; output/status consistency; JSON round tripsEvery fallback equals original bytes with zero edits
Concurrency and resource lifetime640-call bursts per lifecycle run; 40 cancellation/close rounds; uncooperative worker; busy queue and queued deadlineAt most one generation, exactly one resource close, no late delivery
Invalid setupManifest/metadata mutation matrices; symlink/FIFO/size/checksum checks; factory errors and cancellationNo model factory invocation for invalid packs; canceled allocation cleaned up
Corrupted installationCopy checksums; source symlinks; concurrent installers; disk-failure injection; partial cleanupSource unchanged; no overwrite; manifest published only after verified artifacts
Host insertion raceSuperseded completion, host cancellation, invalid timeout, transform orderingCanceled/superseded text never reaches insertion
Untrusted remote responseReal HTTP: wrong request/pack/schema/route, malformed/truncated/oversized bodies, invalid Unicode edits/status/metrics, redirect refusal, slow headers/body/credentialsBounded request, exact raw fallback, explicit route, no redirect or retry
Decoder/cache changesPinned real model versus source reference and four SDK modes; vocabulary isolation; closed/expired/canceled runtimeExact fixture parity; speculative drafts actually accepted; no reused mutable cache

Boundary matrices are table-driven: the test-method count is smaller than the number of cases. The seeded tests use a fixed generator so failures reproduce. Concurrency checks assert lifetime invariants rather than a machine-specific throughput. Deadline tests include scheduling tolerance and are not latency benchmarks.

Real MLX validation

Required for changes to prompts, tokenization, model dependencies, cache ownership, decoding, artifact pins or runtime lifecycle. Optional locally for contract-only contributors; release validation must run it with zero skipped model tests.

First prepare the pinned assets with the README (README.md) instructions. Build the separate Xcode consumer to package Metal shaders, then run:

POMVOX_TEST_PACK=/absolute/path/to/installed/pack \
  sandbox-exec -p '(version 1)(allow default)(deny network*)' \
  xcrun xctest /absolute/path/to/DerivedData/Build/Products/Debug/ModelTests.xctest

The model suite explicitly skips live inference when POMVOX_TEST_PACK is absent. A green run with that skip is not parity evidence. Compare the source reference to library, greedy, cached speculative and uncached speculative output byte for byte. The current corpus includes 24 public synthetic inputs: self-corrections, repetition, negation, amounts, identifiers and Unicode. Parity proves extraction behavior on those inputs; it does not prove all outputs are semantically correct.

Run consumer benchmarks after tests and other inference have finished. Report hardware, OS, build configuration, exact artifacts, preparation, every outcome, sample counts and full-path timing. Never replace failures with successful-only latency statistics.

Release gates

Before a stable production release:

A production cloud service needs its own authentication, authorization, tenancy, retention, quota and abuse tests. This repository currently supplies a transport client and test fixture only. Passing these client tests cannot certify a service that does not exist here.