Skip to content

Audit releases against a generated baseline for knowledge changes - #205

Merged
tzhouam merged 1 commit into
mainfrom
kb/release-audit-generated-baseline
Sep 28, 2026
Merged

tzhouam merged 1 commit into
mainfrom
kb/release-audit-generated-baseline

Conversation

@tzhouam

@tzhouam tzhouam commented Sep 28, 2026

Copy link
Copy Markdown
Collaborator

Third PR of the knowledge-base redesign. It lets the knowledge service and the knowledge gate audit an upstream release without waiting for the adapter baseline to be advanced.

What changes

  • The auditor moves into the adapter. It is now the plugin adapters/vllm_omni/release_audit.py, which ships in the wheel as runtime data. tools/vllm_omni_release_audit.py re-exports it, so the CLI, CI workflow, imupdate skill and existing tests are unchanged.
  • New --baseline-source generated mode (committed stays the default). The baseline is built in memory for the audited SHA pair.
    • Enforced: only knowledge-document issues (stale_knowledge_source, knowledge_metadata_error, owner_document_missing).
    • Reported in reconciliation, never blocking: pin and inventory drift, unrouted paths, stale source-map patterns, doc pins, committed_baseline_behind / committed_previous_differs / committed_inventory_differs. This list is what the adapter-baseline companion PR must fix.
  • knowledge_service.release_audit: repo-neutral plugin loader. It calls the plugin's audit_for_knowledge(), validates the report strictly (a malformed report can never read as clean), and refuses plugin paths that are absolute, escape the adapter, are missing, or aren't .py.
  • Workflow: the release-audit workflow now also triggers on changes to the plugin.

Test Plan

  • test/test_release_audit.py:
    • generated mode doesn't block on an un-advanced committed baseline;
    • it comes back clean once the knowledge is fixed, while reconciliation is still reported;
    • unrouted paths are reconciliation only;
    • a differing previous SHA is reported;
    • the CLI's committed and generated exit codes;
    • the plugin loader, including path rejection and malformed-report rejection.
  • Full suite, check_spec_freshness --strict, check_doc_links.

Test Result

  • Full suite: passed. SPEC freshness: 87/87. Doc links: OK.
  • Local review gate (gpt-6-astra-high): approved after fixes for strict report validation and the previous-SHA reconciliation.

🤖 Generated with Claude Code

The release audit enforced every issue against the committed
release_baseline.yaml, so a knowledge change made right after an upstream
release failed until someone advanced the adapter baseline in a separate PR.
The knowledge service also could not load the auditor from an installed
wheel: it lived under tools/, which the wheel does not ship.

- Move the auditor to the adapter plugin adapters/vllm_omni/release_audit.py
  (packaged runtime data); tools/vllm_omni_release_audit.py re-exports it, so
  the CLI, CI workflow, imupdate skill and existing tests are unchanged.
- Add --baseline-source generated (committed stays the default): the baseline
  is built in memory for the audited SHA pair. Only knowledge-document issues
  are enforced (stale_knowledge_source, knowledge_metadata_error,
  owner_document_missing). Pin and inventory drift, unrouted paths, stale
  source-map patterns and doc pins go to a `reconciliation` list, together
  with committed_baseline_behind / committed_inventory_differs: that list is
  what the adapter-baseline companion PR must fix.
- Add knowledge_service.release_audit, a repo-neutral loader for a plugin's
  audit_for_knowledge() entry. It refuses absolute, escaping, missing or
  non-.py plugin paths.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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-28T11:00:47.724474Z 2511f34 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.

@tzhouam
tzhouam merged commit 934b9ce into main Sep 28, 2026
3 checks passed

@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: 2511f3447a

ℹ️ 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 +135 to +137
if not isinstance(baseline, dict) or not isinstance(baseline.get("upstream"), dict) \
or baseline["upstream"].get("audited_sha") != shas[1]:
raise bad("generated_baseline.upstream.audited_sha must equal upstream.to.sha")

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 Validate the generated baseline's starting SHA

When a plugin omits generated_baseline.upstream.previous_audited_sha or returns a stale value, this validation still accepts the report and may mark it clean because it checks only audited_sha. The accepted baseline therefore does not necessarily represent the reported from/to pair and can give reconciliation or a companion baseline update the wrong starting commit; require previous_audited_sha to be a valid SHA equal to upstream.from.sha.

Useful? React with 👍 / 👎.

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