New packages/runs reads run records, result.json, the release pointer
and the activation log without writing, pruning or following a link out
of the data root. mosaic-task.mjs list and show use it, so a malformed
result.json or a run that is a regular file no longer crashes them.
Deliberate deltas are listed in the README.
Rocko built it. Round 1 (ed3c5392) was approved with notes by Darkwing
(27115) and Filbert (27116); round 2 (2727198f, tests and wording only)
was approved by Darkwing (27123) and Filbert (27124). Sage's gate on
c9a25a47 plus the candidate: runs 41/0, queue 148/0, webui 22/0,
conversation 182/0 (181/1 in the full run on the K12 cgroup timing
test under load, 182/0 alone), control-board 124/0, every
scripts/test-*.sh 0 failed (task 98/0 with Docker, 26/0 without).
Co-Authored-By: Claude Opus 5.5 <[email protected]>
49 lines
2.5 KiB
Bash
Executable File
49 lines
2.5 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Seeds a data root for the row 56 byte-identity check. Usage: seed.sh DIR
|
|
# DIR must not exist. Writes run records only under DIR.
|
|
set -euo pipefail
|
|
D="$1"
|
|
[ ! -e "$D" ] || { echo "seed: $D exists" >&2; exit 4; }
|
|
R="$D/runs"
|
|
mkdir -p "$R" "$D/state"
|
|
run() { mkdir -p "$R/$1"; }
|
|
put() { printf '%s\n' "$3" > "$R/$1/$2"; }
|
|
|
|
A=r-20260101T000000Z-aaaaaa
|
|
run $A
|
|
put $A task.json '{"taskVersion":1,"id":"t-full","prompt":"say hi","mission":"m.json"}'
|
|
put $A mission.json '{"missionVersion":1,"id":"m-full","objective":"Exercise every show line"}'
|
|
put $A result.json '{"runVersion":1,"runId":"'$A'","taskId":"t-full","missionId":"m-full","status":"succeeded","reason":null,"request":"say \"hi\"\nplease","response":"hi","expectedExact":"hi","retriedFrom":"r-20251231T000000Z-000000","workspace":"ws1","tools":["read","ls"],"session":"s1","sessionForkFrom":null,"exitCode":0,"signal":null,"provider":"zai","model":"m","startedAt":"2026-01-01T00:00:00.000Z","finishedAt":"2026-01-01T00:00:01.000Z","durationMs":1000}'
|
|
: > "$R/$A/stderr.txt"
|
|
mkdir "$R/$A/workspace"
|
|
|
|
B=r-20260101T000100Z-bbbbbb
|
|
run $B
|
|
put $B task.json '{"taskVersion":1,"id":"t-fail","prompt":"x"}'
|
|
put $B result.json '{"runVersion":1,"runId":"'$B'","taskId":"t-fail","missionId":null,"status":"failed","reason":"expect-mismatch","request":"x","response":"y","expectedExact":null,"workspace":null,"tools":null,"session":null,"sessionForkFrom":null,"exitCode":null,"signal":"SIGKILL","provider":"zai","model":"m","startedAt":"2026-01-01T00:01:00.000Z","finishedAt":"2026-01-01T00:01:02.000Z","durationMs":2000}'
|
|
|
|
C=r-20260101T000200Z-cccccc
|
|
run $C
|
|
put $C task.json '{"taskVersion":1,"id":"t-incomplete","prompt":"x"}'
|
|
|
|
E=r-20260101T000300Z-dddddd
|
|
run $E
|
|
put $E result.json '{"status": "succeeded", truncated'
|
|
|
|
N=r-20260101T000400Z-eeeeee
|
|
run $N
|
|
put $N result.json 'null'
|
|
|
|
F=r-20260101T000500Z-ffffff
|
|
run $F
|
|
put $F mission.json '{not json'
|
|
put $F result.json '{"runVersion":1,"runId":"'$F'","taskId":"a-task-id-longer-than-eighteen","missionId":"m","status":"succeeded-with-a-long-status","reason":null,"request":"","response":"","workspace":":run","tools":[],"session":"named-session","exitCode":0,"signal":null,"provider":"p","model":"m","startedAt":"s","finishedAt":"f","durationMs":0}'
|
|
|
|
printf 'not a run directory\n' > "$R/r-20260101T000600Z-gggggg"
|
|
ln -s "$A" "$R/r-20260101T000700Z-hhhhhh"
|
|
ln -s "r-does-not-exist" "$R/r-20260101T000800Z-iiiiii"
|
|
run r-zz.weird_name-1
|
|
mkdir "$R/x-not-a-run"
|
|
printf '{"at":"2026-01-01T00:00:00Z","event":"pruned","runId":"r-old"}\n' > "$R/.pruned.log"
|
|
printf 'notes\n' > "$R/notes.txt"
|