Surface failed partial package adoption as incomplete - #490
Merged
chubes4 merged 3 commits intoAug 26, 2026
Conversation
WP_Agent_Package_Adoption_Result::canonical_status() mapped a 'partial' adoption result to STATUS_SUCCEEDED. The orchestrator emits 'partial' precisely when some artifacts were applied but OTHERS FAILED. As a result the canonical run-result envelope reported top-level status = succeeded for a run that had failures. The failures survived only inside outputs.failed, invisible to any consumer keying on the envelope status, so partial adoptions with real failures silently read as fully successful. Map 'partial' to STATUS_INCOMPLETE, an existing non-success canonical status that accurately describes a run that only partially completed. Fully successful adoptions still map to SUCCEEDED and fully failed ones to FAILED. Adds tests/package-adoption-result-canonical-status-smoke.php asserting a partial result yields a non-succeeded canonical status with the failed artifacts still visible, plus no-regression coverage on the clean success and full-failure paths. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
chubes4
marked this pull request as ready for review
August 26, 2026 21:52
This was referenced Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Package adoption uses the raw
partialstatus for two distinct outcomes:The canonical run-result envelope previously could not distinguish those cases consistently for status-oriented consumers.
Fix
Canonical status now derives the partial outcome from the artifact results:
partialwith a non-emptyfailed_artifactslist maps toincomplete.partialwith applied and intentionally skipped artifacts but no failures remainssucceeded.failed.succeeded.The raw package adoption contract is unchanged:
get_status()andto_array()continue to exposepartialfor both partial variants.Testing
Expanded
tests/package-adoption-result-canonical-status-smoke.phpwith canonical envelope coverage for:get_status()andto_array()compatibility for both partial variants.Validation completed after merging current
origin/main:tests/package-*.phpsmoke tests pass.composer testpasses.composer phpstanpasses with no errors.git diff --check origin/main...HEADpasses.