Skip to main content
Two things on a work item prove its work: its acceptance criteria, and the artifacts bound to them. The /build skill records both for you. Use this page to record them by hand or in CI, or to read what a build recorded. Judges and the merge gate says how they count toward the verdict. A runner records the result of each judge itself. See Write a judge.

Before you start

  • Know the item’s number. It is the number on the Work page, not the issue number.
  • Sign in to the factory with outerlayer login, or use a factory key.
  • Hold the Emit evidence permission. A browser outerlayer login holds it when your role can create factory keys. The owner, admin and write roles can. Otherwise, use a factory key bound to you. See API keys.

Record the criteria

An item’s acceptance criteria are one list recorded on the item. OuterLayer reads criteria only from this list, never from the issue. A build records the list before it writes code:
  • It keeps each criterion’s text as the issue wrote it.
  • It keeps the issue’s ids when every criterion has an id that fits the id rules. Otherwise it numbers the criteria AC-<item number>-01, -02 and so on.
  • It keeps a proof the issue states, as in (proof: screenshot).
  • It gives every other criterion the proof a reviewer needs to believe it. A result that follows something a person does in your product’s interface gets a video. A state that a person only opens or looks at gets a screenshot. Text that a person reads gets a log: command output, a log line or an API response. A report that a tool writes gets a report. An outcome that none of these shows gets a test proof: the runner records its test results at the head commit. A criterion that the issue says a person proves gets no proof.
  • When the issue holds no criteria, it drafts them from the issue’s description. The Criteria tab then says the build drafted the list.
A note such as (seam: component) says where the test runs. It does not change the proof. The build’s final report lists each proof it added. To record the list yourself:
  1. Write the criteria to a file:
  2. Record it on the item:
proof names the artifact kind that proves the criterion. null means any artifact bound to the id proves it. The command also reads an acceptance file that ends in .md. Only a person can replace a recorded list. An agent session can record an item’s first list, but not a replacement. A drafted list is no exception. Run the command with your own login, outside the agent session. The id rules, the acceptance file format and the exit codes are in outerlayer emit criteria.

Attach an artifact

OuterLayer uploads the file as it is. Nothing removes secrets from a screenshot, video, report or log. Check the file before you emit it, and use test accounts and seeded data. See What leaves your machine.
Capture the state first, then emit it:
Write the caption as one present-tense sentence with no secrets. The command prints the artifact’s id. The file’s extension sets its kind. You cannot set the kind yourself: A file outside the first five rows never counts as a stronger kind. Convert a .mov recording to .mp4 or .webm before you emit it, for example. A file can be at most 8 MiB. Video is the kind most likely to reach that limit. Record each video proof of a web app as a chapter of the item’s one demo, not as a video of its own. See Record a demo. For an app that Playwright cannot drive, such as an iOS or Android app, see Record a video of a native app. A video that you emit by hand is never recorded again at a new head.

Where the artifact is attached

Inside a session started on a work item, the file is queued. The next outerlayer sync uploads it with the session and prints its link. A session that was not started with OUTERLAYER_WORK refuses the emit, because nothing it produces may leave the machine. Outside a session, the file uploads at once. It attaches to the first of these that exists:
  1. The pull request --pr names.
  2. In GitHub Actions, the pull request the run is for.
  3. The current git checkout.
With nothing to attach to, the command refuses. On other CI systems, pass --pr. An artifact stays pending until a pull request claims it. Open the pull request, or declare it with outerlayer work pr, within 14 days. For an artifact emitted from a session, the period is 28 days. After that, OuterLayer deletes the file.

Bind it to a criterion

Pass the id of a recorded criterion to --for. The Criteria tab then shows the artifact on that criterion’s row:
The artifact’s kind must match the proof the criterion declares. A screenshot never satisfies a criterion that asks for a video. An artifact proves a criterion only at the head commit of a pull request linked to the item. outerlayer emit artifact records the commit it runs at. A push moves the head. Every proof from an earlier commit then shows as out of date on the Criteria tab. Emit it again at the new head. See The Criteria tab. A screenshot or video that no test can record is the one exception. The runner’s criteria judge can keep it current when no change since its commit can alter what it shows. See Kept proofs.

Prove a criterion with test results

A criterion can declare "proof": "test". Bind JUnit XML results to it with --for. Vitest, Jest, pytest, Go (through gotestsum), JUnit, RSpec and many other test runners can write that format.
Every test in the file is bound. To bind only some, name each one with --test:
The part after = says where the test is written. The Criteria tab links a test to its source only when it knows the test’s file. Leave that part out when the results name the file themselves:
  • Vitest’s JUnit reporter writes the file by default.
  • jest-junit writes it only with its addFileAttribute option.
  • pytest writes it only under junit_family=xunit1.
Maven Surefire and Gradle write a class name for each test, and no file. Give each test’s file with --test "<name>=<path>". Outside CI, the command refuses results in which no bound test names a file, and uploads nothing. A host runs the tests again at the build’s final commit, and it finds them by their file. A CI job runs the tests at each commit, so there the command stores the results and prints a warning. A criterion is proven when all of these are true:
  • No bound test failed or errored.
  • At least one bound test passed.
  • No test you named with --test was skipped.
A skipped test you did not name neither proves nor fails the criterion. When you emit again after a fix, retire the old results with --replaces, or the old failure still counts. The head-commit rule in Bind it to a criterion applies to results too. In GitHub Actions, the command records the pull request’s head commit, not the merge commit the checkout holds. On other CI systems, check out the pull request’s head commit before you run the tests. With no passing results at the head commit, the work item’s page says “No passing JUnit results are recorded at this commit”. Run the tests at the head commit and emit the XML again. outerlayer work proofs --record does both for you when the earlier results named each test’s file. See How a test proof is recorded. Test results from any source prove a criterion: CI, a runner build or a local session. To read the results on the item, see Read test results.

Replace an earlier artifact

outerlayer emit artifact prints the artifact’s id. Pass that id to --replaces to correct the artifact:
The earlier artifact is hidden as superseded. Its file and its link stay. An earlier artifact that is still queued never uploads. A failed emit retires nothing. To retire several at once, see --replaces.

Record proofs by rerunning tests

A push makes every proof out of date. To record them again without a script of your own, let each criterion’s test write its proof. outerlayer work proofs --record then reruns those tests at the new head.
  1. Write a test that holds the criterion’s id. A demo test names it in a chapter. Any other test names it in a comment or a string.
  2. Make the test write its proof. A report, log or file proof is the file $OUTERLAYER_PROOF_OUT/<criterion id>.<ext>. The file’s kind must be the kind the criterion declares.
  3. Commit .outerlayer-proofs.yaml at the repository root. It lists the runners that run the tests, and optionally the commands that start and stop the app:
  4. Commit the tests.
  5. Run outerlayer work proofs --record.
The command reruns the tests that name each proof that is not current, and emits what they write. It prints the artifact id of each proof it recorded. It stops when a tracked file differs from HEAD. For a test proof, the command runs the tests its newest results named, and emits their JUnit results. Emit the first results yourself, as in Prove a criterion with test results. A runner runs the same command itself after a build or an amend ends, at the final commit. See The proofs stage. The built-in automation Record proofs again starts an amend that records the proofs at the head. It starts when the head moves later, or when a build ends before it records its proofs. See When the proofs are recorded again. A session of your own still runs the command after each push, because the runner’s recording can fail. The file format, the other flags and the exit statuses are in outerlayer work proofs.

Record a video of a native app

Playwright drives a browser. For an app that it cannot drive, such as an iOS or Android app, a flow test records the video. The runner then records it again at each new head, as it does any other proof file. Know where the test runs before you write it. A runner build runs in a Linux container. An iOS simulator does not run there. Use an Android emulator on a host with KVM, or a remote simulator or device service that the build can reach.
  1. Write a flow test for the criterion with a tool that drives your app, such as Maestro or Detox. Name the criterion’s id in the test.
  2. Make the test save a screen recording of the flow as $OUTERLAYER_PROOF_OUT/<criterion id>.mp4. The recorder of the simulator or emulator can make it, such as xcrun simctl io booted recordVideo or adb shell screenrecord.
  3. Keep the file under 8 MiB. This command makes a recording smaller and writes it where the runner looks:
  4. Add a runner for the flow tests to .outerlayer-proofs.yaml. Set timeoutMinutes when a run can take longer than 10 minutes, for example to boot the simulator and install the app:
  5. Commit the flow tests and the proofs file, then run outerlayer work proofs --record.
A CLI older than 0.46 rejects timeoutMinutes, and then records no proof from the file.

Find it afterwards

Once it uploads, the artifact appears on the work item’s page:
  • on its criterion’s row on Criteria, when it is bound to one;
  • beside the row that names it on Judges;
  • otherwise under Other artifacts on Judges.
To get its link:
  • From a session, run outerlayer sync. It prints a line for each artifact it uploads, ending with the link. outerlayer sync --json lists them under uploadedArtifacts.
  • Outside a session, outerlayer emit artifact prints the link on the line after the id.
  • After another sync uploaded it, run outerlayer sync --link <artifact id>, with the id emit artifact printed. It prints the link and sends nothing.
  • From any machine, the list_artifacts tool of the MCP server lists a work item’s artifacts with their links.
The id emit artifact prints is not part of the link.