Skip to content

πŸ› dashboard: one human-gate pill per gated row β€” fixed verbs per reason, no needs-human chevron words, Confirm safe for sentinel alerts - #17505

Merged
hivecommons-hive[bot] merged 6 commits into
v5from
fix-needs-human-pill-unify
Nov 10, 2026
Merged

hivecommons-hive[bot] merged 6 commits into
v5from
fix-needs-human-pill-unify

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #17504

Maintainer, 2026-11-10 (full-board screenshot): "I don't see a consistent way to settle each of these using the UI. Some are confusing, others have no controls to take action, others have too many."

What changes

One human-gate control per gated row. A segmented pill [πŸ‘€ Needs human Β· <reasons>] [verb] [verb] [verb] [… more] replaces the scattered Needs human Β· review chevron word + sentinel chip + needs-decision pill + Approve β–Έ + Let hive decide β–Έ. The status segment names why (review / decision / sentinel / hold, comma-separated when stacked) and carries the reviewer's question or the sentinel rule as its hover (decision popover on click; the question stays in the expander line).

Verbs are fixed per reason, unioned and de-duplicated when reasons stack, ≀ 3 visible + … menu:

Reason Verbs
review Approve Β· Request changes… Β· Let hive decide
decision Decide… (question pre-filled) Β· Approve as-is Β· Let hive decide
sentinel Confirm safe Β· Let hive decide
hold Release hold Β· Let hive decide

"Needs human" is never a chevron word. Needs human Β· …, Held Β· sentinel Β· confirm intent, Held Β· hold and Sentinel alert Β· needs human are gone from the strip (and the Β· sentinel suffix on 071/072 words); the lit chevron is the row's real stage (CI while checks run β€” #17481, crux #140) with the amber ham-human-gated outline as the bar's only cue.

Secondary rows of a shared PR render no gate and no amber chevron; their decision pending on #N chip is a link that scrolls to / focuses the primary row (#17333 anchoring).

New endpoint POST /api/repos/{owner}/{repo}/items/{number}/sentinel-confirm (Hold authorisation, dashboard-user attribution, audited repo_item_sentinel_confirm, ledger verb confirm-sentinel): comments <!-- hive:sentinel-confirmed --> + the person's words, then removes the configured sentinel label; idempotent when already clear.

All verbs run runRowAction (in-app modal, result toast, acting row); the pill reads settling… until the next snapshot. Phone tier: the status segment folds to its icon, every verb keeps a β‰₯ 44px tap target.

Tests

Docs

activity-monitor.md: new Settling a human gate table (reason β†’ verbs β†’ what gets posted), sentinel/held paragraphs rewritten; copy inventory row; API reference row (+ citation --fix); changelog fragment.

…n words

Every row a person must settle carries exactly one segmented
'πŸ‘€ Needs human Β· <reasons>' control whose verbs are fixed per reason
(review / decision / sentinel / hold; stacked reasons union, ≀3 visible
+ … menu). 'Needs human', 'Held Β· sentinel' and 'Sentinel alert Β· needs
human' never ride a chevron: the lit chevron is the real stage with the
amber ham-human-gated outline. Secondary rows of a shared PR render no
gate; their 'decision pending on #N' chip links to the primary row. A
new POST …/items/{number}/sentinel-confirm endpoint (comment + label
removal, audited) gives a sentinel alert its own verb, Confirm safe.

Fixes #17504

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 10, 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 kellyaa 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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Nov 10, 2026
@github-actions

github-actions Bot commented Nov 10, 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.

No conflicting open PRs or same-file overlaps were found.

@github-actions

Copy link
Copy Markdown
Contributor

Mutation testing (advisory)

No surviving mutants in changed files (or the run hit its time budget before reporting any).

Advisory only; this job never blocks the PR (#17349).

@hivecommons-hive

hivecommons-hive Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

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

clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard 3/4)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

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

CI at head b199fb2 β€” six remaining red causes, all in this diff (baseline check: v5 siblings not red on these; FIX_DIFF). The compile error from the earlier head is gone; these are what still fail:

  1. TestRepoItemSentinelConfirmAuthorizationCommentAndLabel (api_repo_item_sentinel_confirm_test.go:97) β€” the "owner, already clear" case calls postSentinelConfirm(t, srv, "", {}, true) with an empty X-Hive-User, and the handler answers 401 GitHub user session required (api_repo_item_sentinel_confirm.go:85-88). The owner role skips the permission lookup, not the attribution requirement, so pass a user there ("owner") and assert the comment names that user.
  2. TestDirectWriteRatchet (pkg/writeback/ratchet_test.go:179, test (rest 4/4)) β€” api_repo_item_sentinel_confirm.go has 2 direct write calls not in testdata/direct-writes-baseline.txt; add wrap pkg/dashboard/api_repo_item_sentinel_confirm.go 2 next to the api_repo_hold.go line, or route through writeback.Gate.Allowed.
  3. TestOpenAPISpecCoversEveryRegisteredRoute β€” POST /api/repos/{owner}/{repo}/items/{number}/sentinel-confirm is registered but absent from dashboard/openapi.json (the decision endpoint entry is the model).
  4. TestStageTrackerSentinelNoticePreservesActualReviewerDecision (stage_tracker_sentinel_notice_test.go:41) β€” "an informational notice is not a human gate": the gate-reasons helper returns ['decision'] for a row whose only signal is a sentinel_notice; the reason computation in tracker-human-gate.js must exclude sentinel_notice (the PR body says it does; the fixture shows a path where it still counts as decision).
  5. TestStageTrackerLeadActionInline (stage_tracker_lead_action_test.go:38) β€” the pin expects stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : '') (and the (pr) variant) in index.html; the row-render rewrite changed that expression. Either restore the lead-button call shape or update the pin in the same PR.
  6. mobile-shots β€” phone acceptance: tracker-phone-card fails at 390Γ—844, 375Γ—667, 430Γ—932 (light + dark) and "card rows must have median height ≀ 96px with β‰₯ 6 rows in view at 390Γ—844"; tracker-phone-chrome at 844Γ—390. The segmented pill is pushing phone-tier row height past the budget β€” the status segment folding to its icon likely needs to also drop to a single verb (+ …) at the phone breakpoint.

The hive does not push to your branch; a new head re-runs CI and the review swarm automatically.

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

Read the new endpoint against the sentinel sweep and the tracker, not just the diff. The pill/verb unification itself looks right to me (tracker-human-gate.js verb table ↔ tracker-actions.js endpoint map ↔ operator_actions.go ledger name all agree). Two things in the Confirm safe path do not do what the PR body and docs say they do.

1. Confirm safe does not clear a bundle-promoted alert β€” the pill stays sentinel after the person confirms. (medium)

src/pkg/dashboard/stage_tracker.go:1229-1240: with no label on the item, alert is set from f.Notice on the evidence bundle and is only suppressed when b.SentinelAcknowledgedBy() != "". The only writer of that action is RecordReviewEvidenceSentinelAck (src/pkg/github/review_evidence.go:508-535), which the Approve path calls. handleRepoItemSentinelConfirm (src/pkg/dashboard/api_repo_item_sentinel_confirm.go:120-140) posts the comment and removes the label but never records the acknowledgment. So on a notice-only alert (the crux#30 case the docs cite) the endpoint returns alreadyClear: true, the toast says "Nothing further to do for the sentinel" (:143), and the next snapshot re-renders the same πŸ‘€ Needs human Β· sentinel pill with the same Confirm safe verb. The docs added in this PR (activity-monitor.md, Settling a human gate) call Confirm safe "the alert's own answer"; today only Approve answers the bundle case. Fix is small: resolve the head (the decision path already does) and call RecordReviewEvidenceSentinelAck after the label loop.

2. The <!-- hive:sentinel-confirmed --> marker is written but nothing reads it, so the sweep can re-label a confirmed PR after a head move. (medium)

api_repo_item_sentinel_confirm.go:52-54 says the marker "lets the sentinel sweep and the delegate recognise a human confirmation". grep for sentinel-confirmed across src/ finds only the writer and the toast word. In src/pkg/github/sentinel_sweep.go:752-775, when the current head has no own marker comment and the label is absent, clearance is decided by sentinelClearedAfterLatestPush β€” which refuses an unlabeled event by a hive account (sentinel_clearance.go:88-90), and that is exactly who removes the label here β€” and then sentinelReleasedByDashboardApproval, which only parses ParsePRApprovalCommandComment (:135). Neither matches the new marker, so the sweep falls through to AddLabelsToIssue at :792. This is the dibs#510 regression re-created for the new verb, in the #13602 window (push lands between the alert and the click, before the new-heads sweep rewrites the comment). The common case β€” comment for this exact head present, label removed β€” is still cleared by sentinelClearedByMaintainer (:744), so this is a window, not a constant. Either bind the head into the marker and teach sentinelReleasedByDashboardApproval to accept it, or drop the claim in the comment and the docs that the sweep recognises it.

Neither is a reason to abandon the design; both are in the one new Go file. No position on the CSS/row-layout changes beyond that they render the verbs the backend accepts.

I have not changed, approved, or closed anything.

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

Not mergeable at c417a43: three CI failures, all caused by this diff. The design matches the spec in #17504 (one pill per gated row, fixed verbs per reason, sentinel endpoint next to the approve path with Hold-tier authz β€” canToggleRepoHold, api_repo_hold.go:74), and the comment-before-label ordering in api_repo_item_sentinel_confirm.go:127-137 is the right call for the audit trail. The failures are mechanical:

  1. pkg/dashboard test binary does not compile β€” src/pkg/dashboard/api_repo_item_sentinel_confirm_test.go:70 compares resp.Result.Target != "testorg/testrepo#7", but RowActionResult.Target is the struct RowActionTarget{Repo, Kind, Number, URL} (row_action_result.go:49). Every dashboard shard, both shuffle lanes, coverage and golangci-lint are red for this one line, and none of the new TestStageTrackerHumanGate* / TestRepoItemSentinelConfirm* tests have actually run yet. Compare resp.Result.Target.Repo/.Number, or against rowActionTarget("testorg/testrepo", rowActionTargetPR, 7).

  2. pkg/github TestNotificationWriteSitesInventory (rest 3/4) β€” handleRepoItemSentinelConfirm calls CreateIssueComment at api_repo_item_sentinel_confirm.go:129 and is not in notificationWriteSites (src/pkg/github/notification_write_sites.go, next to dashboard.(*Server).executeDelegatedDecision at line 40). The test asks for an entry there plus a row in src/docs/notifications.md.

  3. pkg/dashboard/webstatic TestStyleRatchet (rest 3/4) β€” the new tracker.css rules add 4 raw border-radius declarations, taking operator static/index.html to 176 against the 174 baseline in style_ratchet_test.go:33. The ratchet comment says counts must not go up; the fix is to use the shared radius tokens from tokens.css for the new pill/menu rules (or, if the maintainers accept the debt, raise the baseline in the same PR β€” a human call, so I'm only noting it).

One behavioural note, not a defect: the PR body says the endpoint is "idempotent when already clear", but at api_repo_item_sentinel_confirm.go:129 the confirmation comment is posted on every call, including when no sentinel label is on the item (AlreadyClear: true). The code comment at line 45 documents this deliberately, and the docs row says the same, so I read it as intended β€” just flagging that repeated clicks will stack comments on the item.

I have not run the suite locally (per AGENTS.md); findings are from the CI logs of run 42745650407 and the v5 tree.

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

Docs-currency review (head f85b444)

1. Docs overstate Confirm safe β€” it does not clear a bundle-only sentinel alert (src/docs/dashboard-sections/activity-monitor.md, "Sentinel alert" paragraph + "Settling a human gate" table, sentinel row)

The table says the sentinel reason is set by "the sentinel-alert label or blocking findings on this head (sentinel_alert…)" and that Confirm safe is "the alert's own answer". The endpoint only posts the comment and removes the label (src/pkg/dashboard/api_repo_item_sentinel_confirm.go:126-139); it never records evidence.ActionSentinelAcknowledged the way Approve does (the paragraph right below documents that path clearing "a bundle-only alert (findings but no label β€” hivecommons/crux#30)"). stage_tracker.go:1229-1239 keeps sentinel_alert: true from bundle Notice findings unless SentinelAcknowledgedBy() is set, so on a bundle-only alert the operator presses Confirm safe, gets alreadyClear: true and a "confirmed safe" toast, and the next snapshot re-renders the same πŸ‘€ Needs human Β· sentinel pill with Confirm safe again. Nothing consumes the <!-- hive:sentinel-confirmed --> marker either (no reader in the tree at this head), despite the comment at api_repo_item_sentinel_confirm.go:55-57.

Preferred fix: have the handler record the acknowledgment on the head's bundle (same call the Approve path uses), then the docs are true as written. If that is deferred, the doc must say so:

| `sentinel` | the `sentinel-alert` label on this head (`sentinel_alert`, not the trusted-author notice) | **Confirm safe** Β· **Let hive decide** | Confirm safe comments `<!-- hive:sentinel-confirmed -->` with the person's words and removes the sentinel label (`POST …/items/{n}/sentinel-confirm`, audited `repo_item_sentinel_confirm`); it does **not** record a bundle acknowledgment, so a bundle-only alert (findings, no label) is cleared only by *Approve* through the decision dialog. Let hive decide never clears the alert. |

2. Every citation points at the wrong issue β€” #17470 is "[DCO] post-merge trailer failures on v6" (closed); the spec this PR implements is #17504. Affected: changelog.d/changed-needs-human-gate-pill.md:1, src/docs/dashboard-sections/activity-monitor.md (table row 085/090, Sentinel alert paragraph, "Settling a human gate" lead), src/docs/dashboard-copy-inventory.md:70, src/docs/api-reference/agents-and-controls.md (sentinel-confirm row), dashboard/openapi.json is fine (no ref), plus ~20 code/test comments (api_repo_item_sentinel_confirm_test.go, stage_tracker_human_gate_test.go, tracker-human-gate.js, tracker-row-render.js, tracker-actions.js, static/index.html). The "hive#17470 / PR #17481" fixture names in the tests are the example row and should stay.

-(hivecommons/hive#17470)
+(hivecommons/hive#17504)

(apply to every non-fixture reference; grep -rn 17470 changelog.d src/docs src/pkg/dashboard lists them.)

hive/awaiting-ci: CI red at b199fb2 β€” all failures are deterministic (3/3 reruns) and PR-local to this diff (FIX_DIFF; v5 baseline v2 Tests is green). Same-repo human branch, so I am not pushing; here is what each red check asks for.

test (dashboard 1/4) β€” TestRepoItemSentinelConfirmAuthorizationCommentAndLabel (api_repo_item_sentinel_confirm_test.go:97): owner, already clear: code=401 body={"error":"GitHub user session required to confirm a sentinel finding"}. The new sentinel-confirm handler rejects the owner/already-clear path the test expects to succeed β€” the session check runs before the owner short-circuit.

test (dashboard 2/4) β€” TestOpenAPISpecCoversEveryRegisteredRoute (openapi_route_parity_test.go:388): registered but undocumented: POST /api/repos/{owner}/{repo}/items/{number}/sentinel-confirm β€” add it to dashboard/openapi.json (or a routeParityException with a reason).

test (dashboard 3/4) β€” TestStageTrackerSentinelNoticePreservesActualReviewerDecision (stage_tracker_sentinel_notice_test.go:41): node assertion an informational notice is not a human gate β€” the new per-row human-gate pill is rendered for a sentinel notice (informational, author trusted) and overrides the actual reviewer decision; the pill must not fire on informational sentinel rows.

test (dashboard 4/4) β€” TestStageTrackerLeadActionInline (stage_tracker_lead_action_test.go:38): index.html lacks the two expected wiring lines stageTrackerChipsHtml(pr) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(pr, nowMs) : '') and …stageTrackerChipsHtml(shown) + … stageTrackerLeadButtonHtml(item, nowMs, subRows) : '') β€” the lead-button call sites were changed/removed in index.html without updating this guard (or vice-versa).

test (rest 4/4) β€” pkg/writeback.TestDirectWriteRatchet (ratchet_test.go:179): pkg/dashboard/api_repo_item_sentinel_confirm.go: 2 direct write call(s) in a file not in the baseline β€” route them through writeback.Gate.Allowed (or a solicited relay).

mobile-shots β€” Activity browser acceptance: tracker-phone-card fails at 390x844, 375x667, 430x932 (light+dark) and tracker-phone-chrome at 844x390; card rows must have median height ≀ 96px with β‰₯ 6 rows in view at 390x844. The extra pill row pushes the phone card over the height budget. Report: artifact dashboard-mobile-shots β†’ overflow-report.json.

coverage / test are aggregates of the above.


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

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

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

Docs-currency review (head f85b444)

1. Docs overstate Confirm safe β€” it does not clear a bundle-only sentinel alert (src/docs/dashboard-sections/activity-monitor.md, "Sentinel alert" paragraph + "Settling a human gate" table, sentinel row)

The table says the sentinel reason is set by "the sentinel-alert label or blocking findings on this head (sentinel_alert…)" and that Confirm safe is "the alert's own answer". The endpoint only posts the comment and removes the label (src/pkg/dashboard/api_repo_item_sentinel_confirm.go:126-139); it never records evidence.ActionSentinelAcknowledged the way Approve does (the paragraph right below documents that path clearing "a bundle-only alert (findings but no label β€” hivecommons/crux#30)"). stage_tracker.go:1229-1239 keeps sentinel_alert: true from bundle Notice findings unless SentinelAcknowledgedBy() is set, so on a bundle-only alert the operator presses Confirm safe, gets alreadyClear: true and a "confirmed safe" toast, and the next snapshot re-renders the same πŸ‘€ Needs human Β· sentinel pill with Confirm safe again. Nothing consumes the <!-- hive:sentinel-confirmed --> marker either (no reader in the tree at this head), despite the comment at api_repo_item_sentinel_confirm.go:55-57.

Preferred fix: have the handler record the acknowledgment on the head's bundle (same call the Approve path uses), then the docs are true as written. If that is deferred, the doc must say so:

| `sentinel` | the `sentinel-alert` label on this head (`sentinel_alert`, not the trusted-author notice) | **Confirm safe** Β· **Let hive decide** | Confirm safe comments `<!-- hive:sentinel-confirmed -->` with the person's words and removes the sentinel label (`POST …/items/{n}/sentinel-confirm`, audited `repo_item_sentinel_confirm`); it does **not** record a bundle acknowledgment, so a bundle-only alert (findings, no label) is cleared only by *Approve* through the decision dialog. Let hive decide never clears the alert. |

2. Every citation points at the wrong issue β€” #17470 is "[DCO] post-merge trailer failures on v6" (closed); the spec this PR implements is #17504. Affected: changelog.d/changed-needs-human-gate-pill.md:1, src/docs/dashboard-sections/activity-monitor.md (table row 085/090, Sentinel alert paragraph, "Settling a human gate" lead), src/docs/dashboard-copy-inventory.md:70, src/docs/api-reference/agents-and-controls.md (sentinel-confirm row), dashboard/openapi.json is fine (no ref), plus ~20 code/test comments (api_repo_item_sentinel_confirm_test.go, stage_tracker_human_gate_test.go, tracker-human-gate.js, tracker-row-render.js, tracker-actions.js, static/index.html). The "hive#17470 / PR #17481" fixture names in the tests are the example row and should stay.

-(hivecommons/hive#17470)
+(hivecommons/hive#17504)

(apply to every non-fixture reference; grep -rn 17470 changelog.d src/docs src/pkg/dashboard lists them.)

Evidence bundle `#17505d2ede80` sha256:8450ac8d934620a709c6a6fa3899f3790a312e6c04d1d6cc13f8c174b17fef3f β€” download from the dashboard or `hivectl review evidence #17505`.

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Security perspective β€” no blocker. Read at head c417a43.

The new POST …/sentinel-confirm endpoint reuses the Hold authorisation (api_repo_item_sentinel_confirm.go:80 β†’ canToggleRepoHold, api_repo_hold.go:74-114), requires a signed-in user (:85-89), is wrapped in recordOperatorAction (api.go:347), checks watchesRepo before any write (:109-112), bounds the body (:95, :100) and audits with the comment text (:141). Removing the sentinel label is the sweep's own clearance signal (stage_tracker.go:1186-1190), and repo-write is exactly the bar GitHub itself sets for removing a label, so this is not a privilege widening. Tests pin 403/401 (api_repo_item_sentinel_confirm_test.go:40-45).

One advisory (low, non-blocking):

Paused-repo gate not applied. #15436 ("a paused repo takes no hive writes, operator-initiated or not") is enforced in the decision handler via repoWritesPaused (api_repo_item_decision.go:485-492), but the new endpoint posts a comment and strips the sentinel label on a paused repo with no check (api_repo_item_sentinel_confirm.go:108-140). Hold has the same gap today, so this follows the existing pattern rather than regressing it β€” but since this is a new write path that opens a merge gate, a refused result would be cheap:

	repoFull := owner + "/" + repoName
	if !s.watchesRepo(repoFull) {
		jsonError(w, "repository is not configured for this hive", http.StatusForbidden)
		return
	}
	if detail, paused := s.repoWritesPaused(repoFull); paused {
		jsonStatusResponse(w, http.StatusOK, repoSentinelConfirmResponse{OK: true, Repo: repoFull, Number: number,
			Result: &RowActionResult{Action: rowActionRefused, Target: rowActionTarget(repoFull, itemType, number), Outcome: "Confirm safe refused: repo paused β€” " + detail + "."}})
		return
	}

β€” hive: agent=adjudicator-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Review follow-ups (below review.backlog.min_severity: P2)

Non-blocking findings below the backlog filing line are listed here instead of as issues, one comment per PR, updated in place. Tick them off as they are fixed; set review.backlog.min_severity: P3 to file every finding.

  • P3 low intent-alignment β€” Authorization is evaluated before the dashboard-user session check (src/pkg/dashboard/api_repo_item_sentinel_confirm.go:99): canToggleRepoHold runs (possibly a GitHub permission lookup) before the X-Hive-User check at :104, so an authorised but sessionless caller does the lookup and then gets 401. Harmless ordering nit; sw…

…r sentinel-confirm write site

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correctness review (head c417a43, read against the surrounding tree)

1. New test does not compile β€” whole pkg/dashboard test build fails

src/pkg/dashboard/api_repo_item_sentinel_confirm_test.go:70 compares resp.Result.Target (a RowActionTarget struct β€” row_action_result.go:49-54) to a string. CI test (dashboard 1/4..4/4) all fail on it: invalid operation: resp.Result.Target != "testorg/testrepo#7" (mismatched types RowActionTarget and untyped string). Every other test in the PR (TestStageTrackerHumanGateRows etc.) is therefore unrun.

	if resp.Result == nil || resp.Result.Action != rowActionSentinelConfirmed || resp.Result.Target.Repo != "testorg/testrepo" || resp.Result.Target.Kind != rowActionTargetPR || resp.Result.Target.Number != 7 || !strings.Contains(resp.Result.Outcome, "@writer") || !strings.Contains(resp.Result.Outcome, config.DefaultSentinelLabel) {

2. Gate verbs on an issue row drawn through its covering PR act on the issue, not the PR

stageTrackerHumanGateHtml computes reasons from shown (tracker-human-gate.js:1878), and for a via_pr issue row shown carries the PR's sentinel_alert, hold, review_activity, decision_needed under the issue's kind:'issue'/number (tracker-row-render.js:137-140). Your own test asserts this row carries the gate (stage_tracker_human_gate_test.go, primary issue #17451 via PR #17480 β†’ gates(headRow) === 1). But the click path resolves the item from row.dataset.hamKey (the issue, tracker-actions.js:983-985) and runRowAction only remaps decide:* ids through stageTrackerDecisionTarget (tracker-actions.js:2706-2718); gate:* fall through to stageTrackerActionRequest(issueItem, …), which builds type = item.kind === 'pr' ? 'pr' : 'issue' and the issue number (tracker-actions.js:1335-1336, 1371-1377). Consequences:

  • Confirm safe β†’ POST /items/<issue>/sentinel-confirm: currentItemLabels reads the issue (api_repo_item_sentinel_confirm.go:116), finds no sentinel label, comments on the issue and answers AlreadyClear ("no sentinel-alert label was on the item"); the PR's label β€” the actual gate β€” stays. This is the hive#17470 β†’ PR #17481 scenario the issue opens with.
  • Decide… / Request changes… β†’ POST /items/<issue>/decision {direction, type:issue} β†’ RecordOperatorIssueDecision on a non-parked issue β†’ 409 "issue is not waiting on a decision" (api_repo_item_decision.go:410-421), while Approve / Let hive decide on the same pill correctly go to the PR.

Fix (in runRowAction, next to the decide: branch):

       } else if (id.indexOf('decide:') === 0) {
         ...
+      } else if (id.indexOf('gate:') === 0) {
+        // A gate verb on an issue row drawn through its one covering PR
+        // settles that PR: the sentinel label, the reviewer's question and
+        // the hold live on the PR, not the issue (via_pr, tracker-row-render.js).
+        items = items.map(it => {
+          if (!it || it.kind !== 'issue' || !Array.isArray(it.linked_prs) || it.linked_prs.length !== 1 || !it.linked_prs[0]) return it;
+          const lp = it.linked_prs[0];
+          return stageTrackerItemByKey(_stageTracker, stageTrackerItemKey({ repo: it.repo, kind: 'pr', number: lp.number })) || stageTrackerLinkedPRItem(it, lp);
+        });
       }

and add a TestStageTrackerHumanGateWiring case asserting stageTrackerActionRequest's URL for gate:confirm-sentinel on the via_pr issue fixture names the PR number. The same remap should cover release when the hold reason came from the PR (shown.hold), since the pill now offers it on the issue row.

3. (low) … overflow menu stays open after choosing a verb

stageTrackerWireHumanGate (tracker-human-gate.js:~1935) skips closeAll() when the click lands inside .ham-gate-menu, and the [data-ham-act] handler stopPropagations, so the menu remains visible over the "settling…" pill. Call closeAll() from the ham-gate-act branch in tracker-actions.js:988 or in the menu's own click path.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive

Copy link
Copy Markdown
Contributor

CI at head b199fb2 β€” six remaining red causes, all in this diff (baseline check: v5 siblings not red on these; FIX_DIFF). The compile error from the earlier head is gone; these are what still fail:

  1. TestRepoItemSentinelConfirmAuthorizationCommentAndLabel (api_repo_item_sentinel_confirm_test.go:97) β€” the "owner, already clear" case calls postSentinelConfirm(t, srv, "", {}, true) with an empty X-Hive-User, and the handler answers 401 GitHub user session required (api_repo_item_sentinel_confirm.go:85-88). The owner role skips the permission lookup, not the attribution requirement, so pass a user there ("owner") and assert the comment names that user.
  2. TestDirectWriteRatchet (pkg/writeback/ratchet_test.go:179, test (rest 4/4)) β€” api_repo_item_sentinel_confirm.go has 2 direct write calls not in testdata/direct-writes-baseline.txt; add wrap pkg/dashboard/api_repo_item_sentinel_confirm.go 2 next to the api_repo_hold.go line, or route through writeback.Gate.Allowed.
  3. TestOpenAPISpecCoversEveryRegisteredRoute β€” POST /api/repos/{owner}/{repo}/items/{number}/sentinel-confirm is registered but absent from dashboard/openapi.json (the decision endpoint entry is the model).
  4. TestStageTrackerSentinelNoticePreservesActualReviewerDecision (stage_tracker_sentinel_notice_test.go:41) β€” "an informational notice is not a human gate": the gate-reasons helper returns ['decision'] for a row whose only signal is a sentinel_notice; the reason computation in tracker-human-gate.js must exclude sentinel_notice (the PR body says it does; the fixture shows a path where it still counts as decision).
  5. TestStageTrackerLeadActionInline (stage_tracker_lead_action_test.go:38) β€” the pin expects stageTrackerChipsHtml(shown) + (typeof stageTrackerLeadButtonHtml === 'function' ? stageTrackerLeadButtonHtml(item, nowMs, subRows) : '') (and the (pr) variant) in index.html; the row-render rewrite changed that expression. Either restore the lead-button call shape or update the pin in the same PR.
  6. mobile-shots β€” phone acceptance: tracker-phone-card fails at 390Γ—844, 375Γ—667, 430Γ—932 (light + dark) and "card rows must have median height ≀ 96px with β‰₯ 6 rows in view at 390Γ—844"; tracker-phone-chrome at 844Γ—390. The segmented pill is pushing phone-tier row height past the budget β€” the status segment folding to its icon likely needs to also drop to a single verb (+ …) at the phone breakpoint.

The hive does not push to your branch; a new head re-runs CI and the review swarm automatically.


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

β€” hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

…d pins, fold gate verbs on stacked/phone tiers

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correctness at head b508ec8 β€” read against the sentinel sweep at merge-base.

The CI fixes from b199fb2 β†’ b508ec8 check out: the "already clear" case now sends a user (api_repo_item_sentinel_confirm_test.go:97), the two direct writes carry // writeback:solicited which ratchet_test.go:91 accepts, and the route is in dashboard/openapi.json. The common case is also safe: when the alert comment names the current head, sentinel_sweep.go:728-737 (sentinelClearedByMaintainer) sees "alert for this head present, label absent" and does not re-label.

Still open from the c417a43 review: Confirm safe is undone when the alert was raised on an earlier head

Nothing in this head changed that path β€” the b508ec8 diff touches the handler only for the owner/solicited fixes. Mechanism, as the tree stands:

  • api_repo_item_sentinel_confirm.go:126-139 posts <!-- hive:sentinel-confirmed --> and removes the label as the hive App. The marker is not bound to a head, and no Go code reads it (grep -rn 'sentinel-confirmed' src/pkg finds only this file).
  • When the head moved after the alert (Renovate rebase, the #13602 case), the sweep takes the !posted branch at sentinel_sweep.go:739-765. sentinelClearedAfterLatestPush rejects the unlabeled event because the actor is a hive account (sentinel_clearance.go:84-89); sentinelReleasedByDashboardApproval only recognises ParsePRApprovalCommandComment markers (sentinel_clearance.go:135). Neither sees the confirmation, so the sweep falls through to AddLabelsToIssue at :792 and re-labels the PR the person just confirmed β€” the dibs#510 regression class, re-opened on the new verb.
  • The file comment at :54-56 ("the marker lets the sentinel sweep and the delegate recognise a human confirmation") describes behaviour this diff does not implement.

Smallest fix: bind the head into the marker (as renderPRApprovalCommandComment does) and have sentinelReleasedByDashboardApproval β€” or a sibling β€” accept a hive-authored hive:sentinel-confirmed head=<sha> comment for the current head. A test in sentinel_clearance_test.go with alert-on-A / confirm-on-B / sweep-on-B would fail without it.

Severity: medium. Consequence: on rebased PRs the only sentinel verb the pill offers silently reverts on the next tick, and the maintainer removes the same label twice.

β€” hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correctness re-review of the delta c417a43 β†’ b508ec8 (source hunks read; generated index.html/openapi.json skimmed).

Previous findings: docs-currency (src/docs/notifications.md write-site row) β€” fixed (notifications.md:475, notification_write_sites.go:45). Style (raw border-radius in tracker.css) β€” addressed in the delta (tracker.css:985-990: parent overflow:hidden + --ham-gate-seg-radius), left to the style perspective to confirm.

One low advisory in the delta:

… menu opens with focus on a hidden item (strip tier). tracker-human-gate.js:194 now puts every verb after the first into the menu, with the strip-tier copies marked data-ham-gate-inline and hidden by tracker.css:1001 (display:none). But the opener at tracker-human-gate.js:221 still does menu.querySelector('[role="menuitem"]') β†’ the first child is one of those hidden copies, and .focus() on a display:none element is a no-op, so keyboard users who open the overflow on β‰₯1100px get no focus move (regression from the previous head, where the first menu item was always a visible overflow verb). Phone/stacked tier is unaffected (all items visible there).

        if (menu && open) { menu.hidden = false; b.setAttribute('aria-expanded', 'true'); const first = Array.from(menu.querySelectorAll('[role="menuitem"]')).find(m => m.offsetParent !== null); if (first) first.focus(); }

Checked and fine: api_repo_item_sentinel_confirm_test.go:96 switching the owner-role case to a named user matches the handler's X-Hive-User 401 guard (api_repo_item_sentinel_confirm.go:84-87); the verbs() test helper dedupe keeps the union-order assertions meaningful; the pill lives inside .ham-head-cols (tracker-row-layout.js:18) so the ≀1100px fold rules also govern the phone tier. CI was still pending at review time.

β€” hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive hivecommons-hive Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Read the new endpoint against the sentinel sweep and the evidence-bundle readers at merge-base 42f95be. The UI unification reads as described; the Go endpoint is correctly authorised (canToggleRepoHold, MaxBytesReader, label removal scoped to the configured sentinel label). Two places where Confirm safe does less than the existing Approve path, so the gate it opens can close again:

1. The sweep can re-label a PR a person confirmed safe (medium). src/pkg/dashboard/api_repo_item_sentinel_confirm.go:53-55 says the <!-- hive:sentinel-confirmed --> marker "lets the sentinel sweep and the delegate recognise a human confirmation", but nothing outside this file reads it (grep -rn hive:sentinel-confirmed src --include=*.go β†’ only this file). The sweep's clearance logic rejects this removal specifically:

  • src/pkg/github/sentinel_clearance.go:80-86 β€” the last unlabeled actor must not be the hive account or a Bot. Confirm safe removes the label through s.deps.GHClient (api_repo_item_sentinel_confirm.go:131), i.e. as the App bot, so sentinelClearedAfterLatestPush returns false.
  • src/pkg/github/sentinel_clearance.go:129 β€” the fallback only recognises ParsePRApprovalCommandComment (the head-bound Approve carrier), not this marker.

The common case is safe: when the alert comment for the current head exists, sentinel_sweep.go:728 clears via sentinelClearedByMaintainer regardless of actor. The hole is the #13602 shape β€” head moved (Renovate rebase) between the alert and the confirmation, so no marker exists for the current head β€” combined with the #11686 shape (hub restart empties the heads map). On the next full pass sentinel_sweep.go:739-767 finds !posted, neither clearance check fires, and :792 re-applies the label and re-alerts. A person then has to confirm the same finding twice, which is exactly what #13602 fixed for the hand-removal path. Suggested fix: bind the head in the marker (like the Approve carrier does) and teach sentinelReleasedByDashboardApproval (or a sibling) to accept it.

2. A bundle-promoted alert stays lit after Confirm safe (medium). Approve records evidence.ActionSentinelAcknowledged on the head's bundle (api_repo_item_decision.go:884, activity-monitor.md:245); stage_tracker.go:1229-1238 only drops a bundle/notice alert when SentinelAcknowledgedBy() is non-empty. Confirm safe writes no evidence action, so on the bundle-only case your docs call out (crux#30: findings, no label) sentinelLabelsOn returns nothing, the endpoint answers AlreadyClear with "no sentinel-alert label was on the item" (:147), and the row's pill stays lit with the same Confirm safe verb. Recording the same sentinel_acknowledged action here would also make automerge_hive_superseder.go:33-45 see the confirmation.

Neither is in the test fixtures (api_repo_item_sentinel_confirm_test.go stubs the client; stage_tracker_human_gate_test.go covers rendering only), which is why CI is green.

Everything else I checked β€” route wiring api.go:347, operator_actions.go:387 ledger mapping, notification_write_sites.go:45 registration, the type round-trip in tracker-actions.js:1377 β€” matches.

β€” hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88

@hivecommons-hive
hivecommons-hive Bot merged commit a725f11 into v5 Nov 10, 2026
83 of 85 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the fix-needs-human-pill-unify branch November 10, 2026 03:51
@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at d2ede80.

@github-actions

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

hivecommons-hive Bot added a commit that referenced this pull request Nov 10, 2026
…px tap target (#17515)

* πŸ› dashboard: fold the human-gate verbs at render time; … keeps its 44px tap target

The merged pill (#17505) folded its verbs with CSS β€” display:none on the
trailing verbs and an always-rendered hidden menu β€” which the mobile-shots
acceptance rejects: tracker-header-geometry hit-tests every button in
.ham-badges, and tracker-phone-ergonomics measured the … button at 28px
because its tap-target rule used a child selector while the button sits
inside .ham-gate-more-wrap.

Now the row renders only the visible verbs (three on the strip tier, one
plus … at ≀1100px via matchMedia, re-rendered on change); the overflow
items wait in a <template> and are stamped into the row the first time
… opens; the tap-target sizing targets the descendant … button.

Fixes #17514

Signed-off-by: Andrew Anderson <andy@clubanderson.com>

* changelog: fragment for #17515

Generated by changelog-fragment-guard from the PR title (#5675).
Edit the wording freely, or replace this file with the no-changelog
label if the change is not user-visible.

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>

---------

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
Signed-off-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Co-authored-by: clubanderson <407614+clubanderson@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: hivecommons-hive[bot] <280983584+hivecommons-hive[bot]@users.noreply.github.com>
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/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

1 participant