feat(github): store born-held checks while a preflighted apply changes the target - #942
feat(github): store born-held checks while a preflighted apply changes the target#942aparajon wants to merge 1 commit into
Conversation
bcd6aa4 to
4d42d5f
Compare
aeae2bb to
44166f4
Compare
…s the target Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
44166f4 to
9614adb
Compare
4d42d5f to
c2ddcf0
Compare
|
🤖 Review findings - created by Kiran's code review agent - for pull/942, 4d42d5f. Verdict: 8 findings — none blocking; 4 non-blocking (a narrow residual TOCTOU window plus observability and test-convention gaps), 4 suggestions. Non-blocking
General suggestions
The one thing that could have broken, verifiedThe born-held conversion of a would-pass verdict at the plan-write choke point (check_records.go#L221–:249). I verified its supporting premises directly in the worktree: (1) Verified correct
This review was generated by Claude Code (claude-fable-5). |
Why this matters
The preflight fan-out holds every sibling check that exists when an apply starts — but a sibling that pushes a commit (or runs a manual plan) mid-apply gets a fresh plan against the mid-change schema, and a passing verdict from that plan would mint a fresh green check that sidesteps the hold entirely. This closes the last first-party gap in the merge gate: plan-time writes now know when the target is mid-apply. Stack 7/7, on top of #941.
What it does
upsertPlanCheckRecord— the single choke point every plan-time stored-check write funnels through (auto plans, manual plans, and the settle fan-out's re-plans) — consultsHasActivePreflightedApplyOnTargetbefore storing a verdict that would pass. If a preflighted apply is active on the (environment, database type, database) target, the check is stored born held:action_requiredwith the sameapply_in_flight_on_targetblocking reason the preflight fan-out writes, so the aggregate check and its release path are identical to any other hold.schemabot.merge_gate.plan_time_holds_total— a sustained rate with no matching settle re-plans means holds are piling up on a target; check the merge gate processor's logs.How it moves us toward the northstar
With this, every path that can produce a passing check during an apply window is closed at the source: existing checks are held by the preflight fan-out, and new checks are born held. The merge gate on a busy target is now airtight against first-party surfaces — what remains (admin overrides, unprotected branches) is outside the code host's checks and is handled by drift detection and, eventually, merge-time revalidation.
The chain: #867 (storage) → #868 (drive-tail recording) → #866 (settle re-plan processor) → #939 (request kinds + hold storage) → #940 (preflight hold fan-out) → #941 (apply-start gate) → this PR (plan-time holds). Merges bottom-up; each PR retargets to
mainas its base merges.🤖 Generated with Claude Code