Contributing
Thank you for contributing! This monorepo maintains the shared open wire specification (spec/), the TypeScript reactive workspace (ts/, @zwire/*), and the native zero-dependency Rust workspace (rust/, zwire*).
Prerequisites
Section titled “Prerequisites”Runtime versions are pinned in mise.toml and rust/rust-toolchain.toml:
mise installpnpm installRunning pnpm install at the repository root automatically configures Git hooks in .githooks/ (pre-commit and pre-push).
Core Architectural Invariants
Section titled “Core Architectural Invariants”- Strict 2-Tier Star Topology: Core (
ts/packages/core/src/core/,rust/crates/zwire-core/) must never import companion subpaths, adapters, or crates, and companions must never import each other. Cross-feature integration goes strictly through the 5 lazy extension slots (ts/packages/core/src/core/internal.ts,zwire_core::internal). - Zero-Global Scopes: Never introduce module-level mutable reactive state. All state must remain isolated per
ReactiveScope/Scope/SyncScope. - Zero External Runtime Dependencies: Both
@zwire/coreand allzwire*crates must ship with zero external runtime dependencies. Rust crates enforce#![forbid(unsafe_code)]and#. - Re-entrancy & Deadlock Freedom (Rust): Release
RefCellborrows andMutexGuardlocks before invoking any user callback, and storeWeakScope/WeakSyncScope(never strong clones) in scope-owned closures. - Cross-Language Parity: Any change to optimistic rebase semantics, STM drafts, Top-K collection semantics, or wire JSON formats must update
spec/conformance.json, runmise run sync:specto updaterust/crates/zwire/tests/conformance.json, and pass TypeScript, Rust, andexamples/rust-ts-syncverification.
Verification Checklist
Section titled “Verification Checklist”# Run all spec, changelog, TypeScript, and Rust static checksmise run check
# Typecheck benchmarks and verify Rolldown tree-shaken bundle budgets(cd ts && pnpm run typecheck:bench && node ./bench/run_precision_bench.ts --check-bundles && bun ./bench/run_precision_bench.ts --check-bundles)
# Build TypeScript ESM + declarations and verify dist exports (Node + Bun)mise run build:ts
# Verify documentation site build, links, SEO, and unit testsmise run check:site
# Run TypeScript (Node + Bun), Rust, and cross-language sync demo testsmise run testCommits, Pull Requests & Changelog
Section titled “Commits, Pull Requests & Changelog”- Language & Format: All commit messages, PR titles, and PR bodies must be written in English using Conventional Commits (
feat:,fix:,perf:,refactor:,test:,docs:,chore:). - Conflict-Free Changelog Entries: Never edit
CHANGELOG.mddirectly in feature or fix PRs. Instead, add a dedicated fragment file underchanges/<short-kebab-name>.md(one file per PR so concurrent PRs never conflict on the changelog). Release tooling (mise run release:changelog) aggregates all fragments intoCHANGELOG.mdat release time.