Skip to content

✨ knowledge: prime an agent's own drafts when agent_scopes.include_states lists draft - #17079

Merged
hivecommons-hive[bot] merged 1 commit into
v5from
knowledge-rbac
Nov 7, 2026
Merged

hivecommons-hive[bot] merged 1 commit into
v5from
knowledge-rbac

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #17076

Follow-up to #17042 and @gregoryhunt's knowledge-scoping investigation from the 2026-11-05 community meeting.

Problem

knowledge.agent_scopes.<agent>.include_states: [draft] never reached a kick: the primer is built with no IncludeStates (approved only) and Primer.PrimeScoped applies that filter before intersecting the agent scope, which can only narrow. An agent that just wrote a draft entry could not be primed with it.

Change (default-safe)

  • Fact.Author from author: / owner: frontmatter (filestore.go).
  • FilterByLifecycleFor / lifecycleAllowedFor (lifecycle.go): same as the existing filter, plus drafts whose author is one of the listed identities. Authorless drafts never match.
  • TOCScope.DraftAuthors + knowledge.ListsDraft (toc.go); PrimeScoped and expandWithGraph use the author-aware filter.
  • kick_priming.go: when the agent's scope lists draft or all explicitly, DraftAuthors = agent name, base agent (Config.BaseAgentName), owner logins (DashboardConfig.OwnerLogins, github: prefix dropped). Empty include_states does not opt in.
  • Render: a primed draft carries a (draft) marker after its title.
  • TOC / entry / effective API reads are unchanged.

Tests

kick_priming_draft_test.go, table-driven over a temp vault: unscoped agent / scope without include_states / include_states: [deprecated] → approved only; draft opt-in → own draft + owner draft injected with (draft), other-author and authorless drafts excluded; replica inherits base identity; all opt-in with no matching author → owner drafts only. Plus kickDraftAuthors identity resolution.

Docs

agent-knowledge-and-memory.md, knowledge-toc.md, knowledge-entries.md (author key), knowledge-lifecycle.md, knowledge-curator.md; changelog fragment changelog.d/added-knowledge-draft-kicks.md.

Builds alongside #17060 (scope: frontmatter); per-entry audience and repo auto-scope are #17077.

@kubestellar-prow kubestellar-prow Bot added the dco-signoff: yes Indicates the PR's author has signed the DCO. label Nov 7, 2026
@kubestellar-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign hanthor for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@kubestellar-prow kubestellar-prow Bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 7, 2026
@github-actions

github-actions Bot commented Nov 7, 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
#17086 ✨ agents: drain CLI memory into draft knowledge entries before clearing same files src/docs/agent-knowledge-and-memory.md

@hivecommons-hive

hivecommons-hive Bot commented Nov 7, 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:

  • relative links and anchors resolve

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.

Evidence bundle `#1707919c9f50` sha256:64f1d1f6a86e0d55b13f490e872dbdc3dfc27acfb8a1427ffafdca473bdee698 — download from the dashboard or `hivectl review evidence #17079`.

@github-actions github-actions Bot added the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 7, 2026
@github-actions github-actions Bot removed the conflicts-with-open-pr Open PR has a merge conflict with another open PR label Nov 7, 2026
@kubestellar-prow kubestellar-prow Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2026
@kubestellar-prow kubestellar-prow Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 7, 2026
…ates lists draft

The kick primer admits approved facts only and the agent scope can only
narrow, so knowledge.agent_scopes.<agent>.include_states: [draft] never
reached a kick. Thread the agent's identities (name, base agent, owner
logins) into TOCScope.DraftAuthors when the scope lists draft, admit drafts
whose author: frontmatter matches, and render them with a (draft) marker.
Approved-only stays the default for every other agent.

Fixes #17076

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@hivecommons-hive

Copy link
Copy Markdown
Contributor

@clubanderson this PR is back in your court (stage/071-needs-author). Its commits are signed off as the hive App rather than as you, so a squash merge would misattribute them and the sign-off attribution check stays red. No hive agent can rewrite a contributor's commits — the fix is yours:

  • 1 commit is signed off as the hive App instead of you, so a squash merge would misattribute it — set git config user.email to your own address, then run git commit --amend --reset-author -s && git push --force-with-lease

Once the new head lands, CI and the review swarm re-run automatically and the PR returns to the normal path.

@hivecommons-hive
hivecommons-hive Bot merged commit eb1bd50 into v5 Nov 7, 2026
77 of 79 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the knowledge-rbac branch November 7, 2026 20:21
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Your PR has been merged.

We'd love to hear how your experience was: share feedback

@hivecommons-hive

Copy link
Copy Markdown
Contributor

merged by Hive trusted-author auto-merge: author @clubanderson holds role owner and GitHub permission admin on repo; CI green at 71d4cf8.

@hivecommons-hive

Copy link
Copy Markdown
Contributor

The red relative links and anchors resolve check is not this PR's doing: CHANGELOG.md: broken link 'url' fails on the v5 head itself (incident #17098, fix in #17096). Deferring until the baseline is green and the check re-runs.


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

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

✨ knowledge: honour agent_scopes.include_states for kick priming (draft knowledge reaches the agent that owns it)

1 participant