Repository navigation
test: the gh simulator writes (#87) - #92
Merged
Merged
Conversation
glennfaison
changed the base branch from
feat/gh-simulator-read-paths
to
main
November 10, 2026 01:04
Part of #60. issue edit|close|create|comment|reopen, pr edit|create|comment|merge and label create change the world file through applyEffects, so diffWorlds reads a run back as the effects it had. A call is checked before it writes and a failed call leaves the file as it was. A create_* effect can carry the new item's title, body, creation time, author and branch as data, and a close its reason. Co-authored-by: Claude <noreply@anthropic.com>
glennfaison
force-pushed
the
feat/gh-simulator-write-paths
branch
from
November 10, 2026 01:05
7f71f2f to
8442440
Compare
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 #87. Part 2 of 3 of #60 (next: #88).
Stacked on #90. The base is
feat/gh-simulator-read-paths, so this diff shows only the write paths. When #90 merges and its branch is deleted, GitHub retargets this PR tomain.What
The
ghsimulator now writes:issue edit|close|create|comment|reopen,pr edit|create|comment|mergeandlabel create, with every flag the skills use (--add-label,--remove-label,--add-reviewer,--body-filefrom a path or stdin,--reason,--comment,--match-head-commit,--squash|--merge|--rebase,--delete-branch,--color,--description,--force, ...).tests/sim/surface.mjsmoves these fromplannedtosupported; onlyapiis stillplanned.applyEffects, the function the checker uses. So a run made of these calls is read back bydiffWorldsas the effects it had, andapplyEffects(before, diffWorlds(before, after))gives the world the run left.ghrefuses: a label outside the catalog ('x' not found), an empty comment, a missing--title/--body, a second open PR for the same branch, a merge with no method or two, a merge pinned to a head that is not the head, a merge of a draft or aDIRTY/BEHIND/BLOCKEDPR, an invalid--reason. Merge messages followgh's source (merge.go).seed.mjscommand to run.<!-- agent:... -->in the body. A ready handoff the run just posted holds the merge lane.A change to the checker's effect model
This touches
scripts/scenario.mjs, so please look at it. A run that opens a PR gives it a title and a body, anddiffWorldsreported both asunmodelled. That would make the checker reject every implement run unless its contract allowed anunmodelledwrite. So:create_issue/create_preffect can carrydata:title,body,createdAt,author,branch. Editing a title or body of an item that already existed is stillunmodelled.closeeffect can carry areason.Both are optional, so no existing scenario changes.
tests/diff-worlds.test.mjshas new tests for each, and the round trip still holds. ADR 0012 and 0014 are updated.Choices worth a look
issue-after-pr.md), with a keep-open rule that GitHub's auto-close would hide, so the simulator leaves it open.issue reopenisunmodelled. No effect op reopens an item, so a run that reopens one needs a contract that allows it.pr createuses the checkout. Branch is--heador the current git branch, and the commit is that branch's, so it runs in a git repository. The issues it closes are the existing ones the body names with a closing keyword.gh's, not copied. The ADR says so.Verified
claimandreleasein the reallib.shrun through the simulator (they use onlyeditandcomment). A claim leaves a label and anagent:leasecomment, a release removes the label, and a nested claim does nothing.ghcalls, leave the worldapplyEffectssays. 37 scenarios are replayed, 48 have no effects, and 4 are listed on purpose as not replayable (two open a PR, whose commit is agitfact, and two sync the label catalog), so a new scenario with an effect noghcall makes is noticed.npm run checkpasses: 154 shell tests (unchanged), 430 node tests (407 before, 23 new). Six runs in a row.A bug this found in #90
While writing the tests, a
--jqtest failed intermittently under the full suite (2 of 3 runs). When jq cannot compile an expression it exits before reading stdin, andspawnSynccan report that asEPIPE. The simulator took any spawn error for "jq is missing", so a bad--jqexpression sometimes exited 2 with the wrong message. #90's CI passed by luck. I fixed it on #90's branch as its own commit (946b655) and rebased this PR on it, and the test now runs the bad expression ten times.