Skip to content

Expose safe output partial-batch status counts - #50371

Merged
pelikhan merged 5 commits into
mainfrom
copilot/deep-report-add-items-succeeded-failed-signal
Aug 4, 2026
Merged

Expose safe output partial-batch status counts#50371
pelikhan merged 5 commits into
mainfrom
copilot/deep-report-add-items-succeeded-failed-signal

Conversation

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

safe_outputs batches could persist many items but still appear as a flat failure when one item failed. This adds item-level status signals so consumers can distinguish partial success from total failure.

  • Runtime outputs

    • Emit items_succeeded, items_failed, and status from the process_safe_outputs step.
    • status is one of success, partial_success, or failure.
  • Job-level signals

    • Expose the new step outputs through the safe_outputs job as:
      • process_safe_outputs_items_succeeded
      • process_safe_outputs_items_failed
      • process_safe_outputs_status
  • Step summary

    • Include the same item counts and status in the Safe Output Processing Summary.

Example output shape:

needs.safe_outputs.outputs.process_safe_outputs_items_succeeded: "10"
needs.safe_outputs.outputs.process_safe_outputs_items_failed: "5"
needs.safe_outputs.outputs.process_safe_outputs_status: "partial_success"

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 33.5 AIC · ⌖ 6.08 AIC · ⊞ 8.3K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30949820215

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 11.9 AIC · ⌖ 6.9 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI and others added 2 commits August 4, 2026 19:19
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add items_succeeded/items_failed signal to safe_outputs job status Expose safe output partial-batch status counts Aug 4, 2026
@pelikhan
pelikhan marked this pull request as ready for review August 4, 2026 19:32
Copilot AI balanced review requested due to automatic review settings August 4, 2026 19:33
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (9 lines).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /codebase-design and /tdd — two targeted observations, no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • All-skipped edge case: When all results are skipped/deferred/cancelled, status emits "success" even though nothing completed. The intent should be documented or the status refined.
  • items_failed semantics: The counter includes report-only failures (non-fatal). Consumers who gate on partial_success may over-react to non-blocking errors.

Positive Highlights

  • ✅ Clean extraction of isFailedProcessingResult and computeSafeOutputsStatus into a dedicated module — good separation of concerns.
  • ✅ Comprehensive test coverage for mixed success/failure, all-failure, and output-formatting scenarios.
  • statusOutputsSet guard in the catch block ensures outputs are always emitted, even on unexpected errors.
  • ✅ Go compiler and tests updated in lock-step with the JS change — no drift.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 32.5 AIC · ⌖ 8.1 AIC · ⊞ 7.1K
Comment /matt to run again

const safeResults = Array.isArray(results) ? results : [];
const itemsSucceeded = safeResults.filter(r => r?.success).length;
const itemsFailed = safeResults.filter(isFailedProcessingResult).length;
const status = itemsFailed === 0 ? "success" : itemsSucceeded > 0 ? "partial_success" : "failure";

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/codebase-design] When all results are skipped, deferred, or cancelled (0 succeeded, 0 failed), status resolves to "success" — but no item actually completed successfully. Consumers checking this output may incorrectly treat a fully-deferred batch as a clean run.

💡 Suggestion

Add a test documenting the intended behaviour for all-skipped batches. If the current "success" result is intentional, document why in a comment; if not, consider a separate "empty" status or check safeResults.length before classifying:

const status =
  itemsFailed === 0 && itemsSucceeded === 0 && safeResults.length > 0
    ? "empty"  // all items were skipped/deferred/cancelled
    : itemsFailed === 0
    ? "success"
    : itemsSucceeded > 0
    ? "partial_success"
    : "failure";

@copilot please address this.

@@ -1592,7 +1599,8 @@ async function main() {
await writeSafeOutputSummaries(processingResult.results, allMessages);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[/tdd] items_failed in the exported output counts all active failures, including report-only ones (e.g. assign_to_agent, upload_artifact). A consumer who gates on status === "partial_success" will block on non-fatal failures, defeating the purpose of report-only categorisation.

💡 Suggestion

Decide explicitly whether items_failed should count only fatal failures or all failures, and document that contract in safe_outputs_status.cjs. If only fatal failures should count:

// in safe_outputs_status.cjs, pass a predicate or pre-filter:
function computeSafeOutputsStatus(results, { fatalOnly = false, fatalTypes } = {}) {
  // ...
}

Alternatively, expose two counters: items_failed (fatal) and items_reported (report-only).

@copilot please address this.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean, well-structured implementation. The refactor correctly extracts isFailedProcessingResult into a shared module, the statusOutputsSet guard reliably prevents clobbering a valid status in the catch block, and all early-exit paths emit the new outputs. Tests cover success, partial-success, and failure cases. No actionable issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 15.6 AIC · ⌖ 7.42 AIC · ⊞ 5.4K

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds item-level safe-output status signals for partial-batch outcomes.

Changes:

  • Computes and exports succeeded/failed counts and batch status.
  • Adds status details to step summaries.
  • Exposes outputs at the generated job level with tests.
Show a summary per file
File Description
pkg/workflow/compiler_safe_outputs_job.go Exposes new job outputs.
pkg/workflow/compiler_safe_outputs_job_test.go Tests job output mappings.
actions/setup/js/safe_outputs_status.cjs Computes batch status and counts.
actions/setup/js/safe_output_summary.cjs Adds status to summaries.
actions/setup/js/safe_output_summary.test.cjs Tests summary status rendering.
actions/setup/js/safe_output_handler_manager.cjs Emits and logs runtime outputs.
actions/setup/js/safe_output_handler_manager.test.cjs Tests status computation and export.
.github/skills/agentic-workflows/SKILL.md Removes an invalid reference.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 8/8 changed files
  • Comments generated: 3
  • Review effort level: Balanced

Comment on lines +16 to +21
* @param {Array<{success?: boolean, deferred?: boolean, skipped?: boolean, cancelled?: boolean}>|null|undefined} results
* @returns {{itemsSucceeded: number, itemsFailed: number, status: "success" | "partial_success" | "failure"}}
*/
function computeSafeOutputsStatus(results) {
const safeResults = Array.isArray(results) ? results : [];
const itemsSucceeded = safeResults.filter(r => r?.success).length;
Comment on lines +1683 to +1684
setSafeOutputsStatusOutputs(safeOutputsStatus);
statusOutputsSet = true;
function computeSafeOutputsStatus(results) {
const safeResults = Array.isArray(results) ? results : [];
const itemsSucceeded = safeResults.filter(r => r?.success).length;
const itemsFailed = safeResults.filter(isFailedProcessingResult).length;
Copilot AI requested a review from pelikhan August 4, 2026 19:43
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 90/100 — Excellent

Analyzed 4 test(s): 4 design, 0 implementation, 0 violation(s).

📊 Metrics (4 tests)
Metric Value
Analyzed 4 (Go: 1 modified, JS: 3 new + 1 extended)
✅ Design 4 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 2 (50%)
Duplicate clusters 0
Inflation No
🚨 Violations 0
Test File Classification Issues
computes partial success item status... safe_output_handler_manager.test.cjs behavioral_contract, design_test, high_value None
computes failure item status when all active results failed safe_output_handler_manager.test.cjs behavioral_contract, design_test, high_value None
exports item status outputs safe_output_handler_manager.test.cjs behavioral_contract, design_test, high_value None
should include partial success item counts in the summary safe_output_summary.test.cjs behavioral_contract, design_test, high_value None

Changed Files (numstat)

File Added Deleted
safe_output_handler_manager.test.cjs +44 0
safe_output_summary.test.cjs +29 0
compiler_safe_outputs_job_test.go +6 0
safe_output_handler_manager.cjs (prod) +28 -12
safe_output_summary.cjs (prod) +5 0
safe_outputs_status.cjs (prod, new) +31 0
compiler_safe_outputs_job.go (prod) +3 0

Inflation check: safe_output_summary.test.cjs adds 29 lines vs 5 new prod lines (5.8:1 raw), but production status logic lives in the new safe_outputs_status.cjs (+31 lines), making the effective test/prod ratio 29/(5+31) = 0.8:1. Not flagged as inflation.

Verdict

passed. 0% implementation tests (threshold: 30%). All new tests enforce behavioral contracts on computeSafeOutputsStatus / setSafeOutputsStatusOutputs and their propagation through the summary and compiled job outputs. Build tag present on Go test file. No mock library violations.

🧪 Test quality analysis by Test Quality Sentinel · sonnet46 · 79.7 AIC · ⌖ 8.37 AIC · ⊞ 8.6K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 90/100. 0% implementation tests (threshold: 30%). All new tests enforce behavioral contracts on the new status-count API.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please address the remaining blocking review feedback on this PR, rerun the failed checks, refresh the branch if needed, then run the pr-finisher skill before handing it back.

Failed checks:

No fresh sous-chef cooldown marker was found here, so this is a follow-up nudge to investigate the failing run and finish the branch.

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 33.5 AIC · ⌖ 6.08 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot August 4, 2026 20:43
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot Please investigate this PR and move it toward merge readiness.

  • Refresh the branch if GitHub allows it.
  • Re-run the relevant checks and inspect the prior agent failure.
  • If there is any remaining reviewer feedback or unresolved thread context, address it and resolve addressed review threads.
  • Run the pr-finisher skill before handing it back.

Generated by 👨🍳 PR Sous Chef

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 11.9 AIC · ⌖ 6.9 AIC · ⊞ 8.3K ·
Comment /souschef to run again

@pelikhan
pelikhan merged commit 1cea7a4 into main Aug 4, 2026
34 of 35 checks passed
@pelikhan
pelikhan deleted the copilot/deep-report-add-items-succeeded-failed-signal branch August 4, 2026 21:15
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.85.0

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.

[deep-report] Add items_succeeded/items_failed signal to safe_outputs job status (partial-batch success)

4 participants