Repository navigation
Serve the signed hold list read-only for the kb-gate verifier - #217
Conversation
The kb-gate verifier fails every knowledge segment whose hold list it cannot fetch, but nothing served the service's public/holds.json. - holds_server (kb holds-server [--host] [--port]) serves exactly one file, <state_dir>/public/holds.json, at GET/HEAD /holds.json with Cache-Control: no-store. Every other path is 404: no directory listing, no path following, no writes. A missing list is 503, which the gate treats as unreachable and fails closed. It binds 127.0.0.1 by default; the bot host's reverse proxy adds TLS, and that URL becomes holds_url in .github/kb-gate/config.json (feature doc shows a Caddy route). - The tests fetch and verify the list with the verifier's own fetch_holds / verify_holds, and probe that the ledger and other paths are unreachable. 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: 88b354d24d
ℹ️ 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".
| self.send_error(HTTPStatus.NOT_FOUND) | ||
| return | ||
| try: | ||
| data = holds_path.read_bytes()[:MAX_BYTES] |
There was a problem hiding this comment.
Reject oversized hold files instead of truncating them
When holds.json exceeds 1 MiB, this reads the entire file into memory and then silently returns only its first MiB with HTTP 200. The truncated JSON cannot pass fetch_holds, so every knowledge gate fails closed; moreover, concurrent requests to an unexpectedly large or corrupted file can allocate the full file repeatedly despite the apparent size cap. Read at most MAX_BYTES + 1 bytes and return an error when the extra byte is present.
Useful? React with 👍 / 👎.
Knowledge-service redesign follow-up: the public hold-list endpoint the kb-gate verifier reads. Until now nothing served
public/holds.json, so every knowledge segment would fail closed.kb holds-serverserves exactlyGET/HEAD /holds.jsonwithCache-Control: no-store.127.0.0.1by default. The bot host's reverse proxy adds TLS, and that URL goes intoholds_urlin.github/kb-gate/config.json(the feature doc has a Caddy example).fetch_holds/verify_holds, and probe that the ledger and other paths are unreachable.Commit hook approved; full suite and SPEC freshness pass locally.
🤖 Generated with Claude Code