Repository navigation
✨ knowledge advisor: surface scoped knowledge mid-task when an agent's work enters a new scope - #17068
Conversation
|
[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
|
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
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. |
b9a1d75 to
b8e1053
Compare
…s work enters a new scope Phase 1 of the mid-task knowledge advisor (#17052). The kick primer runs once; this watches the agent's pane on every poll tick, and the first time a scope (directory prefix or gh command family) shows up that was not on screen at kick time, asks the same knowledge Primer under the same agent scope and types one '📚 Knowledge:' line per hit through the existing live-session primitive used by the CI-poll nudge. - crux: KnowledgeAdviser host seam (in-process-only, like SetSpanStarter), crux/agent/knowledge_advisor.go: baseline at first post-kick poll, per-kick cap, cooldown, dedupe against kick-primed slugs, never during a tool call or after the turn ends, prompt-history trigger knowledge-advisor for measurement. - hive: cmd/hive/knowledge_adviser.go adapts Primer.PrimeScoped; the primer now records which slugs survived the byte cap (RenderedSlugs, Scheduler.KickPrimedSlugs) so those are never re-sent. - config: knowledge.advisor (default off), advisor_max_per_kick (3), advisor_exclude_agents. - docs: knowledge-curator.md section, operator-reference row, crux.md HostSetters row. Phase 2 (LLM-ranked, OMP-style) is #17054. Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…t ratchet baselines Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…rity fixtures, keep manager.go at baseline Signed-off-by: Andrew Anderson <andy@clubanderson.com>
b8e1053 to
789b7d7
Compare
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Phase 1 of the mid-task knowledge advisor — the second half of @gregoryhunt's 2026-11-05 Hive Commons proposal (@Danathar's OMP-advisor comparison). Closes #17052. Phase 2 (LLM-ranked, OMP-style) is #17054.
Today Hive injects
# Relevant Knowledgeonce, at kick time, capped at 4096 bytes. This PR keeps watching after the kick and surfaces scoped knowledge when the agent's work enters a scope that was not on screen when the kick landed — default off (knowledge.advisor: false); the plan in #17052 is to flip it on once hive's own hive has run it for a week.Signal and delivery (what was already there)
pollTmuxOutputForAgent(src/crux/agent/manager_poll.go).observedKnowledgeScopespulls directory prefixes (⏺ Read(src/crux/agent/manager.go),● Edit src/pkg/…,$ cat …) truncated to 3 segments, andgh pr|issue|run|api|release|workflowfamilies. Explain-mode narration is stripped first. No new watcher, no proxy hook.tmuxSendLiteralForAgent+tmuxSendEntersForAgent,src/crux/agent/manager_tmux.go), with the same baseline-at-first-post-kick-poll trick asnudgeIfPollingCI. One line per entry:📚 Knowledge: <title> — <≤300 chars> (full: <ref>).Primer.PrimeScopedunder the sameknowledge.agent_scopesrestriction, with the observed file as the primer's file path and the scope segments as keywords. (✨ knowledge: scope block (paths, labels, lanes) on entries and a kick-context filter in the Primer #17045's kick-context paths plug straight intoKnowledgeScope.Pathwhen they land.)Rules enforced by the runtime (
src/crux/agent/knowledge_advisor.go)knowledge.advisor_max_per_kick(default 3) per kick, 2-minute cooldown between lines; state resets whenLastKickmoves.PrimedKnowledge.RenderedSlugs,Scheduler.KickPrimedSlugs); a slug is typed at most once per kick.Running 1 shell command…, OMP'sRunning… (esc to cancel)) — it waits; if the turn reaches an empty prompt first the pending advice is dropped. Skipped while a human is attached and while a kick is being typed.knowledge.advisor_exclude_agents.knowledge-advisor+knowledge advisor: deliveredlog line.Wiring
crux.KnowledgeAdviserhost seam,Host.SetKnowledgeAdviser, registeredHostSetterInProcessOnly(same class asSetSpanStarter); sidecar returns the in-process-only error, recorder records it,crux/api/clientparity test updated.cmd/hive/knowledge_adviser.goadapts the Primer and is installed inbootWatchersnext toSetRecordPromptCallback.manager.gogains exactly one field and stays at its file-size-ratchet baseline.Tests
Table-driven, fake adviser + fake clock,
funcTerminalseams, notime.Sleep: scope extraction across Claude Code / Copilot / shell shapes (URLs, absolute paths, root files, tooling dirs excluded), gh families, keywords, the typed line and its cap, pane gates, baseline → new-kick reset, cap, cooldown, slug dedupe, tool-in-flight wait, idle drop, every refusal path. Root module: config parse/default/opt-out,RenderedSlugsvs the byte cap,selectKnowledgeAdvice/truncateRunes/Policy/no-primer path.Related: #17043 (RFC, sibling), #17045, #17047 — this PR does not touch AGENTS.md or the entry format.