nightward_run
Run pytest after code edits to capture behavior, compare it against a human-approved baseline, and return a boundary signal that flags unapproved regressions.
Instructions
Run the tests, capture behaviors, and return the boundary signal.
Call this after every code edit: nightward_status only reports the last run.
path: what pytest runs (relative to the server's working directory); omit it to
run the project's capture suite ([tool.nightward] path, else ".");
dir: omit it - the server gates the store a human started it with
(`nightward mcp --dir`), and any other store is refused; timeout: seconds
before pytest is stopped (the store is then left untouched and the last
report invalidated).
Returns {boundary, unapproved, changes: [{name, kind, group, judged,
judge_model, judge_reason, judge_replayed, rejected, rejected_by, depth,
ask_human}], judged_same,
not_run (approved behaviors whose test was deselected: not checked), narrowed,
stale, incomplete, generated_at, judge, scrub_rules (custom scrub rules of the run
and what they replaced), env_mismatch (changed behaviors approved on another OS or
Python than this run, or null: tell the human - it never makes a breach
acceptable), store (absolute path of the gated
store), path (what pytest ran), warnings: {skipped, failed, errors, deselected,
xfailed, scrubbed,
scrub_unmatched (custom scrub rules that matched nothing), scrub_rules (per custom
rule: values and behaviors it replaced, and whether that changed since the last run),
judge_added (judge ruling files this run added to the store's judge/ dir - a human
commits them with the baseline), pytest_returncode, pytest_output_tail}}.
boundary is one of:
"intact" done: no unapproved change;
"breached" unapproved changes: fix the code, or ask a human to approve;
"partial" nothing unapproved among what ran, but approved behaviors were
not checked (their test was deselected, see not_run): not done -
run them (remove the -k/-m selection); you can't waive this;
"incomplete" nothing unapproved, but capture tests failed or errored
(see incomplete and pytest_output_tail): fix the tests;
"stale" the baseline, capture or rejections moved since the report: run again;
"unknown" no report yet: run.
Done means boundary == "intact" and stale is false. Behaviors approved with
semantic=True are judged by the judge the humans committed
([tool.nightward] judge in pyproject.toml, or `nightward mcp --judge`);
"judge" says which, and why it was unavailable if it was. This tool cannot
approve changes: a human does that with the nightward CLI.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dir | No | ||
| path | No | ||
| timeout | No |