Repository navigation
✨ sidecar: knowledge advise callback so sidecar runtimes get the mid-task adviser (default off) - #19172
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
|
UI render evidenceRender evidence captured. Built from
These are fixture renders, not live data: the page was built from the PR head and filled with synthetic data from |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Why:
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. ℹ️ Sentinel: informational, author is trusted (owner), merge is not blocked. Head
No hive/awaiting-ci: rebased onto v5 (one docs conflict in api-reference/knowledge.md, kept both sides). CI pending - sweep will merge when green. 🐝 Hive Agent: |
…task adviser Add POST /v1/knowledge/advise to the hive's runtime-callback endpoint, off by default behind knowledge.sidecar_advise. Hive side: the route runs the same adviser chain the hive runs in-process (phase 1, optionally wrapped by the ranking pass), behind the same bearer token as the other /v1 callbacks. It checks that the agent belongs to the calling runtime and that the kick is the agent's current one (403), allows one call in flight per agent and two evaluations per scope per kick (429), rejects a pane tail over pane_lines (400) and a body over 64 KiB (413), and redacts the pane tail again on receipt. No model setting or credential is sent to the runtime and the model reason is never returned. Runtime side: hivecap.KnowledgeAdviser implements the kick-bound adviser seam over the route, fetches each agent's policy in the background, redacts the pane tail before sending, fails closed, and logs one warning per kick. The runtime installs it only when the hive's policy snapshot says the route is on, so with the knob off nothing changes. Settings gets a switch at the top of the Knowledge pipeline section, saved through the pipeline PUT. Docs, OpenAPI and a changelog fragment included. Refs #17157 Signed-off-by: Andrew Anderson <andy@clubanderson.com>
… sidecar switch help Signed-off-by: Andrew Anderson <andy@clubanderson.com>
…gs parity allowlist Signed-off-by: Andrew Anderson <andy@clubanderson.com>
94e3355 to
cbb5426
Compare
What
Slice 5 of the knowledge advisor epic:
POST /v1/knowledge/adviseon the runtime-callback endpoint, so a sidecar-mode runtime gets the mid-task adviser. It ships default off behind the newknowledge.sidecar_adviseknob, per the owner decision on the issue (plumbing only; the rank-mode evidence gate still decides when it is enabled on any live hive, and this PR enables it nowhere).Behaviour when unconfigured
Unchanged. With
knowledge.sidecar_advisefalse or unset (also requiresknowledge.enabledandknowledge.advisor):404 not_configuredandknowledge_adviseis not in/v1/health;knowledge_advise(the JSON is byte-identical), so the runtime never installs the adviser and makes no call;sidecarHost.SetKnowledgeAdviseronly holds the chain for the route; nothing is served from it.Design
Hive side (
cmd/hive/knowledge_advise_callback.go,pkg/cruxhost,crux/api/callback):PrimeScopedunderknowledge.agent_scopes; the request cannot widen scope or pick entries. No model setting or credential crosses, the modelreasonis never returned.kick_atmust be that agent's current kick, else 403 and no advice.pane_linesis 400, body over 64 KiB is 413, malformed scope (unknown kind or action, absolute or..path, long key or keywords) is 400.logscrub.RedactPaneTokenson receipt; an unwanted pane tail is dropped.Runtime side (
crux/hivecap/knowledge.go,crux/cli):hivecap.KnowledgeAdviserimplements a new optionalcrux.KickBoundKnowledgeAdviser(the manager passes the kick identity when the adviser implements it; the in-process adviser is untouched). Async contract unchanged: one in-flight call per agent comes from the manager.policy_onlycall (cached 30 s) so the poll tick never waits on the hive; until it arrives, or when the hive is away, the advisor is off.Settings: a switch at the top of the Knowledge pipeline section (
knowledge.sidecar_advise, YAML hint), saved through the existing pipeline PUT, applies without a restart. Not added to the parity allowlist.static/index.htmlregenerated fromstatic-src.Tests
Docs:
design/crux.md,crux-serve.md,agent-knowledge-and-memory.md(new Sidecar runtimes section),knowledge-curator.md,operator-reference,settings.md, API reference and OpenAPI for the pipeline route. Changelog fragment added.Refs #17157