Fixes, tests and replay
This page covers the fix loop: get a fix candidate, attach it to an issue, verify it on your own machine against recorded cases, approve it, and keep it from coming back with the regression suite in CI.
zyonix fix suggest --issue 3 --out fixes/ # candidates derived from the evidence (optional)
zyonix fix propose --issue 3 --kind prompt ... # administrator: DIAGNOSED -> FIX_PENDING
zyonix replay --fix 4 # member: runs the cases here, the server judges
zyonix fix show 4 # the verification scorecard
zyonix fix approve 4 # administrator: -> AWAITING_DEPLOY
zyonix deploy --fix 4 --release <git-sha> # after you ship it: -> MONITORING
How verification works
Zyonix never runs your code on its servers. zyonix replay and zyonix test call your
application's replayable step (a function marked @zyonix.step(..., replayable=True)) on your
machine with frozen inputs recorded from real runs, then upload what each call returned. The
server judges every output with its checks; the CLI only prints the server's verdict. Your
provider keys never leave your machine. The outputs do, redacted with your zyonix.yaml settings,
so these commands need capture: full and a replay: section
(Set up).
A replay runs three case sets, each case k times, under two arms: baseline (your code as it
is) and candidate (the fix's configuration override merged into the step's configuration
argument):
| Set | Cases | Gate |
|---|---|---|
| A | the issue's failing cases | at least 90% of the reproduced failing cases pass under the candidate |
| B | every other regression case | no case that passed on the baseline fails under the candidate |
| C | the golden set | golden accuracy does not drop by more than 0.5 percentage points |
Each gate is pass, fail or inconclusive. A cost and performance block (latency, tokens, LLM
calls) is shown too; it is advisory and never part of the verdict.
zyonix fix suggest
Fix candidates Zyonix derives from the evidence of an issue or a run. Nothing is applied.
zyonix fix suggest --issue 3
zyonix fix suggest --issue 3 --out fixes/
zyonix fix suggest --run 4be0910c269c
| Option | What it does |
|---|---|
--issue N | suggestions for this issue (give --issue or --run) |
--run RUN | suggestions for one run's findings, uncertain ones included (id or unique prefix) |
--out DIR | write each suggestion as two files: zyonix-fix-issue-3-1.json (a whole fix, for zyonix replay --local) and zyonix-fix-issue-3-1.candidate.json (the candidate only, for zyonix fix propose) |
Who may run it: any reader.
How to read it: one numbered block per suggestion: its title, kind, the check it is for,
whether it is replay-verifiable or needs a code change in your application, why, the patch, and
evidence lines. The Next block gives the exact replay --local and fix propose commands for the
first suggestion. With --json and --out, the files are still written and stdout carries only
the JSON.
zyonix fix propose
Attach a fix proposal to a DIAGNOSED (or REOPENED) issue. The issue moves to FIX_PENDING.
zyonix fix propose --issue 3 --kind prompt --title "Always extract the tax line" --candidate-file fix.json
zyonix fix propose --issue 3 --kind config --title "Raise max_tokens" --candidate '{"config": {"max_tokens": 2048}}'
zyonix fix propose --issue 3 --kind rule --title "Tighten the total rule" --spec-file new_spec.yaml
zyonix fix propose --issue 3 --kind code_note --title "Parse dates day-first" --note "use dayfirst=True in parse_date()"
A prompt or config candidate is a JSON object whose config part is merged into the configuration
your replayable step receives:
{"config": {"prompt_addendum": "Always extract the tax amount, even when it is labelled VAT."}}
| Option | What it does |
|---|---|
--issue N | the issue (required) |
--kind KIND | prompt, config, rule, code_note or runtime_policy (required) |
--title TEXT | a short title (required) |
--description TEXT | a longer description |
--candidate JSON | the candidate as inline JSON (prompt, config) |
--candidate-file FILE | the candidate as a JSON file (prompt, config) |
--spec-file FILE | rule: the new reliability spec (YAML) |
--note TEXT | code_note: the change you will make in your code |
--strategy | runtime_policy: the Guard strategy to enable, R1 to R4 |
| Kind | What it changes | Verified by replay | Applied by |
|---|---|---|---|
prompt | the prompt your step uses | yes | you, then zyonix deploy --fix |
config | model settings or other configuration | yes | you, then zyonix deploy --fix |
rule | what Zyonix checks (a new spec) | yes (the server judges with the candidate spec) | Zyonix, at approval |
code_note | your application code | no | you, then zyonix deploy --fix |
runtime_policy | turns a Guard strategy on | not on customer installations (see below) | Zyonix, at approval |
Who may run it: administrator.
Output: fix #4 attached to ISS-3 (proposed) and the zyonix replay --fix 4 command.
A runtime_policy fix is verified with the Guard running on your machine, which customer
installations do not include; zyonix replay --fix stops with exit code 2 saying so. Talk to
whoever runs your Zyonix deployment before using the Guard.
zyonix fix show
A fix with its candidate and verification report.
zyonix fix show 4
| Option | What it does |
|---|---|
FIX | the fix number |
Who may run it: any reader.
How to read it: Fix #4 prompt [verified] for ISS-3, the title, author, who approved or
rejected it and the deploy marker; the Candidate; Verification: the replay run and its
Set A / B / C scorecard with the server's gate per set, or "running", "not verified yet", or "a
code note cannot be verified by replay". The Next block depends on the state: replay it, approve
or reject it, or record its deploy.
zyonix fix approve
Approve a verified fix. This is a human decision and is audit-logged with who made it.
zyonix fix approve 4 --reason "A 5/5, B clean, C 95.0% -> 95.0%"
| Option | What it does |
|---|---|
FIX | the fix number |
--reason TEXT | why (optional, recorded) |
Who may run it: administrator.
Output:
prompt,config,code_note:fix #4 approved for ISS-3 (approved); the issue isAWAITING_DEPLOY. Ship the change, then runzyonix deploy --fix 4 --release <git-sha>.rule,runtime_policy: Zyonix applies it at once (applied on the server (spec v8); the issue is now MONITORING).
zyonix fix reject
Send a verified fix back. The issue returns to FIX_PENDING.
zyonix fix reject 4 --reason "Set C dropped on credit notes"
| Option | What it does |
|---|---|
FIX | the fix number |
--reason TEXT | why (required, recorded) |
Who may run it: administrator.
zyonix fix promote
Turn a coding agent's verified draft into a fix proposal. It approves nothing: the fix still goes
through zyonix replay --fix and zyonix fix approve. It works in two steps on purpose: look,
then promote exactly the revision you looked at.
zyonix fix promote 7 # shows draft D-7 and what blocks promotion; changes nothing
zyonix fix promote 7 --revision 2 # promote revision 2
zyonix fix promote 7 --revision 2 --replace --reason "better than fix #4"
| Option | What it does |
|---|---|
DRAFT | the draft number (D-7 is 7; see zyonix drafts) |
--revision N | the revision you inspected; without it the draft is only shown. A draft that changed since is refused |
--replace | supersede a fix that is already proposed (never one that is being verified, approved or deployed) |
--reason TEXT | why (optional, recorded) |
Who may run it: administrator.
Output: draft D-7 promoted: fix #9 is proposed for ISS-3 (not verified, not approved). Drafts
are described on Coding agents and MCP.
zyonix replay
Two modes:
- A real replay (
--fix N) verifies a proposed fix: the issue goes toVERIFYING, the cases run here, the server judges them and moves the issue toAWAITING_APPROVAL(passed) or back toFIX_PENDING(failed). - A preview (
--issue N --candidate-file FILE --local) evaluates a candidate that is not a fix yet against the same gate and records nothing: no fix, no replay run, no issue transition.
zyonix replay --fix 4
zyonix replay --fix 4 --k 5
zyonix replay --issue 3 --candidate-file fixes/zyonix-fix-issue-3-1.json --local
zyonix replay --issue 3 --candidate '{"config": {"prompt_addendum": "..."}}' --kind prompt --local --out preview.json
| Option | Default | What it does |
|---|---|---|
--fix N | the fix proposal to verify (a real replay) | |
--local | off | preview a candidate; record nothing |
--issue N | with --local: the issue the candidate is for | |
--candidate-file FILE | with --local: the candidate (JSON), or a whole fix with kind, candidate, title, description (what fix suggest --out writes) | |
--candidate JSON | with --local: the candidate inline | |
--kind KIND | the file's kind | with --local: prompt, config, rule, runtime_policy or code_note |
--out FILE | with --local: write the preview (candidate, per-case results, the server's evaluation) here, for zyonix drafts create --from-preview | |
--timeout SECONDS | 900 | with --local: stop starting new cases after this long; what did not run makes the preview incomplete, never a pass |
--k N | 3 | runs per case and arm (1 to 9) |
--setup MODULE:FUNC | replay.setup | initialises your application |
--config-provider MODULE:FUNC | replay.config_provider | returns your current configuration |
--python-path DIR | replay.python_path | extra import folder (repeatable) |
--json | off | print the verification report (or the preview) as JSON |
Who may run it: a real replay, member. A preview, member or an agent key.
How to read it: while cases run, a progress line on stderr (set A regression#12). Then the
scorecard: one line per set with its case counts and the server's gate (pass, fail,
inconclusive), the overall gate with its reasons, and the advisory performance block. A real
replay ends with VERIFICATION PASSED: awaiting human approval or VERIFICATION FAILED: the fix goes back to FIX_PENDING. A preview ends with PREVIEW VERIFIED, FAILED, INCOMPLETE or
UNSUPPORTED, and for each gate that did not pass, what to do.
Exit codes:
| Code | Real replay | Preview |
|---|---|---|
0 | verification passed | every gate passed (verified) |
1 | verification failed | a mandatory gate failed (failed) |
2 | could not run (no capture: full, step not importable, key, connection) | the same |
3 | a gate could not be evaluated (incomplete), or a code_note (unsupported). Not a pass |
zyonix test
Run the regression suite against your current code: the CI gate. It pulls the suite's cases, calls your replayable step for each with its frozen input, uploads the outputs, and the server judges them.
zyonix test
zyonix test --suite canary --junit results.xml
zyonix test --suite full --trigger nightly
zyonix test --no-record
A regression is a case whose fix is approved or live that fails, or a case that passed last time and fails now. Cases of issues that are not fixed yet are known failing and do not fail the build.
| Option | Default | What it does |
|---|---|---|
--suite | canary | canary (a small set, per commit) or full (every case, nightly or before a release) |
--k N | 1 | runs per case; with more than one, a case passes at 2 of 3 or better |
--junit FILE | write JUnit XML here | |
--trigger | ci when $CI is set, else manual | ci, nightly or manual |
--git-sha SHA | $GITHUB_SHA or $GIT_SHA | the commit to store with the run |
--release LABEL | a release label to store with the run | |
--no-upload | off | run the cases and send nothing; nothing is judged (each case shows not-judged) |
--no-record | off | have the server judge the outputs and classify regressions, and store nothing |
--use-recorded-config | off | run each case with the configuration recorded when it failed instead of requiring replay.config_provider (fixed cases will then keep failing) |
--setup, --config-provider, --python-path | from zyonix.yaml | as for zyonix replay |
--json | off | the results as one JSON document (zyonix.test/1); the exit code is the same |
Who may run it: member (cli key in CI). With --no-upload, any reader.
How to read it: one line per case, starting with its result: PASS, REGRESSION,
KNOWN-FAILING, ERROR or NOT-JUDGED, then the case (regression#12 or golden#3), the
document id, the issue it belongs to, and the failed checks in brackets. Then a total:
PASS regression#12 INV-1042 issue 3
KNOWN-FAILING regression#15 INV-1077 issue 5 [required:tax_amount]
PASS golden#3 INV-0991 golden
3 case(s), 2 passed, 0 regression(s), 1 known failing, 0 error(s): OK
Exit codes: 0 no regression, 1 at least one regression, 2 could not run. It also exits
2 and records nothing when the run could not exercise your code: the cases carry a recorded
configuration but replay.config_provider is not set, or every case failed to run for the same
reason (a missing provider key, an uninitialised application, a changed signature). A broken CI
environment therefore never shows up as regressions.
zyonix test --json prints schema, suite, k, passed, uploaded, recorded,
regression_run_id, counts (cases, passed, regressions, known_failing, errors) and one
entry per case. See Using the CLI in CI.
zyonix regression list
The nightly suite's state and recent suite runs. zyonix regression on its own is the same command.
zyonix regression
zyonix regression list --limit 50
| Option | Default | What it does |
|---|---|---|
--limit N | 20 | how many runs |
Who may run it: any reader.
How to read it: Nightly suite: with its state (for example failing or stale), the last run's time and
counts, then a table RUN, WHEN, SUITE, TRIGGER, GIT, CASES, PASSED, REGRESSIONS,
KNOWN FAILING, RESULT.
zyonix regression show
Per-case results of one suite run.
zyonix regression show 41
| Option | What it does |
|---|---|
RUN | the regression run number (the RUN column of zyonix regression) |
Who may run it: any reader.
How to read it: the run's suite, trigger, time, result, git sha and release, counts, then
CASE, STATUS, FLAG (REGRESSION, must-pass or known failing), FAILED CHECKS, DOC.
zyonix regression cases
The cases a suite runs and how they last did.
zyonix regression cases
zyonix regression cases --suite canary
| Option | Default | What it does |
|---|---|---|
--suite | full | canary or full |
Who may run it: any reader.
How to read it: CASE, DOC, FROM (the issue and its state, or the golden set), SUITE,
MUST PASS (its fix is approved or live), LAST (last status, or never run), ASSERTS. Issues
create regression cases automatically when they are diagnosed.
zyonix golden list
The golden set: documents with a human-verified correct record. They are ground truth and the
yardstick for Set C in every verification. zyonix golden on its own is the same command.
zyonix golden
Who may run it: any reader.
How to read it: how many cases are active, runnable and in the canary suite, then DOC,
INPUT (frozen, waiting for a clean run, or BLOCKED with the reason below the table),
SUITE, FROM, ACTIVE. A case needs a frozen input from a clean run of that document before it
can run.
zyonix golden add
Add (or replace) a golden case.
zyonix golden add INV-1042 --file expected.json
zyonix golden add INV-1042 --json-record '{"invoice_no": "1042", "total": 1190.0}' --trace 3c70b5c68036
zyonix golden add INV-2001 --control
| Option | What it does |
|---|---|
DOC_ID | the document id |
--file FILE | a JSON file with the correct record (- reads standard input) |
--json-record JSON | the correct record inline |
--trace RUN | freeze the input from this run (default: the latest clean run of the document) |
--control | a healthy control for an agent with no correct record: it only has to keep running without errors under a fix. Takes no record |
Who may run it: administrator.
Output: INV-1042 added to the golden set, or with a note when its input could not be frozen
yet (it is captured from the next clean run) or is blocked (with the reason).
zyonix golden import
Add many golden cases from a JSONL file: one object per line with doc_id and the correct record.
zyonix golden import seed.jsonl
zyonix golden import seed.jsonl --field expected
{"doc_id": "INV-1042", "corrected_output": {"invoice_no": "1042", "total": 1190.0}}
| Option | Default | What it does |
|---|---|---|
FILE | (required) | the JSONL file |
--field NAME | corrected_output | the field holding the correct record |
Who may run it: administrator.
Output: 12 golden case(s) added; 3 wait for a clean run to freeze their input. --json gives
added and waiting_for_input. A line without doc_id or the record field stops the import with
its line number.
zyonix golden remove
Remove a golden case.
zyonix golden remove INV-1042
| Option | What it does |
|---|---|
DOC_ID | the document id |
Who may run it: administrator.