Skip to content

fix(#5705): run the post-script when the scan was the only failure - #2

Closed
andrewevansrh wants to merge 1 commit into
agent/5705-spanning-private-keysfrom
agent/5705-post-script-gating
Closed

andrewevansrh wants to merge 1 commit into
agent/5705-spanning-private-keysfrom
agent/5705-post-script-gating

Conversation

@andrewevansrh

Copy link
Copy Markdown
Owner

Summary

Part 3 of 3 split out of fullsend-ai#9699 (part 1: fullsend-ai#10082, part 2:
#1).

A failed output scan fails the run, and the gate that decides whether to run the
post-script treated every scan failure as fatal to posting, so a completed review
was thrown away because one unrelated file somewhere else under the run directory
could not be sanitized.

Base: agent/5705-spanning-private-keys (part 2). Review the diff against
that branch; only that delta is this PR. It is opened in the fork because a
stacked PR's base branch has to live in the repository the PR is opened in. This
one will be retargeted to main once the two below it land.

What changed

  • internal/cli/run.go: the gate runs the post-script when a scan failure is
    the run's only failure and the harness result file (agent-result.json by
    default) survived the scan and still holds a JSON object. Causes are kept apart
    instead of flattened into one joined error — postScanArtifactsError carries
    the scan and chain outcomes and postScanError the terminal outcome — so a run
    that also timed out, broke its audit chain or reported a transcript error keeps
    that cause's outcome, and a broken chain vetoes posting regardless of the scan.
    A result file the scan replaced with a fail-closed marker, or one the scan
    failed on and could not quarantine, is never posted.
  • quiet: the printed log counts the paths a failed scan could not handle
    instead of naming them (ADR 0163), and the completion comment does the same,
    since an output file name is the agent's to choose and Actions log masking does
    not apply to a comment. The run error and telemetry keep the path at every
    level.

Verification

  • go test ./internal/cli (one unrelated pre-existing failure,
    TestPrepare_LocallyPresentImageSkipsPullButRunsPreflight, fails on main too)
  • go test ./internal/security/
  • make lint

Note: Generated with assistance from DeepSeek V4.1 Flash

… failure

A failed output scan fails the run, and the gate that decides whether to
run the post-script treated every scan failure as fatal to posting, so a
completed review was thrown away because one unrelated file somewhere
else under the run directory could not be sanitized.

The gate now runs the post-script when a scan failure is the run's only
failure and the harness result file survived the scan and still holds a
JSON object. Causes are kept apart rather than flattened into one join:
the scan and chain outcomes are carried in a postScanArtifactsError and
the terminal outcome in a postScanError, so a run that also timed out,
broke its audit chain or reported a transcript error keeps that cause's
outcome, and a broken chain vetoes posting regardless of the scan. A
result file the scan replaced with a fail-closed marker, or one the scan
failed on and could not quarantine, is never posted.

At quiet, the printed log counts the paths a failed scan could not handle
instead of naming them (ADR 0163), and the completion comment does the
same, since an output file name is the agent's to choose and Actions log
masking does not apply to a comment. The run error and telemetry keep the
path at every level.

Signed-off-by: anevans <anevans@redhat.com>
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

⚠️ Fullsend review agent did not run

The agent could not start because of a token mint failure.

View the workflow run

@andrewevansrh

Copy link
Copy Markdown
Owner Author

Moved to fullsend-ai#10085 so the stack lands upstream in order.

Note: Generated with assistance from DeepSeek V4.1 Flash

This branch was successfully deployed

1 active deployment
forgejo-dev — 2399a129 Deployed Dec 3, 2026 by andrewevansrh via forgejo-behaviour #5
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.

1 participant