Skip to main content
The change has passed its reviews. Now it has to reach the code host, and that is where hand-run processes go wrong: a second pull request for the same branch, a merge on green checks from an earlier commit, a work branch left behind. You want the last mile to be as strict as the reviews were. One pull request per branch. A merge only when the checks you named ran and passed on the exact revision you’re merging. The reasoning that produced the change carried into the merge message, so it ships with the code. Obversa keeps that step as plain code a process calls after its review gate passes. This file is that step for GitHub, or any host with the same five operations: it pushes the work branch, opens or updates one pull request, proves the change can merge, squashes the work into the base branch, and deletes the work branch. A mock host proves it offline, and a GitHub adapter prints the gh argument list for each operation.

Run it

The file imports no package and runs offline. Copy it into a project with tsx installed, as Installation describes:
Terminal
Output
The report has three parts. verdicts holds the gate’s verdict for each of four fixture pull requests, and every one fails with its reason on the line. ship holds the shipped change: the pull request number, the proof that two calls opened one pull request, the merge, the branch deletion, the synthesis message and the operation log. ghArguments holds the argument list the GitHub adapter would pass to gh for each operation. The file writes no files and makes no network calls, so run it again whenever you like.

The file

A host supplies five operations, the same way it supplies memory:
examples/forge-helper.ts (excerpt)
The pull request body and the squash message come from the same join of the commit bodies, so the reasoning that produced the change is the reasoning that ships it. The gate is a pure function over one status:
examples/forge-helper.ts (excerpt)
The change ships only when the expected workflow ran and passed on the exact head revision, and the branch can merge. A check run counts as passed only when its conclusion is exactly success. Green checks on other workflows don’t ship a change, and neither do green checks from an earlier revision. The demo ships only on the exact string RESULT: PASS and stops on anything else. The GitHub adapter returns one gh argument list per operation, each a pure function of its input; a new branch uses createRefArguments, an open pull request listArguments and editArguments. runGh is the execution layer, one function with no logic of its own, that runs gh with a list and returns the output. It needs a gh login, and nothing in this file calls it. To use the step in a process, give your host the five operations; the mock host in the file shows each one, and the gate stays the same for every host.
examples/forge-helper.ts

The shape

Next steps