Repository navigation
✨ feat(dashboard): Let hive decide shows what hive saw and why each option was ruled out - #16936
Conversation
The preview gave one "Why" line and the ladder's raw "rung: reason" lines, so an owner could not check a decision against what it rested on. The plan now carries saw (every fact the decision rules read, each marked ok / blocks / info), rule_plain and rationale (the deciding rule in plain words and its whole reason), and why_not (each ruled-out ladder option with the fact that ruled it out). The dialog lists them under Details as "What hive saw", the rule, and "Why not the others"; the visible part keeps its budget. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Style/maintainability review at head d29db48.
1. Facts() reads in.Small, but the rule it mirrors reads in.IsSmall() — src/pkg/delegatedecision/facts.go:113 vs policy.go:452,791. IsSmall() also honours the size/XS/size/S labels, so a labelled-small PR is approved under small-low-risk while What hive saw shows no Change: small… line — the list no longer matches "every fact the rules read" (PR body / activity-monitor.md).
if in.IsSmall() {
2. rungOptions is a second operator-facing text table outside the glossary — facts.go:199-205. decision_glossary.go:9-16 declares the glossary "the ONE source for operator-facing text", and TestGlossaryCoversEveryRuleSlug guards it; nothing guards rungOptions, so a future ladder rung silently falls back to Plain(rung) (facts.go:218), which is rule-phrasing ("the author hasn't been reachable…") rather than an option. Suggest an Option string field on GlossaryEntry for the five ladder rungs (read via Explain(rung)), or at least a test asserting every slug decideLadder can put in RuledOut has a rungOptions entry. Related: the fact values re-word mergeBlockers (ladder.go:287-316) — Details now shows "DCO sign-off missing" under What hive saw and "DCO missing" under Why not the others for the same fact; reusing one wording would keep the two lists in step.
— hive: agent=adjudicator-4 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Intent alignment (head d29db48) — the diff does what the title and body say:
Review findings from Correctness review at head d29db48.
The Everything else checked out: Review findings from Read
Not a code finding: two checks on this head show CANCELLED ( Reviewed by Reviewer notesRead the diff against the v6 tree at merge-base and the helpers it leans on; this looks correct to me. What I verified:
No findings. Body matches the diff: the visible dialog text is untouched and all additions sit under Details. |
There was a problem hiding this comment.
Read the diff against the v6 merge-base (19f1b75) and the code it hooks into; this looks correct to me.
What I checked:
Ladder.WhyNot()(src/pkg/delegatedecision/facts.go:212) splits on": ", which is exactly the formatdecideLadder'sskipwrites (ladder.go:161:rung+": "+why). Unknown rungs fall back toPlain(rung), and the nil-ladder case is handled beforeplan.WhyNot = d.Ladder.WhyNot()is reached for non-ladder decisions.Facts()mirrors the rules rather than inventing new ones: CI pending isinfo, notblocks, matchingmergeBlockers(ladder.go:294) andCIRed()(policy.go:339); the Review line uses the sameChangeRequest()/HeadNeedsPerson()the mergeable-as-is rung checks atladder.go:184.- Client side (
tracker-actions.js):stateis normalised took|blocks|infobefore indexingmarks, so a bad value from the server can't producemarks[undefined]; label, value, rule and rationale all go throughesc();why_notfalls back toladder.ruled_outfor an older server. - All four new plan fields are
omitemptyadditions; nothing existing is renamed, andgo build ./pkg/delegatedecision/ ./pkg/dashboard/is clean at eb8377d.
Not verified here: I could not run the suite in this environment, so I am relying on CI for TestDelegatedDecisionPlanShowsWhatHiveSaw and the node dialog test (server-tests is green; dashboard shards were still running when I looked).
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
Summary
The Let hive decide preview tells the owner what the hive would do and gives one short reason. It does not show what that decision rests on, so an owner has to take the reason on trust. This PR adds What hive saw under the dialog's Details: every fact the decision rules read, each marked as fine, holding the item back, or steering the decision. Details also gets the rule that decided, with its whole reason, and each ruled-out option with the fact that ruled it out. The visible part of the dialog is unchanged.
What went wrong
An owner asked for "more information in that pop up dialog, specifically why hive would do what it wants to do". For an adopt decision the dialog said only:
Details then listed the ladder's raw lines (
mergeable-as-is: adoption stalled on a lane blocker). It never said whether CI was green, whether the head conflicts, who the author is, what the review said, or which rule decided. The decision is made by fixed rules over about twenty facts (delegatedecision.Input), and the preview threw all of them away after deciding.What changes
The plan response (
POST …/decide-delegated/plan) gains four fields:saw[{label, value, state}], every fact the rules read, in the order an owner checks them: author, contributor reachability, CI, conflicts, sign-off, review, Sentinel, then size, workflow files, already-landed, duplicates and competing PRs, adoption state, reporter trust, a paused repo, and the reviewer's question.stateisok,blocksorinfo. Facts that do not apply to the item's kind are left out, so an issue gets no CI line.rule_plainrationalewhy. When no mechanical rule applies (llm-delegate), this is the model's own reason.why_not[{option, because}], the ladder's ruled-out rungs as the options an owner would have picked by hand: Approve as it is: conflicting, CI not green.The dialog, under Details only:
why_not, from an older server, still shows the raw lines;A batch labels each item's facts with its reference. The three-second visible budget (title, one sentence, one why, two "then" items) is untouched, and a test pins that the visible text is identical with and without the new fields.
Why not more
A chat panel inside the dialog for asking about the PR was discussed as a next step. It needs a design decision first, because the panel would read untrusted PR text right next to buttons that merge. This PR is the deterministic part: it shows exactly what the rules saw, with nothing generated.
Files
src/pkg/delegatedecision/facts.go(new):Input.Facts(),Ladder.WhyNot().src/pkg/dashboard/api_repo_item_decide_delegated_plan.go: the four fields, filled inplanDelegatedDecision.src/pkg/dashboard/api_repo_item_decide_delegated_plan_rule.go(new):delegatedPlanRule.src/pkg/dashboard/static-src/js/tracker-actions.js,static-src/css/tracker.css, regeneratedstatic/index.html.src/docs/dashboard-sections/activity-monitor.md,src/docs/api-reference/packs-and-acmm.md.changelog.d/added-delegate-plan-what-hive-saw.mdTests
pkg/delegatedecision/facts_test.go:WhyNotmaps rungs to options, including an unknown rung and a nil ladder.TestDelegatedDecisionPlanShowsWhatHiveSaw: through the real plan route, the plan carriessawwith the offline fact the adopt decision rests on,rule_plain,rationalewithout issue references, and awhy_notentry for Approve as it is.TestDelegatedPlanRuleDropsARationaleTheWhyAlreadySaysTestStageTrackerDelegatePlanDetailsShowWhatHiveSawruns the dialog code under node. It checks:Without the change, both route and dialog tests fail. The route test shows
What hive saw has no "CI" line: [],rule_plain = "",why_not = []. The dialog test shows Details with only the raw ruled-out lines. With the change they pass.The whole
./pkg/dashboard/package (146 s),./pkg/delegatedecision/and./pkg/dashboard/webstatic/...pass.go vetis clean, the generatedindex.htmlpasses its-check, and the docs, link, API-reference and changelog checks pass.🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1