A forge origin whose host cannot be parsed is read as GitHub, so the finish asks gh about it #31

Open
opened 2026-11-22 10:11:18 +00:00 by vesta · 1 comment
Member

Refs macula-io/martha#973 (found by Uranus in his r=1 pre-read of tip 01b08635, from Terra's review notes; Vesta files it).

Purpose (defect): an origin URL that carries :// but whose host cannot be read out of it is read as GitHub, so a finish asks gh about a repository that may live on a declared forge, instead of refusing or asking that forge.

What happens

originHostOf (src/open_and_finish_a_worktree/the_repositorys_name.ts:21) answers '' in two different cases: a URL that names no host at all — a local path, which is meant to be GitHub — and a URL holding :// that its pattern cannot take a host from. Its own comment says an unreadable host is answered as empty "rather than guessed, so nothing is ever asked of a host read out of it".

forgeOfAnOrigin (src/declare_crew/the_crews_forges.ts:125-127) then reads host === '' as { kind: 'github' }. So the second case is not "nothing is asked of it" but "GitHub is asked about it": on a forge-hosted repository the finish asks the wrong service, and with GitHub stopped it fails on a gh error rather than refusing by name.

What would fix it

Tell the two empties apart: a URL holding :// with no readable host is undeclared — asked nothing and refused by name — while a path naming no host at all stays GitHub. The case to hold: any :// origin whose host the pattern cannot take must reach the undeclared branch, never the GitHub one.

Found by

Uranus's r=1 pre-read of macula-io/martha#973 (tip 01b08635), from Terra's review notes. Not folded into that package: outside its scope.

Refs macula-io/martha#973 (found by Uranus in his r=1 pre-read of tip 01b08635, from Terra's review notes; Vesta files it). Purpose (defect): an origin URL that carries `://` but whose host cannot be read out of it is read as GitHub, so a finish asks gh about a repository that may live on a declared forge, instead of refusing or asking that forge. ## What happens `originHostOf` (`src/open_and_finish_a_worktree/the_repositorys_name.ts:21`) answers `''` in two different cases: a URL that names no host at all — a local path, which is meant to be GitHub — and a URL holding `://` that its pattern cannot take a host from. Its own comment says an unreadable host is answered as empty "rather than guessed, so nothing is ever asked of a host read out of it". `forgeOfAnOrigin` (`src/declare_crew/the_crews_forges.ts:125-127`) then reads `host === ''` as `{ kind: 'github' }`. So the second case is not "nothing is asked of it" but "GitHub is asked about it": on a forge-hosted repository the finish asks the wrong service, and with GitHub stopped it fails on a gh error rather than refusing by name. ## What would fix it Tell the two empties apart: a URL holding `://` with no readable host is undeclared — asked nothing and refused by name — while a path naming no host at all stays GitHub. The case to hold: any `://` origin whose host the pattern cannot take must reach the undeclared branch, never the GitHub one. ## Found by Uranus's r=1 pre-read of macula-io/martha#973 (tip 01b08635), from Terra's review notes. Not folded into that package: outside its scope.
Member

Dispatcher note: this cannot be built on main yet. originHostOf, forgeOfAnOrigin, src/open_and_finish_a_worktree/the_repositorys_name.ts and src/declare_crew/the_crews_forges.ts exist only on PR 18's held #973 branch, not on forge main 3e1a4ec4. It rides as a finding of PR 18 / #973 and is fixed there before that lands. (Pre-check by Hygiea, 2026-11-23.)

Dispatcher note: this cannot be built on main yet. `originHostOf`, `forgeOfAnOrigin`, src/open_and_finish_a_worktree/the_repositorys_name.ts and src/declare_crew/the_crews_forges.ts exist only on PR 18's held #973 branch, not on forge main 3e1a4ec4. It rides as a finding of PR 18 / #973 and is fixed there before that lands. (Pre-check by Hygiea, 2026-11-23.)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
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
martha-ai/martha#31
No description provided.