Runs staged verification on XCLoom code, CLI, MCP, and skill changes before opening a pull request or finishing a task. Use after editing Rust crates, scripts, or docs to check diffs against base-branch REVIEW.md and reliability-checklist.json, keep workspace tests within 15.0s, run differential, property, and end-to-end checks, block test-gaming, and stop cleanly after repeated failures.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Verify?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/xcloom-verify)
---
name: verify
description: "Runs staged verification on XCLoom code, CLI, MCP, and skill changes before opening a pull request or finishing a task. Use after editing Rust crates, scripts, or docs to check diffs against base-branch REVIEW.md and reliability-checklist.json, keep workspace tests within 15.0s, run differential, property, and end-to-end checks, block test-gaming, and stop cleanly after repeated failures."
---
# Verification Workflow (`verify`)
Run fast static checks before full test builds, read review rules from `<base>` rather than the working tree, and keep the full workspace test suite within `<= 15.0s`.
---
## Verification Sequence
Isolate your Cargo build directory first so concurrent runs do not contend on target lockfiles:
```sh
export CARGO_TARGET_DIR="${CARGO_TARGET_DIR:-/tmp/xcloom-targets/verify}"
BASE="${BASE_REF:-HEAD}"
```
### Stage 1: Base-Branch Rules and Reliability Checklist (`< 0.5s`)
```sh
# 1. Read review rules from <base>
git show "${BASE}:REVIEW.md" >/dev/null
# 2. Match changed files and diff tokens against the 38 failure-mode checks
xcloom verify checklist --base "${BASE}" --json
```
For each triggered `XCL-REL-*` item:
- Read its `incident` and `check_hint`.
- Run its targeted `cargo test` filter (`test_filter`) while iterating.
### Stage 2: Diff Audit and Clippy (`~1-3s` warm)
Inspect `git diff "${BASE}"` before running tests:
- **No disabled tests**: no added `#[ignore]` or commented-out `#[test]` / `#[tokio::test]`.
- **No wall-clock sleeps in tests**: no `std::thread::sleep(` or `tokio::time::sleep(` in `crates/*/tests/**` or `#[cfg(test)]` modules.
- **No net test deletion**: total `#[test]` + `#[tokio::test]` count does not drop unless replaced by a broader property test.
- **Library doctest setting**: all `20` Fair Source library crates (`23` in the full repo; `crates/*` except `xcloom-cli`) keep `[lib] doctest = false` in `Cargo.toml`.
```sh
cargo clippy --workspace --all-targets -- -D warnings
```
### Stage 3: Timed Workspace Test Suite (`<= 15.0s` Budget)
```sh
/usr/bin/time -p cargo test --workspace --quiet
```
- Must exit `0` with `real <= 15.0` seconds and leave `0` `*.proptest-regressions` files.
- If a new test adds `> 500ms`, cache external fixtures (`swiftc`, `codesign`, `actool`) with `std::sync::OnceLock` and set `ProptestConfig { cases: 32..=48, max_shrink_iters: 64, failure_persistence: None, .. }`.
### Stage 4: Verification Coverage
Changes to binary formats, signing, asset catalogs, cryptography, OTA/tunnels, or incremental worker sync require all three test types:
| Test Type | What It Covers | Commands and Suites |
| --- | --- | --- |
| **Differential Checks** | Byte and structural parity against Apple tools or a clean checkout | `xcloom verify diff-archive <lhs> <rhs>`, `xcloom verify diff-ipa <lhs> <rhs>`, `differential_codesign` (`/usr/bin/codesign --verify --deep --strict`), `differential_actool` (`xcrun actool` + `assetutil`), `differential_swift_e2ee` (Swift `CryptoKit` + `COMPRESSION_ZLIB`), worker clean-checkout comparison |
| **Property Tests** | Edge-case inputs (`0 B`, `256 KiB +/- 1`, truncated headers) and idempotency `f(f(x)) == f(x)` | `proptest` suites for RFC 9110 `HTTP 206` / `416` byte ranges, `.dev` side-by-side bundle and `"DEV"` badge idempotency, `VXB1` batch codec, `plist_ext`, `Package.swift` scanner |
| **End-to-End and Skill Sync** | CLI flags, JSON output schemas, and CLI/MCP documentation parity | `xcloom skill check` + `verify_skill_spec_and_zero_cli_mcp_drift` (`69` CLI subcommands and `37` `xcloom_*` MCP tools in Fair Source builds; `74` / `38` in commercial builds) |
### Stage 5: Gate Script and Ledger
Run the repository gate in `enforce` mode (use `--mode observe` only for non-blocking baseline checks):
```sh
./scripts/verify-gate.sh --mode enforce --base "${BASE}"
```
Confirm the trailing JSONL record in `~/.cache/xcloom/verify-ledger.jsonl` reports `"result":"pass"`, `test_seconds <= 15.0`, `0` privacy hits, and `0` `gitleaks` findings.
### Stage 6: Real Apps and Apple's Tools (`T1`, a few minutes, macOS)
The stages above only run the fast in-process tests. Before merging a change to building, signing, packaging, assets, symbolication, preflight, the Simulator or the Canvas, also run the pre-merge tier on a Mac with Xcode:
```sh
# Oracle tests (cargo tests that call swiftc, actool, atos, codesign, ...) plus the real-app ladder:
# build, sign, pack, preflight, symbolicate and launch four fixture apps in a Simulator.
scripts/test-tier.sh T1
# Field-by-field and pixel-by-pixel comparison against Apple's tools.
tests/differential/run-all.sh
# No placeholder results in product code; every number in the docs has a ledger row.
bash scripts/lint-no-fabricated-results.sh
python3 scripts/check-claims-ledger.py
```
A missing oracle tool is a failure on macOS, not a skip. `docs/testing.md` describes the tiers (`T0`-`T3`) and how to read their output.
---
## Stopping After Repeated Failures
Do not loop on blind edits or weaken checks to force a passing exit code:
- **Attempt 1 (Root-Cause Fix)**: Read the compiler diagnostic, assertion failure, or diff mismatch. Fix the underlying bug class rather than patching a single input, then re-run only the affected crate's test (`cargo test -p <crate> <filter>`).
- **Attempt 2 (Checklist and Minimal Reproduction)**: Re-read `git show "${BASE}:REVIEW.md"` and every triggered `XCL-REL-*` item in `architecture/reliability-checklist.json`. Write or shrink a unit, differential, or property test reproducing the failure before re-running `./scripts/verify-gate.sh` (`verify-gate.sh --mode enforce` locks after 2 consecutive failed gate runs in the same session).
- **Attempt 3 (Stop and Escalate)**: After 3 consecutive failed attempts on the same issue (or once `verify-gate.sh` locks after 2 consecutive failed runs):
1. Stop editing code, tests, timeouts, and config files.
2. Do not add `#[ignore]`, delete tests, relax assertions, or pass `--skip-preflight`.
3. Report to the user:
- **Failing Check**: exact command, exit code, and minimal error output;
- **What Was Tried**: the 3 hypotheses tested and what each ruled out;
- **Decision Needed**: the design trade-off or environment dependency needed to continue.