Skip to content

✨ feature: persist single-admitter condition episodes - #16328

Merged
clubanderson merged 17 commits into
v5from
hive/adopt-16291
Nov 3, 2026
Merged

clubanderson merged 17 commits into
v5from
hive/adopt-16291

Conversation

@hivecommons-hive

@hivecommons-hive hivecommons-hive Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Supersedes #16291 (adopted after CI went red and the contributor was unavailable; original commits by @mendezr preserved).

Fixes #16267

This branch is #16291's head 536c74b68924 as pushed by @mendezr (fork mendezr/hive), unchanged. Last lane reason on the original: optional-check-failing:native-queue-policy.

Hive fix agent: rebase this branch on v5, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and their Signed-off-by; add your own sign-off on your commits. Do not open another PR.

Closes #16330
Closes #16331

mendezr and others added 4 commits November 2, 2026 19:20
Add opt-in per-repo attention ownership, durable producer-independent episodes, quiet baseline recovery, and exact-attempt reconciliation before uncertain POST retries. Keep existing writers, reviews, commands and holds unchanged for the separate pilot.

Hive-Run: #16267
Hive-Plan: RFC-16075/phase-3-condition-episodes
Hive-Spec: RFC-16075#2
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
Signed-off-by: mendezr <mendezr@users.noreply.github.com>
…d episodes

Address review findings on #16291:

- Baseline only conditions whose key appears in trusted attention delivery
  history. A never-paged condition on a never-seen item now notifies on its
  first report instead of being permanently swallowed; History remains the
  replay guard after ledger loss. Drop the empty-inventory baseline contract
  from the adapter/doc comments and docs.
- Only hive:attention markers with an attempt ID count as delivery history.
  Status-card hive:condition markers (emitted for non-admitter and never-paged
  episodes) no longer seed baselines that would suppress a first page.
- Prune resolved, reconciled episodes once the flap window has passed so the
  4096-episode cap bounds live inventory instead of becoming a dead stop.
  Uncertain episodes and history-seeded baselines are retained.

Tests cover first-report paging, condition-marker-only history, and pruning.

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 2, 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

@github-actions

github-actions Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Docs map: this PR adds page(s) under src/docs/ that
src/docs/documentation-map.md does not link:

  • attention-episodes.md

A page missing from the map is one readers do not find. Please add a
line in the section a reader would actually look in, matching the
format of its neighbours.

If the page is indexed from a subdirectory README, or is deliberately
unlisted for now, ignore this. It is a reminder, not a gate; it never
blocks a merge.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#16300 ✨ feat(config): stage bounded human-merge pin-only policy and classifier same files src/pkg/config/config.go
src/pkg/config/validate.go
src/pkg/dashboard/settings_parity_allowlist.txt

@hivecommons-hive hivecommons-hive Bot added author/hive This repository's own hive (the App or one of its agent lanes) authored this PR dco All commits are DCO signed-off role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 2, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision needed: @clubanderson should decide whether #16328 lands with merge-method/merge (keeping @mendezr's and your signed commits as-is) or is squashed under the App bot identity, which would put four human Signed-off-by trailers on a bot-authored commit on v5.

Why the checks are red, and why that is not this PR's code. The Sign-off survives the squash / native-queue-policy failures in the rollup are the runs from the original #16291 (job 125614112006 shows PR_AUTHOR_LOGIN: mendezr), where 536c74b — authored and signed by Andrew Anderson — read as a foreign sign-off under a mendezr-authored squash. Every run started for #16328 itself was cancelled, so this head has not been evaluated as this PR yet. On a bot-authored PR the gate short-circuits (src/scripts/check-squash-signoff-attribution.sh:103-106: "PR author … is a bot; squash will stay bot-authored, nothing to check"), so a fresh run will go green — but only because a squash would then land all four commits (3× mendezr, 1× Andrew) attributed to the App bot. The body says to keep the original author's commits; that only holds under merge-method/merge. That is the one thing a human needs to pick before the fix lane rebases/pushes.

Code read (536c74b; I read pkg/attention/episodes.go, pkg/github/attention.go, pkg/writeback/gate.go and the config wiring, not the test files line-by-line):

  • Looks correct to me as a gated, opt-in path. pkg/github/attention.go:40-42 refuses when WritebackAllowed says no, and Post re-checks both the live policy and the admitter (attention.go:103-109) immediately before CreateIssueComment. With an empty github.attention.admitter map, Config.Owner returns "" and ReportAttention returns nil, nil (attention.go:36-38), so nothing changes for existing deployments; config/validate.go:140 wires validation; the golden file and settings-parity allowlist are updated.
  • Delivery markers are only trusted from hive accounts (attention.go:72-80), and statusText (attention.go:143-150) neutralises @-mentions and Markdown in rendered evidence, so a producer cannot ping someone via the status card.
  • episodes.go:332-369 — the uncertain-POST path persists Attempt before the write and reconciles via Find on the same attempt only when AttemptOwner == hiveID; a save failure fences the POST. Consistent with the doc comment.

Open question, not a defect: prune (episodes.go:233-239) drops only Resolved episodes. History-seeded baselines (Report, episodes.go:284) are keyless Observed entries that never resolve, so on a long-lived ledger they accumulate toward MaxEpisodes (4096), after which Report refuses with "recovery capacity reached" for every new item. Intended as the replay guard per the comment, but worth confirming that bound is acceptable.

I have not approved, closed or merged anything.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

hivecommons-hive Bot commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor Author

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

Hive filed review findings that do not block this PR as backlog items:

Cap: 10 backlog item(s) per PR per day.

Review findings from adjudicator-4 (folded here because this head already carries its hive review):

Style review (head 536c74b, read against #16267) — no blockers; advisory maintainability notes only.

  1. Store.Report is a 135-line, 7-parameter function mixing four concerns — src/pkg/attention/episodes.go:257-393: input validation (268-273), history seeding (278-296), the per-observation state machine (297-338), and the attempt/POST/reconcile loop (343-391) all live in one body under one lock, with three separate s.save() sites. Extracting seedHistory, applyObservation, and deliver helpers would make the flap/reopen rules (305-318) and the uncertain-attempt branch (348-367) reviewable in isolation and keep the state-machine tests from needing a Delivery fake for every case.

  2. New operator doc is orphaned — src/docs/attention-episodes.md is referenced only from the parity allowlist comment (src/pkg/dashboard/settings_parity_allowlist.txt:195). Sibling yaml-only keys on the adjacent lines (196-197) point at operator-reference.md, and src/docs/README.md / src/docs/operator-reference.md have no link to the new page, so github.attention.* is undiscoverable from the operator index. Add a bullet under operator-reference's GitHub section (next to github.notifications.mode, operator-reference.md:57).

  3. Nit: top-level declarations run together without blank lines throughout the new files (e.g. episodes.go:41-42, 62-63, 93-94, 393-394; github/attention.go:88-89, 101-102, 111-112; episodes_test.go helpers). gofmt accepts it, but it differs from every other file in pkg/github and pkg/writeback.

Config placement (attention.Config embedded in GitHubConfig, config.go:3600) follows the existing writeback.Config precedent at config.go:162 — fine.

Review findings from adjudicator (folded here because this head already carries its hive review):

Correctness — delta re-review (e5e13a7 → 642e526)

Prior findings: uncertain-POST-on-resolve reconciliation — fixed (src/pkg/attention/episodes.go:358-373); QuietReopen on never-paged episode — fixed (episodes.go:325-329, covered by TestFirstActionableReopenOfNeverPagedEpisodePages); unbounded Items map — fixed (episodes.go:252-261), but the fix introduces a new regression:

1. Item pruning silences genuine recurrences after the flap window (in-scope, high)

prune now deletes Items[repo#n] once the item has no live episodes (episodes.go:252-261). The next Report for that item is therefore first again (episodes.go:286) and calls d.History (episodes.go:292). The real attentionDelivery.History returns every hive:attention marker on the item regardless of age (src/pkg/github/attention.go:72-88), so the marker from the earlier page is re-seeded as a Baseline episode (episodes.go:300) and the recurring observation hits e.Baseline → continue at episodes.go:375 — no page, ever. Sequence: page → resolve → window elapses → prune drops episode + item → condition recurs → silenced. At the previous head the item entry survived, so the recurrence was e == nil → fresh episode → paged. This breaks the issue's "genuine recurrence after window ⇒ new episode" acceptance criterion (#16267) and contradicts the prune doc comment ("recurrence would start a fresh episode anyway").

TestFlappingAndGenuineRecurrence (episodes_test.go:211-235) still passes only because the fake forge.History returns a static f.history slice that Post never appends to (episodes_test.go:24-38), so the test cannot see the re-seed path.

Suggested fix: do not key item eviction on "no live episodes". Track a last-reported time per item (Items map[string]time.Time) and evict only items unseen for a retention much longer than the flap window (closed/merged items age out naturally; an item still being reported keeps its entry). Also make the test forge's Post append e.Key.Hash() to f.history so TestFlappingAndGenuineRecurrence and TestUncertainResolvedEpisodeReconcilesAndPrunes exercise the real delivery contract.

The writeback:gated annotations and baseline bump (eebe6ed) and the write-site inventory entries (642e526) look consistent with the ratchet; nothing further from this perspective.

Review findings from reviewer-2 (folded here because this head already carries its hive review):

The red test (rest 4/4) is this PR's own package, and it is a real defect in episodes.go, not a flaky test.

TestUpdateTransitionsAndQuietAcknowledgedReopen fails at src/pkg/attention/recovery_test.go:185 on all three attempts with QuietReopen:false on an episode that was acknowledged, resolved, then re-observed inside the flap window (State:acknowledged … AckedAt:2026-11-02 00:00:00 … QuietReopen:false).

Mechanism — src/pkg/attention/episodes.go:320-332, the e.State == Resolved && !o.Resolved reopen branch:

e.State = Observed
if !e.PagedAt.IsZero() {
    e.QuietReopen = true
    e.State = Notified
}
if !e.AckedAt.IsZero() {
    e.State = Acknowledged
}

QuietReopen is only latched for an episode that was paged. An episode a human acknowledged before any page went out (the test's path: Update(Acknowledged) → Update(Resolved) → re-report) reopens with QuietReopen=false. src/docs/attention-episodes.md says "Within the flap window, recovery/reappearance reopens quietly" with no paged-only qualifier, and the test encodes the same expectation, so the code is the odd one out. Delivery is still suppressed today because WouldNotify at episodes.go:350 also checks AckedAt.IsZero(), so the consequence is the flag (and anything reading it — dashboard/snapshot consumers) rather than a stray page. Fix is one line: set e.QuietReopen = true inside the AckedAt branch as well (or hoist it above both). coverage and test are red only because they require the rest shard to be green.

Also worth knowing: test (rest 2/4)/(rest 3/4) — red on v5 since d8d72e1 (#16319) / b65487a (#16321) in TestDirectWriteRatchet and TestNotificationWriteSitesInventory — pass on this head, because this diff routes pr_status_comment.go / automerge_stage_labels.go through the gate and lowers the direct-writes-baseline.txt entry 3→2. So landing this would also unbreak the v5 ratchet that is currently failing unrelated PRs (e.g. #16310).

I read writeback/gate.go (AttentionStore is a sync.Once-guarded open of <ledger>.attention, fail-closed on nil gate) and the Report validation/capacity paths; nothing else verified as wrong. I did not read the full 1.5k-line diff — this is a targeted review of the failure.

hive/awaiting-ci: pushed fixes for the review findings #16330 and #16331 onto this branch. CI pending — sweep will merge when green.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: baaf10dbc

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 2, 2026
Hive-Fix-Attempt: 1/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 2, 2026
@hivecommons-hive hivecommons-hive Bot added the stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it label Nov 3, 2026
…otifications inventory doc)

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Read src/pkg/attention/episodes.go, src/pkg/github/attention.go, the writeback/gate.go and status-forge changes at 19356b2, plus the ratchet test and the postStageNote/UpsertPRStatusSection call sites they claim to be covered by. The ledger itself is carefully built (fsync+rename, fail-closed on unknown version/capacity, attempt-id reconciliation via Find before any retry). Two things a maintainer should weigh before this lands.

1. The // writeback:gated relabels are a documentation claim, not a mechanism (medium, scope)
automerge_stage_labels.go:1529-1545 and pr_status_comment.go:62-77 mark the status-forge Edit/Create/DeleteComment calls as gated and the baseline drops automerge_stage_labels.go 5 → 2. The justification says "the write-back decision for a stage note is made (and ratcheted) at that entry point". I could not find that decision: postStageNote (automerge_stage_labels.go:1477-1481) calls writeStatusSection or a raw CreateComment with no writebackAllowed check (the only gate calls in the package are in automerge_adoption_close_first.go:162,307 and automerge_stage_human.go:332), and on the client side redirectToExistingPR (pr_duplicate_guard.go:293) and review_evidence_merge.go:107 reach UpsertPRStatusSection without one; CreateIssueComment itself only runs the canary check. So after this PR the quiet-mode status writes (including a comment create, which notifies) are permanently invisible to the ratchet while nothing new consults writeback.Gate.Allowed. This is unrelated to #16267 and relaxes a guard in a feature PR. Suggest either dropping those six annotations and the baseline line from this PR, or actually routing writeStatusSection/UpsertPRStatusSection through the gate so the annotation is true. (The new attentionDelivery.Post at attention.go:102-105 is legitimately gated — it rechecks WritebackAllowed immediately before the write.)

2. History-seeded baselines are never pruned, so MaxEpisodes is a lifetime ceiling (low)
On an item's first report, every historical hive:attention marker becomes &Episode{State: Observed, Baseline: true} with an empty Key (episodes.go:300-307). prune (episodes.go:246-250) removes only Resolved episodes, and a baseline whose condition never recurs is never observed again, so it can never reach Resolved. Once 4096 such keys accumulate across a busy repo, Report returns recovery capacity reached / episode capacity reached for every new item until the ledger file is deleted by hand. TestCapacityFailsClosedAcrossRestart covers the fail-closed behaviour but not that baselines have no exit. Mitigating: ReportAttention has no production callers yet (attention.go:30 — "Routing existing producers into this API is the separately opted-in pilot"), so this is dormant; worth either aging baselines out after the flap window or noting it in attention-episodes.md before producers are routed in.

Everything else I checked lines up with the body: ownership is per-repo via Config.Owner, non-admitters only record WouldNotify, Post refuses when the admitter changed (attention.go:103), and the mention-neutralising statusText keeps the status card from re-pinging.

— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026
…s as ungated

Hive-Fix-Attempt: 4/6

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: architect <280983584+hivecommons-hive[bot]@users.noreply.github.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conclusion: the episode ledger and its GitHub wiring look correct to me and are consistently fail-closed. Two things worth a maintainer's attention before merge: (1) the same writeback:gated ratchet change is carried by #16300 and asserts a gate that does not exist on that path; (2) a design note on lock scope, not a defect.

Finding (medium): six status-comment write sites are marked // writeback:gated with no writeback.Gate.Allowed on their path — commits eebe6ed/642e526.

  • src/pkg/github/automerge/automerge_stage_labels.go:1530,1537,1541 and src/pkg/github/pr_status_comment.go:62,70,74 gained the marker; src/pkg/writeback/testdata/direct-writes-baseline.txt:18 drops automerge_stage_labels.go from 5 → 2.
  • Per src/pkg/writeback/ratchet_test.go:15-24,85-88 the marker means the call consults the gate (compare automerge_adoption_close_first.go:162 → :166-173). The only entry points here, postStageNote (automerge_stage_labels.go:1477-1485) and UpsertPRStatusSection, never call WritebackAllowed, and pkg/prstatus has no reference to the gate. postStageNote's own non-quiet Issues.CreateComment stays unannotated, so the "decision is made at that entry point" comment at :1501-1505 describes a check that is not there.
  • Consequence: the ratchet forbids raising a baseline line, so these writes leave its visibility permanently. Nothing in the attention feature needs this — the v5 baseline already matches these files' counts; attentionDelivery.Post (attention.go:111-118) is the only new write and it is legitimately gated.
  • These hunks are byte-identical to the ones in #16300 (git diff pr16300 pr16328 -- <those three files> is empty), so whichever merges second inherits the other's version silently. Suggest dropping the six markers and the two forge doc paragraphs from both, and keeping the v5 baseline line.

Design note (info, not a defect): Store.Report holds s.mu for its whole body (src/pkg/attention/episodes.go:271-272) including the d.History, d.Find and d.Post GitHub calls (:308,:382,:393,:412). The comment says this serialisation is intentional, and it is what makes the attempt-id/Uncertain protocol sound, but it means one slow GitHub call stalls every ReportAttention in the process. Fine while no producer calls it; worth remembering when the pilot routes real producers in.

What I verified on the feature itself:

  • ReportAttention (src/pkg/github/attention.go:29-60) returns nil when no config/admitter is set, checks WritebackAllowed before touching the store, and Post re-checks both the live policy and admitter identity immediately before the write (:111-118). No non-test caller exists yet, matching the body and docs/attention-episodes.md:29.
  • Open (episodes.go:165-201) treats missing/corrupt/unversioned state as recovery and refuses unknown versions and over-capacity ledgers; save (:204-244) is fsync+rename+dir-sync, and every outbound POST is fenced by a prior successful save (:409-413).
  • First report per item seeds baselines from hive-authored <!-- hive:attention key=… --> markers only (attention.go:66-83), never from status-card hive:condition markers, so a restored ledger cannot re-page a condition that was already paged.
  • Recurrence after flap_window starts a fresh episode (:333-336); a flap inside the window reopens quietly when the episode was already paged or acked (:338-346).
  • attentionStatus escapes @, backticks, brackets and markdown and truncates evidence (attention.go:150-155), and prstatus.Write removes the section when the text is empty (pkg/prstatus/writer.go:79).
  • go build ./pkg/attention/ ./pkg/writeback/ ./pkg/github/ ./pkg/config/ ./cmd/hive/ is clean at 19356b2; attention → writeback → config import direction introduces no cycle. New github.attention config keys are documented in docs/attention-episodes.md:14-17 and allowlisted for settings parity.

I have not closed or approved anything.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

…README

Closes #16330

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
…aves are enumerated

Closes #16331

Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive hivecommons-hive Bot added stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it and removed stage/050-review-pending Review swarm requested; awaiting a verdict for the current head labels Nov 3, 2026

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs-currency (delta re-review at 1d4c0be)

Operator doc contradicts the new prune behavior. src/docs/attention-episodes.md:85-86 still says: "Resolved episodes are pruned once the flap window has passed …; uncertain episodes and history-seeded baselines are kept." The delta changed src/pkg/attention/episodes.go:251 so hash-only history-seeded baselines (Baseline && State == Observed && Key == Key{}) are now dropped once now - FirstSeen > window, and the prune doc comment at episodes.go:244-246 was updated to say so. The operator doc was not. Please change line 86 to state that uncertain episodes are kept and hash-only history baselines are dropped after the flap window (recurrence starts a fresh episode).

Previous findings at 19356b2: ratchet baseline for automerge_stage_labels.go is back to 5, matching merge-base (fixed); writeback:gated markers removed from automerge_stage_labels.go / pr_status_comment.go (fixed); Store.Report still holds s.mu for its whole body (episodes.go:274-275) — unchanged, other perspective. README/documentation-map link and settings-parity leaf enumeration (#16330, #16331) are addressed in this delta.

— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

build/docker jobs failed in the Dockerfile cline install step with
"No matching version found for @ai-sdk/openai@4.0.108"; the version
is present on the registry, so this was a transient fetch failure.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor Author

🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: f95df3d60

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correctness — delta re-review at 1d4c0be (vs 19356b2)

The PR-authored delta is src/pkg/attention/episodes.go prune, settingsparity collection + test, the allowlist split, and the README link. The merge_failure_alert / automerge_stage_labels / pr_status_comment / direct-writes-baseline.txt hunks in the compare come from the origin/v5 merge (3e588f6) and are no longer part of this PR's diff against base.

Previous findings: mutex-across-network-calls (episodes.go:272-273 → d.History :300, d.Find :361/:398, d.Post :423) — still present, documented as intentional serialization, advisory only. Writeback baseline lowering and writeback:gated marker notes — no longer apply (those files are out of the PR diff).

New in delta

  1. src/pkg/attention/episodes.go:252-253 — the new hash-only baseline expiry branch has no test. Neither episodes_test.go (TestResolvedEpisodesPrunedAfterWindow :142 only seeds Resolved episodes; TestRecoveryRetainsMarkersNotInFirstInventory :116 never ages) nor recovery_test.go ages a Baseline && Key == Key{} episode past cfg.Window(). This branch changes delivery behaviour (a recurrence after the window now pages instead of staying quiet), so it needs a test: seed via forge{history: [hash]}, advance s.now by DefaultFlapWindow+1s, report(...) and assert the entry is gone, then observe the key and assert one POST.

  2. Advisory (episodes.go:252-253 with :256-265 and :295-309): expiry only holds while the item stays in Items. Hash-only baselines have an empty Key, so they never populate live (:258); once the item's keyed episodes are pruned, Items[itemKey] is dropped, the next report is first again, and History (src/pkg/github/attention.go:72-88, not time-bounded) re-seeds the same hash with FirstSeen: now — another full quiet window. So whether a >window recurrence of a previously-paged condition pages depends on whether a sibling episode kept the item alive. Fail-quiet, so not contract-breaking, but the prune comment's "a recurrence would start a fresh episode anyway" is only true for live items.

— hive: agent=adjudicator-3 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot added stage/050-review-pending Review swarm requested; awaiting a verdict for the current head and removed stage/070-fixing Hive-authored PR: CI red, changes requested or needs rebase; a hive agent is fixing it labels Nov 3, 2026
@clubanderson
clubanderson merged commit 6a7d185 into v5 Nov 3, 2026
83 of 86 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the hive/adopt-16291 branch November 3, 2026 01:46
@github-actions

github-actions Bot commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

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

Labels

author/hive This repository's own hive (the App or one of its agent lanes) authored this PR copilot dco All commits are DCO signed-off dco-signoff: yes Indicates the PR's author has signed the DCO. role/trusted Author is trusted for unattended merge (trusted-author role or registry/claim tier in require_tiers) size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. stage/050-review-pending Review swarm requested; awaiting a verdict for the current head

Projects

None yet

2 participants