Repository navigation
✨ [v6] dashboard: General tab controls for contributor_first and contributor_first_grace - #16772
Merged
hivecommons-hive[bot] merged 1 commit intoNov 5, 2026
Conversation
…_first_grace The contributor-first lane keys (hivecommons#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 hivecommons#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. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0113KwWU4TkJ8wfy3XjusyGo Signed-off-by: Douglas Baggett <doug.baggett@gmail.com>
Contributor
|
[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 |
Contributor
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: A hive owner can now switch an agent's lane to contributor-first, and set its grace period, from that agent's General tab in Settings. Until now both keys could only be set in
hive.yaml, so on a hub-hosted spoke only the hub operator could change them. The save refuses exactly what a load would refuse, with the same message, and takes effect on the next governor evaluation without a restart. Governor behaviour is unchanged.What
Two new controls on the agent General tab, after On Demand:
agents.<name>.contributor_first).agents.<name>.contributor_first_grace). It shows values like10mand is blank when unset, with a10mplaceholder.Both controls carry a help mark that links to "Contributor-first lanes" and a YAML hint.
When the role is not one contributors may act as, the toggle is disabled and one muted line names the fix. That fix is adding the role to
hub.contribute_delegatable_roles. Two cases get their own line instead:supervisor(never delegatable) and an agent name with capitals.The controls are not shown while creating an agent.
Why
Contributor-first lanes merged in #16518, but the two keys stayed on the TODO #11854 allowlist. On a hosted spoke, an owner had no way to use the feature.
How
src/pkg/config/contributor_first.go: the per-agent body ofvalidateContributorFirstis nowValidateContributorFirstAgent(name, agent, hub), andvalidateContributorFirstcalls it. So the load and the API share one rule and one message.ContributorFirstDelegatable(name, hub)tells the panel whether the toggle can be turned on at all./api/config/agent/{name}:generalcarriescontributorFirst,contributorFirstGraceandcontributorFirstDelegatable. The grace is in seconds and is 0 when unset./api/config/agent/{name}/general:contributorFirst(bool) andcontributorFirstGrace(seconds).onDemand.Governor.UpdateAgentscall applies it live.agentContributorFirstControlsHtmllives inconfig-agent.js.contributorFirstGraceChanged, lives inshimmy-handlers.js. A blank or unparseable value saves 0.static/index.htmlis regenerated.settings_parity_allowlist.txt.TestSettingsDialogReferencesEveryHiveYAMLLeafnow enforces the controls.agent-configuration.md(Contributor-first lanes) andcontributor-trust-and-roles.md, pluschangelog.d/added-contributor-first-settings.md.Not changed: governor and hub logic, persistence paths, other #11854 keys, and
src/crux.Files
src/pkg/config/contributor_first.go,contributor_first_test.gosrc/pkg/dashboard/api_agent_config.go,agent_config_contributor_first_test.go(new)src/pkg/dashboard/static-src/js/config-agent.js,shimmy-handlers.js,static/index.html(generated)src/pkg/dashboard/settings_parity_allowlist.txtdashboard/test/contributor-first-general.test.js(new)src/docs/agent-configuration.md,src/docs/contributor-trust-and-roles.md,changelog.d/added-contributor-first-settings.mdTests
./pkg/config/...:ValidateContributorFirstAgentgive identical text for four cases: an undelegatable role,supervisor, a mixed-case name and a negative grace.ContributorFirstDelegatablekeeps the defaults when the list adds roles, and excludessupervisoreven when it is listed../pkg/dashboard/...:supervisorand a negative grace each answer 400 with the exact load message. Nothing changes in memory or in the agents dir, even when the request also carriesdisplayName.GetState().CoveredLaneson the nextEvaluateafter the save, with no restart.dashboard/test/contributor-first-general.test.js:renderAgentGeneralfromindex.htmlfor three cases: on, off, and not delegatable. It asserts the toggle state, the disabled state with the fix named, the help marks on both controls and the tooltip wording.supervisorline, that agent creation shows no controls, and that the grace handler saves seconds and clears blank or invalid input.disabledclass, theonstate, and the grace handler's blank-clearing. Each one made a test fail.go test ./pkg/dashboard/... ./pkg/config/...passes, includingTestSettingsDialogReferencesEveryHiveYAMLLeafand./pkg/dashboard/webstatic/...against the regeneratedindex.html.TestGateFailsClosedWithoutIP6Tablesinpkg/configfails identically on an untouched v6 checkout on this machine, because the host lacks ip6tables.cd dashboard && npm test: 51 of 54 pass, including all 6 new tests. The three failures arecontribute,contributors-authzandnous-authz, which needexpress/ws; those weren't installed on this machine.go generatechanged onlystatic/index.html.check-api-reference-citations.sh: all references verified.check-changelog-fragment.sh v6: OK.dashboard-tooltip-smoke.mjs. The Go tooltip ratchet tests ran and pass.Refs #16518, #11854
🤖 Generated with Claude Code
https://claude.ai/code/session_0113KwWU4TkJ8wfy3XjusyGo