Repository navigation
Harden display sanitizing, retry cap, and host create --code-lifetime - #198
Merged
Merged
Conversation
sanitize_for_display replaced only Cc control characters, so bidi
overrides/isolates/marks and zero-width spaces from API-supplied names
reached tables, detail views and the delete prompt; a host named
"web\u{202E}dorp" displayed as "webprod". They are now replaced with
spaces too; ZWJ/ZWNJ stay for emoji sequences and scripts that need them.
Retry-After was capped at 60s before jitter was added, so one retry could
wait up to 90s. MAX_RETRY_DELAY_SECS now caps the total.
host create --code-lifetime accepted any u64; it now has the same
60..=604800 range as host enroll-code, so an out-of-range value is a
local ERR_USAGE instead of an API error after resolving credentials.
Also: parse_tag's doc matches its first-colon split, AuthLock's
dead_code suppression is an #[expect] with a reason, and a
reviewer-directed paragraph left render_host_create_human's doc.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
jasikpark
force-pushed
the
fix/sanitize-hidden-format-chars
branch
from
November 21, 2026 20:16
a7947b6 to
caa75b9
Compare
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 from a review of
src/, each checked against the code before changing it.sanitize_for_displayreplaced only control characters (Cc). Bidi overrides, isolates and marks and zero-width spaces passed through, so a host namedweb\u{202E}dorpdisplayed as "webprod" indn host delete's confirmation prompt. They now become spaces like control characters do; ZWJ and ZWNJ are kept. The proptest generator now draws these characters, and two unit tests pin the disguised name and a ZWJ emoji sequence.Retry-Afterwas clamped to 60s and then up to 50% jitter was added on top (up to 90s per retry).MAX_RETRY_DELAY_SECSnow clamps the total.host create --code-lifetimerange. Same60..=604800parser ashost enroll-code;--code-lifetime 10now exits 2 withERR_USAGEbefore credentials are resolved.parse_tagdoc,#[expect(dead_code, reason = …)]onAuthLock, and a reviewer-facing paragraph dropped fromrender_host_create_human's doc (AGENTS.md comment rules).Considered and not changed: a suspected failure of
tag edit --descriptionon tags without a description. A livedn tag list --jsonshows the API returns"description": ""rather than omitting the field.Left for discussion: whether an unreadable/newer-version
auth.jsonshould block aDEFINED_API_KEYcall (the current doc says skipping it is intended), and howwrite_privateshould treat a dangling symlink atauth.json.Validation:
cargo fmt --check,cargo clippy --locked --all-targets -D warnings,cargo test --locked(all pass locally).cargo mutants -D <this diff>: 16/16 caught. Two things cargo-mutants can't mutate are pinned by their own tests, each checked to fail when its code is removed: every character inis_hidden_format's list (plus ZWJ/ZWNJ kept), and the--code-lifetimerange on bothhost createandhost enroll-codewith no request sent.🤖 Generated with Claude Code