Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/fixed-15008-needs-human-chip-partial-cover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- The Hive activity monitor's **Needs human** chip now counts and filters only rows a person alone can advance β€” stages 015/045/085/090, 071/072 with a human author, or a `needs-human` / `needs-decision` / `unauthorized` pill β€” from one predicate shared by the chip count, the filter, and the new `needs_human` / `on_hold` payload totals; held rows get their own **On hold** chip, and `hold`, `stalled`, `blocked`, handled regressions, covered 040 issues and auto-mergeable PRs no longer appear under Needs human. A hive PR that only references an issue (`Refs #N`, no closing keyword) is recorded as *addressing part of* the issue instead of *covering* it, in the relay, the claim-ledger backfill and the stage reason/caption; a bare cross-reference such as a shared-CI incident deferral never creates a covering relation ([#15008](https://github.com/hivecommons/hive/issues/15008)).
2 changes: 2 additions & 0 deletions src/docs/dashboard-sections.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/docs/labels-and-control-signals.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ referenced it) a lone `stage/050-review-pending`
| `stage/017-possible-existing` | issue | **Possibly exists Β· needs author.** The prior-art gate found something that looks like the request already (knowledge bead, setting, merged PR, closed issue, doc or code) and parked the issue with the findings; the author confirms the gap (`/hive decision proceed β€” <gap>`) or closes it (`/hive decision exists`, label `already-exists`). The label itself is the park signal and an issue-level hard suppress, so no agent claims it; clanker-filed parks auto-close after `runs.triage.prior_art.bot_close_ttl`; hive-filed issues never wear it ([#13575](https://github.com/hivecommons/hive/issues/13575)) | none |
| `stage/020-claimed` | issue | a live claim by anyone β€” a human, a relay contributor or a hive agent's `hive-open-issue claim` / start mark β€” with no PR evidence yet (replaces `claimed`, `hive/in-progress`) | 2h |
| `stage/030-pr-in-progress` | issue | the claimant has a PR under way: its `hive-open-pr --issues` request named the issue or its start marker named a branch / PR (`pr_started=true` on the `hive:claim` marker). A claim or start mark without that evidence β€” the scanner's bare `hive-open-issue claim` included β€” stays at 020 ([#13069](https://github.com/hivecommons/hive/issues/13069)). If the in-progress evidence includes an open Hive-authored PR, the issue-stage lane applies the same PR-link safeguard described for 040: default-branch PRs that fully address the issue get a `Fixes #N` trailer when missing, while partial or non-default-branch PRs get an issue stage-entry comment linking the PR and explaining GitHub's icon limitation. If the claiming PR has already merged, the issue leaves 030: full-fix claims close it with one `<!-- hive:closed-by-merged-pr pr=N -->` comment (checked before posting, so a close that fails after the comment is retried without a duplicate), while `Refs` / `Part of` claims move back to 010 with a partial-landed note. | 90m |
| `stage/040-covered-by-pr` | issue | an open PR covers it (replaces `🐝 covered by PR`); the issue stays here while the PR is open β€” the PR's own stage is named in the issue's stage reason, never written as its label ([#12451](https://github.com/hivecommons/hive/issues/12451)). For Hive-authored PRs on the repository default branch, the stage and claim-label sweeps append `Fixes #N` to the PR body when the PR appears to fully address the issue but lacks a closing keyword, so GitHub can show the Development sidebar link and issue-list PR icon. They also retrofit older Hive-authored default-branch PRs whose only claim line is `Refs #N` by rewriting that one keyword to `Fixes #N` once and stamping `<!-- hive:issue-link-fixed -->`; human-authored PR bodies are never edited. `Part of` / leave-open partial work and non-default-branch PRs get one issue stage-entry comment with the PR link and GitHub limitation instead. Merged full-fix claims close the issue; merged reference claims remove stale 040/030 and return the issue to 010 with a partial-landed note. | n/a (the PR carries health) |
| `stage/040-covered-by-pr` | issue | an open PR covers it (replaces `🐝 covered by PR`), or β€” when the hive's PR only *references* the issue without a closing keyword (`Refs #N`) β€” "an open PR addresses part of it": the issue is still parked here but its stage reason and tracker caption say the remainder stays open when the PR merges ([#15008](https://github.com/hivecommons/hive/issues/15008)). Coverage is derived only from a closing reference in the PR body or commits, a hive claim-ledger entry, or an explicit hive marker β€” a bare cross-reference (an incident deferral comment, `see also`, a backlog link) never puts an issue here; the issue stays here while the PR is open β€” the PR's own stage is named in the issue's stage reason, never written as its label ([#12451](https://github.com/hivecommons/hive/issues/12451)). For Hive-authored PRs on the repository default branch, the stage and claim-label sweeps append `Fixes #N` to the PR body when the PR appears to fully address the issue but lacks a closing keyword, so GitHub can show the Development sidebar link and issue-list PR icon. They also retrofit older Hive-authored default-branch PRs whose only claim line is `Refs #N` by rewriting that one keyword to `Fixes #N` once and stamping `<!-- hive:issue-link-fixed -->`; human-authored PR bodies are never edited. `Part of` / leave-open partial work and non-default-branch PRs get one issue stage-entry comment with the PR link and GitHub limitation instead. Merged full-fix claims close the issue; merged reference claims remove stale 040/030 and return the issue to 010 with a partial-landed note. | n/a (the PR carries health) |
| `stage/045-needs-decision` | issue | **the** issue-side park-for-a-person signal (owner decision, 2026-10-17: issues never wear `stage/085-needs-decision`; that stage is PR-only). Derived whenever the issue carries `needs-human` or a hard-suppress park label (`needs-spec`, the retired `needs-direction` / `needs-decision`, a pre-045 `stage/085-needs-decision`) **and no hold-class label** β€” a held issue (`hold`, `do-not-merge*`, the hive's `hive-pause/<id>`) is paused, not parked: it carries no stage label and the activity monitor shows it as "Open Β· on hold", the reconciler removing a 045 the hold caught it with ([#13012](https://github.com/hivecommons/hive/issues/13012)) β€” and written by the relay (`hive-open-issue --needs-decision`, or `label … stage/045-needs-decision`, the one issue stage label an agent may add) and by the dedupe/selfreport relays; the issue is outside the agent work queue (and off the good-first-issue list) until a maintainer replies `/hive approve` / `/hive decision <text>`, which removes it and adds `approved-direction` (a Hive-added `needs-human` lifts too, so the issue reaches 010, [#13075](https://github.com/hivecommons/hive/issues/13075); a person's `needs-human` is left and keeps deriving 045 β€” the issue stays visibly a person's); with `project.agent_issue_decision_policy: resolve` (default), Hive-authored non-risk engineering questions are not allowed to self-park here β€” the relay records `Decision taken by hive: …`, downgrades to `stage/010-actionable`, and audits the downgrade, while true parks include a `Risk: <category>` line naming security posture, data loss, irreversible/public-facing behaviour, governance/policy/licensing, spend, owner-only credentials/secrets/infra, or uninferable human intent; once `approved-direction` is on the issue the relay refuses an agent's re-park while the recorded decision is unchanged β€” the agent adds `needs-human` and `/unclaim`s instead; a lapsed claim on a parked issue never shows 030. A contributor verdict that parks here citing only the target repository's own confirmation gate ("AGENTS.md says offer a spec and wait", "confirm scope first") or a registered sibling checkout that is merely not cloned yet (`repo_location_missing`) is not a decision: the hub reclassifies it as idle, removes the label with a `<!-- hive:needs-decision-released kind=repo-local-gate -->` comment, and re-offers the issue once; the second such park on the same issue stays (`src/pkg/dashboard/contribute_gate_park.go`, `src/pkg/decisionpolicy`). Leaving 045 is never a regression. An issue still wearing 085 is re-staged to 045 by the reconciler in one write, and a one-shot startup sweep (`/data/issue-needs-decision-stage-v1.done`) catches issues the enumeration never sees (`src/pkg/github/issue_needs_decision_migration.go`) | none |
| `stage/050-review-pending` | PR | review swarm requested/dispatched; awaiting a verdict for the current head (or CI still pending with no verdict) | 1h |
| `stage/060-reviewed` | PR | swarm verdict approve but a gate is still pending (CI running, or the soak clock on a head the lane has not admitted β€” the trust-blocked 090 path) | 30m |
Expand Down
55 changes: 28 additions & 27 deletions src/pkg/dashboard/label_facets.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Hive activity monitor label facets (hivecommons/hive): stage/NNN chips
// first by number then every other label alphabetically, the "+N more"
// dialog data, and the synthetic Needs human facet over the payload's
// needs_human_labels set. Run: node --test src/pkg/dashboard/*.test.js
// dialog data, and the synthetic Needs human / On hold facets (stage and
// modifier predicates, hivecommons/hive#15008). Run: node --test src/pkg/dashboard/*.test.js
const test = require('node:test');
const assert = require('node:assert');
const fs = require('node:fs');
Expand Down Expand Up @@ -31,11 +31,12 @@ const fnSrc = name => {
const src = [
constLine('STAGE_TRACKER_PAGE_SIZES'), constLine('STAGE_TRACKER_DEFAULT_PAGE_SIZE'), constLine('STAGE_TRACKER_LABEL_CHIP_LIMIT'),
constLine('STAGE_TRACKER_AGE_MS'), constLine('STAGE_TRACKER_LABEL_FAMILIES'), constLine('STAGE_TRACKER_SORTS'),
constLine('STAGE_TRACKER_NEEDS_HUMAN_STAGES'), constLine('STAGE_TRACKER_NEEDS_HUMAN_AUTHOR_STAGES'), constLine('STAGE_TRACKER_NEEDS_HUMAN_MODS'),
fnSrc('stageTrackerDefaultFilter'), fnSrc('stageTrackerNormalizeFilter'), fnSrc('stageTrackerLabelFamily'),
pick('label facet helpers begin', 'label facet helpers end'),
pick('label facet model begin', 'label facet model end'),
].join('\n');
const h = new Function(src + '; return { STAGE_TRACKER_LABEL_CHIP_LIMIT, stageTrackerDefaultFilter, stageTrackerNeedsHumanLabels, stageTrackerLabelNeedsHuman, stageTrackerItemNeedsHuman, stageTrackerLabelCompare, stageTrackerLabelFacets, stageTrackerLabelDialogData };')();
const h = new Function(src + '; return { STAGE_TRACKER_LABEL_CHIP_LIMIT, stageTrackerDefaultFilter, stageTrackerItemOnHold, stageTrackerItemNeedsHuman, stageTrackerLabelCompare, stageTrackerLabelFacets, stageTrackerLabelDialogData };')();
const F = over => Object.assign(h.stageTrackerDefaultFilter(), over);
const item = (n, labels) => ({ kind: 'issue', repo: 'a/b', number: n, labels });

Expand Down Expand Up @@ -71,30 +72,30 @@ test('dialog data filters by case-insensitive substring and keeps selected label
assert.strictEqual(h.stageTrackerLabelDialogData(fac, '').rows.length, 4);
});

test('needs-human patterns match new labels and the dialog lists covered ones', () => {
const set = h.stageTrackerNeedsHumanLabels({ needs_human_labels: ['sentinel-alert'] });
for (const l of ['needs-human-review', 'stage/099-needs-decision', 'ci-needs-author', 'sentinel-alert']) assert.strictEqual(h.stageTrackerLabelNeedsHuman(l, set), true, l);
for (const l of ['stage/010-actionable', 'unneeds-humans']) assert.strictEqual(h.stageTrackerLabelNeedsHuman(l, set), false, l);
const fac = h.stageTrackerLabelFacets([item(1, ['needs-human-review', 'stage/010-actionable']), item(2, ['sentinel-alert'])], F(), { needsHumanLabels: set });
assert.deepStrictEqual(fac.needsHuman.covered.map(c => c.label), ['needs-human-review', 'sentinel-alert']);
test('needs-human: stage/modifier predicate, labels alone never qualify (hivecommons/hive#15008)', () => {
const it = (n, stage, mods, extra) => Object.assign({ kind: 'issue', repo: 'a/b', number: n, stage, modifiers: mods, labels: [] }, extra || {});
assert.strictEqual(h.stageTrackerItemNeedsHuman(it(1, 40, [], { labels: ['needs-signal'] })), false, '040 PR in progress (#14976)');
assert.strictEqual(h.stageTrackerItemNeedsHuman(it(2, 80, ['hold'])), false, 'ready for auto merge + hold (#7563)');
assert.strictEqual(h.stageTrackerItemOnHold(it(2, 80, ['hold'])), true);
assert.strictEqual(h.stageTrackerItemNeedsHuman(it(3, 45, ['hold'])), false, 'hold wins over a needs-decision stage');
for (const st of [15, 45, 85, 90]) assert.strictEqual(h.stageTrackerItemNeedsHuman(it(4, st, [])), true, 'stage ' + st);
assert.strictEqual(h.stageTrackerItemNeedsHuman(it(5, 71, [], { author_kind: 'human' })), true);
assert.strictEqual(h.stageTrackerItemNeedsHuman(it(6, 71, [], { author_kind: 'clanker' })), false);
assert.strictEqual(h.stageTrackerItemNeedsHuman(it(7, 72, [], { author_kind: 'human' })), true);
for (const m of ['needs-human', 'needs-decision', 'unauthorized']) assert.strictEqual(h.stageTrackerItemNeedsHuman(it(8, 50, [m])), true, m);
for (const m of ['stalled', 'blocked-on-pr', 'regressed', 'draft']) assert.strictEqual(h.stageTrackerItemNeedsHuman(it(9, 60, [m])), false, m);
assert.strictEqual(h.stageTrackerItemNeedsHuman({ kind: 'pr', number: 10, labels: ['needs-human'] }), false, 'a label without the modifier is not enough');
assert.strictEqual(h.stageTrackerItemNeedsHuman(null), false);
});

test('needs-human set: normalised from the payload, prefix children match, count is distinct items', () => {
const set = h.stageTrackerNeedsHumanLabels({ needs_human_labels: ['stage/045-needs-decision', 'stage/085-needs-decision', 'needs-decision', 'needs-direction', 'needs-spec', 'needs-signal', 'Needs-Human', 'hold', 'on-hold', 'hold/review', 'stage/071-needs-author', 'needs-triage', ''] });
assert.strictEqual(set.length, 12);
assert.ok(set.includes('needs-human') && set.includes('stage/071-needs-author') && set.includes('needs-triage'));
assert.strictEqual(h.stageTrackerLabelNeedsHuman('needs-human/agent-ready', set), true);
assert.strictEqual(h.stageTrackerLabelNeedsHuman('stage/010-actionable', set), false);
assert.strictEqual(h.stageTrackerLabelNeedsHuman('holdover', set), false);
const items = [
item(1, ['stage/045-needs-decision', 'needs-human', 'hold']),
item(2, ['needs-human/agent-ready']),
item(3, ['stage/071-needs-author']),
item(4, ['stage/010-actionable']),
];
const fac = h.stageTrackerLabelFacets(items, F(), { needsHumanLabels: set });
assert.deepStrictEqual([fac.needsHuman.count, fac.needsHuman.on], [3, false], 'distinct items, not the sum of label counts (5)');
assert.deepStrictEqual(h.stageTrackerLabelFacets(items, F({ needsHuman: true }), { needsHumanLabels: set }).needsHuman.on, true);
assert.strictEqual(h.stageTrackerLabelFacets(items, F()).needsHuman, null, 'no set, no chip');
assert.strictEqual(h.stageTrackerItemNeedsHuman(items[3], set), false);
test('needs-human / on-hold facets: count equals what the filter predicate accepts', () => {
const it = (n, stage, mods, extra) => Object.assign({ kind: 'issue', repo: 'a/b', number: n, stage, modifiers: mods, labels: [] }, extra || {});
const items = [it(1, 45, []), it(2, 20, ['needs-human']), it(3, 71, [], { author_kind: 'human' }), it(4, 10, []), it(5, 80, ['hold']), it(6, 45, ['hold'])];
const fac = h.stageTrackerLabelFacets(items, F());
assert.deepStrictEqual([fac.needsHuman.count, fac.needsHuman.on, fac.onHold.count, fac.onHold.on], [3, false, 2, false]);
assert.strictEqual(fac.needsHuman.count, items.filter(h.stageTrackerItemNeedsHuman).length);
assert.deepStrictEqual(h.stageTrackerLabelFacets(items, F({ needsHuman: true })).needsHuman.on, true);
assert.deepStrictEqual(h.stageTrackerLabelFacets(items, F({ onHold: true })).onHold.on, true);
assert.deepStrictEqual([h.stageTrackerLabelFacets([], F()).needsHuman.count, h.stageTrackerLabelFacets([], F()).onHold.count], [0, 0], 'chips always exist');
assert.strictEqual(h.stageTrackerLabelDialogData(h.stageTrackerLabelFacets(items, F({ needsHuman: true, onHold: true })), '').selected, 2);
});
10 changes: 5 additions & 5 deletions src/pkg/dashboard/label_presets.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ const (
// - the reporter-trust awaiting label (default needs-triage): the issue
// waits for a maintainer to triage it before the hive may pick it up.
//
// The Hive activity monitor's synthetic "Needs human" facet reads the same
// list (StageTrackerResponse.NeedsHumanLabels); a label matches when it
// equals an entry or sits under it as `entry/...` (needs-human/agent-ready),
// or matches the needs-human*, *needs-decision or *needs-author patterns
// (stageTrackerLabelNeedsHuman).
// The list still rides the stage-tracker payload
// (StageTrackerResponse.NeedsHumanLabels) for the Projects preset, but the
// Hive activity monitor's own "Needs human" chip no longer reads it β€”
// labels such as needs-signal or hold put rows nobody waits on under the
// chip (hivecommons/hive#15008); it uses stageTrackerNeedsHuman instead.
//
// "blocked" is deliberately absent: the codebase treats it as a contributor
// skip marker and a PR mergeability state, not as a parked-on-a-person label.
Expand Down
Loading
Loading