feat(deep-link): Phase 1 — parser, config, cwd validation#5041
Merged
Conversation
bug-ops
enabled auto-merge (squash)
June 7, 2026 18:19
bug-ops
force-pushed
the
deep-link-phase-1
branch
2 times, most recently
from
June 7, 2026 18:51
4770727 to
67d0a7b
Compare
Add the deep-link feature foundation per spec-066 and fix the INV-TRUST type reference in the spec (closes #5030). New `deep-link` Cargo feature; included in the `desktop` bundle, excluded from `default`. - `parse_deep_link(uri)` — sync, panic-free, no I/O, no zeph-* deps - Percent-decodes all query params via the `url` crate - Enforces 8192-byte prompt cap (post-decode) - Rejects C0 control chars / ESC / NUL in prompt (H-1) - Drops `auto`/`-y` params with WARN log (INV-NOAUTO) - 13 unit tests + proptest fuzz (100k inputs, no panics) - `DeepLinkConfig` with explicit `Default` (`confirm_before_prompt = true`) - `AcpPreference` enum (`never` / `auto` / `always`) - Added to top-level `Config` with `#[serde(default)]` - Migration step 61: injects `[deep_link]` advisory block into existing configs; idempotent - `validate_deep_link_cwd` in `src/url_scheme/validate.rs` - Follows INV-CWD step order exactly: absolute → canonicalize → case-fold → denylist → allowlist → is_dir - Expanded denylist: Linux (+`/etc`, `/root`, `/boot`, `/run`); macOS (+`/System`, `/Library/Keychains`); Windows (`SystemRoot`/`WINDIR`) - Gated under `#[cfg(feature = "deep-link")]` in main.rs Replace non-existent `TrustLevel::Untrusted` with `ContentTrustLevel::ExternalUntrusted` from `zeph-sanitizer` in spec §6. Add Phase 1 deferral note: `QueuedMessage` trust enforcement is wired in Phase 2 (runner.rs dispatch arm). Remove `DeferredHost` error variant; unknown hosts (including future deferred actions) map to `UnknownHost`. Closes #5011 Closes #5030
MIGRATIONS registry now contains 62 steps: 61 (knowledge) added in main via #5040, plus 62 (deep_link) from this branch.
bug-ops
force-pushed
the
deep-link-phase-1
branch
from
June 7, 2026 19:01
67d0a7b to
715e94a
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.
Summary
parse_deep_linkURI parser (zeph-common),DeepLinkConfig+ migration step 61 (zeph-config),validate_deep_link_cwd(src/url_scheme) with INV-CWD-compliant denylistTrustLevel::UntrustedwithContentTrustLevel::ExternalUntrustedfromzeph-sanitizer; remove deadDeferredHosterror variant; add Phase 1 deferral note forQueuedMessagetrust enforcementWhat changed
Cargo.tomldeep-linkfeature; added todesktopbundlezeph-commonparse_deep_link— sync/panic-free URI parser; C0 control-char rejection; proptest fuzzzeph-configDeepLinkConfig(confirm_before_prompt = truesecure default); migration step 61src/url_schemevalidate_deep_link_cwdfollowing INV-CWD; expanded denylist (Linux/macOS/Windows)specs/066-deep-link-schemeDeferredHostremoved;PromptContainsControlCharsaddedCHANGELOG.md[Unreleased]sectionTest plan
cargo nextest run -p zeph-common -p zeph-config --features deep-link— 1191/1191 passcargo nextest run --features deep-link -p zeph— 498/498 passcargo +nightly fmt --check— cleancargo clippy --workspace -- -D warnings— cleanRUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps -p zeph-common— cleanRUSTDOCFLAGS="--deny rustdoc::broken_intra_doc_links" cargo doc --no-deps -p zeph-config— cleanDeferred to Phase 2
zeph url-open,zeph url-scheme register/unregister)runner.rsdispatch arm, INV-TRUST enforcement at enqueue time)Opened via zeph://new-session).desktop, Windows registry, macOS LaunchAgent)Closes #5011
Closes #5030