Repository navigation
feat(judge): validated named metrics and persistence (script judge, slice 1) - #347
Conversation
) Adds the first bounded slice of the alibaba#317 contract: a per-judge metric registry, four independent state axes (execution stage, completion, termination cause, slot availability), a derived quality state, whole-payload versus single-slot validation, and group completion folding that preserves earlier member detail. Execution metadata and planned metric slots are recorded on the member outcome and the grouped path even when no judge result exists, so a gate short-circuit or a cancellation never loses them. An accepted score survives a later cancellation or timeout, and the timeout, its source and any recovery stay visible. Existing PASS/FAIL/SKIP/ERROR verdicts, the alibaba#309 assertion and member denominators, script-timeout verdict mapping and the JSONL event schema are unchanged.
The previous commit added the state machine but no producer: both grouped call sites materialized slots from a nil emission list, so no judge could ever report an AVAILABLE metric and DeriveQuality/FoldGroup had no production caller. This adds the missing slice-1 path. - script judge executes, collects its invocation-bound result file, validates it and materializes one slot per planned registry entry - whole-envelope defects (duplicate json keys, unknown top-level field, bad schema version, unbound or stale invocation, size limit) poison every slot; entry-level defects poison only their own slot and keep valid siblings - a timeout no longer discards a trustworthy result: collected scores stay AVAILABLE while the existing script-timeout verdict mapping is preserved, and slots never reached become NOT_PRODUCED rather than an invented zero - group completion and cause are derived with FoldGroup and persisted into evaluation.json beside the unchanged all_required verdict - integration tests spawn the real script judge through executeCase; the process-kill cancellation case is POSIX-only for the same process-group reason upstream already documents Removes the unconsumed definition-compatibility helper and the cancel sources that slice 1 cannot actually detect; those return with their consumers.
Found while reviewing the real data flow rather than the helper functions: - accepted only means the member reached its own final outcome: no stop, or a deadline that still left collected scores. A cancellation arriving mid-run is never acceptance; previously a killed member kept a COMPLETED-looking verdict and its untouched slots read MISSING instead of NOT_PRODUCED - the collector Lstat-s the assigned path and requires a regular, non-symlink file, and checks the size before reading instead of after - an unassigned channel (non-local runtime) reports metrics_channel_unsupported rather than pretending a stale file was found - the real child-process timeout path is now covered on Windows too: the script writes its bound result, outlives the 1s deadline and is killed; long sleeps were shortened because 30s orphans destabilised concurrent package builds - README documents the payload grammar, injected variables, persistence targets and an explicit not-implemented list for this slice
|
|
|
Thanks for the first implementation slice. I reviewed HEAD
Please add regression tests through the real evaluator paths, asserting verdicts and persisted metadata alongside envelope values. Existing tests that require PASS for every exit-zero metrics script, or INCOMPLETE for an optional omission, should be updated to the agreed contract. The bounded scope remains appropriate: Agent-judge numerical output, sandbox collection, report rendering, comparisons, and JSONL schema extensions can remain in follow-up PRs. |
JHWang-1997
left a comment
There was a problem hiding this comment.
Reviewed commit 72b449d356930945fb573da4ffafa23bd48ba8b0. Requesting changes before merge.
I independently reproduced the six issues in the existing review, and they remain present at this head. Please address those findings: applying the opt-in metric policy to verdicts, preserving single-judge execution metadata and planned slots, finalizing grouped state on early returns, respecting optional metrics when deriving completion, preserving the configured judge identity, and attributing the deadline that actually expired.
The verdict issue is the highest priority: an exit-zero script with min_score: 0.8 and score 0 still produces a case-level PASS, despite metric_quality_state=NOT_MET. Missing required metrics and an invalid score of 2 also leave the case passing. Configurations that explicitly opt into these constraints need the agreed failure/error semantics, while configurations without metrics should retain their existing behavior.
I also found an additional deterministic test-fixture defect, described in the inline comment: the fast and slow judges in TestExecuteCaseCancellationKeepsAcceptedResult reference the same script file. The second write overwrites the first, so the test never reaches the accepted-result state it is intended to protect.
Validation on macOS in an isolated snapshot:
go test -race ./internal/judge ./internal/config ./internal/evaluator ./internal/report: judge, config, and report passed; evaluator failed atTestExecuteCaseCancellationKeepsAcceptedResult.- Temporary targeted reproducers confirmed the verdict, gate-state, optional-completion, identity, and deadline-attribution findings.
These requests stay within the current slice. Agent-judge numeric output, sandbox metrics collection, report rendering, comparisons, and JSONL schema changes can remain follow-up work.
|
Thank you both for the detailed reviews and for reproducing these issues. I appreciate the concrete examples and the extra check on the cancellation test fixture. I’ll work through the reported issues, including the verdict handling, early-return paths, group state, metric identity, and timeout attribution. I’ll also fix the fixture and add regression tests that exercise the evaluator paths. I’ll update the PR when I have changes ready for another review. |
interruptedExecution recorded termination_cause and deadline_source but never the timeout metadata, so a grouped member stopped by its own judge deadline reported the cause without the structured record that README requires. Build it once in interruptedExecution and drop the duplicate in deriveSingleExecution.
Add a grouped judge-timeout case with a live but unexpired case deadline, the shape the review asked about, and assert the stop names judge.timeout_seconds. Assert the coverage buckets behind each contract verdict, the configured judge id on grouped members, and the folded group state on every skip short circuit. Move the two tests that kill a running child onto a scratch workspace, since Windows harness cleanup of a held working directory fails after all assertions pass.
Run a real script judge through NewEvaluator/EvaluateAll, write the case artifacts, then read evaluation.json back from disk and assert the configured judge id, FINISHED execution and the explicit zero score. Split the case into helpers so the complexity gate accepts it, and provide the PowerShell fixture so the path is verified on Windows instead of skipped.
|
Thanks for the detailed review. I pushed three commits to the PR branch at
The cancellation fixture now gives the fast and slow judges distinct script paths. The accepted-result-then-cancellation end-to-end test passes on Linux; it remains skipped on Windows because process-startup timing makes that ordering nondeterministic there. Validation on Linux passed: the real pre-commit hooks for all three commits, |
|
Thanks for the fixes. I re-reviewed HEAD Additional real-subprocess tests through
Please add evaluator-level regressions for timeout plus a below-threshold valid score, nonzero exit after writing a valid metrics file, and unchanged compatibility assertion counts under metric-policy failure. The first two need both execution and scoring outcomes asserted together; testing the collector or quality derivation alone misses the finalizer interaction. The first-slice scope remains appropriate. These three corrections should stay within scoring/persistence; the deferred Agent-judge output, sandbox collection, rendering, comparisons, and JSONL schema work need not be pulled into this PR. |
A below-threshold score must not turn a timeout ERROR into FAIL, because the case then loses the retryable timeout reason, and a script that exited nonzero must not be reclassified as a missing-required-score contract error. Report both metric decisions in the additive metric metadata instead, and stop injecting a synthetic compatibility assertion: the alibaba#309 assertion and member denominators stay exactly as the execution layer produced them.
…real path Each case runs a child script through executeCase and asserts the execution outcome and the metric state together: a timeout with a below-threshold score on the single and grouped paths, a nonzero exit after writing a valid result file, and unchanged compatibility counts when the metric policy decides.
Thanks for the three reproductions — they exposed real issues. I pushed fixes and regression tests in ba9635e and 0dfde3a.
The new tests exercise these cases through the evaluator with real script processes. I also checked that they fail when the production fixes are reverted. On Linux, the repository checks and race tests passed locally. The GitHub workflows for the new head are still awaiting approval, so I don't have CI results yet. The PR remains a draft, and the previously listed follow-up work is still outside this slice. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0dfde3ad95
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A relative --output-dir used to hand the script judge a relative result path, which the child resolves against its case workspace while the collector resolves it against this process, so scores vanished; the channel now binds an absolute path. The judge phase and the metric finalizer work on a copy of the case record, so a threshold miss or a contract violation persisted FAIL/ERROR while the evaluator.case span and skill_up.case.run.count kept reporting the pre-judge PASS on both the single-shot and the multi-turn route: each now writes the final verdict back before the deferred telemetry reads it. Termination causes stay conservative. A skipped judge adopts a context stop only when that stop is the failure it was handed, so an unrelated engine error that lands after the case deadline expired still reports execution_error instead of blaming a knob skill-up never armed, and a judge that fails before producing any grading result counts as prevented rather than materializing MISSING slots. A metric payload carrying a number beyond float64 poisons only its own slot, because the structural scan no longer converts numbers, and a non-finite min_score is rejected at configuration validation since every comparison against NaN is false and quality derivation would then report MET for any score.
Head branch was pushed to by a user without write access
|
The fixes are pushed in 73b3acb. GitHub shows that the three workflows are awaiting maintainer approval. Could a maintainer approve them so CI can run? I’ll follow up with the reviewers once the checks finish. |
|
The fixes are now pushed in |
|
Thanks for clarifying. For the two contract choices:
Please update the null handling and add regression tests covering both cases, including a payload where one metric has null evidence and another retains its valid score. |
Rejecting the whole payload when an evidence array carried a null threw away sibling scores: a run whose correctness entry held [null, "valid evidence"] persisted both planned slots as ERROR and lost the 0.9 that completeness had earned. Per the per-entry isolation contract a null is one entry's defect, so the collector now marks that metric ERROR/invalid_evidence with no value and leaves an independently valid sibling AVAILABLE, which is what evaluation.json shows on read back in the new regression. A blank string element is not this defect: evidence_required asks for at least one nonblank string, so ["valid evidence", " "] still supports the score, and a null evidence field still means an omitted one. Elements that are neither strings nor null remain the whole-envelope shape defect they already were, so the payload boundary stays as documented.
Thanks, Ping — that makes sense. I’ve updated this in 59314df. A null element now marks only the affected metric slot as ERROR/invalid_evidence; other valid slots keep their scores. I also added regression coverage through the evaluator and a persistence test that reads back evaluation.json and checks that the sibling score remains available. For nonblank evidence, the rule remains “at least one”: ["valid evidence", " "] is accepted when evidence is required. Validation on Linux: make verify, make test (including go test -race ./...), and make e2e all passed. |
zpzjzj
left a comment
There was a problem hiding this comment.
Thanks for the update. I re-reviewed HEAD 59314df across all 27 changed files, including configuration, scoring and verdict precedence, evaluator callers, persistence, and regression tests. The previous evidence-validation, default-timeout provenance, and result-less execution-error findings are addressed.
One P2 remains (0 blockers, 1 major, 0 informational findings): completion after collecting a trustworthy result at a judge deadline is still fixed to INTERRUPTED. The inline comment describes the reproduction and requested correction.
Local validation on macOS:
go build ./...,make verify,go test -race ./..., andmake e2epassed.make testdid not pass overall: its Python plugin regression suite hit a 30-second subprocess timeout intest_dynamic_dispatch_and_prefixed_shells_are_rejected. The Go race suite was run separately and passed.- Additional temporary evaluator tests reproduced the remaining finding with real script processes on both single-judge and grouped paths; those tests were removed after verification.
Live credential-dependent agent paths and sandbox metrics collection were not independently verified. The existing first-slice scope remains appropriate; this request does not require report rendering, comparison, Agent-judge numeric output, or JSONL schema work.
| func (j *ScriptJudge) timeoutResult(ctx context.Context, timeout time.Duration, debugInfo string, in Input) (*Result, error) { | ||
| source := "judge.timeout_seconds" | ||
| execution := &ExecutionMetadata{ | ||
| Stage: StageStarted, Completion: CompletionInterrupted, |
There was a problem hiding this comment.
[P2] Derive scoring completion after collecting a valid timeout result
timeoutResult assigns CompletionInterrupted before collecting the result file, and neither collection nor the evaluator revises it from the validated slots. I reproduced this through executeCase with a real script that writes both configured, invocation-bound metrics and then sleeps past a one-second judge deadline: both scores remain AVAILABLE, but single-judge execution and grouped member/group completion remain INTERRUPTED. The legacy verdicts correctly remain FAIL (single) and ERROR (grouped).
The agreed contract distinguishes a trustworthy final scoring outcome from execution exceeding its budget. After collecting and validating that outcome, derive COMPLETED / INCOMPLETE / FAILED from the scoring requirements while retaining deadline_expiry, its source, and timeout metadata. Use INTERRUPTED when no trustworthy final scoring outcome was obtained; preserve the existing timeout verdict mappings.
Please add evaluator-level regression cases for a collected complete valid result, an unavailable required metric, and an invalid metric, asserting completion alongside retained scores and timeout provenance. The current TestExecuteCaseGroupedJudgeTimeoutUnderLiveCaseDeadline instead requires INTERRUPTED even with both valid scores, so that assertion should be reconciled with the contract.
zpzjzj
left a comment
There was a problem hiding this comment.
Requesting changes on 59314df for the one remaining P2 in the existing inline review. timeoutResult still fixes completion to INTERRUPTED before collecting metrics, even when a trustworthy final result is recovered. Please derive scoring completion from validated requirements after collection while preserving timeout provenance and legacy verdicts, and add evaluator coverage for complete, missing-required, and invalid metrics. Earlier resolved findings need not be reopened; this supersedes my older approval.
Thanks, Ping. I pushed 55e366c to address the timeout completion finding. When a trustworthy result is recovered after the judge deadline, scoring completion now comes from the validated metrics. Deadline provenance and existing timeout verdicts are preserved. A recovered single-judge result with a missing required metric records INCOMPLETE and retains the existing FAIL verdict. The evaluator regressions passed on Windows and Linux. Linux make verify and the full non-race Go suite passed. The race run was blocked by host memory limits, and the Windows full-suite failures reproduced on the original HEAD. Could you take another look? |
|
Thanks for the timeout follow-up. On
|
Thanks, Ping. I pushed e339a26 with all three follow-ups. Single-judge timeouts retain FAIL even when a metric slot is invalid. At the case deadline, a recovered result now determines scoring completion while preserving the timeout source. The decoder also rejects noncanonical top-level JSON keys, including when both spellings are present. The full Go race suite passed on Linux, and make verify passed on the merge tree. GitHub CI is awaiting maintainer approval. Could you approve the run when you get a chance? |
zpzjzj
left a comment
There was a problem hiding this comment.
Thanks for the update. I reviewed PR #347 at head e339a263c816cf944c4c127136116f4abc90c116 against base 6fec8e9f0a9c63ebad772922b6b6cf79030dd20e. The three issues raised on 55e366c are addressed in the scenarios originally reported: single-script timeouts retain FAIL even when a metric is invalid, recovered results determine scoring completion at both judge and case deadlines, and noncanonical top-level JSON keys are rejected.
I’m still requesting changes for the following findings:
- [P1] A late deadline can bypass the required-metric check. If an exit-zero script has already produced a final envelope with a required slot
MISSINGand an optional siblingAVAILABLE, a deadline that fires before finalization can cause the finalizer to treat scoring as prevented and skip required-slot validation. The single case can remainPASS; the grouped path can also retainPASSbecause the sibling score is available. Please record whether scoring reached a final result independently of any later stop, and add a regression where the deadline fires after collection. - [P1] A validated case override can silently discard its metric policy. With a global script judge, a case-level
judge.metricsregistry without a repeatedjudge.typepasses validation, but plan resolution and runtime merging discard it. That can leave a configured threshold unenforced. Please reject this form during validation or apply the local registry consistently. - [P2] The collector does not enforce the file-type and size limits on the file it actually reads. The collector calls
Lstatand then reopens the pathname with unboundedos.ReadFile. If the file grows or the path changes between those operations, collection can exceed the 1 MiB cap or block on a non-regular file. Please validate the opened file and bound the read itself. - [P2] Deadline metadata can identify the wrong budget. A shorter caller deadline can be labeled as the configured case timeout. Likewise, if the judge deadline fires first and the case deadline expires before metadata is recorded, grouped attribution can incorrectly name the case budget. Please carry the effective deadline’s source rather than inferring it from which contexts are expired at finalization.
- [P2] Signal provenance can race with cancellation. The event-log CLI path uses separate signal subscriptions for cancellation and provenance. Registration order does not guarantee that the observer records the signal before downstream code sees cancellation, so a real interrupt can be persisted as
unknown. Please record the signal before canceling the evaluation context. - [P2] Grouped execution metadata can overwrite or lose recorded facts. The grouped fallback can rewrite a setup failure before invocation as
STARTED. It also misses a script’s default timeout when no metric registry is configured: metric finalization returns early, and the member is recorded asFAILED / execution_errorinstead ofINTERRUPTED / deadline_expiry. Please preserve the recorded stage and stop independently of the registry. - [P2] An explicit decline of a required metric is recorded as a contract error. The slot retains
SKIPand its reason, but the case or member metadata reportscontract_errorrather thanjudge_declined. Please preserve the existing verdict and incomplete scoring state while distinguishing deliberate decline from invalid output.
One documentation follow-up: the judge README leads with an agent_judge metrics example even though that producer is unsupported in this slice. Please use a runnable script example and clarify which entry grammar errors reject the entire envelope versus which semantic errors invalidate only one slot.
This was a static review of all 27 changed files, including the ten tests and README excluded by OCR’s default filter. I did not execute the PR code. git diff --check passed, but exact-head CI, Extended CI, and CodeQL still report action_required with no jobs. Please add targeted regressions for the findings above and rerun CI on the next head.
Thanks, Ping. I pushed 84975a9 and 30c3382 to address both P1s, the five P2s, and the README follow-up. The changes include targeted regressions for late deadlines, stop provenance, and required-metric declines. The full make test suite and make verify passed on Linux, and the Windows amd64 cross-build passed. The new GitHub CI run is awaiting maintainer approval. Could you approve it and take another look when you have a chance? |
zpzjzj
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. I re-reviewed 30c3382 and confirmed that both original P1 scenarios are addressed: a deadline that arrives after metric collection no longer suppresses required-slot validation, and a case-level judge.metrics registry without judge.type is now rejected. The earlier fixes for bounded reads, signal provenance, grouped execution metadata, and explicit metric declines are also in place.
I’m still requesting changes for three remaining issues:
-
[P1] An untyped eval-level metric registry can still bypass scoring. The new check covers case-level overrides, but
eval.yamlcan still declarejudge.metricswith a threshold and omitjudge.type. Eval validation accepts it, plan resolution only checks the case-level registry, and the evaluator defaults toPASSwhen no judge is selected. Please apply the same validation at both levels and add a regression through the eval-config entry point. -
[P2] The top-level timeout summary can still name the wrong budget. If a grouped judge times out first and the case deadline expires during cleanup, the structured member record correctly retains
judge.timeout_seconds. ButexecuteCasecan still appendcase timeout … via …because the case context is expired by the time it inspects the error. Please use the recorded stop source for the summary, and add a regression that asserts the top-level error text as well as the structured metadata. If the case deadline separately prevents pending judges from running, report that as a separate event. -
[P2] Windows long paths can be rejected even when the result file opens successfully. The Windows opener uses an extended path, but the collector’s
os.SameFilecheck uses metadata fromLstaton the original path. Go’s Windows implementation can reopen that original path to obtain the file ID. On systems still subject toMAX_PATH, the reopen can fail and a valid result can be reported asunbound_or_stale_result. Please normalize the path consistently for both operations and add a native Windows long-path regression. This finding is based on source inspection, not a Windows reproduction.
The exact-head CI, Extended CI, and CodeQL runs have now all passed. I did not run the PR code locally.
Thanks, Ping. I pushed the three follow-up fixes in fa6c22c.
Thanks, Ping. I pushed the three follow-up fixes in fa6c22c.
|
zpzjzj
left a comment
There was a problem hiding this comment.
Thanks for the follow-up. I re-reviewed fa6c22c and confirmed that all three issues from my previous review are addressed: eval-level metric registries now require an explicit judge type, the grouped timeout summary distinguishes the judge’s deadline from a later case deadline that prevents pending judges from running, and Windows uses the same extended path for both the metadata check and the file open.
One P2 remains: a late deadline can make a completed metric contract failure retry as a timeout. Consider a grouped case with one script judge. The script exits successfully and metric collection finishes with a required slot missing. The judge’s deadline then expires during cleanup, while the case budget is still active. The evaluator correctly reports required named metric unavailable, but the grouped path also adds context.DeadlineExceeded to the error chain. The retry classifier then treats the failure as a timeout and can rerun the entire case under retry_on: [timeout], even though the deadline did not interrupt scoring or prevent another judge from running.
This behavior predates fa6c22c and is separate from the timeout-summary issue fixed here. Please keep the late deadline in the execution metadata without adding it to the retry-driving error chain unless it caused a failure or prevented a pending judge from running. A one-member regression that asserts the top-level retry classification stays error would cover the gap; the existing test checks finalization and member metadata, but not the aggregated error or retry classification.
This is the only remaining change I’m requesting. I verified it by source inspection and did not run the PR code locally.
Thanks, Ping. I pushed a fix in 084c978. A deadline that fires after metric collection stays in the execution metadata, and a missing required metric now keeps the retry classification as error. The new one-member grouped regression reproduced timeout before the fix and passes now. make verify and the full make test suite, including Go race tests, passed on Linux. Could you take another look when you have a chance? |
|
Thanks for the follow-up. I re-reviewed One narrower P2 remains. I suggest capturing Merge conflicts: GitHub currently reports conflicts with This follow-up is based on source inspection; I did not run the PR code locally. |
Thanks, Ping. I merged upstream main and updated grouped judge handling to use a single ctx.Err() snapshot for both stop classification and retry handling. The new deterministic regression reproduces the timeout misclassification before the fix and passes on c76b59e. make verify and the full race-enabled make test passed locally on Linux. The PR is now mergeable. GitHub Actions shows action_required with no jobs listed. Could you approve the runs if needed and take another look when you have a chance? |
feat(judge): validated named metrics and persistence (script judge, slice 1)
Refs #317. First bounded implementation slice, scoped per #317 (comment) — named metrics only, with report integration and cross-run comparison left for later PRs.
What this adds
A per-judge named-metric registry, a script-judge result channel that feeds it, and the derived state that reaches the persisted artifacts. Per the maintainer decision,
NOT_RUNis dropped (a never-started and a stopped-mid-flight member are bothINTERRUPTED, separated byexecution_stage) and nogroup_execution_stateis introduced.Configuration —
judge.metrics[]withid,required,min_score,evidence_required, validated ininternal/config(identifier shape, duplicate ids, thresholds inside[0,1]). The registry is the coverage denominator: fixed before execution, never inferred from a returned payload. Unknown ids in output are diagnostics and never create slots; a duplicated id invalidates its planned slot once.Input channel (script judge only) — the runner assigns one private, invocation-bound result path per attempt and injects
EVAL_METRICS_RESULT_PATH,EVAL_METRICS_INVOCATION_IDandEVAL_METRICS_TEMPLATE. The path isLstat-ed and must be a regular, non-symlink file; its size is checked before it is read; the payload must echo the invocation id. Rejected as a whole envelope: unparseable JSON, non-object top level, trailing content, duplicate JSON keys at any level, unknown top-level or entry fields, an evidence element that is neither a string nor null, wrongschema_version, unbound/stale invocation, oversized file. A nonzero exit never collects scores even if a valid file exists — the file stays an on-disk diagnostic. stdout remains evidence; there is no stdout fallback.State — four fields, one question each:
execution_stageNOT_INVOKED/STARTED/COMPLETEDcompletion_stateINTERRUPTED/FAILED/INCOMPLETE/COMPLETEDtermination_causenone/cancellation/deadline_expiry/expect_gate/process_exit/execution_error/contract_error/judge_declined(+deadline_source/cancel_source)score_availabilityAVAILABLE/MISSING/ERROR/SKIP/NOT_PRODUCEDmetric_quality_stateis present whenever the envelope exists and is derived from slots only, never fromcompletion_state: thresholds configured and all thresholded values available →MET/NOT_MET; thresholds configured but a thresholded value unavailable (including cancellation, gate and error cases) →UNKNOWN; valid scores with no thresholds configured →NOT_CONFIGURED; no valid scores →NOT_ASSESSED. A judge-declaredSKIPkeeps its own reason and is never reachable for a slot the execution layer never reached — that slot isNOT_PRODUCED, so an interrupted run cannot masquerade as a judge declining a metric. Scores are never fabricated as zero.Group completion is derived, not assigned — folded over member completions by
FAILED > INCOMPLETE > INTERRUPTED > COMPLETED, sofailed + pending-cancelledkeepsFAILEDwhile the cancellation and the unfinished members stay visible on their own members, andcompleted + pending-cancelledreadsINTERRUPTED. Members with no execution metadata contribute nothing, and an empty set leaves the field unset so the artifact omits it rather than inventing a state.Timeouts do not discard a trustworthy result — a child that writes its bound result and then outlives the deadline keeps both scores
AVAILABLE(an explicit0included) and the existing script-timeout verdict mapping is preserved unchanged: groupedERROR, single-judgeFAIL. Cancellation arriving while a member is running is never treated as acceptance, so its untouched slots readNOT_PRODUCEDrather than an omission from a completed judge.Whole-envelope vs single-entry rejection — an entry-level semantic defect (out-of-range or non-finite value, or unmet evidence requirement) poisons only that slot; independently valid siblings stay
AVAILABLEand are treated identically by the collector, the stored envelope and any later consumer.Compatibility, deliberately untouched —
PASS/FAIL/SKIP/ERROR; the #309 assertion and member denominators with zero-credit skipped members (skipped: trueretained insummary.totaland counted insummary.failed); theall_requiredone-assertion-per-member aggregation;grading.json; the JUnit mapping; the existing single-vs-grouped script-timeout asymmetry. No JSONL evaluation-event field is added here — that stays behind its own schema and consumer review.cancel_sourcereportsos_signalonly when an interrupt was actually observed andunknownotherwise; it is never inferred from error text.Persistence — the envelope rides on
judge.Result.Metrics(report.json→grading.metrics) and on each groupedjudge.Outcome(evaluation.json→judge_results[].metrics,judge_results[].execution), withaggregation.completion_state/aggregation.termination_causealongside the unchangedaggregation.status. Nothing lives only insidejudge.Result: a member with no result at all still carries its execution facts and its registry-derived slots.Review updates (head
e19d55d)["valid evidence", " "]supports the score. Anullelement is that entry's own defect: the slot becomesERRORwith reasoninvalid_evidenceand a sibling with a valid score staysAVAILABLEwith its value, as the persistedevaluation.jsonregression shows. A nullevidencefield stays equivalent to an omitted field, and elements that are neither strings nor null stay a whole-envelope shape defect.FAILED/execution_errorwith unproduced metric slots.Verification status for
e19d55dmake verify, the judge/config/evaluator package tests, and e2e passed; the pre-commit hook also passed. Linking used-ldflags=-wfor the package tests due to WSL instability.action_requiredwith no completed jobs. Earlier passing checks on73b3acbdo not establish CI status for this head.Earlier verification (historical; not the latest head)
Verified by real execution on this machine (Windows, go1.26.4, base
6fec8e9):0→ both scores (including0.0) reach the envelope and the derived state, throughexecuteCasefor the single-judge path and the grouped pathAVAILABLE,quality=NOT_CONFIGURED, and the verdict mapping staysERROR(grouped) /FAIL(single). This isTestScriptJudgeRealSubprocessTimeoutCollectsResult.INTERRUPTED/NOT_PRODUCED/NOT_ASSESSED, groupINTERRUPTED+cancellation, member assertion denominator unchangedWriteEvaluationwriterNot verified on this machine:
TestExecuteCaseCancellationKeepsAcceptedResult) is POSIX-only and skipped here: on Windows whether the first member finishes before the timer fires depends on process-startup timing, so the ordering is not deterministic. The branch therefore does not claim this ordering as proven end-to-end; the decision itself is covered at unit level byrecordMemberContextErrorwith a genuinely cancelled context and deterministically byTestExecuteCaseCancellationInterruptsRunningMember. Maintainer or CI confirmation on Linux is welcome.noneenvironment behaviour beyond the explicitmetrics_channel_unsupportedresultTest status:
go build ./...,go vet,gofmtclean.internal/judge,internal/config,internal/report,internal/clipass.internal/evaluatorshows 4 failures andinternal/runtimefails to build. I ran the identical full-suite command (./internal/... ./pkg/...,-count=1) on base commit6fec8e9in this same Windows environment and on this branch: both give 18 passing packages, the same 9 failing tests and the same 4 failing packages, including theinternal/runtimebuild failure. That comparison is environment-scoped: it shows this branch adds no new failure here, and it is not a claim of zero regressions on Linux/macOS, which CI will establish.Out of scope for this PR
agent_judgenumeric metric output (its strict result contract is separate work)noneenvironment is assigned a path; anything else reportsmetrics_channel_unsupportedinstead of pretending a stale file was foundCo-authored-by / AI assistance note: this slice was drafted with AI assistance against the contract in #317 and reviewed commit by commit; no test was weakened or skipped to make it pass.