Dev Tooling (xtask) & Docs Site
Workspace automation lives in crates/xtask (dev-only, never shipped in release archives), and the searchable documentation website lives in docs/site/ (Astro Starlight).
1. Developer Tasks (cargo run -p xtask -- ...)
Run cargo run -p xtask -- --help to list all available tasks:
| Command | When to run it & what it does |
|---|---|
cargo run -p xtask -- gen-api |
After editing proto/hya/v2/*.proto. Uses vendored protoc to regenerate Rust hya-api types, hya-server gRPC adapters, docs/protocol/api-reference.md, docs/protocol/openapi.json, and packages/hya-tui’s operation catalog + proto copies. Commit all generated files; CI checks for drift. |
cargo run -p xtask -- gen-relay |
After editing proto/hya/relay/v1/*.proto. Regenerates crates/hya-relay bindings. |
cargo run -p xtask -- gen-schemas [--check] |
After editing Config v3 schemas in crates/hya-app. Regenerates (or verifies with --check) the published JSON schemas under public/schema/v3/. |
cargo run -p xtask -- gen-plugin |
After editing plugin hook types in crates/hya-plugin/src/messages.rs. Regenerates TypeScript wire.gen.ts guards and syncs shared stdio runtime files across Bun and Claude adapters. |
cargo run -p xtask -- boundary-check [--print-findings] |
When touching crate dependencies or core identifiers. Runs the core/bundle and ring boundary guard from crates/xtask/boundary.toml (also run by cargo test -p xtask): no core crate may depend on an outer ring or bundle crate, and core identifiers may not name a denied bundle domain word. The allowlist is empty, so any finding fails; fix the code instead of adding an entry. --print-findings prints current violations in TOML form. |
cargo run -p xtask -- ring-report |
Prints production line counts across the architectural rings (r0, r1, r2, entry, clients, bundle_tooling, repo_tooling) defined in crates/xtask/boundary.toml. |
cargo run -p xtask -- matrix-check |
After editing crates/hya-e2e tests or matrix.toml. Verifies 1:1 Track P scenario registration with zero orphan files or numbering holes. |
cargo run -p xtask -- check-abi |
Checks abi-contract.lock against the Native ABI v2 contract, cross-boundary dependencies, and pinned Rust toolchain. CI runs this check. |
cargo run -p xtask -- update-abi-lock |
Refreshes abi-contract.lock after an intentional ABI version bump. |
cargo run -p xtask -- package-abi-sdk --out <dir> |
Writes the deterministic four-crate Native ABI v2 source SDK archive (hya-abi-sdk-<abi_id>.tar.gz) and abi-manifest.json matching the host’s pinned rustc and Cargo.lock. |
cargo run -p xtask -- package-bundle <src-dir> <out.hyabundle> |
Validates a schema_version: 2 bundle source directory and writes a deterministic .hyabundle archive. |
cargo run -p xtask -- package-native-tool-library <bundle-dir> <lib.so|.dylib> <out.hyabundle> |
Packages a compiled Native ABI v2 dynamic library into its deterministic .hyabundle archive. |
cargo run -p xtask -- generate-profiles ... |
Generates official static registry profile JSON manifests (default, minimal, tui, providers). |
cargo run -p xtask -- stage-release --bin-dir <dir> --package-root <dir> |
Stages the unified release directory layout (bin/hya, bin/hya-migration, pinned Bun, adapters, TUI, WebUI, and @hya/tui-sdk). Used by .github/workflows/release.yml and release-rehearsal. |
cargo run -p xtask -- stage-bun-programs ... |
Stages the Bun runtime programs (bun-adapter, claude-adapter, tui, tui-web, tui-sdk) for source installs. |
cargo run -p xtask -- startup-bench [--db <seed.db>] |
Measures cold hya server startup latency and prints the HYA_STARTUP_TRACE phase waterfall. |
cargo run -p xtask -- lifecycle-bench [--json] [--check crates/xtask/lifecycle-baseline.json] |
Benchmarks 1/16/64-subagent spawn, work, report/archive, and mail revival SQL/event counts offline, through hya/multi-agent and hya/agent-channels driven by scripted task, report, and send calls. Install both compatible packages into the user registry before measuring. |
cargo run -p xtask -- release-rehearsal --version <semver> --target <triple> --no-publish |
Full end-to-end local release staging, checksum, installer, and smoke verification for the host target. |
2. Landing Page (public/) & Documentation Website (docs/site/)
GitHub Pages serves the static landing page from public/ at the site root (/) and mounts the Astro Starlight documentation site under /docs/. Starlight renders the Markdown files directly from docs/ with sidebar navigation, dark/light themes, Mermaid diagrams, and Pagefind full-text search—without duplicating Markdown files or requiring frontmatter in docs/.
Preview locally
Requires Node.js >=22.23.4 (CI uses Node 24) and npm:
cd docs/sitenpm cinpm run dev -- --port 4321Open http://localhost:4321. Edits to docs/**/*.md hot-reload in the browser.
Build & link verification gate
.github/workflows/ci.yml (docs job, gated by ci-gate) runs these checks on every PR and main push touching public/, docs/, or proto/hya/v2/ (checking public/ static integrity first via .github/scripts/check_web.py, then assembling public/ at / and Starlight under /docs/ in docs/site/dist-pages), and .github/workflows/docs.yml builds and deploys main to GitHub Pages:
python3 .github/scripts/check_web.pycd docs/sitenpm testnpm run checknpm run buildnode scripts/check-build.mjsHow routing and sidebar validation work
docs/site/src/content.config.tsloadsdocs/**/*.md(excludingchanges/,examples/, andsite/), taking each page’s# H1heading as its title.docs/site/src/lib/remark-docs.mjsrewrites relative.mdlinks,assets/*images, andprotocol/openapi.jsonto clean site routes (honoringDOCS_BASE, e.g./hya/docson GitHub Pages), and turns links to repo source files ordocs/examples/*into GitHubblob/main/...links.scripts/check-build.mjsenforces two strict rules:- Zero broken internal page or asset links across the entire built site.
- Every rendered
.mdpage indocs/must appear in the sidebar navigation (docs/site/astro.config.mjs)—if you add a new Markdown file underdocs/, make sure its group or slug is listed inastro.config.mjs!