Skip to content

RFC: knowledge intake — merged-PR and bugfix learnings return as reviewed knowledge PRs #111

Closed

Description

@tzhouam

Background

The knowledge tree has a written intake contract (knowledge/AGENTS.md: PR-learning produces only executable rules in the nearest owner's rules.md, validators + release audit gate every batch) — but no automated feeder. Learnings evaporate at the two moments they are freshest:

  1. a vllm-omni PR merges (review discussion + final diff carry generalizable lessons), and
  2. a copilot pr_debug run lands a verified fix (root cause + verification stop at run-scoped debug memory and never reach the human-curated tree).

The governing constraint is the knowledge plane's safety model: agents propose, humans promote. A pull request against this repo is the promotion gate, so the design delivers validator-clean proposals as PRs and nothing else.

Design

Three decoupled stages (full record: doc/RFC-knowledge-intake.md on the PR below):

  • Recording (cheap, every watch cycle) — the reviewbot scans all merged PRs straight from GitHub's closed pulls (drafts and untracked PRs included, durable overlap-safe cursor) and ingests copilot bugfix drop files (pr.harvest_debug_knowledge writes one JSON per landed, non-dry-run fix). Rows wait in a knowledge_intake SQLite table so a distiller outage never loses an event.
  • Distillation (at most once a day) — the model only proposes: catalog-constrained rule sections as structured output, sources fenced as untrusted data. Code applies append-only (new ## <rule-id> sections + updated: bump, never a rewrite); check_knowledge_tree.py + check_wiki_lint.py gate the batch fail-closed, with a bounded attempt cap parking poison rows visibly.
  • Publication (fork-based, double-gated) — the date-scoped branch pushes to the bot's fork and the PR targets this repo; merging is the human promotion act. Shadow by default; posting requires POST_MODE=review and KNOWLEDGE_PR_ENABLED plus a configured fork. Same-day reruns build on the day's branch and resume failed publication.

Implementation

End-to-end tests pin the watch-cycle flow (reviewbot) and the crash-then-resume checkpoint path (copilot); the cross-repo drop-record contract is pinned by deliberately duplicated fixtures on each side.

Rollout

KNOWLEDGE_INTAKE_ENABLED (recording + shadow batches) → wire KNOWLEDGE_INTAKE_DIR = COPILOT_INTAKE_DIR (bugfix channel, shared host) → create the bot's fork + KNOWLEDGE_FORK_SLUG → KNOWLEDGE_PR_ENABLED under POST_MODE=review. Rollback at any stage is turning the flag off; nothing in the tree changes without a merged PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EwmmhpCK9pfEsWWzUBx3GB

Activity

  1. tzhouam commented on Aug 28, 2026

    @tzhouam
    CollaboratorAuthor

    Design accepted and implemented; closing as the record. Code is in the three PRs above (all green, pending merge), the living design doc ships as doc/RFC-knowledge-intake.md on #110, and enablement is operational (flag order in the Rollout section).

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions