fix(status): report the repo's own origin host in status --json, not the auth target #459

Merged
hexajon merged 1 commit from issue-429-status-host into main 2026-08-27 04:40:20 +00:00
Owner

Summary

madtea status --json set .host to the configured/authenticated server host instead of the current repo's own origin remote host, so a clone whose origin points at a different forge than the auth target reported the wrong host (.owner/.repo were already correct). The cwd path in repoIdentity now resolves the origin host first (ADR 0025 origin-first chain) via a new statusOriginHost seam and the shared config.ParseRemoteHost, and only falls back to the configured host when the repo has no origin. The dir path (madt_status dir=) drops its hand-rolled URL parser and reuses the same shared parser, so both surfaces report the same host for the same origin, an explicit port included, and a latent port-drop on ssh://git@host:PORT is fixed. Credentials are stripped on every path. Adds regression tests: origin-host-wins-over-auth, no-origin fallback, credential strip, and port preservation on both paths.

Closes #429

## Summary `madtea status --json` set `.host` to the configured/authenticated server host instead of the current repo's own origin remote host, so a clone whose origin points at a different forge than the auth target reported the wrong host (`.owner`/`.repo` were already correct). The cwd path in repoIdentity now resolves the origin host first (ADR 0025 origin-first chain) via a new statusOriginHost seam and the shared config.ParseRemoteHost, and only falls back to the configured host when the repo has no origin. The dir path (madt_status dir=) drops its hand-rolled URL parser and reuses the same shared parser, so both surfaces report the same host for the same origin, an explicit port included, and a latent port-drop on ssh://git@host:PORT is fixed. Credentials are stripped on every path. Adds regression tests: origin-host-wins-over-auth, no-origin fallback, credential strip, and port preservation on both paths. Closes #429
fix(status): report the repo's own origin host in status --json, not the auth target (#429)
Some checks failed
drift / govulncheck (pull_request) Has been skipped
drift / surface-diff (pull_request) Successful in 1m16s
drift / forgejo-smoke (pull_request) Has been skipped
ci / mcp-conformance (pull_request) Successful in 2m16s
ci / mcp-conformance (push) Successful in 3s
drift / govulncheck (push) Has been skipped
drift / surface-diff (push) Successful in -2s
drift / forgejo-smoke (push) Has been skipped
ci / gate (pull_request) Failing after 8m30s
ci / gate (push) Successful in 14m41s
680d1997f4
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
sixfold-space/madtea!459
No description provided.