Change a pipeline
A pipeline changes when its file changes on the forge’s default branch. The server reads the merged file and checks that it loads, and the new version waits until a team admin or the pipeline’s shepherd approves it. Approving makes it the current version. New runs use the current version. Runs already going keep the version they started with. This page covers a change a person makes. For a change an agent proposes, read Review a proposal.
Edit the file
Section titled “Edit the file”- Clone the repo that holds the team’s pipelines from the forge. The shipped setup names it
pipelines, with one file per pipeline underpipelines/. - Edit the pipeline’s file. Keep
import typefor anything fromshared/pipeline.ts, since the server loads the file from its stored source. The pipeline file lists what a file may hold. - Open a pull request on the forge against the default branch, and merge it once it is reviewed. The forge setup protects
mainon the repos it makes, so nobody pushes to it directly.
The server reads pipelines/ from each of the team’s repos on the forge that has no policy. A file’s name, without pipelines/ and .ts, is the pipeline’s name. A repo with a policy holds code, so the server never reads it for pipelines, even if it has a pipelines/ folder.
Wait for the server to read it
Section titled “Wait for the server to read it”The forge tells the API when someone pushes, and the server reads the repo at once. The server also reads every repo every 5 minutes, so a change shows within that time even when the forge’s notice is missed.
Check the new version
Section titled “Check the new version”- Choose Pipelines in the places bar, then the pipeline’s row.
- Read the Versions list. Each version is named by the first 8 characters of git’s id for the file. The current one reads
is the current version, and each earlier one readswas a version, with the time it was added and how its runs went, such as3 runs, 2 done, 1 stopped, $0.84 and 4 min on average.A version with no run readsNo runs yet. - If a version reads
It does not loadfollowed by a reason, fix that problem in the file and merge again. The earlier version stays current until a version loads and is approved. - The version from the default branch that nobody has approved yet reads
waits for approval. A team admin, or the pipeline’s shepherd, sees Approve beside it. Approving makes it the current version, and it then reads who approved it and when. Until then, runs keep using the version that is current, and a pipeline with no approved version starts no runs. - Under a waiting version, read what it would have done. The server replays it against the pipeline’s 5 latest finished runs: for each, whether it takes the same path, goes another way at a stage, or fails at one, and which stages would get a different prompt, command, question or text. The replay asks only the pipeline file, on the outcomes the run’s agents reported, and runs no agent. A version reads
has not been replayed against the current version yetuntil it is replayed against the version current now, and it can’t be approved until then. The next sync replays it, or a team admin or the pipeline’s shepherd chooses Replay now beside those words to replay it at once. A proposal shows its candidate’s replay the same way. - To read a version’s file, choose its id. The file opens beside the pipeline, and the pipeline’s pill,
<name>, its file, opens and closes that panel.
Runs that replay a past report to score a proposal do not count toward any version’s record. A proposal’s candidate is replayed before anyone approves it, since the scores are how it makes its case, and a replay never touches the forge or waits on a person. Approving the proposal’s gate merges it, and that approval also approves the merged version.
An agent can approve for the person it works for, with approve_pipeline_version, and that person is asked before each one. list_pipeline_versions reads what each pipeline runs and what waits. bin/agentsctl pipelines versions and bin/agentsctl pipelines approve <pipeline> <version> do the same from a terminal.
What pipeline code can reach
Section titled “What pipeline code can reach”The server runs a version’s code in an isolate of its own, a separate JavaScript engine with no file, network or process access and no way to import anything. Each prompt, command or text function gets a copy of the run context and gives back a string. A file that imports a module, or a function that reads process, calls fetch or returns anything but a string, fails, and a function that runs past its time limit is stopped. Stages still act through the runner: an agent stage’s session, a check’s command on the run’s machine and the forge actions are the runner’s, not the pipeline code’s.
Go back to an earlier version
Section titled “Go back to an earlier version”A version is the file’s content, named by git’s id for it. Restore the earlier content on the default branch and merge. The server finds that version already recorded, and since it was approved before, makes it current again at once.
Add the shipped pipelines to a team’s repo
Section titled “Add the shipped pipelines to a team’s repo”The forge setup puts the five shipped files into the team’s pipelines repo the first time, with node --env-file=.env ops/forge-setup.ts <team>. After the Agents repo’s own pipeline files change, node --env-file=.env ops/publish-pipelines.ts proposes them to the forge’s pipelines repo as one pull request. Files that already match are left alone. Add --merge to merge the pull request too.