Repository navigation
✨ feat(config): one repository can override Sentinel's sensitive paths and the workflow fence scope - #17547
Conversation
…s and the workflow fence scope
Add two opt-in project.repo_policies keys:
- sentinel_sensitive_paths replaces sentinel.sensitive_paths for that
repository's pull requests (nil inherits; an explicit [] matches
nothing, as the hive-wide key does).
- workflow_fence_scope ("all" | "human_merge_paths") replaces
auto_merge.contributor_lane.workflow_fence_scope for that repository.
Either can be stricter or looser than the hive-wide value, and a
hive-wide change does not reach a repository that has its own. Sentinel
resolves the list per PR repository (SentinelSweepOptions
.SensitivePathsForRepo); the contributor lane resolves the scope per PR
repository (ContributorLanePolicy.WorkflowFenceScopeForRepo), so the
lane, stage notes, merge asks and /hive approve all agree. A
human_merge_paths override still keeps the full fence for a repository
with no human_merge_paths entry.
Fail closed: Validate rejects a blank pattern or unknown scope, and the
resolvers treat an invalid override as unset. repoPolicyHasNoOverrides
counts both keys, so clearing another override does not prune them.
Read visibility: Settings → Security and Settings → Features → Auto
Merge list the overrides; GET /api/config/governor returns
security.sentinel.repoSensitivePaths and GET /api/config/auto-merge
returns contributor_lane.workflow_fence_scope_repos (settings_read). The
admin MCP sentinel.settings preview names the repositories with their
own list and what those lists leave out, and fingerprints them so a
changed override makes the confirm stale. Write path: hive.yaml.
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.
Decision needed: @clubanderson should decide whether a project.repo_policies entry may make Sentinel and the workflow fence looser than the hive-wide setting (including sentinel_sensitive_paths: [] which disables Sentinel path matching for that repository), or whether per-repo overrides should only be allowed to tighten.
I read the diff against v6 and the wiring is sound; I am routing this to a person because it changes who can relax two merge-safety controls, not because I found a defect.
What I verified
- Resolution is per PR repository, as the body says:
main_sweeps.go:1410→cfg.RepoSentinelSensitivePaths(repo)feedsSentinelSweepOptions.SensitivePathsForRepo, applied insentinel_sweep.go:95-96;merge_eligibility.go:117,127→cfg.RepoWorkflowFenceScope(repo)feedsContributorLanePolicy.WorkflowFenceScopeForRepo, read byworkflowFenceScopedToHumanMergePaths(automerge_workflow_fence_scope.go:56-61) and in the fence cache key (:126-130), so a per-repo scope cannot be served from another repo's cached fence result. RepoPolicyFor(repo_policy.go:97-111) normalises both sides throughrepoPauseKey(org, …), soowner/repoand barerepomatch the same entry.- Fail-closed on bad input:
Validaterejects blank patterns / unknown scope, and the resolvers re-validate and fall back to the hive-wide value if an invalid entry reaches a live config (repo_policy_sentinel_fence.go:32-48). - Unset keys reproduce today's behaviour (
rp.SentinelSensitivePaths == nil→c.Sentinel.EffectiveSensitivePaths()).
The decision a person has to make
repo_policy_sentinel_fence.go:32-36 returns an explicit sentinel_sensitive_paths: [] as an empty list, which matches nothing — i.e. one repo_policies entry can switch Sentinel's path alerting off for a repository and set workflow_fence_scope: human_merge_paths there. The PR body states this is intended ("stricter or looser"). That is a policy call on a trust surface: whether the operator-writable repo_policies config should be able to weaken Sentinel/fence below the hive-wide floor per repository, versus override-only-to-tighten. I cannot settle that. If "looser is fine", the code does what it says and I have no further findings; if not, RepoSentinelSensitivePaths/RepoWorkflowFenceScope need a floor check and the docs/dashboard copy should say so.
Not a defect, for completeness: the PR's motivating case (projectbluefin wanting lockfiles / Justfile unflagged on their own repos) is served either way; the question only affects what the override is allowed to do.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…o settings search resolves it The read-only overrides note from hivecommons#17547 and the new per-repository table both carried yamlHint('project.repo_policies[].workflow_fence_scope'), so TestSettingsSearchIndexResolvesToControls found two innermost rows. The note keeps its text; the table row keeps the key. static/index.html edited identically (manifest concatenation cmp-identical). 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>
…e scope from the dashboard and admin MCP (#17556) * ✨ feat(settings): set per-repository Sentinel paths and workflow fence scope from the dashboard and admin MCP #17547 added project.repo_policies[].sentinel_sensitive_paths and workflow_fence_scope, but they could only be set by editing hive.yaml, which a hub-managed hive cannot do. This adds the write surface: - PUT/PATCH /api/config/auto-merge takes contributor_lane.workflow_fence_scope_repos ({owner/repo: "all" | "human_merge_paths" | null}) and PUT /api/config/governor/security takes sentinel.repoSensitivePaths ({owner/repo: [globs] | null}). Per repository: null clears, an absent repository is untouched, the hive-wide value and the policy's other fields never change. Owner only, validated before anything changes (watched repo, the loader's rules plus malformed globs), audited per repository. Requests without the keys behave as before. - Settings gets a per-repository table in Auto Merge and in Security → Suspicious Activity, with help marks; static/index.html regenerated by the manifest concatenation. - auto_merge.update and sentinel.settings take the two keys, send only the changed repositories, name what loosens per repository, remind that a repository without human_merge_paths keeps the full fence, fingerprint what the disclosure read, and refuse a hive whose GET does not report the write as settable. - RepoPolicy.MarshalYAML keeps an explicit empty sentinel_sensitive_paths, which omitempty dropped, so a saved "flag no path" no longer comes back as the hive-wide list after a reload. Refs #17547 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> * 🐛 fix(dashboard): one control carries the per-repo fence scope key, so settings search resolves it The read-only overrides note from #17547 and the new per-repository table both carried yamlHint('project.repo_policies[].workflow_fence_scope'), so TestSettingsSearchIndexResolvesToControls found two innermost rows. The note keeps its text; the table row keeps the key. static/index.html edited identically (manifest concatenation cmp-identical). 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> --------- Signed-off-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Danathar <Danathar@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Summary
Two merge-safety settings, Sentinel's sensitive-path list and the contributor lane's workflow fence scope, can only be set for the whole hive today. An operator who wants to relax them for their own repositories would also relax them for repositories that belong to other maintainers. This PR adds two opt-in per-repository keys under
project.repo_policies. A repository without them behaves exactly as before. Settings,settings_readand the admin MCP Sentinel preview show which repositories have their own value.Why
On the projectbluefin hive the operator wants Sentinel to stop flagging lockfiles,
requirements*.txtandJustfile, and wantsworkflow_fence_scope: human_merge_paths. Both keys apply to every repository today, includingutahandutah-packages, whose maintainer has not agreed to that. There is currently no way to change them for only some repositories. The live hive runs0b22971(the current v6 tip) withworkflow_fence_scope: alland the shipped Sentinel defaults, and it has no per-repository override.What changes
project.repo_policies[].sentinel_sensitive_pathsandproject.repo_policies[].workflow_fence_scope(allorhuman_merge_paths). A repository's own value replaces the hive-wide one, whether it is stricter or looser. A later hive-wide change does not affect a repository that has its own value.sentinel_sensitive_paths: []matches nothing. Ahuman_merge_pathsoverride still keeps the full fence when the repository has nohuman_merge_pathsentry./hive approveall read the same per-repository scope.repoPolicyHasNoOverrides).GET /api/config/governor(security.sentinel.repoSensitivePaths) and inGET /api/config/auto-merge(contributor_lane.workflow_fence_scope_repos), whichsettings_readreturns. The admin MCPsentinel.settingspreview names the repositories that keep their own list, along with the hive-wide globs those lists leave out, in its effects and in the widening disclosure. The override lists are part of the preview fingerprint, so a confirm is refused if an override changed after the preview.max_open_held_prsandred_main_threshold.Files
src/pkg/config/repo_policy_sentinel_fence.go(new): the resolvers, validators and override lists.repo_policy.goandvalidate.goget the fields, the prune check and the load-time validation.src/pkg/github/sentinel_sweep.go,src/cmd/hive/main_sweeps.go: Sentinel uses the list for each repository.src/pkg/github/automerge/automerge_workflow_fence_scope.go,automerge_contributor_lane.go,src/cmd/hive/merge_eligibility.go: the fence uses the scope for each repository.src/pkg/dashboard/api_governor_security.go,api_config_automerge.go, the static UI (source and builtindex.html): read-only display.src/pkg/adminmcp/tools_config_surface_ops.go,tools_settings.go: the MCP preview, disclosure and fingerprint.operator-reference/README.md,operator-reference/sweeps-and-operations.md,hive-merge.md,admin-mcp.md. Changelog fragmentadded-repo-policy-sentinel-fence-overrides.md.Tests
None of these were run locally (AGENTS.md); CI is the verdict.
TestRepoSentinelSensitivePathsResolvesPerRepo,TestRepoWorkflowFenceScopeResolvesPerRepo: an override present, absent, explicit empty and invalid. A hive-wide change does not reach an overridden repository.TestValidateRepoSentinelFenceOverrides,TestRepoPolicySentinelFenceOverridesCountAsOverrides: validation, and the trap where an override is pruned on save.TestContributorLaneWorkflowFenceScopeRepoOverride: the real lane loosened and tightened by an override. Another repository's override does not apply. Ahuman_merge_pathsoverride withouthuman_merge_pathskeeps the full fence.TestSweepSentinelPerRepoSensitivePaths: a real Sentinel sweep where arequirements.txtchange is flagged or not, depending on the repository's own list.TestRepoPolicySentinelFenceOverridesShownInSettings: both GET responses list the overrides, and a hive-wide Sentinel save leaves a repository's own list alone.TestSentinelSettingsOpNamesReposWithTheirOwnList,TestSentinelSettingsOpRepoOverrideChangeMakesPreviewStale: the MCP disclosure names the repositories, and a changed override makes the confirm stale.🤖 Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1