fix(http,audits): the guide describes the router that exists, and the registry gate finds its own - #31
Merged
Conversation
… registry gate finds its own
Two pack files still described a Zig daemon that the product they ship to
retired. Both are rewrites rather than path swaps, which is why they were left
out of 0.9.3 and reported instead.
`docs/REST_API_DESIGN_GUIDELINES.md` §7 taught a six-place route registration
— a `Route` union, a `match()` arm, a spec table, a scope table, an invoke
shim — through files that no longer exist. The router it now describes is built
FROM the route table: `Route::all()` is walked at startup, so a path cannot be
served under a spelling the table does not carry, and adding an endpoint is a
family enum plus its `ALL` entry, a `RouteMeta` row, a handler in a plane
crate, and the generated document. The failure table says which of those fail
loudly and which one — a variant missing from `ALL` — is silent and answers
404. Guards replace the middleware policy table, `RouteClass` and `Scopes` join
them, and `Ownership` is written down for the first time: it is derived from
the template, so the cross-tenant check a Zig handler had to remember by hand
is not a thing a handler can forget. §8 describes an axum handler taking the
extractors it reads and returning `Result<Response, Refusal>`; §4 and §5 stop
naming `hx.ok` and `hx.fail`. The base is the product repo's own copy, which
had already been corrected in place and would have been overwritten by an
update.
`audits/error-codes.sh` hard-coded one repository's registry path, source globs
and allowlist — the debt its own header acknowledged and named the fix for. All
four are resolved at run time now, from `ORLY_ERROR_*` or by autodetection:
Rust where something declares `ErrorCode::declare("<PREFIX>-…")`, Zig where an
`error_registry.zig` exists, and a repository with neither SKIPS with a reason
rather than hard-exiting or passing vacuously. Two findings the Rust runtime
forced: unit tests live inside the file they cover, so `#[cfg(test)]` blocks are
skipped by brace depth the way the UFS gate already does; and a doc comment
naming a retired code is prose, not a call site, so comment lines leave the
USED set.
Verified on macOS bash 3.2: `make audit` green — fixture evals 43/43, parity
10/10, ledger 23/23. Against the product repo the rewritten gate autodetects
its Rust registry and reports `172 declared`, which is the number that proves
it found the registry rather than scanning nothing; against a repository with
no registry it skips with a reason and exits 0. `docs/RULE_ENFORCEMENT.md`
regenerated by the command the audit named.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BSLUVqAJkk9Yj3TfSC3U2Z
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
The two files 0.9.3 deliberately left. Merging this publishes 0.9.4.
docs/REST_API_DESIGN_GUIDELINES.md§7 taught a six-place route registration through files that no longer exist. The router it now describes is built FROM the route table:
Route::all()is walked at startup, so a path cannot be served under a spelling the table does not carry. Adding an endpoint is a family enum variant plus itsALLentry, aRouteMetarow, a handler in a plane crate, and the generated document — and the failure table says which of those fail loudly and which one is silent.Guardreplaces the middleware policy table.RouteClassandScopesjoin it.Ownershipis written down for the first time: derived from the template, so the cross-tenant check a handler used to call by hand is not a thing a handler can forget.§8 describes an axum handler taking the extractors it reads and returning
Result<Response, Refusal>. §4 and §5 stop naminghx.okandhx.fail.The base is the product repo's own copy, which had already been corrected in place and would have been overwritten by the next
orly update.audits/error-codes.shThe script hard-coded one repository's registry path, source globs and allowlist — the debt its own header acknowledged and named the fix for. All four now resolve at run time from
ORLY_ERROR_PREFIX,ORLY_ERROR_REGISTRY,ORLY_ERROR_SOURCESandORLY_ERROR_ALLOWLIST, or by autodetection: Rust where something declaresErrorCode::declare("<PREFIX>-…"), Zig where anerror_registry.zigexists. A repository with neither skips with a reason instead of hard-exiting or passing vacuously.Two findings the Rust runtime forced:
#[cfg(test)]blocks are skipped by brace depth, the same shapeaudits/ufs.shalready uses.Verification
macOS bash 3.2:
Against the product repo the rewritten gate autodetects its Rust registry and reports
registry (rust): 172 declared— the number that proves it found a registry rather than scanning nothing. Against a repository with none it printsskipped — no UZ-* registry foundand exits 0.🤖 Generated with Claude Code
https://claude.ai/code/session_01BSLUVqAJkk9Yj3TfSC3U2Z