[runtime-observer] Skip unavailable Helix evidence - #1729
vitek-karas merged 3 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Two moderate findings remain unresolved in the Helix validation and skip handling.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Updates the runtime observer to skip unavailable Helix evidence while keeping malformed data and request failures fatal.
Changes:
- Adds per-candidate Helix skip handling and request-specific error labeling.
- Adds focused HTTP and traversal tests.
- Regenerates workflow lock metadata.
File summaries
| File | Reviewed changes and findings |
|---|---|
.github/workflows/tests/test_runtime_failure_observer_http.py |
Adds focused HTTP and traversal tests. |
.github/workflows/runtime-failure-observer.agent.md |
Defines evidence-retention handling. Moderate, 2 votes: ` |
.github/workflows/runtime-failure-observer.agent.lock.yml |
Updates generated workflow metadata. |
.github/workflows/runtime-failure-observer-http |
Adds request-specific HTTP error labels. |
Review details
Suppressed comments (1)
.github/workflows/runtime-failure-observer.agent.md:258
- This helper message is not sufficient evidence of retention: the
jqexpression above passes the literalnullwhen the selected object lacksName/WorkItemName(or uses a different casing, despite the helper's case-insensitive lookup), and_console_urlthen reportsfound 0. The new rule would therefore skip malformed work-item data, contrary to rule 6; validate the selected object/index and require a non-empty name before allowing this skip, keeping missing-field cases fatal.
- The helper reports `expected exactly one Helix work item named '<name>', found 0`: `skipped: Helix work item unavailable`.
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (5)
.github/workflows/runtime-failure-observer.agent.md:304
- This message is not sufficient evidence that the work item is merely unavailable:
_console_urlalso emitsfound 0for malformed records. For example, a selected item with a truthy non-stringNameand a validWorkItemNamepasses the new jq validation, but the helper'sName or WorkItemNameexpression uses the invalidName, finds no match, and is now incorrectly downgraded to a skip instead of rule 6's fatal malformed-data path. Align the helper's name selection with the validation (or validate the response shape) before treatingfound 0as an evidence-retention signal.
- The helper reports `expected exactly one Helix work item named '<name>', found 0`: `skipped: Helix work item unavailable`.
- The helper reports `Helix console request failed with status 404`: `skipped: Helix console unavailable (HTTP 404)`.
These skips apply only after the helper request itself succeeded far enough to produce the explicit signal. Do not skip malformed or unexpectedly shaped JSON, unreadable or non-text logs, missing required fields, access denials, authentication failures, timeouts, HTTP 401/403/429/5xx, generic transport errors, or any other unexplained HTTP status; apply rule 6 and stop the run. A 404 from the Helix work-items request is not the console 404 signal and is fatal under rule 6.
.github/workflows/runtime-failure-observer.agent.md:241
pipefaildoes not preserve the first command's status when the downstreamgrepexits 1: if the firstgrepfails with status 2 (for example, a read error or a race after the file check), the secondgrepsees no input and returns 1, so the pipeline is classified as the expected no-match skip. Capture/check each command's status separately, or use a single extraction that preserves non-1 failures, so malformed/unreadable evidence remains fatal as required by rule 6.
grep -oE 'Sent Helix Job(: |; see work items at https://helix\.dot\.net/api/jobs/)[a-f0-9-]+' /tmp/gh-aw/agent/helix-send.log \
| grep -oE '[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}'
.github/workflows/runtime-failure-observer.agent.md:233
- This example puts the helper request and its validation in one shell block without preserving the helper's exit status. If a later build's
azdo-logfails after an earlier candidate left a readablehelix-send.log, thetestsucceeds and the combined call reports success, allowing stale evidence to be parsed. Rule 11 requires each helper request and follow-up validation to be separate shell calls; show them as separate calls (or otherwise fail on the request error) so transport failures remain fatal.
test -f /tmp/gh-aw/agent/helix-send.log && test -r /tmp/gh-aw/agent/helix-send.log
.github/workflows/runtime-failure-observer.agent.md:269
- The jq normalization only accepts a top-level
.valuearray, but the helper's_json_itemscontract also acceptsWorkItemsandworkItems(lines 425-431). A valid response in either of those shapes will fail this new preflight with “not an array” and stop the scan, even thoughhelix-consolecould resolve it; preserve all response shapes supported by the helper here.
(if type == "array" then . else .value end) as $items
| if ($items | type) == "array" then $items[INDEX] else error("Helix work-item response is not an array") end
.github/workflows/runtime-failure-observer.agent.md:292
- The console-fetch jq repeats the same
.value-only normalization, so responses using theWorkItemsorworkItemsforms accepted by_json_itemsare rejected after the preflight (or if the preflight is adjusted). Keep this extraction expression consistent with the helper's supported response shapes.
(if type == "array" then . else .value end)
| .[INDEX]
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Lite
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Motivation
The runtime-failure observer can encounter Helix evidence that is no longer retained or cannot be retrieved for an individual candidate. Treating these expected evidence gaps as a fatal scan failure prevents the observer from continuing to other builds and work items, even when those later candidates have actionable xharness failures. The change distinguishes evidence-retention gaps from malformed responses and actual request failures.
Changes
Validation
gh aw compile .github/workflows/runtime-failure-observer.agent.md --no-emitpython3 .github/workflows/tests/test_runtime_failure_observer_http.py RequestBehaviorTests HelixTraversalTests