You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Check uuid shape through one helper; python_script's Uuid::parse_str also accepts braced, urn and unhyphenated forms #1845
The last one has drifted. Uuid::parse_str also accepts the 32-hex simple form, {braced} and urn:uuid: forms. So a hosted-URL grant segment that every other recognizer (hosted_patch_url_uuids uses is_canonical_uuid) rejects is accepted there as a uuid.
The CLI also re-tests the core rule with 14 looks_like_uuid_* tests (crates/socket-patch-cli/src/lib.rs L475-L562).
Proposed change
Keep two named rules in one place, patch::path_safety: is_canonical_uuid (path segments the server mints) and is_uuid_shaped (user input, any case).
Delete redact's private copy.
Replace the three Uuid::parse_str(..).is_ok() calls with is_canonical_uuid.
Re-export or move target::is_uuid_shaped there.
Size
4 files in core (plus the import in the CLI). About −30 lines.
Acceptance criteria
Existing target, redact, path_safety and python_script tests pass.
Add one same_hosted_artifact test where a braced or unhyphenated uuid grant segment is not treated as a rotation.
Drop the CLI's duplicated looks_like_uuid_* tests, or keep a single smoke test.
[agent] Triaged: priority:p3 (cross-cutting refactor). Related to the older tracking issue #705 (one utils::uuid grammar). This is one concrete instance of it, not a duplicate.
[agent] Janitor: closing as a duplicate of #705, the older tracking issue for one UUID grammar in core. Both ask for the same change: one named rule (canonical lowercase for server-minted path segments, any case for user input), with the Uuid::parse_str grant checks in python_script.rs replaced by it.
Site list on origin/main 5ca56238, carried over for #705 (several of #705's original sites are gone):
uuid::Uuid::parse_str ×3 in python_script::same_hosted_artifact, crates/socket-patch-core/src/utils/python_script.rs:99-101. These accept simple, braced and urn:uuid: forms that hosted_patch_url_uuids rejects.
14 looks_like_uuid_* tests in crates/socket-patch-cli/src/lib.rs:480-562
Extra acceptance item from here: a same_hosted_artifact test where a braced or unhyphenated grant segment isn't treated as a rotation. Reopen if you want the two tracked separately.
Activity
mikolalysenko commentedon Oct 29, 2026
[agent] Triaged: priority:p3 (cross-cutting refactor). Related to the older tracking issue #705 (one
utils::uuidgrammar). This is one concrete instance of it, not a duplicate.Generated by Claude Code
mikolalysenko commentedon Oct 30, 2026
[agent] Janitor: closing as a duplicate of #705, the older tracking issue for one UUID grammar in core. Both ask for the same change: one named rule (canonical lowercase for server-minted path segments, any case for user input), with the
Uuid::parse_strgrant checks inpython_script.rsreplaced by it.Site list on origin/main
5ca56238, carried over for #705 (several of #705's original sites are gone):utils::target::is_uuid_shaped,crates/socket-patch-core/src/utils/target.rs:329utils::redact::is_uuid_shaped,crates/socket-patch-core/src/utils/redact.rs:79patch::path_safety::is_canonical_uuid,crates/socket-patch-core/src/patch/path_safety.rs:51uuid::Uuid::parse_str×3 inpython_script::same_hosted_artifact,crates/socket-patch-core/src/utils/python_script.rs:99-101. These accept simple, braced andurn:uuid:forms thathosted_patch_url_uuidsrejects.looks_like_uuid_*tests incrates/socket-patch-cli/src/lib.rs:480-562Extra acceptance item from here: a
same_hosted_artifacttest where a braced or unhyphenated grant segment isn't treated as a rotation. Reopen if you want the two tracked separately.Generated by Claude Code