Skip to content

sdk(knowledge): widen the catalog to owner rule pages with capacity - #136

Merged
tzhouam merged 1 commit into
mainfrom
fix/knowledge-catalog-capacity
Sep 8, 2026
Merged

tzhouam merged 1 commit into
mainfrom
fix/knowledge-catalog-capacity

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Automatic knowledge batches (omni-reviewbot daily intake) could only append to each owner's rules.md entry page, and several of those pages sit within a few hundred bytes of check_knowledge_tree.py's 32 KiB split gate (scheduler 32,496 B, minimax-h3 31,752 B, model-executor 31,389 B, serving 31,197 B). Every rule routed there failed validation after apply, rolled the whole batch back, and needed a human to split the page by hand (#133, #134). The 09-06 and 09-07 production batches failed exactly this way.

Change

  • KnowledgeCurator.catalog() now lists every owner rule page: the rules.md entry page plus the owner's type: rule rules-<topic>.md topic pages the tree already uses. Look-alike names and type: guide pages are never targets.
  • New catalog_entries() / KnowledgeCatalogEntry carry each page's free_bytes and free_lines, mirrored from the validator's split gate (>= 32 KiB or >= 500 non-empty lines fails). The prompt shows that room and tells the model to prefer a topic page that fits or shorten.
  • validate_proposals() rejects a proposal that would not fit with a page full: ... reason before anything is written, charging the newline apply inserts on an unterminated page and consuming room across one batch so two rules aimed at the same page cannot both pass.
  • Knowledge API 1.0.0 → 1.1.0, backward compatible (no signature changes; catalog() still returns IDs).
  • Contract text: the knowledge CONTRIBUTING P0 sentence, the RFC, SPEC/sdk.md and SPEC/contract.md now name the owner's rule pages rather than only rules.md.

Nothing in knowledge/ content changes. ReviewBot adopts this by pinning the merged SHA; its doctor checks the version's presence, not its value.

Validation

  • pytest: full suite passes except test_phase1_cluster.py::test_drift_guard_unimportable_checked_class_fails_guard, which fails identically on a clean origin/main checkout in this environment (vllm import).
  • New tests: topic pages in the catalog and applied end to end, page full before validation, capacity consumed across a batch, unterminated-page boundary (accepted proposal renders exactly 32,767 bytes).
  • check_knowledge_tree.py, check_wiki_lint.py, check_doc_links.py, check_doc_citations.py, check_spec_freshness.py --strict all pass.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Js5CsiwSYjcAYvqti1Lp1Y

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-08T07:05:36.813465Z 96b1b8f PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 96b1b8f851

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

documents: list[str] = []
for path in sorted(self._knowledge.rglob("rules.md")):
entries: list[KnowledgeCatalogEntry] = []
for path in sorted(self._knowledge.rglob("rules*.md")):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Support topic pages' existing heading levels

When vllm-omni proposals target a newly exposed topic page that stores rules as level-three headings—for example, knowledge/repos/vllm-omni/components/diffusion/rules-platform-kernels.md:15 contains ### DIFF-1t—this expansion is incompatible with the existing _HEADING and _rule_exists logic, which recognize only ##. A proposal matching the page's style is rejected, while a ## DIFF-1t proposal is accepted as new and can be appended beside the existing rule because neither fixed validator checks duplicate rule IDs. Recognize both heading levels or exclude incompatible pages before cataloging them; otherwise automated intake can reject valid proposals or persist duplicate conclusions.

AGENTS.md reference: AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

Automatic knowledge batches could only append to each owner's rules.md
entry page, and several of those pages sit within a few hundred bytes
of the tree validator's 32 KiB split gate. Every rule routed there
failed validation after apply, rolled the whole batch back, and needed
a human to split the page by hand (#133, #134).

The catalog now lists every owner rule page: the rules.md entry page and
the owner's type: rule rules-<topic>.md topic pages the tree already
uses. catalog_entries() carries each page's remaining bytes and
non-empty lines, mirrored from check_knowledge_tree.py, the prompt shows
that room, and validate_proposals rejects a proposal that would not fit
("page full") before anything is written, consuming room across one
batch so two rules aimed at one page cannot both pass. Knowledge API
1.0.0 -> 1.1.0, backward compatible.

The knowledge contract sentence that named rules.md as the only PR
learning target now names the owner's rule pages; SPEC/sdk.md and
SPEC/contract.md record the new surface and version.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Js5CsiwSYjcAYvqti1Lp1Y
@tzhouam
tzhouam force-pushed the fix/knowledge-catalog-capacity branch from 96b1b8f to 2d9f8d0 Compare September 8, 2026 07:41
@tzhouam
tzhouam merged commit f532d40 into main Sep 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant