SwarmOps
ReferenceCommandsswarmops check runs

Page kind: Reference

swarmops check runs#

Describes stable at 47a431aa, ; latest release v0.13.0what changedLast changed View as Markdown

List the run lines of a workspace's or a directory's checks, newest first.

Each check a run of check run reaches leaves one run line on the host that ran it: its name, run, stage and tree, how long it waited and ran, how it ended and, on Linux, its sampled peak memory. This reads the lines of the workspace (--ws, --ws-path, else the one around the working directory) from its .swarmws/check-runs/, or those beside the runs of the directory --dir names, or the lines in the directory --run-lines names, else SWARMOPS_CHECK_RUN_LINES_DIR, whatever wrote them there. It gives those that match every filter given (--check and --outcome may be given several times), newest first by the time each check started, at most --limit of them, with a cursor when more match: pass it back as --cursor, with the same filters, for the page after. A line that does not read is passed over and counted in skipped. The lines are diagnostics, appended unsynced: nothing decides from them. Reads only: no identity, no lock, nothing written, no store operation.

--selection[=WHICH] keeps the lines of shadow runs (check run --shadow) and counts them: WHICH is all (the default), would_skip (those the plan would have skipped) or misses (those of them that failed, timed out, or could not start for their program or directory). The answer's selection holds the counts of every shadow line the other filters take, whatever WHICH, the cursor and the limit are, in total and for each check (the 1,000 smallest names, the rest counted in checks_omitted): lines read, not distinct keys.

Metadata
Group
checks
Since
0.13.0
Mutates
no
Identity required
no
MCP tool
check_runs
Envelope op
check_runs
Exit codes
02

Syntax#

Syntax
swarmops check runs [OPTIONS]

Required arguments#

None.

Optional arguments#

The command also takes the global options.

Syntax: --ws <NAME>.

The workspace, by its name in the store's registry (default: the one around the working directory).

Syntax: --ws-path <DIR>.

The workspace's directory.

Syntax: --dir <DIR>.

Read the lines beside the runs of the checks of DIR on this host.

Syntax: --run-lines <DIR>.

Read the lines in DIR, whatever run wrote them there.

Syntax: --check <NAME>....

Only the lines of this check; repeatable.

Syntax: --tree <TREE>.

Only the lines of the tree whose id starts with these 12 to 64 hex digits.

Syntax: --outcome <OUTCOME>....

Only the lines that ended this way; repeatable. Values: passed: It exited 0; failed: It exited with another code, or a signal ended it; timed_out: It ran past its timeout; cancelled: A signal stopped the run while it ran; not_started: Its directory is missing, or its program did not start.

Syntax: --run <RUN>.

Only the lines of this run, by its id.

Syntax: --since <MS>.

Only the checks that started at or after this time, in Unix milliseconds.

Syntax: --until <MS>.

Only the checks that started before this time, in Unix milliseconds.

Syntax: --selection [<WHICH>].

List the lines of shadow runs only and count them: all (the default), would_skip, misses. Values: all: Every line of a shadow run; would_skip: The lines whose plan would have skipped the check; misses: The lines that showed the plan wrong.

Syntax: -n, --limit <N>. Default: 100.

The most lines to list, 1 to 1,000.

Syntax: --cursor <CURSOR>.

Resume a list: the previous page's cursor, exactly as it was returned.

Examples#

Shell
swarmops check runs --run-lines [tmp]/lines --outcome passed -n 2
Output
{ "ok": true, "op": "check_runs", "api": 1, "result": { "vouched": true, "source": "run_lines", "dir": "[tmp]/lines",
Show 40 more lines "runs": [ { "at": "[at]", "run": "0193f1e2-0000-7000-8000-0000000000a3", "check": "unit", "attempt": 1, "stage": "manual", "vouched": true, "definition_digest": "[id1]", "wait_ms": 3000, "duration_ms": "[duration_ms]", "outcome": "passed", "exit_code": 0, "run_dir": "/runs/5f2c/0193f1e2-0000-7000-8000-0000000000a3" }, { "at": "[at]", "run": "0193f1e2-0000-7000-8000-0000000000a3", "check": "lint", "attempt": 1, "stage": "manual", "vouched": true, "definition_digest": "[id2]", "wait_ms": 10, "duration_ms": "[duration_ms]", "outcome": "passed", "exit_code": 0, "run_dir": "/runs/5f2c/0193f1e2-0000-7000-8000-0000000000a3" } ], "cursor": "r1.1700000200010.0193f1e2-0000-7000-8000-0000000000a3.1.lint", "scanned": 17, "skipped": 3 }, "meta": { "elapsed_ms": "[elapsed_ms]", "resolved": {}, "auth": "trust" } }

Exit code 0. Recorded by the CLI tests. A name in square brackets, such as [tmp] or [c1], stands for what differs from run to run: the test's temporary directory, an id, a time.

No recorded example yet.

Details#

check runs lists the run lines of a workspace's or a directory's checks, newest first: what ran lately, how long each check waited and ran, and how it ended. It reads only: no identity, no lock, no store operation, and it writes nothing.

What a run line is#

Each check a run of check run reaches appends one line of diagnostics, a JSON object, to run-lines.jsonl on the host that ran it; that page has the keys, where the file is and how it rotates. A line is not a record of the store: the file is not synced, anything that can write the directory can write it, and nothing decides from it. No gate and no land reads a run line, and a line says nothing a later check may rest on. From M33-1 the store's own run records are to be what this command reads; source says which it read, and is run_lines today.

Which lines#

  • check runs with --ws NAME, --ws-path DIR, or the workspace around the working directory: the lines in that workspace's .swarmws/check-runs/. The workspace is found as the ws commands find it, with no store opened. vouched is false.
  • check runs --dir DIR: the lines beside the runs of DIR, below the runs root, as check run --dir keeps them. vouched is true, and the envelope has no meta.repo.
  • --run-lines DIR, else SWARMOPS_CHECK_RUN_LINES_DIR (absolute; else E_INVALID_ARG, details.reason: run_lines_dir): the lines in that directory, whatever run wrote them there, of every directory and workspace that sent its lines to it. vouched is true. Something there that is no directory is run_lines_dir too.

dir names the directory read, absolute. Both files there are read, run-lines.1.jsonl and run-lines.jsonl, each opened before either is read and never through a symbolic link. A file that is not there holds no line: a workspace or directory that has run nothing answers an empty page, exit 0. A file that does not open, or is anything but a regular file, is E_IO with details.path.

Filters#

A line is listed when it matches every filter given.

FlagRequestMatchesRefused (E_INVALID_ARG, details.reason)
--check NAME, repeatablechecksA line whose check is one of them.check: not a check's name.
--tree TREEtreeA line whose tree starts with these 12 to 64 lowercase hex digits. A line of the directory form, which has no tree, never matches.tree
--outcome OUTCOME, repeatableoutcomesA line that ended as one of passed, failed, timed_out, cancelled, not_started.The command line takes no other word; the tool refuses not_run and skipped, which leave no line, with outcome.
--run RUNrunThe lines of that run.run: not a run's id.
--since MS, --until MSsince, untilA line whose check started at or after since and before until, in Unix milliseconds.time: since after until.

Shadow lines#

--selection[=WHICH] keeps only the lines of shadow runs (check run --shadow) and counts them. WHICH is all (the default when the flag has no value), would_skip (the lines whose plan would have skipped the check) or misses (those that showed the plan wrong: the check failed or timed out, or did not start for its program or its directory; the rule is check run's). The answer gains selection:

JSON
{"lines": 412, "would_skip": 96, "misses": 1,
 "checks": [{"check": "site-check", "lines": 103, "would_skip": 80, "misses": 1}],
 "checks_omitted": 0}
  • The counts are over every shadow line the other filters take (--check, --tree, --outcome, --run, --since, --until), whatever WHICH, the cursor and the limit are, so every page of one listing gives the same counts.
  • They count lines read, not distinct keys: a key the two files both hold counts twice, so lines can exceed what the pages list.
  • checks holds the 1,000 bytewise smallest names, sorted; the lines of the others are counted in checks_omitted. The answer is the same in any order of the lines. Memory stays the page and that map.
  • plan, plan_reason and not_started of a line are the words its writer wrote: a word a later release added (reused, a new reason) still reads, counts in lines, and is no would-be skip.
  • The lines are diagnostics, unsynced: nothing decides from them. The number of lands with no miss is not read from them; the run records of M33-1 are to carry it.

Order, pages and the cursor#

Lines come newest first by when each check started (at), then by run, check and attempt: the order is the lines' own, not the files', so lines that several runs appended at once, and a rotation, change no page. Two lines of the same check, run, attempt and time are listed once.

A page holds at most --limit lines (-n; 1 to 1,000, 100 by default; another is details.reason: limit). When more lines match, the page carries a cursor: give it back as --cursor, with the same filters, for the page after. A page with no cursor is the last. Pass a cursor back as it was returned and do not build one: it names a place in the order, not a position in a file. Lines appended since the first page appear only on a new first page; lines rotated away are no longer listed; a later page repeats nothing and loses nothing that is still kept. A cursor pins no filter: with other filters it goes on from the same place under them. One that no page gave is details.reason: cursor.

Lines that do not read#

A line longer than 4 KiB, one that is not UTF-8 or not JSON, one that is not a run line or whose values a run does not write (a run that is no id, a name that is no check's, a tree that is not 64 hex digits, not_run or skipped, a run directory that is relative or past 1,024 bytes), and a last line with no line end (a writer in the middle of its append) are passed over and counted in skipped. scanned counts every line read, matching or not.

Bounds#

Each page reads both files whole, at most 128 MiB, as a stream: memory holds one line and the page, never a file. How long a page takes on full files is not measured.

The MCP tool#

swarmops mcp serves the workspace form as the tool check_runs, whose arguments are CheckRunsReq (workspace, checks, tree, outcomes, run, since, until, selection, limit, cursor) and whose result is the command's. It reads the directory the server's SWARMOPS_CHECK_RUN_LINES_DIR names, else the workspace's own state; there is no directory form there.

Return information#

result is a CheckRunsResp (swarmops schema CheckRunsResp prints its JSON Schema).

FieldTypeRequiredDescription
cursorstring or nullnoThe cursor of the next page; omitted when no more lines match.
dirstringyesThe directory the lines were read from, on this host, absolute.
runsarray of CheckRunLineyesThe page: the lines that match, newest first, by the time each check started.
scannedintegeryesThe lines read from the files, matching or not.
selectionCheckSelectionOut or nullnoThe counts of the shadow lines, when selection was asked. Omitted otherwise.
skippedintegernoThe lines among them that did not read as a run line, each passed over. Omitted when 0.
sourceCheckRunsSourceyesWhat the lines were read from.
vouchedbooleanyesWhether only the caller stands behind where the lines were read from: true for a directory's lines (check runs --dir) and for a directory the caller named; false for a workspace's own state.

Envelope op: check_runs.

Exit codes:

  • 0: Success.
  • 2: The request or the command line is malformed.

Errors#

  • E_INVALID_ARG (exit 2): A malformed argument or request, including a command-line usage error.

Any command that opens a store may also fail with a store error, such as E_NOT_A_REPO, E_IO or E_STORE_CORRUPT; a command line the grammar refuses is E_INVALID_ARG (exit 2).

See also#

On this page