Skip to content

feat(boatstack): observe the published PR's phase — checks, review, mergeability - #236

Merged
bigboateng merged 1 commit into
mainfrom
boatstack/pr-phase-observation
Jul 28, 2026
Merged

feat(boatstack): observe the published PR's phase — checks, review, mergeability#236
bigboateng merged 1 commit into
mainfrom
boatstack/pr-phase-observation

Conversation

@bigboateng

Copy link
Copy Markdown
Contributor

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

  • observePublishedPR widens its single read-only gh pr view call with statusCheckRollup, reviewDecision, mergeStateStatus, mergeable, baseRefName. If an older gh rejects the enriched field list, it falls back to the legacy list so the basic lifecycle observation is never lost.
  • New pr_phase.go: a pure, total, fail-closed derivation to PRPhasePR_CHECKS_PENDING, PR_CHECKS_FAILING, PR_CHANGES_REQUESTED, PR_REVIEW_REQUIRED, PR_MERGE_ELIGIBLE, PR_MERGED, PR_CLOSED, and PR_UNKNOWN for anything not understood with certainty (conflicts, stale base, drafts, novel check vocabularies all stay Unknown → operator).
  • Both statusCheckRollup shapes (CheckRun and StatusContext) are classified; failing check names surface (capped at 8) so a status reply can say which job is red.
  • Additive NextStatus/RecoveryStatus fields (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

  • Boundary: external GitHub state entering read-only resolution output.
  • Control law: 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.
  • Authorized actor: the read-only resolvers (next-status, recovery-status) observing via gh.
  • Required evidence: conformance classes in pr_phase_conformance_test.go — positive (each understood combination → its phase through the real ResolveNext path), 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).
  • Failure behavior: fail-closed to PR_UNKNOWN; gh unavailability degrades to exactly the pre-change behavior.
  • Release condition: all existing conformance suites green; persistObservedTerminalPRState byte-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.
  • Release note added: 2026-07-28-pr-phase-observation.md; release_notes.py preflight — PASS.

Next slices: flow frontier dashboard, flow watch, then the configurable delivery.terminal: merged goal.

…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
@bigboateng
bigboateng merged commit c03b391 into main Jul 28, 2026
12 checks passed
@bigboateng
bigboateng deleted the boatstack/pr-phase-observation branch July 28, 2026 16:20
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