Skip to content

Wire supported domains into doctor#76

Open
jmcte wants to merge 4 commits into
mainfrom
codex/issue-8-supported-domains
Open

Wire supported domains into doctor#76
jmcte wants to merge 4 commits into
mainfrom
codex/issue-8-supported-domains

Conversation

@jmcte
Copy link
Copy Markdown
Contributor

@jmcte jmcte commented May 23, 2026

Summary

  • Adds supportedDomains to the persisted APW config shape and preserves it across config rewrites.
  • Makes apw doctor read configured domains and validate their AASA responses, while retaining APW_AASA_DOMAINS as a CI/manual override.
  • Keeps doctor domain discovery non-destructive: malformed user config is preserved while supportedDomains are read with a best-effort parse.
  • Rejects AASA responses that redirect, are not served as application/json, or omit a non-empty webcredentials.apps array.
  • Updates the domain expansion playbook and adds unit plus CLI-level regressions for configured-domain validation.

Closes #8.

Verification

  • cargo fmt --manifest-path rust/Cargo.toml -- --check
  • cargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warnings
  • cargo test --manifest-path rust/Cargo.toml doctor::tests::associated_domains_check_preserves_invalid_config_when_env_unset -- --nocapture
  • cargo test --manifest-path rust/Cargo.toml utils::tests::supported_domain_probe_read_preserves_invalid_user_config -- --nocapture
  • cargo test --manifest-path rust/Cargo.toml doctor::tests -- --nocapture
  • cargo test --manifest-path rust/Cargo.toml --test security_regressions doctor_ci_reports_unreachable_supported_domain_from_config -- --nocapture
  • cargo test --manifest-path rust/Cargo.toml --test security_regressions
  • bash scripts/ci/run-fast-checks.sh
  • git diff --check

Notes

  • This keeps entitlement expansion as a signing/release step: config can narrow the active domain set, but the app still cannot return credentials for domains missing from the signed Associated Domains entitlement.
  • Mutation testing / CRAP indicator coverage remains in the dedicated quality PR; this PR adds issue-specific doctor and security-regression coverage.

Closes #8.

Adds supportedDomains to the v1 config shape, preserves it during config rewrites, and makes apw doctor probe configured AASA domains while retaining APW_AASA_DOMAINS as a CI override. Updates the domain expansion playbook and adds both unit and CLI-level regressions for unreachable configured domains.
@jmcte jmcte requested a review from pheidon as a code owner May 23, 2026 23:30
@athena-omt athena-omt added area:ai AI/model/agent behavior surface. lane:daedalus Daedalus implementation/forge lane. review:athena Athena review governance requested. risk:medium Medium-risk change; normal care required. state:waiting-checks Waiting for CI/check status to settle. status:needs-review PR is ready for Athena review. labels May 23, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d3f3598104

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread rust/src/doctor.rs Outdated
if let Ok(raw) = std::env::var("APW_AASA_DOMAINS") {
return parse_domain_list(&raw);
}
crate::utils::read_config_file_or_empty().supported_domains
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid clearing user config during doctor domain discovery

configured_associated_domains() now reads supportedDomains via read_config_file_or_empty(), which internally calls read_config_file(). That read path invokes clear_config() on several validation errors (for example malformed JSON/schema/host/port), so a diagnostic apw doctor run can now delete ~/.apw/config.json (and potentially keychain-backed secret metadata) instead of remaining read-only. This is a regression from the previous env-only path and can cause data loss when users run doctor specifically to troubleshoot config problems.

Useful? React with 👍 / 👎.

@pheidon pheidon added state:needs-repair PR needs repair before review can proceed. codex:P1 Codex Connector P1 finding. priority:P1 Codex Connector P1; blocks execution until Athena and Ares validate. risk:high High-risk change; validation required. and removed state:waiting-checks Waiting for CI/check status to settle. labels May 24, 2026
@athena-omt athena-omt added the state:waiting-checks Waiting for CI/check status to settle. label May 24, 2026
@jmcte jmcte removed state:waiting-checks Waiting for CI/check status to settle. state:needs-repair PR needs repair before review can proceed. labels May 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ai AI/model/agent behavior surface. codex:P1 Codex Connector P1 finding. lane:daedalus Daedalus implementation/forge lane. priority:P1 Codex Connector P1; blocks execution until Athena and Ares validate. review:athena Athena review governance requested. risk:high High-risk change; validation required. risk:medium Medium-risk change; normal care required. status:needs-review PR is ready for Athena review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: expand associated-domain support beyond the demo domain

3 participants