feat(boatstack): observe the published PR's phase — checks, review, mergeability - #236
Merged
Merged
Conversation
…ergeability Widen the single read-only gh observation behind next-status and recovery-status with statusCheckRollup, reviewDecision, mergeStateStatus, mergeable, and baseRefName, and derive a fail-closed PRPhase (PR_CHECKS_PENDING/FAILING, PR_CHANGES_REQUESTED, PR_REVIEW_REQUIRED, PR_MERGE_ELIGIBLE, PR_MERGED, PR_CLOSED, PR_UNKNOWN) from it. The phase and the failing check names ride along as additive status fields and sharpen the published reasons; nothing non-terminal is ever persisted, and an older gh that rejects the enriched field list falls back to the legacy lookup. control-law: pr-phase-derives-only-from-live-observation First slice of the published→merged program: give the system eyes on the post-publish frontier before any prescription or goal change. Disclosure-Reviewed: reviewed — public-safe only, private facet kept out of this commit
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.
First slice of the published → merged program: before Boatstack can prescribe anything past
publish-pr, it needs eyes on where the published PR actually stands. This PR adds exactly that observation — and nothing else. No prescription, actor, or goal behavior changes.What changed
observePublishedPRwidens its single read-onlygh pr viewcall withstatusCheckRollup,reviewDecision,mergeStateStatus,mergeable,baseRefName. If an olderghrejects the enriched field list, it falls back to the legacy list so the basic lifecycle observation is never lost.pr_phase.go: a pure, total, fail-closed derivation toPRPhase—PR_CHECKS_PENDING,PR_CHECKS_FAILING,PR_CHANGES_REQUESTED,PR_REVIEW_REQUIRED,PR_MERGE_ELIGIBLE,PR_MERGED,PR_CLOSED, andPR_UNKNOWNfor anything not understood with certainty (conflicts, stale base, drafts, novel check vocabularies all stay Unknown → operator).statusCheckRollupshapes (CheckRun and StatusContext) are classified; failing check names surface (capped at 8) so a status reply can say which job is red.NextStatus/RecoveryStatusfields (pr_phase,pr_review_decision,pr_merge_state,pr_failing_checks; schema versions unchanged) and phase-aware published reasons, with the pre-phase sentences kept as the degraded fallback.Boundary conformance
pr-phase-derives-only-from-live-observation— the phase derives only from one live observation at resolution time; never persisted, never accepted from text; underivable →PR_UNKNOWN.next-status,recovery-status) observing viagh.pr_phase_conformance_test.go— positive (each understood combination → its phase through the realResolveNextpath), negative (degraded/malformed/unrecognized →PR_UNKNOWN), bypass (non-terminal observation leaves the delivery ledger byte-identical; terminal cache write unchanged), failure-state (older gh → legacy field fallback).PR_UNKNOWN; gh unavailability degrades to exactly the pre-change behavior.persistObservedTerminalPRStatebyte-for-byte behavior preserved.Evidence
go build ./... && go vet ./... && go test ./...— pass (full package suite).python3 -m unittest tests.test_product_loop— 18/18 pass.2026-07-28-pr-phase-observation.md;release_notes.py preflight— PASS.Next slices:
flow frontierdashboard,flow watch, then the configurabledelivery.terminal: mergedgoal.