gstack-artifact validate now refuses a run.json that gstack-autoplan never wrote (GST-3090) (#4494)

`gstack-artifact validate` and `ack` now refuse a run.json that
gstack-autoplan never wrote, so a hand-built run can no longer pass as a
finished review.

Why: a session skipped `gstack-autoplan next`, built run.json with a
script copied from the reference fixture, and got ARTIFACT_VALID.

Nothing to do unless you validate old or hand-made run directories:
rerun those through gstack-autoplan.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This commit is contained in:
Garry Tanandcapy-ai[bot] authored and GitHub committed 2026-11-18 16:45:06 +00:00
1 parent 45f879b534
commit 2767d229fb
12 files changed
+334 -18

No files matched your search

+32
View File
@@ -3511,6 +3511,38 @@ record does not state that publication order was unverified.
**Fix.** Start the run through `gstack-skill-start` (it prints the line) and
keep the line in the review record.
<a id="artifact-not-autoplan-run"></a>
### `ARTIFACT_NOT_AUTOPLAN_RUN`
**Meaning.** `run.json` parses and matches its schema, but gstack-autoplan did
not write it: `host` is not `gstack-autoplan`, a field gstack-autoplan writes
on every run is missing (`plan_input`, `plan_source`, `active_plan`,
`restore`, `out`, `created_at`, `revision`, `attempt_counter`,
`outside_enabled`, `phase_order`, `history`, `scope`), or the run directory
has no `attempts.jsonl` journal. A run.json written by hand or by a script,
for example one copied from `test/fixtures/multi-agent-wave/reference-run`,
is refused here even when every structural check passes.
**Fix.** Drive the run with `gstack-autoplan next`, `submit`, `answer` and
`export`, then validate the directory it wrote. A run written by a gstack
older than these fields is refused too; rerun it with this gstack.
<a id="artifact-journal-mismatch"></a>
### `ARTIFACT_JOURNAL_MISMATCH`
**Meaning.** The run directory disagrees with its own record of what happened:
the journal has no `init` row for this run, a reviewer attempt in `run.json`
was never journaled as dispatched, a completed voice's output or hash differs
from its journaled `submitted` row, a bound review output changed after
submit, or the run's checkpoint (when `GSTACK_AUTOPLAN_CHECKPOINT_DIR` or the
Drive opt-in names one) is ahead of `run.json`, disagrees on status or gate
revision at the same revision, or holds a journal the live one no longer begins with.
**Fix.** Treat the run as edited after the fact. Restore it from its
checkpoint (`gstack-autoplan resume --out <new dir> --from <checkpoint>`) or
rerun it with gstack-autoplan; never edit `run.json` or `attempts.jsonl` by
hand.
<a id="guard-not-installed"></a>
### `autoplan guard: not enforced by this host; publication order is unverified (GUARD_NOT_INSTALLED)`
+15 -4
View File
@@ -424,8 +424,14 @@ checks its prompt.
terminal outcome, every listed artifact exists inside the run directory with
the recorded hash, every JSONL file parses row by row against its schema with
run-bound unique ids, task dependencies and finding references resolve
without cycles, `counts` agree with the files, and (unattended) the guard
line is present. Otherwise it exits `1` with one error line per problem and
without cycles, `counts` agree with the files, (unattended) the guard
line is present, and gstack-autoplan wrote the run: `run.json` carries
the fields it writes on every run (`host: gstack-autoplan`, `plan_input`
and the rest, `ARTIFACT_NOT_AUTOPLAN_RUN`) and agrees with its
`attempts.jsonl` journal, its bound review outputs and its checkpoint
(`ARTIFACT_JOURNAL_MISMATCH`). `gstack-artifact ack` runs the same
check. A public copy (`validate --public`) carries no journal and is
checked against its private run's digests instead. Otherwise it exits `1` with one error line per problem and
`ARTIFACT_INVALID: <n> error(s)`; `--json` returns the same as
`{ valid, run, status, run_dir, errors[] }`. A run that was interrupted shows up here as
`ARTIFACT_RUN_INTERRUPTED`, never as a partial success.
@@ -1015,8 +1021,13 @@ line, on an ephemeral state root.
## Reference run
`test/fixtures/multi-agent-wave/reference-run/` is a complete unattended
`/autoplan` run (the one that produced this wave's plan) and validates clean.
`test/fixtures/multi-agent-wave/reference-run/` is the hand-written run
that produced this wave's plan, from before `gstack-autoplan` existed. It
pins the structural contract (`validateRun` passes it), but
`gstack-artifact validate` refuses it with `ARTIFACT_NOT_AUTOPLAN_RUN`: it
has no `plan_input` and no journal, because no gstack-autoplan wrote it. Copy
a run gstack-autoplan wrote, never this one, when you need a run that
validates.
`test/fixtures/multi-agent-wave/INCIDENTS.md` records what went wrong while it
was produced by hand and which validator rule now catches each incident.