Skip to main content

Crate xtask

Crate xtask 

Source
Expand description

The pending-increment format validator (increment-allocation track, Slice 0).

A feature PR adds one design/pending/<slug>.md declaring its bump level, a one-line changelog blurb, and — when it records a decision — one or more ADR prose blocks. It writes no version and no ADR number: those are the two serial counters that the merge-time stamp assigns on main, so that parallel increments stop conflicting on them. See design/pending/README.md and ADR 0206 (design/decisions/0206-allocation-on-main.md).

This module is the format contract between that human-authored file and the future stamp. It is process tooling, not compiler behaviour, which is why it lives in the unpublished xtask crate rather than in bynk’s test suite. check_all is exercised two ways: an integration test (tests/pending_files.rs) runs it over the real design/pending/** as a drift guard, and the check-pending binary subcommand exposes it for local runs.

Modules§

bench
Compile-time and editor-latency benchmarks (#3168).
delivery_isolation
The structural guard of Decision I of #3928 (back-half paydown 1B.1c): the event failure-isolation code has one home.
editor_contract
The editor contract: the compiler-owned facts a language-client extension must stay in step with, as one JSON document.
fn_length
The ratcheted maximum function length (#3167).
grammar
Render the tree-sitter-bynk grammar to EBNF.
greenfield_status
cargo xtask greenfield-status — the probe harness (track doc §8, proposal #999).
manifest_schema
#2096: the JSON Schema for bynk.toml, generated from the manifest’s Rust types.
module_lines
The module-size ratchet (#4085, slice 2.0 of the back-half paydown track, spine #3676).
release_notes
The cumulative migration note (#3178).
release_pages
The Book’s release pages (web presence track, slice 3, #3868): one page per release tag under RELEASES_DIR, an Unreleased page the stamp writes each increment’s row into (UNRELEASED_PAGE), and an index listing every release (INDEX_PAGE).
site_page
Shared test helper: turn a generated mdBook-format reference page into the Starlight page committed under site/src/content/docs/. This is the same transform site/scripts/migrate-page.mjs applied during the Book migration — lift the leading # H1 into title: frontmatter (dropping the heading), and rewrite relative .md links to site routes — so the generated-page drift guards keep their committed site pages byte-identical to the migrated originals once docs/ is gone.
stamp
The merge-time stamp (increment-allocation track, Slice 1).
tiers
The test-tier probe (crate-hygiene track, C4b, #2940).

Structs§

Adr
One ADR block. The stamp writes design/decisions/NNNN-<slug>.md — a # NNNN — <title> heading, a status line, then body verbatim — and a decisions/README.md index row (**<title>** … <summary>), assigning NNNN at merge. title is required (the file heading and the index bold need it); summary defaults to title, status to Accepted.
Pending
A parsed, validated pending-increment file.
Raise
One raises: entry: a growth probe and the reason its reading may rise.

Enums§

Level
The bump level an increment declares. The stamp turns this into the next X.Y.Z in merge order; the format never carries a concrete number.

Functions§

acknowledged_probes
The gated probes acknowledged by every pending file under root — the union of their probes keys. The pending files present in a tree are exactly the increments not yet stamped (the stamp deletes each one as it rewrites the table), so on a PR’s merge ref this covers both the PR’s own acknowledgement and any just-merged increment whose stamp hasn’t landed yet. An unreadable or invalid pending directory acknowledges nothing; pending_files reports why.
check_all
Validate every *.md under pending_dir except README.md (the format doc, excluded like the decisions index excludes its own README). Returns the number of pending files validated, or every error found across all files (each prefixed with its filename) so one run reports the whole picture.
is_rule_id
Is s shaped like a greenfield-reference rule id — R followed by <digits>.<digits> (e.g. R2.3, R0.1)? Syntax only; whether the id actually exists in the reference is known_rule_ids’s job.
known_rule_ids
Every rule id (R2.3, …) enumerated in the greenfield reference (design/bynk-greenfield-compiler.md) — the existence check for a pending file’s closes_rule entries, separate from is_rule_id’s pure syntax check because it needs the repo root. Root-parameterised like stamp::next_adr_number, so a fixture tree can supply its own reference doc.
pending_dir
design/pending/ under repo_root.
pr_number_from_subject
The PR number a commit subject (the first line of its message) names, if it ends in the (#NNNN) GitHub’s squash-merge appends to the PR title — pure and root-independent, so xtask/src/main.rs’s pr_number_from_head (the only caller, which runs git log -1 --format=%s to get subject) stays a thin wrapper over this, and this half — the part with the interesting edge cases — is unit-testable without a git tree (#1001, caught by review as the one piece of new logic with no test coverage).
raised_probes
The growth probes raised by every pending file under root — the union of their raises keys. Same reasoning as acknowledged_probes for why the pending files present in a tree are the right set.
raised_probes_checked
Like raised_probes, but an invalid pending directory is an error (with each problem) rather than an empty set, so a caller can say the pending files are invalid instead of reporting a misleading “unraised” rise.
repo_root
The repo root, resolved from this crate’s manifest dir so it’s independent of the working directory (the same trick decisions_index uses).
validate
Validate a single pending file’s content. filename is used to check the stem is a kebab-case slug. Returns every problem found (not just the first), so a malformed file reports completely.
validated_pending_in
Read and validate the pending files under root/design/pending (skipping README.md), sorted by filename. Root-parameterised so the stamp — and its fixture tests — can target any tree; check_all is this over the real repo_root.