Repository navigation
logs --adoption: record per-run lifecycle evidence failures instead of aborting the batch - #79258
Conversation
…s batch Co-authored-by: copilot-swe-agent[bot] <[email protected]>
…atisfy custom lint gate Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
|
@copilot Fix failing checks |
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Fixed the org-rollout result framing failures and restored the unrelated workflow change in commit |
|
@copilot Resolve conflicts |
There was a problem hiding this comment.
🔵 Needs a closer look
Interacting changes to batch failure handling, cache bypass, reporting coverage, and rollout subprocess-result acceptance affect operational and trust-boundary contracts beyond the limited-consequence review scope.
No open issues 🎉
What changed in this PR
This PR addresses #79254 by keeping gh aw logs --adoption and --delivery batches running when an individual run has invalid lifecycle evidence, preserving results for the remaining runs.
Changes:
- Records per-run evidence failures in
adoption_errorswith unavailable coverage while preserving fatal errors. - Adds JSON output support, schema updates, documentation, and regression coverage.
- Separately tightens rollout worker result validation to reject trailing output.
| File | Description |
|---|---|
specs/safe-output-lifecycle.md |
Requires per-run error reporting and continued batch evaluation. |
schemas/logs.schema.json |
Adds adoption_errors to output schemas. |
pkg/cli/org_rollout.go |
Rejects worker results followed by trailing output. |
pkg/cli/org_rollout_test.go |
Covers trailing output without a newline. |
pkg/cli/logs_report.go |
Adds the errors field and documents an intentional lint suppression. |
pkg/cli/logs_outcomes.go |
Classifies evidence failures and records them without aborting batches. |
pkg/cli/logs_outcomes_test.go |
Covers mixed-validity batches, warnings, JSON, and single-run errors. |
pkg/cli/logs_orchestrator_render.go |
Copies adoption errors into cross-run output. |
pkg/cli/logs_lifecycle_evidence.go |
Introduces a sentinel for missing lifecycle identity. |
pkg/cli/audit_cross_run.go |
Exposes adoption errors in cross-run reports. |
docs/src/content/docs/setup/cli.md |
Documents continued processing after evidence failures. |
docs/src/content/docs/reference/delivery-adoption.md |
Describes error fields, reasons, and unavailable coverage. |
Review effort: Balanced (adaptive)
…tion-error # Conflicts: # pkg/cli/org_rollout.go # pkg/cli/org_rollout_test.go Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Merged refreshed |
When one run's lifecycle session (
aw_session.jsonl) lacked its format or execution identity,gh aw logs --adoption/--deliveryfailed the whole invocation withevaluate adoption for run N: …and produced no JSON. Isolating the run and retrying re-downloaded everything else; in the pilot this took about 1,300 API requests instead of about 300.This PR records the failure on the affected run and keeps evaluating the rest of the batch.
Error classification (
logs_lifecycle_evidence.go,logs_outcomes.go)errLifecycleIdentityMissing, with the same message as before.lifecycleEvidenceError{reason, err}wraps only thereadLifecycleItemserror incollectRunLifecycle. It supportsUnwrap, soerrors.Isstill matches the original error.lifecycle_identity_missingfor a missing format or execution identity.lifecycle_evidence_invalidfor everything else that is per-run: identity/repo/host mismatch, malformed JSON, oversized file, manifest decode or I/O errors.observeLifecycleerrors are unchanged.Batch behaviour (
collectLogsLifecycles)unavailablecoverage on both adoption and deliveryeval_errorsetevaluate adoption for run %d: %w.audit, experiments) still receive the error as before.Output
adoption_errors(json:",omitempty") onLogsDataandCrossRunAuditReport, filled inattachLogsOutcomesand copied into the cross-run render.--deliveryand--adoption, includinglogs episode.runs[]still contains the failed run.schemas/logs.schema.jsonregenerated.unavailablecoverage and are not listed inadoption_errors.Docs/spec
reference/delivery-adoption.md,setup/cli.md,specs/safe-output-lifecycle.md.logsrecords the failure inadoption_errorsand continues with the other runs.Other
//nolint:ignoredlocalerroron an existing, intentional fail-open discard (GetCurrentRepoSlug) inlogs_report.go. The change-scoped lint gate flags any diagnostic in a touched file.Test
TestLogsOutcomeRunEvidenceErrorsDoNotAbortBatch: four runs (no session, header-only, mismatched identity, valid), run in both delivery and live modes.