Repository navigation
✨ [v6] feature: contributor-first lanes — a contributor relay covering a role withholds the resident agent's kicks - #16518
Conversation
|
[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.
Security perspective (read at head a524bf8, plus merge-base contribute_agent_roles.go / contribute_failure_streak.go / contribute_ws.go).
Medium — an idle relay holds a contributor-first lane indefinitely; the hold is available to contributor-tier identities with no grant.
src/pkg/dashboard/contribute_coverage.go:49-66 counts a connection as covering a role when its role is set, its pong is fresh, and it is not in a failure-streak pause. Nothing requires the relay to have claimed or finished any work. Dispatch is pull-based (contribute_ws.go:2550 ready), and the streak only arms on hub-timed task_failed (contribute_failure_streak.go:13-28), so a relay that authenticates with HIVE_AGENT_ROLE=quality and simply never sends ready is "covering" forever — the governor then withholds the resident agent at every gate (governor.go:1024, :1206, :1282, :1410) and the grace in contributor_first.go:199 only ever starts once the socket drops.
Pre-PR, the lowest tier that can claim scanner/quality/outreach is contributor with no operator grant (contribute_agent_roles.go:10-13, :95-99). This PR gives that tier a new lever over hive-owned capacity: one connected-but-inactive relay per lane silences the resident agent. Opt-in and visible on the tile, but the docs (src/docs/agent-configuration.md, "Who may act as the role") say a busy relay counts and do not say an idle one does.
Requested change (pick one, first preferred): in RoleCoverage, require evidence of work — e.g. c.currentTask != nil or a last ready/task_complete within contributor_first_grace — before a connection counts; or gate coverage on trusted-or-above / an explicit contributor_first grant. Either way, add a test for the connected-never-claims case and state the behaviour in the docs.
— hive: agent=adjudicator-2 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 Correctness review @ a524bf8 (contributor head, pre-rebase)
This contradicts the PR's own design: Fix: in (CI red / merge conflict are already being handled by the fixer per the PR body; not re-reported.) Review findings from Intent-alignment review (head The core feature matches the PR body: the four kick gates ( One claim in the body is not deliverable through config load — replicas / review heads of a contributor-first lane. The body says replicas (
Net effect: Requested change: in Review findings from The governor/hub logic reads correct to me; the red Finding (medium, correctness/test adequacy) —
|
… kicks while a contributor relay covers the role A contributor relay acting as an agent role used to work in parallel with the hive's resident agent: the governor never knew the relay was there, so the hive's own inference budget kept being spent on a lane a contributor was already covering. Standby (RFC #7629) is the opposite order on purpose and only fires once a lane is paused for budget. agents.<name>.contributor_first: true makes the connected relay the lane's primary worker. While at least one relay is acting as the role (fresh heartbeat, not failure-paused) the governor withholds the resident agent's kicks at the same four gates that honour an exhausted budget: cadence, continuous re-kick, CEL event kick and crash-recovery resume kick. Once no relay has covered the role for contributor_first_grace (default 10m) the resident agent resumes its normal cadence. Budget pause and standby are unchanged: a covered lane is never reported as paused for budget, and the budget gate is checked first. The load fails when the flag names a role contributors may not act as, so the setting can never sit inert. The Governor section shows each covered lane and who covers it; /api/status carries governor.covered_lanes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7sQjJ5QDk9LVqL115w Signed-off-by: Douglas Baggett <doug.baggett@gmail.com>
…; cover the crux grace helper Review finding on #16469: with hub.contribute_suspended set, the hub refuses work to every relay while their sockets stay up, so RoleCoverage kept reporting the connected relays as covering the lane and the governor kept withholding the resident agent. Pausing contributors became pausing the lane. RoleCoverage now returns no coverage while contributions are suspended, mirroring the task-selection gate, with a test next to the stale and failure-paused cases. The crux/config coverage floor (90%) tripped at 89.9% because the new ContributorFirstGraceOrDefault helper was only exercised from pkg/config; it now has its own table test in crux/config (90.3%). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7sQjJ5QDk9LVqL115w Signed-off-by: Douglas Baggett <doug.baggett@gmail.com>
…ir base lane; case-insensitive agent lookup Second review finding on #16469: replicas (quality-2) and review heads (quality-fast-1) copy the base agent's contributor_first flag, but the hub reports coverage under the BASE role a relay acts as while the gate looked the record up by each agent's own name. Only replica 1 was ever withheld, and the tile still claimed the lane was covered. The gate now resolves every agent to its coverage lane through ReplicaOf, so a covered lane withholds all of its derived agents, and covered_lanes publishes one entry per lane rather than per replica. Third finding: SetContributorCoverage looked the lane's grace up by the lower-cased role while agents are keyed by their raw YAML name, so a mixed-case agent name expired on the default grace instead of its own. Agent lookups are now case-insensitive, and the loader additionally rejects a mixed-case contributor_first name, because relays claim roles in lower case and such an agent could never be covered at all. Tests: a replica/review-head lane test and a mixed-case grace test in pkg/governor, and the new load-error case in pkg/config. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WcWm7sQjJ5QDk9LVqL115w Signed-off-by: Douglas Baggett <doug.baggett@gmail.com>
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>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
1823d88 to
abf3c95
Compare
|
Scanner triage at abf3c95: the only red check, 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
…(linux/amd64) Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
…_first_grace (#16772) The contributor-first lane keys (#16518) were hive.yaml-only, so on a hub-hosted spoke only the hub operator could switch a lane. The agent's General tab now has a Contributor-first toggle and a Contributor-first grace field. - config: the per-agent body of validateContributorFirst is exported as ValidateContributorFirstAgent (validateContributorFirst calls it), plus ContributorFirstDelegatable for the panel. The load and the API refuse with the same message. - API: GET general carries contributorFirst, contributorFirstGrace (seconds, 0 when unset) and contributorFirstDelegatable. PUT general accepts the two keys, validates the copy before anything persists, and answers 400 with the load's message on a refusal. 0 clears the grace to the 10m default; omitted keys are left alone. - UI: the toggle is disabled for a role contributors may not act as, with one muted line naming the fix; both controls carry help marks and YAML hints. Not shown when creating an agent. - The two TODO #11854 parity allowlist lines are removed; docs and a changelog fragment say the tab exposes both keys. No governor change: the save already calls Governor.UpdateAgents, and a test shows a covered lane is withheld on the next evaluation. Claude-Session: https://claude.ai/code/session_0113KwWU4TkJ8wfy3XjusyGo Signed-off-by: Douglas Baggett <doug.baggett@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Supersedes #16469 (adopted after CI went red and the contributor was unavailable; original commits by @Danathar preserved).
This branch is #16469's head
a524bf8c9127as pushed by @Danathar (forkDanathar/hive), unchanged. Last lane reason on the original:label:needs-rebase.Hive fix agent: rebase this branch on
v6, fix the failing checks / review asks, and push to THIS branch. Keep the original author's commits and theirSigned-off-by; add your own sign-off on your commits. Do not open another PR.Conflicts with
v6: the contributor head could not be replayed onto the base, so this copy opened as it is and the hive's fixer is resolving the conflicts on this branch (rebase-resolve episode, two attempts). If both fail the PR parks for a person: adopt the commits into a fresh branch, or close it as superseded.