Skip to content

✨ prompt sources: owners can approve their own managed repos - #18499

Merged
kubestellar-prow[bot] merged 3 commits into
v5from
feat/18490-owner-prompt-allowlist
Nov 16, 2026
Merged

kubestellar-prow[bot] merged 3 commits into
v5from
feat/18490-owner-prompt-allowlist

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #18490

What

An owner can now allow one of the hive's own managed repos (project.repos) as a source for agents.<n>.prompt_source and definition_source without editing the config volume.

  • Settings -> Security -> Prompt sources lists each managed repo and its gate state. Approve... opens a confirm naming the trust implication (anyone who can merge to that repo can steer the agents); Revoke removes it.
  • API: GET /api/config/prompt-sources and PUT /api/config/prompt-sources/owner-repos with {"repo","allowed","acknowledge_trust"}. Both owner-only (403 for read, read-write, merger, unverified owner). Repos outside project.repos are refused with a 400 pointing at the seed edit; an approval without acknowledge_trust: true is refused.
  • Storage: variables.security.owner_github_prompt_repos (repo, approved_by, approved_at), written through Config.Save to the PVC runtime config so it survives restart. The dashboard overlay's variables block is still never merged, so the overlay cannot approve a repo (test included).
  • Scope: each approval covers that repo only; it neither needs nor flips allow_github_prompt, so seed allowlist entries are unaffected. An approval lapses if its repo leaves project.repos.
  • Audit: config_prompt_source_repo on every approve and revoke.

Gate API

Config.GitHubPromptAllowed(slug) / GitHubDefinitionAllowed(slug) keep their signatures and now admit seed-allowed OR owner-approved managed repos, so existing resolvers (and #18491's repo discovery) need no change. New exported helpers: SeedGitHubPromptAllowed, OwnerPromptRepoAllowed, IsManagedRepo, ManagedRepoSlugs, NormalizeOwnerPromptRepo, AllowOwnerPromptRepoAndSave, RevokeOwnerPromptRepoAndSave.

Tests

  • pkg/config/owner_prompt_repos_test.go: managed-repo matching, slug validation, gate semantics (owner path, lapse on removal, seed path unchanged), persistence across reload for approve and revoke, overlay cannot approve.
  • pkg/dashboard/api_config_prompt_sources_test.go: owner approve/revoke, 403 for read/read-write/merger/unverified owner, non-managed refusal, ack required, bad bodies, audit entries, section rendering.

Docs

src/docs/agent-configuration.md (new "Owner approval for the hive's own managed repos" section), src/docs/api-reference/configuration.md, src/hive.yaml.example, changelog fragment.

static/index.html carries the same edit as static-src/js/config-watchdog-security.js (byte-identical concatenation).

🤖 Generated with Claude Code

Adds an owner-only path to allow one of the hive's project.repos for
agents' prompt_source and definition_source without editing the config
volume: Settings -> Security -> Prompt sources plus
GET /api/config/prompt-sources and PUT /api/config/prompt-sources/owner-repos.

Approvals require acknowledge_trust, cover one repo only, are audited,
persist to variables.security.owner_github_prompt_repos via Save, and
lapse if the repo leaves project.repos. GitHubPromptAllowed keeps its
signature and admits seed or owner-approved repos.

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@kubestellar-prow kubestellar-prow Bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Open PR overlap check

Base branch: v5

Conflicts are checked with every PR merged onto the current tip of v5, so a PR that only needs a rebase is not reported as conflicting with its siblings.

PR Title Relation Files
#18523 ✨ Dashboard: Collaborate sidebar group (Inbox, Calendar, Meetings, Sessions) same files src/pkg/dashboard/static/index.html
#18507 ✨ governor: release-feed watcher kicks agents when a tracked upstream dependency releases same files src/docs/agent-configuration.md
src/pkg/config/config.go
#18542 🐛 hive never applies hold itself: gates use ready-for-review / decision-needed same files src/hive.yaml.example
src/pkg/config/config.go
src/pkg/config/testdata/agent_runtime_golden.json
#18504 ✨ Inbox: delete hive recordings same files dashboard/openapi.json
src/pkg/dashboard/static/index.html
#18527 🐛 dashboard: Meetings and Calendar wait for the role, sit in the layout, and read cleanly same files src/pkg/dashboard/static/index.html
#18540 🐛 inference: refresh rotated gateway keys and refuse ignored api_key_file paths same files src/docs/agent-configuration.md
src/pkg/config/config.go
src/pkg/dashboard/static/index.html
#18505 ✨ Discover agents declared in a managed repo's .hive/agents/ behind owner approval CONFLICT dashboard/openapi.json
src/docs/agent-configuration.md
src/pkg/dashboard/api.go (conflict)
src/pkg/dashboard/api_agents.go
src/pkg/dashboard/static/index.html
#18500 🐛 Inbox recording: saved panel follows the transcript, plain previews, hive audio retention note same files src/pkg/dashboard/static/index.html
#18521 ✨ Reference repos: per-hive write identity, bot / bot only / owner (backend) (#18516) same files src/pkg/config/config.go
#18528 ✨ meetings: agent-backend model mode with a warm tool-less Claude Code CLI and Settings picker (part 1 of #18517) CONFLICT dashboard/openapi.json
src/docs/api-reference/configuration.md (conflict)
src/pkg/dashboard/api.go
src/pkg/dashboard/static/index.html
#18536 ✨ feature: choose remote repository write identity CONFLICT dashboard/openapi.json
src/docs/agent-configuration.md
src/docs/api-reference/configuration.md (conflict)
src/hive.yaml.example
src/pkg/config/config.go
src/pkg/dashboard/api.go
src/pkg/dashboard/static/index.html

@hivecommons-hive

hivecommons-hive Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor.

clubanderson this PR is held at stage/071-needs-author and the hive will not merge it yet.

Failing checks:

  • test (dashboard shuffle 1/3)

Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path.

@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Mutation testing

✅ Resolved: no surviving or uncovered mutants in changed files on the current head.

Verdict: pass (#17349).

@hivecommons-hive

Copy link
Copy Markdown
Contributor

Scanner triage: the failing checks are PR-local, not a shared baseline incident. The branch is 3 commits behind v5 (baseline helper: MERGE_BASE). This is a human-authored branch, so the scanner will not push to it. Please merge v5 into the branch (signed off) and re-check; if it still fails, the job logs are the next stop.


🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

— hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.325

…atch

Signed-off-by: Andy Anderson <andy@clubanderson.com>
@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 16, 2026
Signed-off-by: Andy Anderson <andy@clubanderson.com>
@clubanderson clubanderson added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 16, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@clubanderson

Copy link
Copy Markdown
Member Author

cc @joerunde: this is part of the hive changes for the spyre-inference deps agent and sandboxed reviewer setup.

@kubestellar-prow
kubestellar-prow Bot merged commit 188cde9 into v5 Nov 16, 2026
99 of 101 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the feat/18490-owner-prompt-allowlist branch November 16, 2026 22:49
clubanderson added a commit that referenced this pull request Nov 17, 2026
Layout tests count v5's calendar and meetings sections; the SHA hold test no longer expects a hold-source record (needs-sha replaced hold, #18468); settings_read reaches v5's GET /api/config/prompt-sources (#18499).

Signed-off-by: Andy Anderson <andy@clubanderson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. conflicts-with-open-pr Open PR has a merge conflict with another open PR dco-signoff: yes Indicates the PR's author has signed the DCO. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ Owners can allowlist their own managed repos for repo-sourced agent prompts and definitions

1 participant