Skip to content

Record the knowledge snapshot on every Direct review plan - #212

Merged
tzhouam merged 1 commit into
mainfrom
kb/plan-knowledge-snapshot
Sep 28, 2026
Merged

tzhouam merged 1 commit into
mainfrom
kb/plan-knowledge-snapshot

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

PR 9 of the knowledge-service redesign: each Direct review plan now records which knowledge it was served.

  • DirectReviewPlan.knowledge_snapshot: the activated snapshot id, packaged, or unverified.
  • DirectReviewPlan.knowledge_tree_sha256: the verified snapshot's manifest tree hash, or empty.
  • Both default to empty, so existing callers are unaffected. Every document read under the plan's review_context_id comes from the same snapshot, so the review bot can record both values with each review.
  • The old diagnostics.knowledge_snapshot value leaked a development tree's absolute path (unverified:/abs/path); it now uses the path-free public form.

Commit hook approved; full suite and SPEC freshness pass locally.

🤖 Generated with Claude Code

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-28T13:48:43.529201Z b5ec5cf 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: b5ec5cf166

ℹ️ 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".

Comment on lines +255 to +256
knowledge_snapshot: str = ""
knowledge_tree_sha256: str = ""

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Bump the Direct protocol version for the new fields

In a rolling or mixed-version deployment, get_capabilities() and each plan still advertise Direct 1.1.0 even though older 1.1 providers do not return these snapshot fields. A ReviewBot relying on the version handshake therefore cannot determine whether it can safely record the required knowledge provenance and may silently receive missing values. Increment DIRECT_API_VERSION and document the new contract version, as was done when the previous public Direct fields were introduced.

Useful? React with 👍 / 👎.

A review should record which knowledge it was served, so a finding can be
traced to the exact rules that were active (the knowledge service now swaps
snapshots at runtime).

- DirectReviewPlan gains knowledge_snapshot (the activated snapshot id,
  "packaged", or "unverified") and knowledge_tree_sha256 (the manifest tree
  hash of a verified snapshot, else empty). Every document read under the
  plan's review_context_id comes from that same snapshot. Both fields default
  to empty, so existing callers are unaffected.
- KnowledgeView.public_snapshot never exposes a development tree's absolute
  path. The old diagnostics value "unverified:/abs/path" leaked it into plans;
  diagnostics.knowledge_snapshot now uses the public form too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tzhouam
tzhouam force-pushed the kb/plan-knowledge-snapshot branch from b5ec5cf to c2fe833 Compare September 28, 2026 13:53
@tzhouam
tzhouam merged commit 5f9ac5c into main Sep 28, 2026
5 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