The crew landing tools read only the github.com origin and gh: a forge-homed repo cannot be batched or landed by the tool #8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose (defect): the crew's landing tools work on a repository whose home is the forge, so a batch is built, checked and landed by the tool, not by hand.
The class
Crew tools that read or write a repository take its home to be the github.com
originof the workspace clone and GitHub's API throughgh. Since DECIDED 2026-11-21 "move all our work off Github", the forge (git.macula.io) is where the work lives, and the shared gh account answers "HTTP 403: Your account was suspended". So each such tool either fails or, worse, sends traffic to GitHub while the crew is told to send none.Read at macula-io/martha
3479a491:src/land_passed_work_as_one_batch/land_passed_work_as_one_batch.ts:217,:533,:586rungit fetch origin;src/read_the_origin_a_clone_has/read_the_origin_a_clone_has.ts:77takes the repo and default branch fromorigin.src/find_the_work_a_verdict_passed/find_the_work_a_verdict_passed.ts:100finds the PR withgh api repos/<repo>/commits/<head>/pulls.['fetch', ... 'origin']is inopen_and_finish_a_worktree.ts(crew_worktree_create / crew_worktree_finish),check_a_range_before_the_owner_says_yes.ts(crew_verify_range),the_commits_a_handoff_names.ts(the HANDOFF/VERDICT sha check) andrun_an_owner_signed_command/signed_base.ts.The instance
2026-11-22, macula-apps/martha-board: Mars asked for crew_land_batch on forge PR 2 (P4 of #2, 5ed27607) + PR 3 (#7 part b, dfa59b27) on main 7e9eb42b. The workspace clone's
originis github.com, so the tool would have fetched from GitHub and asked GitHub for the PRs. Terra built the same batch by hand on the forge clone (terra/batch-p4-7b at 8c46083b, forge PR 10). The VERDICT/HANDOFF sha check also refused shas until the branch was fetched by hand from the clone'sforgeremote into the github.com clone.Done when
/repos/{o}/{r}/pulls, matchinghead.sha), with noghcall and no github.com fetch.A check fails by name when any of these tools, run against a clone whose home is a Forgejo URL withCUT by the Supervisor (B11), relayed by Mars 2026-11-23: "the new "fails by name" check is CUT (B11; the landing-path tests cover the harm)". Raf can overrule.ghabsent from PATH, callsghor fetches from github.com. (This is a new check: it needs Raf's yes before it is built, per DECIDED 2026-11-19 "No new checks without your yes (Recommended)".)Same class on the crew-code side: macula-io/macula-sponsors#4 (crew_worktree_create always fetches origin and takes no base) and macula-io/macula-sponsors#5 (the SendMessage sha check fetches github.com and is tied to the package repo). This issue covers martha's src/ copies; those cover the crew mod. Build them as one fix, not twice. Until it lands, batches are built by hand: every commit listed (sha + subject), the base read from forge main by ls-remote, and the run ids, read by eye by the Supervisor.
Design r=1: landing and batching on the #46 host seam (Venus)
Purpose (defect), restated: a batch on a forge-homed repository is built, checked and landed by the tool, with no
ghcall and no github.com fetch. DECIDED 2026-11-22 "Martha should be able to work with any git hoster": every host call goes through the one adapter that the declared host kind picks. This design adds no second way to choose a host.Seam: PR 50 (
pallas/46-forge-ci-seamata75c4c35, stacked on PR 40), not yet landed. The build stacks on PR 50 and merges it in once if its head moves. Read at forge maind8e33b07.1. What is host-specific today, and what is not
git fetch/push/ls-remote originland_passed_work_as_one_batch.ts:217,526,533,545,573,586,check_a_range…:183,open_and_finish_a_worktree,the_commits_a_handoff_names,signed_baseorigin. Since the workdir moved togit.macula.io(crew.jsonworkdir,former_workdirs: ["github.com"]), each clone's origin is the forge. The issue's instance ran in the old github.com tree.gh api repos/<r>/commits/<head>/pullsfind_the_work_a_verdict_passed.ts:98-102openPullRequestsAt(§2)gh api …/actions/runs?head_sha=and…/runs/<id>/jobscheck_a_range_before_the_owner_says_yes.ts:311,331runsOnTip+ newjobsNamed(§2)land_passed_work_as_one_batch.tsheaderautodetect_manual_merge, which is off by default. martha-board PRs 2/3/10 and martha PRs 4/34/40/51 readmerged=false.2. Two methods added to
TheCiOfAHost(one interface, every adapter)openPullRequestsAtis today'srepos/<r>/commits/<head>/pulls, filtered tostate=open && head.sha===head.jobsNamedis today'sruns/<id>/jobs. Both go through the GitHub adapter's own budget, as #46's reads do. A GitHub landing reads exactly what it reads today.openPullRequestsAtisrepos/<r>/pulls?state=open&limit=50&page=n, matchinghead.shaexactly, with pages bounded asFORGEJO_TASK_PAGESbounds tasks. A page past the bound is awhy, never "none". I probed it live: 19 open on martha,head.shapresent,x-total-countsent.commits/<sha>/pulldoes not fit: it finds only merged PRs, and an open PR's head answers 404 (probed on PR 50's head).jobsNamedis the tasks joinjobsOfalready does, returned as rows instead of a count.jobsOfbecomes the count ofjobsNamedwhen every row has ended, so it keeps one reader.no adapter for <kind>, as #46 has it. That closes #31's class for the landing, because a host that cannot be parsed isno origin host, never GitHub.3. Where the landing picks its adapter
theCiOfAHostFor(asked, repo)reads<clones>/<repo>. The landing works in the clone path it is handed (batch.path,range.path). I split the seam's entry so the same choice runs on a given path:Same fail-closed words, same origin parser.
verify_range,land_batchandfast_forward_after_the_owners_yesreceive the sameTheCiAskedthe send gets (a_crews_tools.ts:919-934), built once and passed to both. Each answer's menu line nameshost=<host> kind=<kind>, so the owner sees which host was read.Failure behaviour does not change (martha#601): a host the seam cannot choose, or an adapter
why, is one notice line, and the passed head still lands. That is today's "gh could not answer". The one new refusal: a clone whose origin repository is not the package's repository is refused by name, as #46 refuses it.4. The PR's merged mark on Forgejo
A
--no-ffpush of the passed head marks a GitHub PR merged. On Forgejo it does so only when the repository hasautodetect_manual_merge: true(aPATCH /repos/{o}/{r}setting; it needs repo admin). Two options:autodetect_manual_mergeon each crew repo. This is a forge setting and needs no code. It sits in the chain menu as one line per repo, under DECIDED 2026-11-22 "add the rules" (the crew administers the forge).The landing does not depend on either: it lands the passed head whatever the PR says. Option (a) only keeps the forge's PR list true.
5. Tests (red first), no new check
find_the_work…: a Forgejo origin, with a stand-in curl answering a pulls page copied from the live answer (per the stand-in rule), yields the PR number. Also: two open PRs give the "more than one" notice; a page past the bound gives a notice;ghabsent from PATH and never called.check_a_range…: a Forgejo origin; runs + tasks copied from live answers; a job not ended is named; noghcall.theCiOfAHostAton a path;jobsNamedon both adapters;jobsOf= count ofjobsNamed.The Done-when's second bullet, a check that fails by name when any of these tools calls gh or fetches github.com on a forge clone, is a new check, so it needs Raf's yes (DECIDED 2026-11-19 "No new checks without your yes (Recommended)"). The tests above are ordinary suite cases, not that check. I ask for it as its own menu line and do not build it without the yes.
6. Not in this package
keep_the_owners_todo_list.ts:300-301(pr_merged/tag_existsviagh): it is not among #8's named tools, and it is on #16's list.crew_worktree_finish's open-PR check reading GitHub is macula-sponsors#29 (crew mod). It can useopenPullRequestsAtonce this lands; a note goes on #29, and nothing is built here.openPullRequestsAtreadsx-total-countand refuses a short read. It does not settle #32's other readers.Refs #46, #8, #31, #32, macula-io/macula-sponsors#29.
Done-when cut: the second line (a new check failing by name when a tool calls
ghor fetches github.com on a forge clone) is CUT. The Supervisor ruled it (B11), relayed by Mars: "the new "fails by name" check is CUT (B11; the landing-path tests cover the harm)". Raf can overrule. The issue body strikes the line. The design (comment 707) keeps its §5 landing-path tests (stand-in curl output copied from live answers,ghabsent and never called), and those are the cover. Saturnus reviews the design, with a fable subagent for the token part. The seam is PR 50.Design r=2: landing and batching on the #46 host seam (Venus)
r=2 answers Saturnus's r=1 FAIL (R1-R3 required, the open choice, notes N1-N7). The lines that changed are marked [r2]. The diff against r=1 is at the end.
Purpose (defect), restated: a batch on a forge-homed repository is built, checked and landed by the tool, with no
ghcall and no github.com fetch. DECIDED 2026-11-22 "Martha should be able to work with any git hoster": every host call goes through the one adapter that the declared host kind picks. This design adds no second way to choose a host.[r2] R3 Seam:
pallas/46-forge-ci-seamat5a936f42or later. That commit expands~/in the token file against the launch's home and passes curl-q, so curl reads no~/.curlrc. At r=1 time it was still unpushed in Pallas's worktree, and the forge's PR 50 head reada75c4c35. The build stacks on5a936f42and merges the seam branch in once if its head moves. Read at forge maind8e33b07.DECIDED cut: the Done-when's "fails by name" check is CUT (the Supervisor's B11, relayed by Mars; Raf can overrule). §5's landing-path tests are the cover.
1. What is host-specific today, and what is not
git fetch/push/ls-remote originland_passed_work_as_one_batch.ts:217,526,533,545,573,586,check_a_range…:183,open_and_finish_a_worktree,the_commits_a_handoff_names,signed_baseorigin. Since the workdir moved togit.macula.io(crew.jsonworkdir,former_workdirs: ["github.com"]), each clone's origin is the forge. The issue's instance ran in the old github.com tree.gh api repos/<r>/commits/<head>/pullsfind_the_work_a_verdict_passed.ts:98-102openPullRequestsAt(§2)gh api …/actions/runs?head_sha=and…/runs/<id>/jobscheck_a_range_before_the_owner_says_yes.ts:311,331runsOnTip+ newjobsNamed(§2)land_passed_work_as_one_batch.tsheaderautodetect_manual_merge, which is off by default2. Two methods added to
TheCiOfAHost(one interface, every adapter)openPullRequestsAtmakes today'srepos/<r>/commits/<head>/pullscall once per head, filtered tostate=open && head.sha===head.jobsNamedis today'sruns/<id>/jobs. [r2 N4] These are the same API paths and the same filters as today. They now go through the GitHub adapter's budget, as #46's reads do, so a GitHub landing asks GitHub the same questions; the calls are not byte-for-byte the same process, because the budget wraps them.openPullRequestsAtreads the open list once per batch ([r2 N7], not once per package):repos/<r>/pulls?state=open&limit=50&page=n. It matches each entry'shead.shaexactly against the batch's full heads.commits/<sha>/pulldoes not fit: it finds only merged PRs, and an open PR's head answers 404 (probed on PR 50's head).why. The transport returns thex-total-countheader beside body and status. It adds%header{x-total-count}to the-wit already writes, which needs curl ≥ 7.84; the transport already requires 8.3. I probed this live: the line reads19on page 1 at limit 50 and on page 3 at limit 7. The new answer shape is{ status, body, total }, wheretotalis''when the header is absent.total, bounded byFORGEJO_TASK_PAGES. A page's length is never the stop, so a server cap under 50 still reads every page.totalwas present, a non-negative integer and the same on every page; every entry parsed (number, state,head.sha); and the count read equalstotal.whyin fixed words:no total count,the total count moved while it was read,an entry this cannot read,the open list lies past the pages read, or the transport's own why.jobsNamed(forgejo) is the tasks joinjobsOfalready does, returned as rows instead of a count.jobsOfbecomes the count ofjobsNamedwhen every row has ended, so it keeps one reader.no adapter for <kind>, as #46 has it. That closes #31's class for the landing, because a host that cannot be parsed isno origin host, never GitHub.3. Where the landing picks its adapter
theCiOfAHostFor(asked, repo)reads<clones>/<repo>. The landing works in the clone path it is handed (batch.path,range.path). I split the seam's entry so the same choice runs on a given path:It keeps the same fail-closed words and the same origin parser, plus three [r2] guards:
repois held toREPObefore anyjoin, so..or an empty segment never reaches a path.the origin names no repository, not a pass (r=1 letnamed === undefinedthrough).git remote get-url --push origin, which appliespushurl/pushInsteadOf) must name the same host and repository as the fetch URL. If it does not, the landing is refused before any push:origin pushes to <host>, not <host>. A forge clone with a GitHubpushInsteadOfcannot send a landing to GitHub.verify_rangeandland_batchreceive the sameTheCiAskedthe send gets (a_crews_tools.ts:919-934), built once and passed to both. [r2 N6]fast_forward_after_the_owners_yesreads no host API: it takes no adapter. It runs the same fetch/push-URL guard (N3), and its existing base-sha check stands.[r2 N5] Before any host is asked, a VERDICT head is resolved in the clone to its full sha (
git rev-parse --verify <head>^{commit}). A short sha that does not resolve, or resolves ambiguously, is refused by name, so a host's exacthead.shamatch never sees a short sha.[r2] R2, a
whyis always UNREAD, never "none". martha#601 stands: the passed head lands, and the owner is still asked. But whenever the host or kind cannot be named, or an adapter answers awhy, the menu line says so on its own line, every time:CI UNREAD on <tip>: <why>, for exampleCI UNREAD on 1a2b3c4: no host kind is declared for git.macula.ioor…: the token file is not 0600: <path>.PR UNREAD for <package>: <why>.A
whynever shows as "no runs", "no jobs" or "no open pull request". Those words appear only when a complete read answered them. A hosts entry that is missing or a token that is 0644 therefore puts UNREAD in front of the owner, never an empty CI that reads like a pass. Each read line also nameshost=<host> kind=<kind>when they are known. The one new refusal stays: a clone of a repository other than the package's is refused by name, as #46 refuses it.4. The PR's merged mark on Forgejo
[r2] Open choice settled (a) (Saturnus backs it). A
--no-ffpush of the passed head marks a GitHub PR merged. On Forgejo it does so only when the repository hasautodetect_manual_merge: true(aPATCH /repos/{o}/{r}setting; it needs repo admin). The chain menu carries one line: setautodetect_manual_mergeon every crew repo on the forge, before the next landing, under DECIDED 2026-11-22 "add the rules".[r2] The seven PRs reading
merged=false, checked against forgemaintoday (2026-11-23):41e8aacc) and martha#51 (d8e33b07). Both are already closed. Forgejo re-checks only on a push to the base, and its API has no "mark merged", so these two stay closed-unmerged. The menu line says that as a known gap and does not promise to fix it.merged=falseis true. Nothing to do.The landing does not depend on the setting: it lands the passed head whatever the PR says.
5. Tests (red first), no new check
find_the_work…: a Forgejo origin, with stand-in curl answers copied from the live pulls pages (body +x-total-count+ status), yields the PR number. Also each of these gives itswhyand aPR UNREADline, never "no open PR":total, atotalthat changes between pages, an unparsable entry, and a list past the page bound.ghis absent and never called.check_a_range…: a Forgejo origin, with runs + tasks copied from live answers; a job not ended is named; [r2 R2] a missing hosts entry and a 0644 token each giveCI UNREAD … <why>; noghcall.theCiOfAHostAton a path; [r2] the N1/N2/N3 guards;jobsNamedon both adapters;jobsOf= count ofjobsNamed; [r2 N5] short sha resolved, ambiguous short sha refused.6. Not in this package
keep_the_owners_todo_list.ts:300-301(pr_merged/tag_existsviagh): it is not among #8's named tools, and it is on #16's list.crew_worktree_finish's open-PR check reading GitHub is macula-sponsors#29 (crew mod). It can useopenPullRequestsAtonce this lands; a note goes on #29, and nothing is built here.openPullRequestsAtno longer assumes it (R1). #32's other readers are not touched here.Refs #46, #8, #31, #32, macula-io/macula-sponsors#29.
Diff r=1 → r=2 (for the diff-only read)
-- github:
openPullRequestsAtis today'srepos/<r>/commits/<head>/pulls, filtered tostate=open && head.sha===head.jobsNamedis today'sruns/<id>/jobs. Both go through the GitHub adapter's own budget, as #46's reads do. A GitHub landing reads exactly what it reads today.-- forgejo:
openPullRequestsAtisrepos/<r>/pulls?state=open&limit=50&page=n, matchinghead.shaexactly, with pages bounded asFORGEJO_TASK_PAGESbounds tasks. A page past the bound is awhy, never "none". I probed it live: 19 open on martha,head.shapresent,x-total-countsent.commits/<sha>/pulldoes not fit: it finds only merged PRs, and an open PR's head answers 404 (probed on PR 50's head).jobsNamedis the tasks joinjobsOfalready does, returned as rows instead of a count.jobsOfbecomes the count ofjobsNamedwhen every row has ended, so it keeps one reader.+- github:
openPullRequestsAtmakes today'srepos/<r>/commits/<head>/pullscall once per head, filtered tostate=open && head.sha===head.jobsNamedis today'sruns/<id>/jobs. [r2 N4] These are the same API paths and the same filters as today. They now go through the GitHub adapter's budget, as #46's reads do, so a GitHub landing asks GitHub the same questions; the calls are not byte-for-byte the same process, because the budget wraps them.+- forgejo:
openPullRequestsAtreads the open list once per batch ([r2 N7], not once per package):repos/<r>/pulls?state=open&limit=50&page=n. It matches each entry'shead.shaexactly against the batch's full heads.commits/<sha>/pulldoes not fit: it finds only merged PRs, and an open PR's head answers 404 (probed on PR 50's head).why. The transport returns thex-total-countheader beside body and status. It adds%header{x-total-count}to the-wit already writes, which needs curl ≥ 7.84; the transport already requires 8.3. I probed this live: the line reads19on page 1 at limit 50 and on page 3 at limit 7. The new answer shape is{ status, body, total }, wheretotalis''when the header is absent.total, bounded byFORGEJO_TASK_PAGES. A page's length is never the stop, so a server cap under 50 still reads every page.totalwas present, a non-negative integer and the same on every page; every entry parsed (number, state,head.sha); and the count read equalstotal.whyin fixed words:no total count,the total count moved while it was read,an entry this cannot read,the open list lies past the pages read, or the transport's own why.+-
jobsNamed(forgejo) is the tasks joinjobsOfalready does, returned as rows instead of a count.jobsOfbecomes the count ofjobsNamedwhen every row has ended, so it keeps one reader.no adapter for <kind>, as #46 has it. That closes #31's class for the landing, because a host that cannot be parsed isno origin host, never GitHub.3. Where the landing picks its adapter
@@ -35,31 +44,47 @@
// theCiOfAHostFor(asked, repo) = theCiOfAHostAt(asked, join(asked.clones, repo), repo)