Repository navigation
Use HTTP for Collie's forge operations with the CLI's login - #194
Merged
Merged
Conversation
A host polls `job`, `baseJob`, `retryJob` and `runStatus` for every Run waiting on CI, and each poll spawned several `gh`/`glab` processes. ForgeHttp asks the same routes through the `forges` library instead, with the token read from the CLI the human signed in, so no new credential is introduced and the benchmark on this Machine shows the library no slower than the CLI on either forge. Only `src/forge/` may import the library, and it is loaded lazily so a start that asks no forge never pays for it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The panel and the branch lookups ran gh or glab on every poll and every push; measured on this Machine, asking the forge directly is faster on both forges (GitHub 716 -> 572 ms, GitLab 727 -> 301 ms median for the panel). GitHub's panel is one GraphQL query for every field gh pr view asked for; GitLab's reads the merge request, its approvals and its discussions together. A branch's merge requests are the REST list filtered by source branch, read to its last page. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keep agent launch decisions and deployment polling on ForgeHttp with the CLI's cached login. Preserve unknown protection on failures, page GitLab's protection rules and GitHub's deployments, and keep the caller fixtures answering on their HTTP face.
Use the CLI's cached login for issue publication, review posting and personal merge-request menus. Preserve partial review success and the host's privacy checks without resending uncertain writes.
Read review and release state with the CLI's cached login so release watches reuse HTTP connections. Read back uncertain merge writes without resending them, and bind agent-supplied GitLab pipeline URLs to their host's stored login.
Serialize credential reads by host so normal and stored-login caches cannot race GitLab's rotating refresh token. Keep the stricter token cache separate.
Guard side-effect imports of forges and its subpaths so they cannot bypass the adapter boundary.
Exercise the compiled runner's lazy provider against the existing HTTP fake so an omitted forge dependency fails the smoke gate.
Remove comments that repeat field and parameter names without explaining a constraint.
Prevent workflow tests from reaching fake hostnames on the real network after the transport cutover. Serve both forge models for each scenario, follow model replacements and bound host sessions so a missing fixture cannot stall the suite.
Publish the fixture PID atomically so a reader cannot turn an empty file into process group zero and report that an already stopped child is still running.
added 4 commits
October 23, 2026 15:29
Avoid missing the startup barrier when a new process has not yet published the command line and environment the old proc reader matched. Gate the real spawner directly, release it on test cleanup and assert that another Run's processes survive the stop.
Require the complete version-marker line so a temporary path containing v2 cannot suppress the fixture's tool upgrade. Keep such a path in the baseline regression so both workflow variants prove the check runs again after the upgrade.
Finish repository cleanup inside each test's Effect scope before its promise resolves. Pure snapshot tests no longer allocate a Git fixture, and filesystem tests no longer rely on separate cleanup hooks racing the suite's leak check.
madskronborg
pushed a commit
that referenced
this pull request
Oct 23, 2026
#194 made the host's placement need ForgeHttp, which reviewedBranch now gets from the host's services as checkoutReviewed does, and gave worldWith an adapters object.
madskronborg
added a commit
that referenced
this pull request
Oct 26, 2026
madskronborg
added a commit
that referenced
this pull request
Oct 26, 2026
) * Offer a review's fix only where it can run, and log a refusal once A review offered Fix findings for a target with no branch to fix, refused every answer the same way, and replays wrote the refusal again each time. The review now asks the host before its first menu whether the reviewed branch can be established, by the checkout's own resolution and cutting nothing, and withholds what cannot run, naming why. A fix refused when it starts stands for the rest of the Run, and each refusal is recorded inside the Activity that met it. Closes #185. * fixup! Offer a review's fix only where it can run, and log a refusal once * fixup! Offer a review's fix only where it can run, and log a refusal once * fixup! Offer a review's fix only where it can run, and log a refusal once * Wait for a held check's record before ending its host in tests The host writes a check's running-checks record only after spawning it, but the tests ended or restarted the host as soon as the child noted its pid. On a loaded machine the record was not there yet, so the next host found the check by its markers alone and the record count was zero. Both tests failed on master the same way. * Rerun the gate now desktop dependencies are installed The gate's check failed at 064b000 only because this worktree had no desktop/node_modules, which master's typecheck now reads. Installing them changes nothing git tracks, and Collie does not rerun a Run's check on a tree it already failed on. * Write a parked reason by renaming it into place A reader that found the file between its creation and its write read an empty reason, which failed the idle-budget test in CI and would show the board a Run parked for nothing. * Keep git's detached maintenance out of test repositories Git 2.47+ (CI has 2.55) detaches the maintenance a commit starts, so it can still be writing into a test's repository after a fast test removed it, and the suite reports the directory as left behind. * Fit the reviewed branch and its test to master's forge and test APIs #194 made the host's placement need ForgeHttp, which reviewedBranch now gets from the host's services as checkoutReviewed does, and gave worldWith an adapters object. --------- Co-authored-by: Mads Kronborg <mk@cego.dk>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Move Collie's GitHub and GitLab reads and writes to cached in-process
forgesproviders using the existinggh/glablogin. This removes repeated CLI startup from CI, merge-request and release polling while preserving forge behavior, credential refresh and safe write handling. CLI commands remain for agent instructions, credentials and repository setup. The fake forge now serves HTTP to spawned hosts as well as in-process callers.Verified on
336f9503by GitHub CI: all four jobs passed. The full suite passed 4,364 tests with zero failures and 11 existing optional live-harness skips; build, smoke and the pinned herdr contract check also passed. Focused local checks through Collie passed 284 baseline cases and 244 forge/release/verification cases under CI's Bun 1.4.4 and four workers, plus typecheck, lint and formatting.The earlier Collie
checkgate passed on92e08921before the CI repairs and master integration; that historical gate is not offered as proof of the new tree. Current-head CI verification is recorded asci-integrated-github.Required verification:
The changes after the last review have the test and gate evidence described above but were not re-reviewed:
# v2marker so temporary paths cannot suppress the intended upgrade; retain a deterministic path regression.One non-blocking finding remains:
test/desktop-peers.test.ts:65times out when run from sources because its upgrade fixture copies Bun rather than the complete source command. This reproduces on released baseb4ef74af; the compiled test and complete final gate pass.Not settled by the run
Recorded implementation assumptions
runargument is no longer used by the four moved operations.forgesis imported lazily inside src/forge/http.ts so a start that asks no forge never loads it (docs/internals.md keeping a start fast); smoke greps the binary for it because of that.env -u GITLAB_TOKEN -u GITLAB_ACCESS_TOKEN -u OAUTH_TOKEN, cached under its own key, so an environment token is never sent to a host from agent-supplied text.glab auth statusfirst), so its red was shown by mutating the guard rather than on the base.<Display> answered <status>: …,could not be reached) but their wording now comes from the HTTP answer rather than CLI stderr.COLLIE_FORGE_APIis the name of the base URL a test points a host at to reach the fake's HTTP face; unset in production.cego/colliewith a check left to CI, the card shows the job's state as before.cego/collie, the card's panel shows the pull request's checks, review decision and auto-merge as before.not pushed: auto-merge is on for <url>.cego/colliepull request shows its deploy line as before.self-improveoncego/colliefiles an issue and comments on one, and the Run's record has their URLs.cego/colliepull request leaves one comment and an approval.cego/colliereads its review, replies to a comment and merges as before.The recorded ticket-01 smoke assumption was superseded during review: the final smoke exercises the compiled CLI against the HTTP fake and checks its response and request. Ticket 05 completed the review/release operations deferred by ticket 04.