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-bynkgrammar 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 transformsite/scripts/migrate-page.mjsapplied during the Book migration — lift the leading# H1intotitle:frontmatter (dropping the heading), and rewrite relative.mdlinks to site routes — so the generated-page drift guards keep their committed site pages byte-identical to the migrated originals oncedocs/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, thenbodyverbatim — and adecisions/README.mdindex row (**<title>** … <summary>), assigningNNNNat merge.titleis required (the file heading and the index bold need it);summarydefaults totitle,statustoAccepted. - 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.Zin 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 theirprobeskeys. 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_filesreports why. - check_
all - Validate every
*.mdunderpending_direxceptREADME.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
sshaped like a greenfield-reference rule id —Rfollowed by<digits>.<digits>(e.g.R2.3,R0.1)? Syntax only; whether the id actually exists in the reference isknown_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’scloses_ruleentries, separate fromis_rule_id’s pure syntax check because it needs the repo root. Root-parameterised likestamp::next_adr_number, so a fixture tree can supply its own reference doc. - pending_
dir design/pending/underrepo_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, soxtask/src/main.rs’spr_number_from_head(the only caller, which runsgit log -1 --format=%sto getsubject) 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 theirraiseskeys. Same reasoning asacknowledged_probesfor 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_indexuses). - validate
- Validate a single pending file’s
content.filenameis 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(skippingREADME.md), sorted by filename. Root-parameterised so the stamp — and its fixture tests — can target any tree;check_allis this over the realrepo_root.