Skip to content

fix(automation): read probe counts from a JSON file, never parsed logs - #109

Merged
trefeon merged 1 commit into
mainfrom
fix/probe-json-contract
Oct 22, 2026
Merged

trefeon merged 1 commit into
mainfrom
fix/probe-json-contract

Conversation

@trefeon

@trefeon trefeon commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Follow-up to #108: the first dispatched health-check run on main went red in the annotation step.

Cause

The workflow kept everything from the first line beginning with { in the probe's stdout. The probe prints its degraded-model summary lines after the JSON object, so the captured file was JSON followed by prose and JSON.parse failed. The probe step itself passed (exit 0, no dead model), and the annotation step turned a healthy run into a failure.

Fix

  • The probe writes the same structured object to --json-output <file>; the workflow reads that bare file and no longer parses logs.
  • The annotation step treats a missing, unreadable or non-numeric count as zero. An annotation must never decide the run's status.
  • New test: the CLI writes a parseable JSON document when --json-output is set (real daemon, stubbed upstream).

Verification

  • npx tsc --noEmit clean; targeted suites 29/29 pass.
  • Live run with the exact workflow command: exit 0, dead=0, degraded=2 (longcat 402 retried → unavailable, flint-40b one probe-cap timeout → inconclusive), annotation reads 2 from the JSON file.

The health-check workflow derived its dead/degraded counts by keeping
everything from the first line that opened a brace in the probe's stdout.
The probe prints its summary lines after the JSON object, so the captured
file ended with prose and the annotation step failed to parse it — which
turned an otherwise healthy run red.

The probe now writes the same object to the path given by --json-output,
so the workflow reads a bare JSON document. The annotation step also
treats an unreadable or non-numeric count as zero instead of failing the
job: an annotation must never decide the run's status.
Copilot AI balanced review requested due to automatic review settings October 22, 2026 13:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@trefeon
trefeon merged commit f0dbaa2 into main Oct 22, 2026
7 checks passed
@trefeon
trefeon deleted the fix/probe-json-contract branch October 22, 2026 13:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants