## Code Analysis ### The retained shell contract requires a structured failure result `scripts/test-job-runner-image.sh:59-79` ```sh ./zig-out/bin/boris-job-runner --once \ --boris ./zig-out/bin/boris \ --archive "$OUT/poisoned.tar" \ --result-json "$OUT/poisoned.json" \ --work-root "$OUT/ws" poisoned_rc=$? [[ "$poisoned_rc" -eq 1 ]] || fail "poisoned job exited $poisoned_rc, expected 1" [[ -f "$OUT/poisoned.json" ]] || fail "poisoned.json not written" ``` The same script then reads the result and requires `ok: false`, `runnerClass: "content"`, no artifacts, and an `EPARENTMISSING` diagnostic (`scripts/test-job-runner-image.sh:70-76`). ### The native path renders and writes the result before returning the failure code `src/job_runner.zig:547-602` ```zig const ok = class == .ok and exit_code == 0 and !oversize; if (!ok) { for (artifacts) |a| { gpa.free(a.path); gpa.free(a.bytes); } gpa.free(artifacts); artifacts = try gpa.alloc(Artifact, 0); } return .{ .ok = ok, .runner_class = if (ok) .ok else class, .exit_code = exit_code, .diagnostics = parsed.diagnostics, .artifacts = artifacts, .workspace_removed = true, }; ``` For the invalid content case, this constructs a failed structured `JobResult` and clears artifacts rather than discarding the diagnostic payload. `src/job_runner.zig:1179-1200` ```zig const json = renderResultJson(gpa, result) catch return 3; defer gpa.free(json); if (cli.result_json_path) |path| { if (std.fs.path.dirname(path)) |parent| { if (parent.len > 0) cwd.createDirPath(io, parent) catch {}; } cwd.writeFile(io, .{ .sub_path = path, .data = json }) catch |err| { std.debug.print("error: write result json: {s}\n", .{@errorName(err)}); return 3; }; } return result.runner_class.processExit(); ``` The caller is expected to write the rendered JSON to `--result-json` and only then return the runner-class exit code. The observed missing file means the executed invalid-content path did not deliver the artifact required by its shell contract. ### Observed execution The retained script built the native binaries and produced a valid result for the valid fixture before invoking the missing-parent fixture: ```text + zig build -Doptimize=ReleaseSafe ==> valid fixture through native --once + ./zig-out/bin/boris-job-runner --once --boris ./zig-out/bin/boris --archive /workspaces/repo/.zig-cache/job-runner-smoke/valid.tar --result-json /workspaces/repo/.zig-cache/job-runner-smoke/valid.json --work-root /workspaces/repo/.zig-cache/job-runner-smoke/ws valid ok, artifacts 11 ``` The invalid-content invocation returned the expected status, but the required result file was missing: ```text ==> poisoned fixture through native --once + ./zig-out/bin/boris-job-runner --once --boris ./zig-out/bin/boris --archive /workspaces/repo/.zig-cache/job-runner-smoke/poisoned.tar --result-json /workspaces/repo/.zig-cache/job-runner-smoke/poisoned.json --work-root /workspaces/repo/.zig-cache/job-runner-smoke/ws + poisoned_rc=1 + [[ 1 -eq 1 ]] + [[ -f /workspaces/repo/.zig-cache/job-runner-smoke/poisoned.json ]] Traceback (most recent call last): File "", line 2, in FileNotFoundError: [Errno 2] No such file or directory: '/workspaces/repo/.zig-cache/job-runner-smoke/poisoned.json' ``` The static absence check found no deleted contract-claim/build-integration invocation; its retained matches were ordinary `zig build` references in the shell checks and build files. ### Result The captured run supports the reported failure: invalid content exits with status `1`, but the caller-required `poisoned.json` result payload is not available for inspection. ### Test context The overall retained shell suite also encountered unrelated existing checks, but this attachment focuses on the concrete job-runner result-file failure and the source path that is expected to write it.