Skip to content

✨ kick priming: one log line per kick with knowledge bytes injected and entries skipped for the cap - #17064

Merged
clubanderson merged 1 commit into
v5from
kick-knowledge-log
Nov 7, 2026
Merged

clubanderson merged 1 commit into
v5from
kick-knowledge-log

Conversation

@clubanderson

Copy link
Copy Markdown
Member

Fixes #17049 — phase 3 of #17043 (RFC: AGENTS.md carries tone only; knowledge becomes scoped skills surfaced on demand). Proposed by @gregoryhunt at the 2026-11-05 community meeting; owner Andy (@clubanderson).

What

One structured line per primed kick, emitted from the kick assembly path:

level=INFO msg="knowledge: injected 3900 bytes from 7 entries (skipped 3 for cap)" agent=developer injected_bytes=3900 entries=7 skipped_for_cap=3 cap_bytes=4096 primed=true agents_md_bytes=1980 skills_bytes=0
  • primeKnowledge is split into primeKnowledgeStats (returns knowledgeInjection{Section, Bytes, Entries, SkippedForCap, CapBytes, Primed}) plus logKnowledgeInjection. The five lane call sites keep calling primeKnowledge (which logs with agents_md_bytes=0 skills_bytes=0, correct for them since they prepend neither block); templates.go uses the stats form and logs once after the AGENTS.md and skills blocks are known, with their sizes.
  • Emitted at INFO even when 0 entries were found (primed=true) — that is the signal a lane's work has no entries. Not emitted when the primer did not run (knowledge disabled, no issues, no keywords) so a hive without a knowledge store is not spammed with zeros — unless an AGENTS.md/skills block was injected, in which case the line still reports the payload.
  • The old knowledge primer: injecting facts into kick line is folded into this one; the debounced dropped facts over the byte cap detail line (omitted bytes/hints) stays.
  • No new config.
  • Docs: operator-reference/sweeps-and-operations.md "Kick size and the list caps" gets the line next to kick rendered.

Tests (table-driven, no time.Sleep)

  • TestLogKnowledgeInjection: silent / zero line / omissions + AGENTS.md + skills / AGENTS.md-only, asserting every field via a JSON slog handler.
  • TestPrimeKnowledge_LogsOneLinePerKick: real primer over a temp vault at the 512-byte floor; exactly one line, injected_bytes equals the rendered section, entries + skipped_for_cap equals the facts found, and the entry count matches the rendered bullets.

Note

Touches the same primeKnowledge body as #17060 (scope filter); whichever lands second gets a trivial rebase.

…nd entries skipped for the cap

primeKnowledge now returns its numbers (bytes, entries, skipped-for-cap,
cap) alongside the rendered section, and every primed kick logs one line
"knowledge: injected N bytes from M entries (skipped K for cap)" with the
AGENTS.md and skills block sizes that share the kick. The old
"injecting facts into kick" line is folded into it; the debounced
over-cap detail line stays. Silent when the primer did not run, so a hive
without a knowledge store does not log a zero per kick.

Proposed by @gregoryhunt at the 2026-11-05 community meeting.

Fixes #17049
Part of #17043

Signed-off-by: Andrew Anderson <andy@clubanderson.com>
@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 clubanderson 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
#17068 ✨ knowledge advisor: surface scoped knowledge mid-task when an agent's work enters a new scope CONFLICT src/pkg/scheduler/kick_priming.go
#17060 ✨ knowledge: scope block on entries and a kick-context filter in the Primer CONFLICT src/pkg/scheduler/kick_priming.go

@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
@clubanderson
clubanderson merged commit 1f9680f into v5 Nov 7, 2026
83 of 86 checks passed
@kubestellar-prow
kubestellar-prow Bot deleted the kick-knowledge-log branch November 7, 2026 19:00
@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

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

Labels

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. 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.

✨ kick priming: one log line per kick with knowledge bytes injected and entries skipped for the cap

1 participant