MainworthyDocs Open Mainworthy

Planned runs

Start a planned run to test a set of cases and close the run with a verdict. Each case gets a slot that keeps the version that was current when you started the run. Report results by hand or let CI results fill qualifying slots so you can focus on the work that remains.

A planned run with CI results, unfilled slots, and the selected caseA planned run with CI results, unfilled slots, and the selected case
A planned run with CI results, unfilled slots, and the selected case

Find a run #

Runs (g r) lists every run of the project, newest first. Mainworthy creates a change run for each commit a person or pipeline reports. Its name gives the commit and its change or branch, such as 58fbc1c on pr:482. Each row shows the verdict and the age of the run. Planned runs also show the number of slots and how many are in progress. In the details for a planned run, each slot with only skipped or blocked results counts once as "skipped or blocked". Slots with no result count as "not run".

Choose Planned or Change to see one kind, and Open or Closed to see one state. To open the cockpit where you record results, select a planned run and press Enter. Select a change run to see its commit, its change, and every result its gate counted, with the same filters as a change's results. Press Enter to open its change. Below the verdict, Mainworthy adds the durations reported for results the gate counts. Tests that ran in parallel each contribute their full duration. If durations are missing, Runs says how many results had one. mainworthy find --in results returns the same sum as testTime. The sum stops at 9,007,199,254,740,991 ms, including when older or restored results hold larger durations. If every counted report gives a start and end time and no declared results are still due, Runs also shows the reported test span. It measures the time between the earliest reported start and the latest reported end using the runners' clocks. See report when the tests ran.

From the command line, mainworthy find --in runs lists the same runs. Add --origin planned or --origin change for one kind, and --state open or --state closed for one state.

Plan a run in the web app #

You need the plan capability to start a planned run.

  1. Press g r to open Runs.
  2. Press n.
  3. Enter a "Run name".
  4. Choose "All active cases", "By folder", "By tag", or "By search" under "Cases".
  5. If your selection needs a folder, tag, or search text, enter that value.
  6. Choose which results the run accepts.
  7. Choose "Plan run".

While the planner counts the active cases you selected, it says "Counting matching cases…". It leaves out fragments, the cases that provide reusable steps. A folder, tag, or search that matches only fragments selects zero cases. If your selection exceeds 20,000 cases, narrow it by folder, tag, or search. The API can preview the same selection with find and {"in":"cases","select":{}}. When select.cases names a case more than once, the preview and plan count it once. Without folder, tag, or search criteria, an explicit case list keeps the order of first appearance. If you open another screen while planning finishes, the run is recorded and you stay on that screen. Before sending a plan, the browser keeps the request for your signed-in account and project on this device. If the reply is lost or unreadable, the planner locks and dims your submitted choices. Choose Retry plan or press Enter to resend the same request without creating a second run. Cancel and Esc close the planner and keep the request while its outcome is unknown. After closing the planner, visiting another screen or project, or reloading the page, reopen the planner in the same project to retry. A readable success clears that request. Plans submitted simultaneously in different tabs are saved separately. Each tab keeps its own submitted choices and retries its own request. Reopen the planner to recover any remaining saved plans, one at a time. A session change, permission refusal, rate limit, or server error also keeps it. If the operation refuses the request, the planner shows the reason and unlocks your choices for correction, even after a retry. The server replays a recorded request before running the operation again. If it says the saved request differs from one already recorded, the planner keeps the request locked and saved. A run may already exist. Check Runs before discarding the request. If the project is missing or you no longer have a grant on it, the request stays available to retry. To release a request whose outcome is unknown, choose Discard this plan. The plan may already have been recorded. Discarding the saved request does not undo a run. If the browser cannot read or remove the saved request, it keeps your choices locked and says it could not discard it. Restore device storage and try again. Other tabs release that request too and clear its submitted choices. A delayed failure or queued retry cannot restore it or send those choices as a new plan. Enter new choices before planning again. If another tab discarded or completed the saved request, the planner says it is no longer saved. Check Runs before planning again. If the browser cannot read a saved request, retry waits. Reopen the planner once storage is available. If this tab has no saved request of its own and another tab has a saved plan, submitting first shows that plan and a notice without sending it. Choose Retry plan to send the displayed request. A saved plan carries the project's identity, so deleting the project and creating another with the same key cannot send that plan into the replacement. If the browser knows the project changed, Retry plan explains why it cannot send the plan and keeps it locked. Choose Discard this plan before planning in the new project. If the project changed after the page last read it, the server refuses the request. Reload to read the new project. The browser removes invalid or outdated saved requests without retrying them. That includes requests that lack a project identity. The browser must be able to save the request before it sends a plan. Clearing this site's browser data or signing out with Sign out and clear browser data removes any request still kept on this device. "Count only results recorded in this run" accepts work explicitly reported to the run. "Accept results for a commit" also accepts qualifying results already reported for that commit and results that arrive later. Enter the tested commit's hash.

A run planned for a commit counts one commit. When you plan the run, Mainworthy resolves an abbreviated hash against known commits. If the commit is not known yet, use the full hash your pipeline will report. Mainworthy refuses an ambiguous abbreviation.

A planned run from plan to close. Zoom, search and follow a path in the frame, or open it full screen.

Understand what each slot requests #

When you plan the run, each selected case gets a slot pinned to its current version. Editing, moving, or archiving the case later does not change that slot's version. To exercise the selected version, read the pinned document in the run.

By default, each slot needs one pass from a person or an automated test. Each result has a basis, which says which case version it applies to. The loose and standard policies accept exact or assumed versions by default. The strict policy requires an exact basis by default.

To require other methods or two distinct passing actors, use the CLI or API. An actor contributes at most one pass even if they pass by several methods. An excused failure still needs a separate pass from that actor for the actor to count. If the run requires two actors and only one has passed, it stays pending until another supplies a counted pass.

If a slot has no matching exercise requirement in the run, Mainworthy counts the slot as missing. The slot's stored state can still say it passed.

A person's result counts when the pinned case admits people. An automated test counts when its link or annotation identifies the case and the result meets the run's requirement for the case version. An agent counts only when the run asks for agents and the pinned case admits them. An agent's review is not a runtime pass. See agents.

The web planner uses these policy defaults. It does not yet offer controls for custom method requirements, required jobs, or actor assignments. For those settings, use the CLI or the API.

Record results by hand #

To record a result, follow these steps.

  1. Select an unfilled slot.
  2. Exercise the pinned case's steps.
  3. Press the key for the outcome.

p records "Pass". b records "Blocked". s records "Skip". These keys move you to the next unfinished slot you have not reported. They move you at once, before the server answers. Until it does, the slot's row and the line under the result buttons say sending; the line says recorded once the server has the result. If the server refuses it, the slot goes back to what it was, the status says why, and your note is kept. The cockpit opens the first slot waiting for your result. When someone claims work on a slot, they hold a lease that expires. Automatic selection, advancement, and Up next skip slots with someone else's active lease. They still include slots you hold. The cockpit checks later pages before choosing a slot just for reading. If a later page fails, its error appears beside More slots and automatic paging stops. To retry, press More slots. You can still use the slots already loaded. When no eligible unfinished slot remains, it opens the first slot not held by someone else for reading. If every slot is held by someone else, choose one explicitly or wait for a lease to expire. Automatic advancement stops when none remain. Completed and closed runs still open a case to read. After a result is confirmed, a delayed refresh cannot make automatic navigation revisit that slot. You can still select it yourself to read or correct the result. If a lead judges a disputed failure mistaken, that result no longer fills the slot. The next successful refresh returns the slot to your work when another result from you is needed. You do not need to reload the cockpit. The cockpit tells you while it reads the run. If a read fails, it shows what it could not read, why, and Retry. If the run does not exist, it links back to Runs. If the run has no cases, the cockpit tells you that too.

To record a failure, follow these steps.

  1. Press f or choose Fail to focus "Result note".
  2. Enter the failure details.
  3. Press Enter, or choose Fail again, to record "Fail" and move on. On a phone, choose Fail again.

On a phone, the result buttons Pass, Fail, Blocked and Skip are under the case, and a note typed in "Result note" is recorded with the next of them.

While the note has the focus, the outcome keys type letters and Enter records "Fail". To record another outcome with a note, follow these steps.

  1. Type the note.
  2. Press Esc to leave the field.
  3. Press the outcome key.

Type a step number before f to mark the failed step. Use j and k to move between slots, including your earlier results and slots another producer filled. A producer is the person, pipeline, or agent that reported the result. Recording a result moves on to the next slot waiting for your first report and passes over the others. You can also click a slot to reopen it and correct your result. The header's "N left in run" counts the slots that have no result yet, from anyone. While a run is pending only for results it lacks, its verdict says so in the same words: "pending: 3 not run", or "pending: 2 not run, 1 skipped or blocked". Below the verdict, the progress line counts each slot once by what it holds: passed, failed, disputed, blocked, skipped, waived, and not run. A slot holding both a skip and a blocked result counts as blocked. "Nothing left for you to run" means no unfinished slot that admits your method is waiting for your first report. The run can still be pending because a result was skipped or blocked, or another required person has yet to report. If browser storage is available, the run keeps unfinished notes on this device until the server records the result. If a report's reply is lost, unreadable, interrupted by an internal server error, or arrives after you sign in again, the page keeps its outcome unknown and checks the original command. A command that has begun but not finished is sent again under the same ID. Leaving the cockpit for another screen and reopening it in the same tab keeps pending reports in order. If the check fails, press a result key on that slot to check again, including after leaving and reopening the cockpit. The original result and note are recovered before another result can be recorded. Pending reports belong to the project in which they started. Removing and recreating a project does not replay them into its replacement. If a report belongs to an obsolete project, reload before recording a new result. Reloading the tab, signing out, switching to another person, or clearing this device's data ends the queue. Before recording the result, paste a screenshot into Result note or choose Attach a file. Pending files stay with their slot while you move between slots. Closing or reloading the page discards pending files. A saved result shows its images and file downloads. Each file may be at most 4 MiB, and a result may hold 20 files and 16 MiB. See attachments for report uploads, access, and retention.

See the keyboard guide for all run keys.

Blocked and skipped results record that the case was not proven. They do not satisfy a slot, and a run with missing proof stays pending. A failure opens a question. Answer it in Queue.

Press u to correct the last result. Undo waits for pending reports and restores the previous recorded outcome, note, failed step, and attachments. A refused report cannot become the outcome restored by undo. If an earlier attachment cannot be read, undo records nothing and reports the error. Press u again to retry once the attachment can be read. If there was no previous recorded result, the correction is a skip with the note "Withdrawn by the author". Both results stay recorded. The cockpit shows that slot as withdrawn, counts it as not run, and offers it to you again. Undo targets only the result recorded by this page. If another tab has replaced it, the page reports that it changed and leaves the newer result in place. If the policy closed the run automatically, a person allowed to withdraw its approval can press u to reopen the run and correct the result. The cockpit says when this action is available. Other closed runs show a link to the sign-off in Queue > Settled instead of offering correction. Reopening and correction happen in order. If reopening succeeds but correction fails, the run stays open and the status says the correction was not recorded. If the withdrawal's reply is lost, check the sign-off in Queue before trying again. The reporting operation also accepts late results for closed runs that accept a commit.

Let CI fill the run #

A run that accepts a commit can use linked test results for that same commit. Evidence already recorded fills qualifying slots when you plan the run. Later reports fill qualifying slots even after a commit run closes. The result must meet the slot's pinned version, method, and basis requirements.

An assumed result cannot fill a slot that requires an exact basis. A pass on another case version does not count just because the title is unchanged. See report results.

If a slot already has another producer's result, the web app leaves their evidence in place. If the slot still needs another person, you can record your result if the slot accepts your method. The result controls and automatic navigation include such slots, even if they contain only skipped or blocked results. Skipped and blocked results do not count toward the required people.

Require CI jobs #

Add named jobs when the run must receive reports from all parts of a pipeline. Each required job needs an applied pipeline report that ran something. A report containing only skipped or blocked results does not meet the requirement. Only results that their producer has not corrected count toward a required job. Correcting its last decisive automated result to skipped or blocked makes the job missing again, including in runs planned after the correction. If the run is closed, Mainworthy reopens it and reconsiders its approval. An agent's report under the same job name does not meet it either. A nothingRequired declaration never satisfies a required job or a case slot. That restriction applies even when the project's policy allows an empty commit gate to pass. A run that counts only its own results cannot require CI jobs.

Use this CLI form for one case, one commit, and a required tests job:

$ mainworthy plan --json '{"name":"Checkout CI","select":{"cases":["C-1"]},"accepts":{"commit":"1111111111111111111111111111111111111111"},"require":[{"id":"exercise","kind":"exercise","methods":["human","auto"],"minActors":1,"basis":"exact"},{"id":"jobs","kind":"jobs","jobs":["tests"]}]}'

Match the job name to the report's detected job or explicit --job value. A required job is separate from the evidence each case slot needs.

Resolve a disputed slot #

A counted pass and a counted fail from different producers make a slot disputed. A later write from another producer does not silently replace the disagreement. To settle the dispute, open the slot's separate "Disputed" question in Queue. Choose the appropriate failure answer. Each slot, cause, and scope has its own question. An earlier answer about the cause continues to apply elsewhere, but does not settle this slot. The order of that answer and the contradictory result makes no difference.

A settlement applies to the named failures in this slot. Another run that counts the same results needs its own settlement. A later effective result from a person or pipeline renews the question. An agent's report never renews or ends a person's settlement, even if its attempt or outcome changes. While the scope and evidence from people and pipelines stay the same, the classification covers later agent failures of that cause in this slot. A different cause needs its own settlement. Withdrawing or expiring an answer leaves this slot disputed again. Neither action withdraws the cause's answer or changes an unrelated commit gate.

"The failure was a mistake" judges the named results themselves. They stop counting in their commit gate and every open run that admitted them. This answer therefore has effects beyond the selected slot. A new failure reported later needs a new answer.

Under standard and strict, a person who produced the disputed evidence cannot settle that dispute. See policy. The same retry rules used by commit gates apply to results within each producer's job and target. See report results.

Close and reopen a run #

When a planned run passes, Mainworthy asks whether to close it. This question is the sign-off. Under loose, standard, and ci, the policy normally approves and closes the run automatically. Under strict, an authorized person approves with a reason in Queue. Rejecting sign-off leaves the run open. You cannot approve a run that no longer passes. While the question is open, the cockpit and the run's page in Runs say "Waiting for sign-off" and link to the question in Queue. Press o there to open the question.

A run that accepts a commit keeps receiving qualifying results after it closes, including reports that name the run. While a report waits for the server to apply it, the run's gate is pending. Once the server applies all accepted reports, Mainworthy asks for sign-off again if a report added or corrected qualifying results in the run. Reports that change neither qualifying slot results nor required-job evidence leave the run's approval in place. That includes reports for repositories or environments the run excludes. The ledger keeps the replaced approval and records that it no longer holds. A passing run can close again under its policy. A run with missing proof or unexplained failures stays open and cannot be approved.

A run that counts only results recorded in it takes no more results after closing. To reopen the run, follow these steps.

  1. Find the run's sign-off in Queue's "Settled" view.
  2. Withdraw that approval.

Newer decisions and the current policy still control who may withdraw it. To withdraw an automatic approval, you normally need answer, which makes your answer count where the policy asks a project member. That also applies if you recorded the last result. The cockpit's u shortcut can do this before correcting its last result, as described above.

Plan a run from the command line #

$ mainworthy plan --json '{"name":"Checkout smoke","select":{"tags":["checkout"]}}'

The reply names the run, its slot count, and how many slots evidence already filled. Use mainworthy gate --run R-2 to read its verdict. See the CLI guide for selection, methods, assignments, and other plan inputs.

Plan a release run #

Plan a release run after a successful deployment.

Use a pipeline token or the token of a person who holds admin on the project. Mainworthy refuses an agent's token, even one that holds admin.

  1. From the deploy step, announce the build label, artifact digest, and source commit.
  2. Plan a run that accepts the build.

For example, use these commands:

$ mainworthy announce --deploy 1.4-rc3 --env staging --digest sha256:aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa --repo acme/web --commit 1111111111111111111111111111111111111111 --cmd deploy-staging-rc3-1
$ mainworthy plan --json '{"name":"Release smoke","select":{"tags":["smoke"]},"accepts":{"build":"1.4-rc3","env":"staging"}}'

The plan reply gives a run ref. To record and check the release evidence, follow these steps.

  1. Report against the artifact.
  2. Check the release gate with the returned run ref.

For example, use these commands:

$ mainworthy report smoke.xml --build 1.4-rc3 --env staging
$ mainworthy gate --run R-2

Use the artifact's actual SHA-256 digest and the full source commit. For an artifact built from several repositories, send code as an array of {repo, commit} through announce --json. Mainworthy records who attests the source and when. It trusts that caller's statement and does not validate an external provenance signature.

Once bound, a build label cannot name a different digest. To announce another deployment of that build, supply --deploy, --env, and a new --cmd. Retrying an unchanged request with the same cmd records nothing twice. Use mainworthy find --in deployments to read deployment history and the attestation. The newest announcements come first, with a cursor for the next page.

When a report target or plan names an environment, announce that build label there first. Otherwise Mainworthy returns invalid and lists the environments where that label was deployed. A deployment under another label does not qualify that label.

A release run counts the exact artifact digest and its selected environment. Omit env from the plan to accept that artifact in any environment. Two labels bound to the same digest name the same artifact. Existing qualifying results fill slots at planning time, and reports arriving while the run is open fill them too. If you deploy the selected label to another environment later, results already recorded there for the same digest can fill a new run. Those results can come from reports under another deployed label. Results need not postdate the deployment announcement. A refused report stores no results. After announcing its deployment, send it again. Results from an attested source commit do not count as artifact execution.

Open the run in the web app to record manual results against its pinned cases. Recording by run alone uses that run's build and environment. MCP's report schema omits the build target. To report through MCP, supply a planned run in run. A gate with missing evidence stays pending. Failures and sign-off use the same rules as other planned runs. The web planner does not yet offer a build picker.

Take a slot while working #

The cockpit shows each live lease's holder and when work began. The header counts in-progress slots. Evidence counts and the verdict stay separate. Updates from other producers arrive through the existing live connection. The web cockpit skips other holders' slots during automatic navigation and includes them again when their leases expire. Initial selection, Up next, and advancing after a result include only slots whose pinned case and own exercise requirement admit your method (human or agent). When no unreported slots admit your method, the cockpit says Nothing left for you to run, even if the run still needs evidence from other methods. New plans and case proposals store each method once, accepting repeated method names. Slot admission also deduplicates methods in older stored records. You can still click a held slot or select it with j or k and record a result. Recording a qualifying result releases that slot's lease, including when someone else holds it. Unassigned slots without a lease say Available, and yours means the slot is assigned to you. A slot someone holds, you included, shows In progress with who holds it. Selecting a slot does not claim it. Press t to claim the selected slot and r to release it. On a phone, open the slot, then choose Claim slot or Release slot from Actions. The row says Claiming… or Releasing… until the server answers, then shows the hold the server gave. A claim uses the existing 15-minute work lease. If someone claims it first, the status shows the refusal and refreshes the slot's holder. Leases are advisory and never block recording. The CLI and API can also take, renew, and give back work.

Take the next free unfinished slot with the CLI:

$ mainworthy work --do take --run R-2

Include --slot 123 to take a named slot or renew your lease. --seconds 900 requests a length between 30 and 86400 seconds, with 900 as the default. The server sets the start and end. The slot's exercise requirement and its pinned case must both allow your method. If either lists a method more than once, Mainworthy uses it once when it reports the slot or checks whether your method qualifies. If someone else holds the lease, Mainworthy refuses the claim and names the holder and deadline. A null slot means no eligible unfinished slot is free. Two simultaneous next-slot requests get different slots.

Give the slot back with mainworthy work --do give-back --run R-2 --slot 123. A qualifying result from any producer ends the lease. Expiry frees it without a background cleanup job. Closing a run also ends its leases. A lease changes neither the evidence a run counts nor its verdict.

A plan accepts up to 1,024 requirements. Each requirement for CI jobs accepts up to 1,024 jobs. Archive imports apply the same limits.

Mainworthy 0.1.0 · Licence · this page is docs/guide/runs.md in the repository