Repository navigation
Add the knowledge service core: repo registry, ledger, signed outbox - #206
Conversation
Foundation for the knowledge service that takes knowledge ownership from ReviewBot. There are no workflows or scheduler yet; those build on this. - kb_service.config parses each adapter's knowledge_lifecycle section into a repo registry (general/ is configured by the service). It refuses unknown keys, bad modes or triggers, a missing auditor plugin, a knowledge_dir that disagrees with the adapter, auto_merge without a calibration set, and any private upstream in auto_merge. knowledge_lifecycle joins the adapter HIGH_RISK_SECTIONS, so only a human can enable auto-merge. - kb_service.ledger: one SQLite file with every table keyed by repo, a heartbeat lease for single-instance operation, and per-repo and global generation numbers; bump_generation voids everything issued before it. - knowledge_service.signing: Ed25519 envelopes whose signature covers a purpose tag, so a verdict, outbox item, control record, hold list or ack signature never verifies for another purpose. Keys are 0600 and never overwritten. Vendorable (only cryptography, new `kb` extra). - kb_service.outbox: the service writes signed items, a control record and a hold list, and reads acks signed by the publisher's key. check_item() is what the GPU-box publisher runs before any write: signature, control record no older than 10 minutes, expiry, generation, pause, private upstream, and no enqueue or verdict unless the repo is in auto_merge; pause and close are always allowed. verify_holds() fails closed on a stale list. - `infermatrix-copilot kb keygen|status|pause|resume|control`. - vllm-omni gets knowledge_lifecycle in shadow mode with its release_audit.py auditor; afd-plugin is declared but disabled until its own calibration. - CI installs the kb extra. 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: eeaa3093fd
ℹ️ 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".
| if item.kind in ALWAYS_EXECUTABLE: | ||
| return item |
There was a problem hiding this comment.
Apply mandatory checks before exempting stop items
When a signed pause or close item is present, this early return accepts it before checking expires_at or repo_publishes. Consequently, a stop item left during a publisher outage remains executable beyond its configured 24-hour TTL, and one issued for a private repository—Outbox.issue() currently permits this—bypasses the publisher's private-upstream fail-closed check. Exempt these items only from generation, paused-state, and mode checks, while still enforcing expiry and visibility.
Useful? React with 👍 / 👎.
| return RepoLifecycle( | ||
| repo=GENERAL, full_name="", enabled=enabled, mode=mode, knowledge_dir=GENERAL, | ||
| intake=IntakeConfig(merged_prs=False), | ||
| release=ReleaseConfig(trigger="none"), |
There was a problem hiding this comment.
Require calibration before enabling general auto-merge
When KB_GENERAL_ENABLED=1 and KB_GENERAL_MODE=auto_merge, this helper creates an enabled auto-merge lifecycle whose inherited calibration_set is empty. Because general configuration bypasses parse_lifecycle(), it also bypasses the guard at lines 150–151 that rejects every other auto-merge repository without calibration, and _sync_repos() will register general as auto-merge. Require a calibration set here or reject auto-merge for general until one is supplied.
Useful? React with 👍 / 👎.
Fourth PR of the knowledge-base redesign: the knowledge service core. There are no workflows or scheduler yet; those build on this.
What changes
kb_service.config: each adapter'sknowledge_lifecyclesection becomes a repo registry.general/is configured by the service. Invalid configuration is refused, including a private upstream inauto_mergeandauto_mergewithout a calibration set.knowledge_lifecyclejoinsHIGH_RISK_SECTIONS, so only a human can enable auto-merge.kb_service.ledger:knowledge_service.signing: Ed25519 envelopes with purpose-tagged signatures, so a verdict, outbox item, control record, hold list or ack signature can't be replayed across purposes. Keys are 0600 and never overwritten. Vendorable; adds a newkbextra (cryptography).kb_service.outbox:check_item()runs on the publisher before any write and checks:auto_mergerepos get non-stop writes: shadow and disabled repos publish nothing.pauseandcloseare always allowed.verify_holds()fails closed on a stale list.infermatrix-copilot kb keygen|status|pause|resume|control.knowledge_lifecyclein shadow mode with itsrelease_audit.pyauditor. afd-plugin is declared but disabled until it has its own calibration set.kbextra. Addsdoc/features/knowledge-service.mdand thekb_serviceSPEC.Test Plan
test/test_kb_service_core.py(39 tests):check_spec_freshness --strict,check_doc_links.Test Result
🤖 Generated with Claude Code