outerlayer emit command and outerlayer demo record, with their flags and exit codes. For the tasks they serve, see Prove the work, Record a demo and Findings.
Every emit command takes these options. demo record takes neither.
Each command exits 0 on success. It exits 1, with the reason on stderr, when it refuses or the input is not valid.
emit finding and emit findings also exit 3.
In CI, set the credential variables instead of running login. See In CI. A command connects the repository to a factory on its own when exactly one factory fits. See Automatic connection.
On this page, a recorded session is an agent session started with OUTERLAYER_WORK set to a work item’s number. Inside an agent session started without it, every emit command refuses.
outerlayer emit artifact
Upload a proof artifact with a caption.--replaces.
When you reach the gateway’s rate limit for uploads, the command prints how many seconds it waits. Then it sends the artifact again, up to 3 attempts. If every attempt fails, the command exits 1 with an error that names the rate limit and the seconds to wait. See Rate limits.
More on --test:
--testneeds--forand an.xmlfile. Without either, the command exits 1.- A name several tests share binds all of them, with a warning.
- A test’s own title is enough when the reporter puts its describe blocks in front, as in
widgets > adr > returns one row. The command binds the one test whose full name ends with the title after>or›, and prints that full name. When several tests match, it exits 1 and lists them. <name>=<path>:<line>gives the test’s location, as in--test "renders the banner=src/login.test.ts:42".<name>=<path>gives only the test’s file. The path must end in a test source’s extension, such as.tsor.py, with no spaces.- A testcase’s own
fileandlineattributes win over the location you give. With neither, aclassnamethat is a test file’s path gives the file. - When no bound test names its file, the command exits 1 and uploads nothing, because a host cannot run the tests again at a later commit. Give each test’s file with
<name>=<path>. In a CI job, the command prints a warning and stores the results. - The command exits 1 on a name the file does not hold, or on a location that is absolute or leaves the repository. When names in the file contain the name you gave, it lists some of them.
--for, the command reads an .xml file first and exits 1 on a malformed file, before it sends anything. Without --for, it sends an .xml file without checking it.
More on --replaces:
- A target that already uploaded is hidden everywhere.
- A target still in the local queue is cancelled, so it never uploads.
- If you name several ids and one is still queued, the command refuses. Run
outerlayer syncfirst, then retry.
outerlayer sync, which prints its link. Outside a session, it uploads at once, and the command prints the link on the line after the id. See Where the artifact is attached.
With --json, the output depends on where the artifact goes:
- In a recorded session, it has
spooled(true) andrecord.record.artifactIdis the id that--replacestakes. - Outside a session, it has
id,kind,prNumber,provenance,repository,urlandverification. It also hasclientArtifactId, the id that--replacestakes.
verification is confirmed when OuterLayer already knows the pull request, and pending otherwise.
See also: Prove the work.
outerlayer demo record
Record a demo script. The CLI carries the recorder and its own Playwright release, so the repository installs neither.npm install --global @outerlayer/cli. It does not run through npx. See Before you start.
Without --no-voice, each line is spoken with the CLI’s voice. That needs espeak-ng. The first run downloads the voice pack (about 400 MB) to ~/.outerlayer/voice/.
The script imports test and expect from @outerlayer/playwright. Without --config, it runs in one Chromium project, with no retry and no time limit. The command prints the path of each manifest it finds. Under outerlayer work proofs --record, the demo goes to the folder that OUTERLAYER_PROOF_OUT names.
See also: Record the demo.
Record a script in any language
Put a command after-- to record a demo from a script in any language.
outerlayer demo chapter, beat, beat-end, run, http, checks, frame and chapter-end. These commands work only inside outerlayer demo record. Outside it, each exits 1 and says so. The recorder makes each check from a command it ran, an HTTP call it made or a JUnit report it read. See Record a demo from a script.
outerlayer emit demo
Attach a narrated demo to a work item from the manifest thatdemo record wrote.
--replacestakes the id thatouterlayer work demo --item <n> --jsonprints for the item’s newest demo record. Outside a recorded session it needs--item. See Record the demo again.--outputwrites a summary next to the file, as<file>.json. The command exits 1 when the demo holds a frozen, silent stretch over 2 seconds, a beat shows steps for more than 4 seconds after its line, or a check failed. See Render the demo on your machine.--jsonprintsrecordArtifactId,video,clips,screenshots,failures,differencesandexitCode.videois the whole video’s artifact id, oromittedwhen it was left out for its size.screenshotslists each chapter with a frame decision, with the artifact id or the reason.--jsonwith--outputprints the summary instead:output,seconds,leftOutSeconds,deadAirCutSeconds,chapters,measure,deadAir,failuresand, when present,note.
ffmpeg and ffprobe on PATH. A narrated run also needs espeak-ng. The command reads manifest versions 1 to 6. The manifest’s fields are in Manifest format.
What the command stores
- One
videoartifact nameddemo.webm, for the whole demo. It is bound to no criterion. The video is WebM with VP9 video and, when narrated, Opus audio. - One
videoartifact namedchapter-NN.webmfor each chapter. It is a time range of the whole video. A chapter is bound to its criterion only when it ran at least one check and every check passed. - One
screenshotartifact namedscreenshot-NN.pngfor a chapter whose test marked a frame. The command stores the frame only when the chapter’s criterion declares the proofscreenshotand every check of the chapter passed. Otherwise it prints the reason. A frame over 8 MiB is also left out. - The manifest, as the demo record.
outerlayer sync.
A second run with the same manifest, video, --item and --pr stores nothing new. When an upload fails part way, run the command again. It stores only what is missing.
Refusals
The command refuses, and uploads nothing, in these cases:- The manifest is not valid, or its video is missing. A manifest holds 1 to 200 chapters, and only the first chapter may have no criterion.
- The manifest’s version is newer than the CLI reads. The refusal says to update the CLI.
ffmpegorffprobeis not onPATH, or a narrated run has noespeak-ng. Pass--no-narrationto run withoutespeak-ng.- A chapter ends after the video ends, overlaps the one before it, or names a criterion twice.
- A chapter names a criterion that is not on the item’s recorded list. When the list cannot be read, the command warns and goes on.
- A narration line breaks a rule in Write the lines, or is over 2,000 characters. The refusal names the chapter, the beat, the line and the reason.
- The demo still holds a frozen, silent stretch over 2 seconds. The refusal names where.
- A beat shows steps for more than 4 seconds after its line ends. The refusal names the beat.
- A narration line is still longer than its chapter at 1.3 times speed. The refusal names the chapter and the overrun in seconds.
- A clip is larger than 8 MiB. The refusal names the chapter and the size.
- A file of the voice pack does not match its pinned checksum. The refusal names the file.
- With
--compare, the two runs differ in their chapters, titles or checks. The refusal names the first difference. - With
--compare, a still file of either run is missing, is not a PNG, or does not match its checksum. - With
--compare, both manifests are the same file.
See also: Emit the demo.
outerlayer emit finding
Record one problem you hit in the factory.--problem that is not in this factory, and an event id that is not in the session.
The command adds two things to the finding, and removes credentials from both before it sends them:
- The lines around
--linein--file, or around--rule-linein--rule-path, read from your checkout. - The tool call and its output at the start event, read from the session.
--json, the output has workItemId, count and results. count is the number of findings stored. Each result has id and outcome, which is stored or needs_choice. A result can also have these keys:
method: how the finding joined its problems.problems: the problems the finding joined, each withidandtitle.overridden: the problems you named that a key match replaced.candidates: the close problems of aneeds_choiceresult, each withid,title,reportCountandreports.
Choose among candidates
Every finding joins a problem. The command decides which in this order:- A key match. A
contextfinding’s key is its rule path, quoted sentence and relation. A flaky test’s key is its file and test name. A command alone is never a key. A finding whose key matches an earlier report joins that report’s problem, and the output names it.--problemand--neware then ignored. - Your choice.
--problemlinks the finding to each problem you name.--newrecords a new problem, titled with the finding’s title. - A search. With neither flag, OuterLayer searches every problem in the factory. If none is close, it records a new problem.
--problem <id> --link-reason <text> for each problem the finding reports, or with --new:
Mark when the problem started and ended
A finding’s time runs from a start event to an end event. The CLI reads the events from the session’s transcript on your machine, and from the transcripts of its subagents. The defaults for--started-at and --ended-at are in the table above.
When the session has events and no start is found, the command stores nothing. It prints the recent events, each with an id and its time, and exits 1:
--started-at e118. An id with a prefix, such as a5c9fb78:e42, is an event of the subagent that the prefix names. --find <text> also lists older events.
Only Claude Code sessions have a transcript the CLI can read. Where the CLI finds no transcript, the finding records no time. It still counts toward how often the problem occurs.
See also: Findings.
outerlayer emit findings
Record a batch of findings from a JSON file.- as the file reads standard input. The file looks like this:
"schemaVersion": 3. Any other version is refused.- Optional
headShaandcontextSourceSha.headShadefaults to the checkout’sHEAD. - 1 to 500
findings. Each has the fields ofemit finding, under the flag’s name in camel case.--whereiswhere.label. The--rule-*flags arerule.path,rule.relation,rule.quoteandrule.line.--trace-id,--turnand--roundarewhere.traceId,where.turnIndexandwhere.round.
problems, a list of problem ids, withlinkReason. Or"new": true.codeReviewProblem, a code review problem id on the same work item.startedAtandendedAt, as event ids. They default as inemit finding."untimed": true, to record no time.
"untimed": true.
The findings that need no choice are stored. The ones that need a choice are listed and not stored, and the command exits 3. Add problems with linkReason, or "new": true, to those findings and run the command again. Findings already stored keep their problems. See Choose among candidates.
With --json, the output has the same keys as emit finding. results holds one entry for each finding of the file.
See also: Findings.
outerlayer emit step
Report that you started a step of the work. The work item’s Overview tab shows each step as it is reported.outerlayer sync sends each queued step, which then shows at the time you ran the command. A queued step older than 14 days is dropped. If the gateway refuses the step with a 4xx, the command prints the gateway’s reason, exits 1 and queues nothing.
With --json, a stored step prints id, item and startedAt. item holds the item’s number. A queued step prints a line of text, not JSON.
outerlayer emit criteria
Record a work item’s acceptance criteria as one list. OuterLayer reads criteria only from this list, never from an issue.spec edit also records the criteria in the new body of an issue.
.md. - reads JSON from standard input.
The list holds 1 to 200 criteria. The command checks the file before it sends anything, and names the id or value it refuses.
The acceptance file
.md file as follows:
- Each numbered list item that opens with an id in backticks is one criterion. Its text is the rest of the item.
- The id looks like
`AC-412-01`:AC-, an issue number of three or more digits, and two digits. For a Linear or Jira issue, it looks like`AC-ENG-142-01`, with the issue key betweenAC-and the two digits. - A numbered item with any other id is ignored. A file with no matching item is refused with “lists no criteria”.
- A
(proof: <kind>)written outside backticks names the criterion’s proof. - A bulleted item that names an id is a note about that criterion, so it is skipped.
Replace a recorded list
Every list you record is kept, with who recorded it and when. The newest is the item’s current list. Only a person can replace a recorded list. An agent session, or a key bound to no member, gets409. Run the replacement with your own login, outside the agent session.
A JSON file may carry a top-level "drafted": true. A build sets it on a list it drafted from the issue’s description, and the item’s Criteria tab then says so. A drafted list is replaced like any other: until a person replaces it, a later build’s record is refused. A list a person records is never marked drafted, even when its file says so.
Recording a list starts a new evaluation of the item’s linked pull requests.
With --json, the output has workItemId, count and replaced. replaced is true when the list replaced an earlier one.
See also: Record the criteria, The Criteria tab.
outerlayer emit plan-note
Record the plan note of a child work item. A plan note is what a build leaves for the other children of its plan. A later child build reads the notes of the children that have shipped. See What a child build receives.
No text part is empty. A build with nothing to pass on says so in words. The three text parts hold 8,000 characters at most together. The command refuses a longer note, and states the limit, before it sends anything. A note is a summary: the pull request holds the detail.
A plan note is valid when it affects no child and says that the other children have nothing to follow.
Who may record a note
The key of a build’s live claim records a note on its own item. A member who is logged in, with Withdraw others’ work (work.update), records a note on any child. A plain API key is refused with member_login_required, even one bound to a member.
Refusals
Replace a note
Every note you record is kept, with who recorded it and when. The newest note is current. Record a new note when a later change makes the first one wrong. The new note replaces the old one for the other children. The old note stays in the item’s history. A plan note is a record for builds and for people. It is never proof, and recording one does not change the item’s verdict. With--json, the output has id, workItemId and replaced. replaced is true when the note replaced an earlier one.