Skip to content

πŸ› base red: read the base tip and hold automatic adoption until the base-red memory is published - #19311

Merged
hivecommons-hive[bot] merged 4 commits into
hivecommons:v6from
Danathar:fix/base-red-absent-on-tip
Nov 19, 2026
Merged

hivecommons-hive[bot] merged 4 commits into
hivecommons:v6from
Danathar:fix/base-red-absent-on-tip

Conversation

@Danathar

Copy link
Copy Markdown
Contributor

After a restart, the hive no longer reads every base as "not red" until its first CI enumeration finishes. Until then, the stage pass reads the base tip itself, and automatic adoption waits. That stops it superseding PRs that are red only because their base is.

What was wrong (live case)

The base-red index and the #18842 memory live in the process. They're published only at the end of the first CI-enriched eval cycle (main_eval_cycle.go, repos_rescan.go). Until then, foldBaseRed returned early with nothing remembered, so every base read as not red. On knuckle on 11-18 that window lasted 3 to 27 minutes per restart.

projectbluefin/common#1689 (castrojo had approved it) was red only on E2E β€” composed common suite / e2e / GNOME β€” common. That check was red on main's tip 8820523227 too, failing at 12:48 PM EST. The brief that reported this called it "absent on tip", but it had only read the first page of the tip's 361 check runs. The timeline (EST):

What changed

  • Base tip read before the first publish. foldBaseRed reads the base tip (summarizeChecks on the base ref) when the memory isn't published yet. A head whose every red check is also red on the tip, and that touches no CI-owning path, gets BaseRedChecks and goes to 050/060 base-branch-red, so it's not nudged or adopted.
    • A check still running on the tip, or with no run there, isn't red.
    • An unreadable tip keeps today's author-facing route. A failed read is retried after 1 minute.
  • Automatic adoption waits for the publish. adoptContributorPR defers an automatic adoption while the memory isn't published, logging "adoption deferred until the base-red memory is published" once per head. Supersession can't be undone, and the tip read can't catch every case: a run in progress, a missing check, or a failed read. The wait also covers the shared-CI incident index, which has the same blind spot. An operator's "Adopt now" or adoption/supersede request isn't held.
  • After the first publish: nothing changes, and there's no extra API.
  • API cost, only before the first publish:
    • per base: one tip read (combined status plus check-run pages) every 10 minutes;
    • per red head the index can't answer: one head-checks digest and one PR file listing, both cached per head.
    • The adoption wait costs nothing.
  • No new setting.

Out of scope: #1690 β†’ #1710 at 3:38 PM was a different path. The orphan re-adoption (recoverOrphanedAdoption) never checks base red; #1690 itself had been base-branch-red since 3:14 PM. Possible follow-ups:

Tests

  • TestBaseRedReadsTheBaseTipUntilTheMemoryIsPublished replays fix: guard knowledgeAPI.FileStores() against nil when knowledge is disabledΒ #1689 through the adoption harness:
    • tip red: 050 base-branch-red, no pull, no adoption comment, one tip read across two passes;
    • tip green: stays at 072, isn't adopted before the publish, and is adopted on the first pass after it.
  • TestForcedAdoptionNotHeldBeforeTheBaseRedMemoryIsPublished: before the publish, a PR past its grace isn't adopted and nothing is recorded; "Adopt now" still supersedes.
  • TestFoldBaseRedOptionalFromTheBaseTipBeforeTheMemoryIsPublished: on the optional/soaking route the result is 060 base-branch-red; an unreadable tip stays optional-check-failing, and the failed read is reused at +30s and retried after the error TTL.
  • TestStageBaseRedRemembered is extended for the ready flag.
  • Docs: labels-and-control-signals/stage-labels.md (base-red row). Changelog: changelog.d/fixed-base-red-after-restart.md.

πŸ€– Generated with Claude Code

https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1

Danathar and others added 2 commits November 19, 2026 12:42
…estart

The base-red index and hivecommons#18842's per-base memory live in the process and
are first published when the first CI-enriched enumeration after a start
finishes. On knuckle that took about 25 minutes on 2026-11-18 (restart at
1:26 PM EST, first base-branch-red route again at 1:53 PM). In that window
every base read as not red, so PRs red only on main's own E2E check went to
070/072, and projectbluefin/common#1689 and hivecommons#1690, already past their 072
grace, were adopted at 1:42 PM and superseded (hivecommons#1708, hivecommons#1709 -> hivecommons#1710),
losing a maintainer's approval, into copies red for the same reason.

Until the memory is published (new StageLabelPolicy.BaseRedRememberedReady,
wired to whether stageBaseRedMemory has been stored), foldBaseRed reads the
base tip's checks itself when the memory does not cover a red head's red
checks: one combined-status plus check-run listing per base, cached per
base for humanChecksTTL (10 min), failures included. A head whose every red
check is red on the tip, touching no CI-owning path, is base red and goes
to 050/060 instead of 072, so it is neither nudged nor adopted. An
unreadable tip keeps today's author-facing route. Once the memory is
published nothing changes and no tip is read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
…ished

Review follow-up to the startup base tip read. That read can still miss the
base's red: a tip run still queued or in progress, a tip with no run of the
check, or a failed read. Adoption cannot be undone, so while
StageLabelPolicy.BaseRedRememberedReady is false adoptContributorPR now
returns before anything is recorded for an automatic adoption, logging
"adoption deferred until the base-red memory is published" once per head
and due reason. An operator's Adopt now and an adopt-supersede request are
not held. This costs no API and also covers the unpublished shared-CI
incident index. The 072/nudge side keeps the tip read.

A failed base tip read is now reused for a minute (baseTipRedErrorTTL)
instead of the full humanChecksTTL.

Scope: this covers common#1689 -> hivecommons#1708 (and hivecommons#1690's first adoption into
hivecommons#1709 at 1:42 PM EST). hivecommons#1690 -> hivecommons#1710 at 3:38 PM was the orphan re-adoption
path, which does not read base red; that is out of scope here.

Docs and changelog now describe the deferral, that the tip read counts
commit statuses as well as check runs (unlike the enrichment's read), and
the 3 to 27 minute window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1
Signed-off-by: Danathar <6772335+Danathar@users.noreply.github.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 19, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 19, 2026
@github-actions

github-actions Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

βœ… Resolved: no conflicting open PRs or same-file overlaps remain against v6.

@hivecommons-hive
hivecommons-hive Bot merged commit dde1f2d into hivecommons:v6 Nov 19, 2026
71 checks passed
@hivecommons-hive

hivecommons-hive Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Hive status β€” updated in place; edits do not notify. Full history is in the Activity Monitor.

Evidence bundle `#193113228015` sha256:3b6e2e308458944888b7b61aaab18c50ae7fd3f39442a7e924752d65795fb013 β€” download from the dashboard or `hivectl review evidence #19311`.

merged by Hive trusted-author auto-merge: author Danathar holds role owner and GitHub permission maintain on repo; CI green at 3228015.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant