Skip to content

fix(advisor): prevent unsafe repository auto-detection#810

Draft
wattswolf wants to merge 3 commits into
mainfrom
fix/ak-411-safe-advisor-repo-detection
Draft

fix(advisor): prevent unsafe repository auto-detection#810
wattswolf wants to merge 3 commits into
mainfrom
fix/ak-411-safe-advisor-repo-detection

Conversation

@wattswolf

@wattswolf wattswolf commented Jul 24, 2026

Copy link
Copy Markdown

Summary

  • require an exact case-insensitive owner/name match before advisor auto-scopes to a connected repository
  • fall back to organization-level querying for name-only, missing, or duplicate exact matches
  • centralize bounded git remote get-url origin execution for advisor scope, sticky scope, sync caching, and sync telemetry
  • add regression coverage for unsafe name-only inference, duplicate exact matches, detached HEAD handling, and the shared Git helper

Why

AK-411 follows up on review feedback from actual-cli #807. The prior name-only fallback could silently scope an advisor query to an unrelated connected repository with the same name. Three other call sites also carried near-identical origin-remote subprocess implementations.

Jira: AK-411

Validation

  • cargo fmt --check
  • cargo clippy -- -D warnings
  • cargo build --release
  • exact CI coverage workload: 3,012 instrumented library tests plus all configured integration targets passed
  • per-file LCOV enforcement: 97/97 files at 100% line coverage
  • cargo test -p tui-test --lib: 222/222 passed
  • Claude Code adversarial review of exact head 50d532e43347e78e5433b9bf2ef393b200137cd3: PASS, zero findings
  • production review skill: no actionable defects; hosted exact-head checks intentionally remain the final gate

Risk and rollback

Risk is limited to repository auto-detection and shared origin lookup. A lookup failure or non-exact match degrades to the existing organization-level query. Rollback is a revert of the three commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant