Repository navigation
diag: register HYB-E4004/E4005 and gate the source -> registry join (fixes #4460) - #4461
Open
jorge123255 wants to merge 1 commit into
Open
jorge123255 wants to merge 1 commit into
jorge123255 wants to merge 1 commit into
Conversation
…ixes limitlessprojects#4460) The capability terminal invariants print two codes the registry never got: error[HYB-E4004]: linear send capability 'tx' was not closed before scope exit $ hyb explain HYB-E4004 unknown diagnostic code: HYB-E4004 (registry has 48 codes) Only one direction of the join was enforced. `check_guarantees.py` fails when a GUARANTEES row names an unregistered code; nothing failed when the compiler printed one, so a code can be added to the checker and be unexplainable forever — and un-citable from any row. The capability split (`hy.pipe[T]()`) has no row at all, so nothing forced these two. Register both in ascending order with title, summary, fix-its and an example so `hyb explain` serves them. `tools/check_diagnostic_registry.py` closes the direction: every `HYB-E####` any `.rs` under a crate's `src/` can print must be in the registry, else exit 1 naming `file:line`. Comment mentions count too — a doc comment naming a code that does not exist is the same drift one step earlier, and the whole set is 50 codes. Wired into `make registry`, the `check` target and CI, with six unit tests (drift detected with its location, unrelated crates scanned, missing registry refuses to pass, registered-but-unused is fine). The gate reproduces the bug on b1627e8: four findings in `channel_liveness.rs` (lines 7, 8, 103, 117), exit 1. Co-authored-by: OpenBot <openbot@openbot.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4460.
The gap
hyb checkprintsHYB-E4004/HYB-E4005(the linear-capability terminal invariants inhy-check/src/channel_liveness.rs), andhyb explainanswersunknown diagnostic code: HYB-E4004 (registry has 48 codes). The registry is append-only and is exactly whatexplainserves, so the code that fails the build is the code the user cannot look up.Only one direction of the join was policed:
check_guarantees.pyfails when a GUARANTEES row names an unregistered code. Nothing failed when the compiler printed one, so both codes shipped disappearing — and neither could be cited by a row (the capability surface has no row).What this does
send-capability-not-closed,recv-capability-not-drained) with title, summary, fix-its and an example, soexplainserves them.tools/check_diagnostic_registry.py: everyHYB-E####any.rsunder a crate'ssrc/can print must be registered, else exit 1 namingfile:line. Comment mentions count too — a doc comment naming a nonexistent code is the same drift one step earlier, and the entire set is 50 codes, so the strictness costs nothing.make registry, thechecktarget and a CI step (make registry) run it, with six unit tests: drift is reported with its location, other crates are scanned, a missing registry refuses to pass, registered-but-unused stays legal.Gates
channel_liveness.rs(7, 8, 103, 117), exit 1; clean after registering;hyb explain HYB-E4004and… E4005serve full pages,E4004/4004aliases included;cargo test -p hy-diaggreen (the registry discipline tests: unique, ascending, every code has a reference page);check_guarantees,check_test_registration,check_corpus_censusgreen.No rule and no verdict moves; this is registry and tooling only.
Co-authored-by: OpenBot openbot@openbot.dev