Skip to content

Refactor OPENASTROVIZD_SOCKET readiness parsing to explicit URI schemes#78

Merged
seanwevans merged 2 commits intomainfrom
codex/refactor-socket_ready-for-explicit-schemes
Apr 1, 2026
Merged

Refactor OPENASTROVIZD_SOCKET readiness parsing to explicit URI schemes#78
seanwevans merged 2 commits intomainfrom
codex/refactor-socket_ready-for-explicit-schemes

Conversation

@seanwevans
Copy link
Copy Markdown
Owner

Motivation

  • The previous readiness check inferred protocol from target.contains(':'), which was brittle and misclassified Windows paths and other inputs.
  • Require explicit URI schemes to make readiness checks deterministic and easier to validate at startup.
  • Support both TCP and filesystem/unix socket readiness semantics with platform-aware handling for Windows drive-letter paths.

Description

  • Replace ad-hoc inference with a typed ReadinessTarget enum and a parse_readiness_target function that accepts tcp://, unix://, and file:// URIs.
  • Validate tcp:// addresses using ToSocketAddrs and normalize filesystem URIs with path_from_uri (including Windows drive-letter handling), and expose readiness checks via readiness_target_ready used from wait_for_readiness.
  • Make the old socket_ready helper test-only and add unit tests covering scheme-required behavior and parser acceptance/rejection cases.
  • Update README.md, daemon/README.md, and daemon/openastrovizd/README.md to document the accepted OPENASTROVIZD_SOCKET formats with examples.

Testing

  • Ran cargo test -p openastrovizd parse_readiness_target, which executed parser tests and passed (2 passed).
  • Ran cargo test -p openastrovizd socket_ready_requires_scheme, which passed (1 passed).
  • Attempted cargo fmt --all but formatting failed in this environment because rustfmt is not installed for the active toolchain.

Codex Task

@seanwevans seanwevans merged commit cc3b530 into main Apr 1, 2026
@seanwevans seanwevans deleted the codex/refactor-socket_ready-for-explicit-schemes branch April 1, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant