ADR 0025 T7: session forge — workspace scan with fail-closed ambiguity #33

Closed
opened 2026-07-13 15:57:07 +00:00 by hexajon · 0 comments
hexajon commented 2026-07-13 15:57:07 +00:00 (Migrated from codeberg.org)

Add internal/config/sessionforge.go and insert at the marked point in the T4 chain (// (ADR 0025 §3 session-forge scan inserted here by sessionforge.go)), active only when cwd is not inside a git repo:

  • scanChildOriginHosts(root) []string — unique sorted origin hosts of immediate child repos (skip symlinks, .git, remoteless).
  • Unanimous host → session forge (https://<host>), source "workspace scan" — outranks global.
  • Mixed hosts + global madtea.url set → global wins (tie-break; keeps the error's remedy honest). Mixed + no global → ErrAmbiguousForge{Hosts}: ambiguous forge: found <h1>, <h2> — pass dir= or set madtea.url. Empty scan → global fallback.
  • Expose the chain as a testable helper if needed for URL-only assertions.

Depends on: T5 (both touch the chain region; land T5 first).

Acceptance: table-driven workspace fixtures (unanimous/mixed±global/empty/remoteless-child) green; ADR 0022 guard cases still pass.

Part of #30.

Add `internal/config/sessionforge.go` and insert at the marked point in the T4 chain (`// (ADR 0025 §3 session-forge scan inserted here by sessionforge.go)`), active only when cwd is not inside a git repo: - `scanChildOriginHosts(root) []string` — unique sorted origin hosts of immediate child repos (skip symlinks, .git, remoteless). - Unanimous host → session forge (`https://<host>`), source "workspace scan" — outranks global. - Mixed hosts + global madtea.url set → global wins (tie-break; keeps the error's remedy honest). Mixed + no global → `ErrAmbiguousForge{Hosts}`: `ambiguous forge: found <h1>, <h2> — pass dir= or set madtea.url`. Empty scan → global fallback. - Expose the chain as a testable helper if needed for URL-only assertions. Depends on: T5 (both touch the chain region; land T5 first). Acceptance: table-driven workspace fixtures (unanimous/mixed±global/empty/remoteless-child) green; ADR 0022 guard cases still pass. Part of #30.
Sign in to join this conversation.
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#33
No description provided.