Repository navigation
Refuse to activate knowledge in a format this Copilot does not read - #224
Conversation
The design requires activation to refuse a knowledge/API version mismatch: knowledge is released independently of the code now, so a tree written for a newer format must not be served by a Copilot that cannot read it. - The knowledge tree declares its format in knowledge/_format.yaml (format_version: 2, i.e. rule lifecycle footers, typed operations, _routes.yaml and _tombstones.yaml). The file sits outside the auto-merge whitelist, so changing it takes a person. The SDK's KNOWLEDGE_API_VERSION is a separate thing: it versions the curation API that the review bot's release checks pin. - knowledge_view.knowledge_format reads the declaration, which must be exactly an integer: 2.9, "2", true or .inf are treated as malformed (undeclared), never coerced. build_manifest records it in MANIFEST.json. - activate.verify_snapshot refuses a snapshot whose format is undeclared or not in SUPPORTED_FORMATS, leaving active untouched. Snapshots carry _format.yaml alongside the top-level pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 90d30a0596
ℹ️ 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".
| declared = knowledge_format(view.root) | ||
| if declared not in SUPPORTED_FORMATS: |
There was a problem hiding this comment.
Enforce the format in every snapshot reader
When the knowledge scheduler and review service are upgraded independently, a newer scheduler can activate format 3 while an older, long-running review worker still resolves the shared $KB_STATE_DIR/active link. That worker calls KnowledgeView.current()/_load_snapshot() directly and never executes this verify_snapshot() check; _load_snapshot() currently accepts the format-3 manifest, so the old worker serves knowledge it cannot interpret. The same bypass occurs when an unsupported snapshot is supplied directly via KNOWLEDGE_ROOT. Validate knowledge_format against SUPPORTED_FORMATS in the snapshot-loading path as well, so every consumer fails closed rather than only the process performing activation.
Useful? React with 👍 / 👎.
Knowledge-service redesign follow-up (§8.5): activation refuses a knowledge/API version mismatch. Knowledge now releases independently of the code, so a tree written for a newer format must not be served by a Copilot that can't read it.
knowledge/_format.yaml(format_version: 2: lifecycle footers, typed ops,_routes.yaml,_tombstones.yaml).KNOWLEDGE_API_VERSION, which versions the curation API and is pinned by the review bot's release checks.2.9,"2",trueand.infcount as undeclared, never coerced.MANIFEST.jsonrecordsknowledge_format.verify_snapshotrefuses an undeclared or unsupported format and leavesactiveunchanged.Note: the top-level
_format.yamlis outside the auto-merge whitelist, so the kb-gate precheck on this PR fails. That is the intended human-gated path; the check isn't required yet.Commit hook approved; full suite and SPEC freshness pass locally (rebased on #223).
🤖 Generated with Claude Code