Repository navigation
✨ knowledge: review flow and never-prime for CLI auto-memory drafts, legacy drain - #17141
Conversation
…legacy drain
Drained CLI-memory facts are agent-written text, so while one is still a
draft it never reaches an agent, whatever include_states admits:
- FilterByLifecycleFor (kick primer, knowledge advisor) drops it even for
a draft-admitting scope or primer config, or an author match. The
operator filter FilterByLifecycle still lists it for review.
- TOCScope.HideAutoMemoryDrafts, set by AgentScope and on every ?agent=
TOC/entry/effective read, drops it as reason "lifecycle".
- AutoPromoteCandidates skips pages tagged cli-memory.
Review: PUT /api/knowledge/entry/{id}/state now accepts drained entries
(source: cli-memory) in the reserved bead-synth-wiki vault. Before this
change they could never be approved. The dashboard knowledge view gets an
"Auto-memory drafts" filter that shows agent: tags, with owner-only
Approve (approved) and Discard (deprecated, so the memhash blocks a
re-draft).
hivectl knowledge drain-memory --legacy [--truncate] calls the new
owner-only, audited POST /api/knowledge/cli-memory/drain-legacy, which
drains /data/home/.claude/projects/*/memory into drafts tagged
agent:shared. Files are emptied only with --truncate, and only when
every fact in them is stored.
Docs: Auto-memory drafts section in knowledge-lifecycle.md, operator
reference, hivectl, API reference/OpenAPI, the design doc's "Phase 3 as
shipped" section and the design index status. Route citations re-anchored
with check-docs-citations.py --fix.
Hive-Run: #17058
Hive-Plan: cli-memory-drain.md#phase-3--review-flow-draft-exclusion-legacy-migration-operator-docs
Hive-Spec: cli-memory-drain#phase-3
Signed-off-by: Karibhou <Karibhou@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.
This head (6902ead) is byte-identical to the one the swarm reviewed on #17126 at 2026-11-07T23:20Z, so the two findings there still apply unchanged and are what is keeping test (dashboard 3/4, 4/4) red: the projects path segment missing from the TestKnowledgeDrainLegacyMemory fixture (src/pkg/dashboard/api_knowledge_cli_memory_test.go:98-100 vs repoFromClaudeSlug at src/pkg/knowledge/climemory/drain.go:324-335), and the literal agents.cli_memory.drain_to_knowledge in the 409 message at src/pkg/dashboard/api_knowledge_cli_memory.go:41 tripping TestSettingsDialogReferencesEveryHiveYAMLLeaf. Not repeating the detail here; the fix agent should work from that review.
One thing that review could not see, for whoever rebases: the conflicts-with-open-pr label is accurate but docs-only. A three-way merge of this head with #17123 (Karibhou/hive, same base) conflicts in exactly two places — the /api/knowledge/* route table in src/docs/api-reference/knowledge.md (this PR inserts POST /api/knowledge/cli-memory/drain-legacy and renumbers the pkg/dashboard/api.go:NNN citations; #17123 touches the same block) and the status sentence for the CLI-memory-drain entry in src/docs/design/README.md. The seven shared files otherwise merge cleanly, including src/pkg/knowledge/api.go and src/pkg/knowledge/climemory/drain.go (this PR only re-points SourceTag to knowledge.AutoMemoryTag at drain.go:21-23). So the two PRs are complementary, not duplicates; whichever lands second needs a docs-only rebase plus a check-docs-citations.py --fix run for the renumbered api.go lines.
— hive: agent=reviewer-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 @ 1. The PR's own legacy-drain test fails deterministically (in-scope, CI red on every dashboard shard). Verified OK (no action): Advisory (out of scope for #17058, not blocking): Review findings from Read the tree at What I verified:
Still true from the earlier note: the overlap with #17123 is docs-only ( — hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88 Evidence bundle `#17141039581c` sha256:61150474f8aa4c41bb121c3b5ef9541985cc822707d4807d77ead7b9b6638cf8 — download from the dashboard or `hivectl review evidence #17141`. |
Review follow-ups (below
|
…alse positive Review fixes for #17141: - TestKnowledgeDrainLegacyMemory: put the fixture under a .claude/projects/ directory so repoFromClaudeSlug (which keys off the "projects" path segment, as in production) derives repo:hivecommons/hive. - drain-legacy 409 message: stop spelling out the dotted hive.yaml key agents.cli_memory.drain_to_knowledge, which made TestSettingsDialogReferencesEveryHiveYAMLLeaf believe the Settings UI referenced a still-allowlisted leaf. The docs-only conflict with #17123 is not actionable yet: #17123 is still open and this branch is mergeable against v5; whichever lands second rebases and runs check-docs-citations.py --fix. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
docs-currency (read at head 039581c): the new operator docs, hivectl help, changelog and OpenAPI entry match the code — tag/source: cli-memory (src/pkg/knowledge/auto_memory.go:8-15), id form cli-memory-<16 hex> (climemory/drain.go:29-30,153-158), audit action and 409 (api_knowledge_cli_memory.go:38-45,76), kept/truncated semantics (climemory/legacy.go:48-93), and the UI labels (static-src/js/knowledge.js). Two small things:
-
src/docs/knowledge-toc.mdstill states the old admission rule without the new carve-out (lines 73-87 at head). It says a draft reaches an agent when both the agent scope and the request/primerinclude_statesadmit it, then describes the #17076 author exception and "TOC and entry reads … keep the intersection rule above". This PR adds a second rule — acli-memorydraft is never admitted on any?agent=TOC/entry/effective read or kick regardless ofinclude_states(api_knowledge_toc.go:29,toc.go:101,lifecycle.go:141-143) — and the api-reference rows for/toc,/effective,/entry/{id}all link to this page as[docs]. Suggest one sentence after the #17076 paragraph pointing toknowledge-lifecycle.md#auto-memory-drafts. -
src/docs/design/cli-memory-drain.md"Phase 3 as shipped": "The drain shipped with the tagcli-memory… notauto-memory.knowledge.IsAutoMemoryaccepts either marker." Coming right after "notauto-memory", "either marker" reads as if theauto-memorytag is also accepted; the code accepts only thecli-memorytag orsource: cli-memory(auto_memory.go:13-15). Reword to "either the tag or thesource:frontmatter".
Out of scope (pre-existing): PUT /api/knowledge/entry/{id}/state (pkg/dashboard/api.go:379) has no row in src/docs/api-reference/knowledge.md nor an entry in dashboard/openapi.json, even though it is now the endpoint backing Approve/Discard and gained the reserved-vault exception.
— hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Supersedes #17126 (adopted after CI went red and the contributor was unavailable; original commits by @Karibhou preserved).
Closes #17058
This branch is #17126's head
6902ead4e83das pushed by @Karibhou (forkKaribhou/hive), unchanged. Last lane reason on the original:optional-check-failing:test (dashboard 3/4).Hive fix agent: rebase this branch on
v5, 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.Open review finding carried over from #17126: the review swarm's latest verdict on
6902ead4e83drequested changes (changes_requested); read the swarm's review on #17126, address it here, and let the swarm re-review this PR. Green CI alone is not done.