11. Contributing & Releases¶
This page is the contributor and release guide. It covers the contribution flow, local checks, coverage and performance review, and the release procedure for every flavor.
11.1. Start With¶
- Contributing guide: CONTRIBUTING.md
- Spec index: spec/README.md
- Compatibility matrix: compatibility-matrix.md
11.2. Contribution Flow¶
- Open an issue for non-trivial work.
- Branch from
develop, open the feature PR todevelop, and run the relevant flavor checks locally. - Every PR must pass the required conformance, flavor, docs, examples,
security, and spec-discipline checks. Maintainers promote
developto protectedmainthrough a separate PR. developandmainstay in sync by tree, not by history.develophistory does not contain themainmerge commits. After each promotion, check the tree:git diff --quiet <promotion head> <main merge commit>must exit 0. The full policy is in CONTRIBUTING.md §1.1.- For behavior changes, start in
spec/and follow the ADR discipline. - Keep all supported flavors visible when a change affects shared behavior.
- Edit the site and wiki pages only in their sources:
docs/content/and the other files thatdocs/manifest.yamllists. Runmake docs-checkbefore the PR. The site and wiki are generated from these sources and publish only frommain. A manual run of thewikiworkflow (workflow_dispatch) publishes only when it runs onmain; on any other branch it builds the wiki and skips the publish. Do not edit the wiki directly: each publication replaces every wiki page.
The repository's CONTRIBUTING.md holds the full
policy: review, branch synchronization between develop and main, CI run
cancellation, and documentation publication.
11.3. Validation Entry Points¶
The main local check families are:
- C#: restore, build, test, and
dotnet format - Python:
uv sync --locked --all-extras, thenuv run python -m pytest,ruff, andmypy --strict - TypeScript:
npm ci, fixture sync, typecheck, lint, build, and test. Vitest global setup runsnpm run build, including fixture and schema synchronization, before test workers start. This also applies to watch reruns, directnpx vitest, and coverage runs. Generated writes do not trigger reruns. Rerun manually after changing spec inputs outside Vitest's import graph. Do not run a separate build of the package while tests run. - Swift:
swift buildandswift test - Rust:
cargo fmt --check,cargo clippy --locked --all-targets --all-features -- -D warnings, andcargo test --locked --all-features - Public API baselines: each flavor's CI compares its public API with a recorded
baseline. The C#, Python, and TypeScript checks, and the React adapter check
(
packages/react/api/vmx-react.api.txt), fail on any change. The Rust and Swift checks fail on a breaking change. Commit the updated baseline in the same pull request as the API change. - Repo-wide coverage and example-contract tools
The full commands for each flavor, and the baseline file and update command for each one, are in CONTRIBUTING.md §2.8.
For reproducible Python checks, set UV_PYTHON to a supported version
(3.10–3.14) before locked sync and every later uv command. Installing Python
alone does not select it for an existing compatible environment. The Ubuntu
3.10 CI cell first seeds a 3.14 environment and checks that a selected sync
repairs it.
11.3.1. Reproduce Controlled Interleavings¶
A controlled interleaving acknowledges the exact runtime boundary that creates the tested ordering. A worker-start signal proves only that a worker began. Elapsed time proves only that a deadline passed. Neither proves that VMx entered a specific wait. The selected lifecycle and notification regressions acknowledge the exact per-instance wait and inspect the protected state while it is active.
The Swift command regression cancels from the synchronous executing notification. This happens inside the admission window, before the body task installs its cancellation handle.
The test owns every participant and error channel. It releases gates in cleanup, joins workers, awaits task results, and reports callback failures to the coordinator. The test fails on premature completion, missing terminal delivery, a swallowed worker or subscriber error, or cleanup that leaves work running. A diagnostic timeout fails the test; it never proves that an operation was correctly blocked.
Negative controls mutate the production boundary that the test exercises. They
run in a subprocess group with a watchdog and restore the original source bytes
in finally. A valid control reaches the selected assertion or ends as a
demonstrated deadlock mutant. A compilation failure, zero matched tests, an
unrelated assertion, a crash, or watchdog expiry is not proof.
Order test infrastructure like runtime participants. A build that rewrites imported fixtures or schemas must finish before workers read them; TypeScript enforces this with global setup and an awaited rerun hook. A filesystem error alone does not identify the process that holds a lock. Trace the actual writer and reader before you assign a cause.
Each technique answers a different question:
- Controlled thread interleavings force and acknowledge a particular runtime boundary.
- Stress tests sample many schedules and remain supplementary evidence.
- Event-loop drains let queued continuations run, but do not prove that a foreign thread reached a boundary.
- Virtual schedulers advance modeled time deterministically, but do not establish native-thread scheduling behavior.
The controls establish the named paths, not exhaustive freedom from races. Linux CPU affinity does not represent macOS scheduling. An external watchdog contains a stuck process but does not prove in-process cleanup.
The Swift thread sanitizer job runs the library tests with
swift test --sanitize=thread and TSAN_OPTIONS=halt_on_error=1, so a
data-race report fails the job. A single-process swift test also stops when
one case hangs: the test target's TestCaseHangGuard prints the case name and
ends the process after 300 s (VMX_TEST_CASE_TIMEOUT_SECONDS changes the
bound). A COMP-026 test that detects a deadlock ends the process at once,
because the stuck worker keeps the shared selection coordinator.
Run the selected regressions from the repository root with the same locked inputs used by CI:
dotnet test langs/csharp/tests/VMx.Tests/VMx.Tests.csproj -c Release \
--filter 'FullyQualifiedName~Foreign_Dispose_Waits' \
-- RunConfiguration.TreatNoTestsAsError=true
UV_PYTHON=3.12 uv --directory langs/python run python \
../../tools/check-python-interpreter.py --venv .venv -- \
-m pytest tests/unit/components/test_lifecycle_race.py \
-k foreign_dispose_waits
cargo test --locked --all-features --manifest-path langs/rust/Cargo.toml
swift test --package-path langs/swift \
--filter AsyncRelayCommandTests.testCmd012ImmediateCancelDuringAdmissionIsNeverLost
The Python command assumes the locked environment has already been synchronized
with UV_PYTHON=3.12 uv --directory langs/python sync --locked --all-extras.
CI additionally repeats the Linux commands three times normally and three times
under taskset on a CPU returned by os.sched_getaffinity(0). Do not substitute
CPU 0: hosted runners may exclude it. The Swift mutation experiment belongs in
the macOS workflow because it requires supported Xcode XCTest; local machines
without an accepted Xcode license cannot supply that evidence.
The
Concurrency Test Audit (docs/maintenance/2026-09-24-controlled-interleavings-audit.md)
records exact test locations, the maintained scope, follow-up dispositions, and
limitations.
11.3.2. Checked Documentation Snippets¶
A fence in docs/content or a published README can be tied to code that CI
runs. The gate scans packages/*/README.md, langs/*/README.md and
langs/csharp/packaging/*/README.md. Put the code in a test or example, mark
it, and put a marker comment directly above the fence:
<!-- checked-snippet: path/to/source.ts --> whole file
<!-- checked-snippet: path/to/source.ts#region-name --> one region
A region is every line between docs-snippet:start region-name and
docs-snippet:end region-name comments in the source, dedented. A source may
split one region into several start/end pairs, for example around a namespace
line the page leaves out; the parts are joined in order. A fence may be
indented as CommonMark allows, also inside a list item; the check removes that
indentation first. make docs-check fails when a fence differs from its source,
including in the generated site and wiki pages.
11.3.3. Coverage Floors¶
Every flavor gates CI on a coverage floor over its library sources:
| Flavor | Gate | Metrics |
|---|---|---|
| C# | tools/check-cobertura-threshold.py in csharp.yml |
line, branch |
| Python | fail_under in langs/python/pyproject.toml |
combined line and branch |
| TypeScript | coverage.thresholds in langs/typescript/vitest.config.ts |
statements, branches, functions, lines |
| Rust | tools/check-coverage-floor.py with tools/coverage-floors.json |
lines, regions, functions |
| Swift | tools/check-coverage-floor.py with tools/coverage-floors.json |
lines, regions, functions |
For Rust and Swift, the coverage floor job runs in rust.yml or
swift.yml. It fails when line, region, or function coverage falls below the
flavor's floors in tools/coverage-floors.json. Rust measures with
cargo-llvm-cov on a pinned toolchain:
cargo install cargo-llvm-cov --version 0.9.1 --locked
cargo llvm-cov --locked --all-features --manifest-path langs/rust/Cargo.toml \
--json --output-path rust-coverage.json
python3 tools/check-coverage-floor.py --flavor rust --report rust-coverage.json
Swift runs the library tests once with coverage on macos-15 and the default
Xcode. CI runs the test command through tools/swift-test-watchdog.py, which
names and kills a case that runs longer than four minutes:
swift test --package-path langs/swift --enable-code-coverage \
-Xswiftc -Xllvm -Xswiftc -instrprof-atomic-counter-update-all
python3 tools/check-coverage-floor.py --flavor swift \
--report "$(swift test --package-path langs/swift --show-codecov-path)"
The denominator is library sources only: langs/rust/src/ and
langs/swift/Sources/VMx/. Tests, examples, bundled resources, and build
output are not counted. A change that touches only generated or resource files
therefore cannot fail the gate. Removing a test that exercised library code
lowers the figure and can fail it.
A failure names each source file that gained uncovered lines since the
recorded baseline, with the unexecuted line ranges that llvm-cov show marks.
Each job uploads the llvm-cov export and a provenance file with the commit,
toolchain, and measured figures. Instrumented code stays in the coverage job:
cargo-llvm-cov uses its own target directory, and Swift instruments only that
job's debug build. No release build, package, or published crate contains it.
Two flavor details affect the figures:
- Rust counts come from llvm-cov summaries, which count a line once for each function that spans it. A closure's lines count twice, so a file's ranges can hold fewer lines than its count.
- The Swift build updates counters atomically. Coverage counts the code after a
guardas the function's entries minus its early returns. Plain counter updates can lose entries when many threads call one function, as DISP-003 does withNotificationHub.dispose(). A region that ran could then read as unexecuted and fail the floor without a code change (#513).
Each Rust and Swift floor is the lowest figure measured across repeated runs of the baseline commit, truncated to two decimals. Only run-to-run variation in scheduling-dependent paths is tolerated.
The floors file records the commit, toolchain, every measured run, and each
source file's uncovered lines. tools/compare-coverage-runs.py compares the
llvm-cov exports of repeated runs. It names every line that some runs execute
and others do not. Cover such a line with a deterministic test rather than
lowering a floor.
Raise a floor when coverage improves. Never lower one to make a change pass. If deleting code legitimately lowers coverage, explain it in the pull request and record the new baseline. Percentages are not comparable across flavors, because each tool counts differently.
Coverage shows which lines ran, not whether a test would catch a wrong result. It does not replace the conformance assertions.
11.3.4. Review Performance Changes¶
A change that touches a hot path, such as hub delivery, batching, property publication, collections, or lifecycle, should include a benchmark comparison. Run the flavor's harness on the change and compare it with the committed baseline, or with a baseline you record from the base branch on the same machine. Baselines gives the commands.
Explain every case the tool marks SLOWER and every probe that is not bounded
in the pull request. The comparison is a review signal, not a CI gate. The
method, cases, report format, and thresholds are in
Performance Methodology.
11.3.5. Rust Ownership-Test Conventions¶
The caller controls each stored VM's construct, destruct, and dispose operations. A Rust serviced collection retains a member item as an ordinary value; that retention does not transfer lifecycle ownership. A returned old value, lookup result, or snapshot can keep a shared item alive after removal. Cloning the collection shares its backing store without cloning items. Rust's collection-change history has no item payload to retain.
Rust Drop is not VM disposal. The Rust tests for the serviced-collection
ownership IDs use test-private wrappers to observe caller ownership. Their
evidence and its limits are recorded in the
Rust ownership-test evidence record (docs/maintenance/2026-11-10-rust-ownership-test-evidence.md).
11.4. Spec Discipline¶
Two repo rules matter most:
- semantic changes under
spec/require a matching ADR unless the change is in an exempt path - new conformance IDs require matching stubs in every catalog-complete flavor
Those rules are enforced in CI and described in the contributing guide and repository automation.
11.5. Release Shape¶
Flavor packages version independently. Each release uses an annotated,
immutable <lang>-vX.Y.Z tag on a verified main commit. C# companions use
package-specific tags, the spec uses spec-vX.Y.Z, and Swift pairs its
operational tag with the semantic vX.Y.Z tag that SwiftPM requires.
Registry-backed channels publish through a protected environment and a trusted
publisher, and only the publish job holds id-token: write.
The release invariants in CONTRIBUTING.md §4.3 apply
to every flavor, and each flavor's RELEASING.md runbook adds its own steps.
The compatibility matrix (compatibility-matrix.md) records which
versions are published.
11.5.1. Release Checklist¶
Use this sequence for every flavor:
- Start from a clean, freshly fetched
origin/main; never release fromdevelopor an unmerged feature branch. - Confirm the source/package version and minimum-spec declaration agree, and prove both the intended operational tag and public registry version are unused.
- Run the flavor's complete release gate and build the exact package locally. Inspect that artifact, install it into a clean consumer, and retain the check evidence before creating a tag.
- Create the immutable annotated
<lang>-vX.Y.Ztag (git tag -a "<tag>" -m "<package> <version>" origin/main) on the verifiedmaincommit. For Swift, create the paired semanticvX.Y.Ztag on the same commit. For C# companion packages, use their package-specific tag prefixes. This includes Python, because release-please creates no tags. Older lightweight Python tags stay valid. - Monitor the matching release workflow, approve its protected environment only after the pre-publish jobs identify the expected artifact, and do not bypass a failed gate.
- Verify the exact version on the public registry and install it into a second fresh consumer. Confirm the GitHub release points to the tagged commit and contains the expected artifacts and notes.
- Only after public verification, update the repository docs and regenerate
this site and the wiki through
developandmainPRs. - If source, build, package-publication, or package behavior fails after tag
creation, keep the tag immutable. Correct the source or workflow on
main, bump the affected package to a new patch version, and publish through a new tag. For the React adapter only, a missing GitHub Release after successful registry, provenance, and fresh-consumer gates is metadata-only recovery; follow the React-specific recovery runbook.
11.5.2. Validate Python Release Tests¶
Run gh workflow run release.yml --ref develop to run only the Python test
matrix of the release workflow. This dispatch cannot publish a package or
create a release. CONTRIBUTING.md §4.4 describes its
scope and how to collect warm-cache evidence.
11.5.3. Recover React Release Metadata¶
A missing GitHub Release for a React adapter version whose npm publication and
fresh-consumer checks have passed is metadata-only recovery. The complete
procedure and commands are in
packages/react/RELEASING.md, section 5.