Repository navigation
GitHub: pull request reads and writes - #42
Merged
Merged
Conversation
Red: github.ts has no pullRequest, markPrReady, markPrDraft, commentOnPr, compare or checks yet, so the 38 new cases fail and the file does not typecheck. Issue: #14
tracker/github.ts gains pullRequest, markPrReady, markPrDraft, commentOnPr, compare and checks, each with the argv softfac's github.rs uses. branchTip landed with #12. A ref refused before the call (a `..` in compare, a sha that is not a full id in checks) is a GitHubInvalidArgument, as branchTip and fileAt already do, where softfac reports it as a parse error. Issue: #14
Red: markPrDraft only reads the pull request after a non-zero exit, so a timed out, rate limited or oversized undo on a closed PR is still an error. softfac's mark_pr_draft falls back on every error. Issue: #14
A timed out, rate limited or oversized `gh pr ready --undo` on a pull request that is closed or merged by now is done, as in softfac; one that is still open keeps the original error. Issue: #14
Already green: covers what the several-runs case only asserted by state. Issue: #14
rawphp
marked this pull request as ready for review
October 15, 2026 13:03
Author
|
Factory gate: passed (attempt 1, run by the factory in a fresh checkout of the pull request's head
|
Tests pin the check ranking against a skipped run, the tie between two failed runs, and lookalike GitHub links; the CheckStatus doc says a skipped run keeps its conclusion.
Author
|
Factory gate: passed again (attempt 2, run by the factory in a fresh checkout of the pull request's head
|
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.
Closes #14
Contract
tracker/github.tsgainspullRequest,markPrReady,markPrDraft,commentOnPr,compareandchecks, each with the argv softfac'sgithub.rsuses;branchTipalready landed with GitHub: issue reads and writes through the gh CLI #12. softfac's test cases for these calls are ported togithub.test.tsand pass.vp test run apps/server/src/factory/tracker/github.test.ts→ pass (119)Acceptance criteria
pullRequest reads the real shape with the exact call,pullRequest from a fork and into another base says so,a pullRequest that does not exist is nullmarkPrReady runs gh pr ready,markPrDraft runs gh pr ready --undo, the already-ready / already-draft / closed-or-merged casescommentOnPr appends the markerbranchTiptests)compare asks for the status of the two refs with the exact call,compare reads each status GitHub giveschecks reads the check runs of the commit with the exact calland the ranking, paging, skipped and link casessrc/github.rscases for these calls are ported and pass — 38 cases ported one to one; one argv note belowOne deliberate divergence from softfac: a ref refused before any
ghcall (a..incompare, a sha that is not a full id inchecks) isGitHubInvalidArgument, as the already-landedbranchTipandfileAtdo, where softfac reports a parse error. The argv and every answer are otherwise the same.Gate
vp test run apps/server/src/factory→ exit 0 (19 files, 504 tests)vp run --filter t3 typecheck→ exit 0Run on
44cd981e3. Logs in the run's.factory/gate-1.logandgate-2.log.Models
modelsblock in.dw/config.yml, Tom's roster applied)Review
markPrDraftonly read the pull request after a non-zero exit; softfac does it on every error, so a timed out, rate limited or oversized undo on a closed PR is now done too (32b4a1851,249fae93e).249fae93e): 12 of 12 named mutants killed, none unreached; nit testing-1 taken as44cd981e3.Lessons
--repotogh pr create. Symptom: the draft opened on the upstream repository (pingdotgg/t3code#19893, closed at once with an apology) instead of the fork the issue lives in. Cause: in a fork checkoutghresolves the parent as the default repo forpr create. Default: alwaysgh pr create --repo <owner/repo> --head <branch>with the issue's repo, and read the printed URL's owner before reporting it.prefer-catch-tags) only showed up because the maker ranvp linton the two files by hand. Cause: the gate lists tests and typecheck only. Default: after the first green, lint the contract files with the repo's own lint command before Check, so reviewers and CI see the tip that passes it./tmpinstruction for a reference clone yields to § Scratch. Symptom: the issue said to clone the reference repo into/tmp/softfac-ref. Default: clone it under<worktree>/.factory/instead and give reviewers that path; the worktree's removal then takes the clone with it.Commits
9b690bb63test(factory): port softfac's pull request, compare and check-run cases— Make slice (red: 38 failing, file did not typecheck)9a1137638feat(factory): pull request reads and writes through gh— Make slice (green)32b4a1851test(factory): markPrDraft reads the PR state after any failure— Check cycle 1 (red: 1 failing)249fae93efix(factory): markPrDraft reads the PR state after any failure— Check cycle 1 (green)44cd981e3test(factory): a check's conclusion and link come from the deciding run— Check nit (already green)Files
apps/server/src/factory/tracker/github.ts— the six calls, their schemas and typesapps/server/src/factory/tracker/github.test.ts— softfac's cases ported to@effect/vitestNo new seam: both files are under the factory's own directory.
Worktree note: the factory's worktree was cut at
e4bcce9f6, behindorigin/mainafter #12 and #39 merged; it was fast-forwarded to952129a80before any write. Labels: all sevenfactory:*labels already existed; none created.