engine sync on the forge: the gate without upstream's GitHub run #13
Loading…
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 (platform): the engine sync's gate is defined without upstream's GitHub CI run, so the sync runs on the forge, once a day, and upstream syncs resume.
Why this exists
martha-ai/martha-engine#11 put the fork's own workflows in
.forgejo/workflows/, which the forge reads instead of.github/workflows/. Upstream'sci.ymltherefore no longer runs on the forge, and the sync's second gate,upstream-ci, dispatched it withgh workflow run ci.yml --ref "$BRANCH"on GitHub and watched it there. GitHub is closed to the crew and the sync must call it for nothing, so the gate cannot be carried over as it stands. This is a decision about what the sync proves, not a port.Upstream syncs pause until this lands.
.github's own copy of the sync is inert on the forge once.forgejoexists, and it stays byte-identical upstream's.Ruling
RULED (Supervisor, 2026-11-26, via Mars): option (c), run now as an exception to the week rule.
DECIDED 2026-11-26 "shouldn't an upstream sync happen daily?" (Raf): yes, the forge sync gets a daily
schedule:.Scope
ci.ymlgoes under.forgejo/workflows/, and it triggers onworkflow_dispatchONLY. With upstream's own push and pull_request triggers it would run its jobs on every pull request and main push, and undo #11..forgejosync dispatches that copy on the forge instead of on GitHub..github's copy of the sync stays byte-identical and is not touched: once.forgejoexists the forge reads ours, and GitHub is not the crew's to call..forgejosync triggers on a dailyschedule:(04:00 UTC, off-peak for host00) plusworkflow_dispatch. When upstream has no new commits it exits early: no test dispatch, no pull request.if: github.server_url == 'https://github.com'in.github/workflows/martha-engine-sync.yml, and each needs a forge form:merge(line 31), which merges upstream and sets the sync outputchecks(71), which calls the fork's checks as a reusable workflow atref: ''upstream-ci(80), thegh workflow run/gh run watchpairname-the-patch(107), which names the fork's patches on a conflictpull-request(126), thegh api/gh pr createpairpush_the_sync_branch.shalso leans on GitHub's rule that a push made with GITHUB_TOKEN triggers no workflow, and needs the forge's answer.Done-when
Options, as they were put to the ruling
(a) Fold the sync rewrite into #11's shape. The gate is reduced to the fork's checks running on the sync branch, which the forge does automatically, and the sync's GitHub-API jobs are rewritten against the Forgejo API. Cost: the sync stops proving upstream's own CI passes on the merge, and only our four-job
ci.ymlruns on the sync branch.(c) Keep a copy of upstream's
ci.ymlunder.forgejo/workflows/and dispatch that. The gate survives in substance, because upstream's own CI still runs on the sync branch. Cost: a copy has to be kept in step with upstream by the same drift read that.forgejo/workflows/ci.ymlalready needs, and it is a reusable-free copy of a 15-job file.Refs martha-ai/martha-engine#11, martha-ai/martha-engine#8, macula-io/forge-setup#60, macula-io/forge-setup#63
The dispatch right is proven, before the first real sync
Mars asked for this number after the land; it arrived early, on a throwaway probe rather than on a sync run.
A
workflow_dispatch-only probe (run 5235, task 17398, branchpluto/13-probe-the-run-token, since deleted) called the dispatch endpoint from inside a forge job, with the token the sync itself will use:400 naming the missing ref is the answer a caller that is ALLOWED to dispatch gets; a refused one gets 403. So a job's own token can dispatch, under the
actions: writetheupstream-cijob declares, with no user token and no secret:POST /actions/workflows/upstream-ci.yml/dispatcheswithreturn_run_infowill answer 201 and the run id. The bogus ref was deliberate, so the probe started no run and cost one task.Two smaller things the same run shows:
runs-on: ubuntu-latesthere isdocker.io/library/node:22-bookworm, so theapt-getpre-steps the copy carries are the right shape; and the job-log route/<o>/<r>/actions/runs/<index>/jobs/<n>/attempt/1/logsreads on this (public) repository, which is how the above was read.Still to be measured on the first real run after the land, as asked: whether the 285-minute wait holds for 15 uncached jobs (16 tasks, the tls matrix being two) on a three-slot runner where the waiting
upstream-cijob holds one slot for the whole wait.Re-measured on Forgejo 17.0.2, and the dispatch right proven from inside a job
Mars asked for this before the gate is trusted; both halves are done, one of them a task early rather than after the land.
The four shapes the package rests on, measured on 15.0.12 before the upgrade and again on 17.0.2 after it:
/api/v1/version17.0.2+gitea-1.22.0GET /actions/runs/<id>.statusGET /branches/<ref>.commit.id, following the branchPOST /actions/workflows/<file>/dispatchesOne correction to my own instrument, so nobody repeats it: the run object carries no
conclusionkey at all, on 15 or 17. My first check demanded one and reported the shape as moved;dispatch_and_watch_the_run.shalready reads.conclusionwhen it is there and falls through to.status, so nothing in the package changed. 17 also addsGET /actions/runs/<id>/jobs(a bare array) andGET /actions/jobs/<id>/logs. The package calls neither, so the jobs route's shape change has no caller here to break.The dispatch right, which was the one assumption that could have sunk a five-hour gate: a
workflow_dispatch-only probe on a throwaway branch (run 5299, task 22281, branch since deleted, one task, no run started by the dispatch itself) called the endpoint from inside a forge job with the job's own token, under the samecontents: read/actions: writetheupstream-cijob declares:A refused caller gets 403 and an allowed one gets the complaint about the ref, so the sync's own token can dispatch
upstream-ci.ymlwithreturn_run_infoand no user token or secret is involved. The probe fails by conclusion, not by log, so the answer survives a changed log route: the step exits red unless the answer is that 400.Still owed: the 285-minute read, on the first real sync run after this lands. Fifteen upstream jobs are sixteen tasks with the tls matrix, on a three-slot runner where the waiting
upstream-cijob holds one slot for the whole wait. That number goes here.First real sync run: 5321, green in 13 s, and why Done-when 1 is not met yet
Landed as
27d48e8db5df, dispatched2026-11-26T05:00:43Z, run 5321 (run 292), all five jobs.Three things it proved, which is why it is not a wasted run:
if:onneeds.merge.outputs.syncwas honoured: upstream-ci, name-the-patch and pull-request all skipped when the merge named nothing.github.com/aaif-goose/goose.gitfrom inside a forge job, so the thing the sync exists to do is reachable from where it now runs.pick_the_upstream_change: sync/927005e14358 is not finished; a person finishes it first- and the run ended green with no merge, no test dispatch and no pull request, which is Raf's "exits early ... no test dispatch, no PR" applied to a day blocked by an unfinished sync.Why Done-when 1 is not met:
sync/927005e14358(tipfa60a2423, 2026-11-18, "Re-pin Martha to 47bd76f (#5)") is the onlysync/*branch on origin and main never took it, and the one-sync-at-a-time rule blocks every new sync until it is finished or dropped. Deleting it is a delete, so it goes to Raf through the Supervisor; when the yes arrives I delete it and re-dispatch.One finding, not yet a defect. The
checksjob - auses:call - ran althoughneeds.merge.outputs.syncwas empty; three plain jobs read that same output correctly and skipped, so job-levelneeds.*.outputsis honoured for plain jobs but not for auses:job on this forge. The callee then ran with an emptyrefand both of its jobs skipped, the wrapper reporting "resolved without a runner". Underworkflow_callthe callee sees the caller's event,workflow_dispatch, sogithub.event.actionis empty and'' != 'closed'should be true - which makes the emptyrefthe likelier cause. The next real sync's logs decide; if the guard turns out hollow, that is a fold-in brought to Mars before it is made.The 285-minute read still needs a real gate, and goes here with it.
The first real sync's conflict, as the merge job named it
Run 5337 (the first dispatch after the stale branch was cleared) found upstream's new main
51f875e66286, merged it, and conflicted. It undid the merge, named the files and the fork's patches, and pushedsync/51f875e66286at main for a person to finish, which is the designed path. Done-when 1 therefore needs a person to finish this merge, and that is me under Mars's ruling of 2026-11-26.The merge job's own words, unedited:
A correction to my own message: I told Mars "10 fork patches"; the job lists 24. I had read a truncated tail of the log and quoted its count, which is exactly the kind of number that should come from the source. The list above is the job's.
How it will be resolved (RULED, Mars 2026-11-26)
Cargo.lockis never merged by hand: upstream's is taken and cargo regenerates it from the resolvedCargo.tomlfiles, so the gate's build proves it.services.rs,advertised_tools.rsandstreamable_http.rsgo to Mars hunk by hunk before anything is pushed.bundle-windows.yml,maven-sdk.ymland the third the job names), the fork's version is kept only where a martha#601 patch lives in it, and which ones gets said..githubpatches is a scope question for the Supervisor, from Mars; the patch set is not changed in this package.The work is in
/home/rl/work/worktrees/martha-engine-sync-51f875e66286onpluto/sync-51f875e66286, and it reachessync/51f875e66286only as a normal push from that branch, then the sync is dispatched withresume=sync/51f875e66286so the gate itself proves the result.PR 17 is r=2 PASS and green on both runs, and it is with Terra to land.
Mars's r=2 PASS is on
f5bec341a.ci=forgejo:5442,5443, every job green: 5442ci.yml(changes, Check Rust Code Format, Build and Test Rust Project, Lint Rust Code) and 5443martha-engine-checks.yml(The evidence keeps the model server's log, Build the engine and run the fork's checks).Merge-tree against main
40a2b77d2is clean, exit 0, tree7bab46bb, so the land carries one integration merge and nothing to resolve. The base27d48e8dbis an ancestor of the tip.What PR 17 adds, all of it inside the scope above:
jqin both jobs of.forgejo/workflows/martha-engine-sync.ymlthat call the API:upstream-ci, which died atdispatch_and_watch_the_run.sh:32in run 5415, andpull-request, the same gap atreport_the_sync_for_a_pull_request.sh:26;martha/sync/report_the_sync_for_a_pull_request.sh, which the workflow runs by path and which was 100644, so it exited 126.jqis the only tool missing from that container: job 22988 and the run-token probe in run 5299 both randocker.io/library/node:22-bookworm, where curl is present, apt works, andjqis not. Run 5299 is also proof that a job's own token can dispatch. The workflow header andmartha/sync/README.mdname the step.What the run after the land proves, and what it does not
After the land, one dispatch of
martha-engine-sync.ymlfrom main withresume: sync/51f875e66286. That run is Done-when 1 here, and its run ids are appended to this issue when it finishes.It does not meet martha-ai/martha-engine#15's Done-when 3. This dispatch is a resume of a branch a person already finished:
0cfe816acis the resolution commit, so this sync needed a person. #15 therefore stays open, and its Done-when 3 is the first daily sync that carries an upstream.github/workflowschange and merges it with no person at all. That is now provable, because #15 has upstream's.githubbytes back to upstream's own.PR 17 landed: main is
b5af6bc3e3, a merge of40a2b77d2bandf5bec341af, which is exactly the tip Mars passed at r=2 and the tip both checks ran on (5442, 5443).The one dispatch is made. Run 5555, workflow
martha-engine-sync.yml,workflow_dispatchon mainb5af6bc3, withresume: sync/51f875e66286(that branch is at0cfe816ac). It iswaitingbehind the single runner now.Done-when 1 is that run ending with its gate green and its pull request merged, so this issue stays open until then; the run's terminal state and every run id it produces are appended here. Nothing else is dispatched: this is the only dispatch this issue gets.
Run record so far, so the next read is not confused by it.
Attempt 1 of the one sync dispatch was run 5555 (with its child, upstream-ci.yml run 5610, on
sync/51f875e66286). Both readcancelled: they were stopped by the crew-wide job cancel of 2026-11-26, in the same sweep at 09:53:06Z that stopped engine runs 5318, 5472 and 5523. Neither the sync workflow nor the upstream CI copy cancelled anything.So this issue has no Done-when run yet. The fresh dispatch waits on two things: the full lift of the freeze, and PR 253 (martha#251, one push queues 8 jobs not 24) being on main.
Refs martha-ai/martha#251.
Per red job of run 5793, which of the two kinds it is. The evidence for each is named.
1. Build and Test TLS Backend (rustls-tls) — kind (b), fix the port.
This is the configuration Martha's members run. The ACP binary is built with
--features rustls-tls,system-keyring,online-model-meta,live-voice(.github/workflows/build-acp.yml:89), andcrates/goose-cli/src/lib.rsrefuses to compile with neither or with both TLS features.Its red is not a container gap and not a code break: 2300 tests passed, one failed,
goose_apps::cache::tests::missing_read_only_cache_entry_still_lists_compiled_default(assertion failed: !app_path.exists()). The forge job container runs as root, root ignores file modes, and that test's premise is a read-only directory. This repo already knows the case and fixes it in the main job, "Build and Test (on the forge, the read-only tests unprivileged)", whose own comment citescache.rs:427 !app_path.exists()and run 1737 task 2265; the TLS job has no such step. Fix is that step, applied here.2. Build and Test TLS Backend (native-tls) — kind (a), switch off.
Same red, same cause, but members run the rustls-tls binary. Native-tls still compiles for the repo's own
just build-lean, and that job ("Build Lean ACP Binary") passed with it. Nothing Martha runs needs this leg.3. Check and Test GDK Agent Crates on wasm32 — kind (a), switch off.
cargo check --target wasm32-unknown-unknown -p goose-agent -p goose-provider-typesand the wasm test loop. A browser/wasm target; members run Linux x64.4. Check goose-sdk UniFFI — kind (a), switch off.
Upstream's cross-language SDK bindings (
uniffifeature build). Martha's members speak ACP to the engine binary; nothing of theirs loads the SDK.5. Check GDK Release Configuration — kind (a), switch off.
python3 crates/goose-sdk/scripts/gdk-release.py check-config: crate membership and publication order for upstream's SDK release.6. Check GDK API Reference is Up-to-Date — kind (a), switch off.
python3 documentation/automation/gdk-api/generate.py --check: generated documentation data for the GDK.So: five of the six go off with upstream's CI, and the one Martha needs is the rustls-tls test leg, which is red for a reason this repo has already met and fixed once.
The package that follows from this: the forge sync stops dispatching
upstream-ci.ymlat all, the upstream copy goes, and the rustls-tls build-and-test becomes a job of the fork's own CI with the unprivileged read-only-test step. No run is touched by me, and no sync is dispatched until that is in.Run 5828 folded in here, because this issue is where the unfinished branch lives.
The scheduled round of 2026-11-27 04:00:53Z (trigger_event schedule, ScheduleID 406) ran on main
96b82a29and finished green in 24 s. It got no further thanmerge: job 24719's log endspick_the_upstream_change: sync/51f875e66286 is not finished; a person finishes it first.checks(24736) reported success with its two inner jobs skipped and an empty log,name-the-patchand the pull-request report skipped, and there is no upstream job any more (martha-ai/martha-engine#18 closed on this run).So Done-when 1 is untouched:
sync/51f875e66286is still at0cfe816acas it was when run 5555 was dispatched at 2026-11-26 07:54Z, and every nightly round now stops atmergeand exits green. The work is the same as this issue already carries: a person finishes the branch, then oneworkflow_dispatchofmartha-engine-sync.ymlwithresume: sync/51f875e66286, and the run ids are recorded here.The sync branch is finished and the one resume dispatch is made.
State found:
sync/51f875e66286already held upstream51f875e66286(the 11-26 merge and its resolution, tip0cfe816ac), but main had moved 6 commits past it since, so it was not ready to land.Done in my worktree (
pluto/sync-51f875e66286, /home/rl/work/worktrees/martha-engine-sync-51f875e66286):96b82a29) into the branch. One conflict,.github/workflows/oi-kit-release.yml(the branch had droppedmaven-central), resolved to main's copy, because martha-ai/martha-engine#15 made.github/workflowsupstream's byte for byte..github/workflowsin the branch is now identical to main, and so aremartha/and.forgejo/.cargo metadata --locked --no-depsexits 0, so the merged lock and manifests agree.0cfe816ac..10a3627d9tosync/51f875e66286.The one dispatch: run 5886,
workflow_dispatchon main,resume: sync/51f875e66286, created 2026-11-27T09:39:20Z. Its checks run on the branch is what Done-when 1 needs; the run's ids are appended here when it is read to a real terminal state (blockedis not terminal on 17).Run 5886 read to a real terminal state: success, created 2026-11-27T09:39:20Z, ended 09:51:37Z, tip
10a3627d9.Jobs: merge 24873 success, checks 24877 success with its inner jobs 24878 (the evidence keeps the model server's log) and 24879 (build the engine and run the fork's checks), report 24876 success, name-the-patch 24875 skipped. There is no upstream job to run.
That the round really checked something, since 5828's green call job skipped every inner job:
refs/remotes/origin/sync/51f875e66286at10a3627d9(log line 71), not main.2430 passed; 0 failed, and both read-only cases passed undersetpriv --reuid=nobody.pickwrites its output to$GITHUB_OUTPUT, so it logs nothing; the Merge and Push steps were skipped, which happens only whenmerged=1and the branch already holds upstream51f875e662. The checks job'srefcomes from that output, so its checkout of10a3627d9is the proof the pick readmerged=1.One stale line found, not changed in this tip: the report job's summary still says "Upstream's CI and the fork's checks passed on ...", which stopped being true when #18 removed the upstream job. The text is in
martha/sync/report_the_sync_for_a_pull_request.sh; it wants the same treatment #18 gave the other sync prose.The pull request is open: PR 20, sync/51f875e66286 into main, mergeable. The land is Done-when 1's last word, so the review is the remaining step.
Done-when 1: one real goose sync ran end to end on the forge, gate green, merged. The run ids.
The land: PR 20 merged as a merge commit (no squash, upstream history kept), main is now
8b865ba1dd, merged 2026-11-27T10:13:13Z. Its first parent is96b82a29and its second is10a3627d9, and upstream51f875e662is an ancestor of main, so the one-sync-at-a-time guard has nothing left to stop on.The sync run itself: 5886, workflow_dispatch with
resume: sync/51f875e66286, created 09:39:20Z, success 09:51:37Z on10a3627d9. Jobs: merge 24873, checks 24877 with its inner 24878 and 24879, report 24876, name-the-patch 24875 skipped, no upstream job. 24879 checked outorigin/sync/51f875e66286at10a3627d9and ran the gate there: S1's checks green, the goose lib's rustls-tls tests 2430 passed and 0 failed, and both read-only cases green undersetpriv --reuid=nobody.The pull request's own runs on
10a3627d9: 5892 ci.yml success (changes 24890, Check Rust Code Format 24891, Build and Test Rust Project 24892, Lint Rust Code 24893) and 5893 martha-engine-checks.yml success (24894, 24895).The landed main push runs on
8b865ba1d, all success:Closing on that. Refs martha-ai/martha-engine#18 (the upstream job's removal, proved here by its absence), martha-ai/martha-engine#15.