Repository navigation
Bound governed authoring reads and resumable retrieval work - #11
Conversation
|
OpenRouter review posted ( |
Codex Review Summary: ✅ CompletedThis 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. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: issues
Scope: full-pr (full-pr)
Mode: initial
Commit: c7d521b6c5571f2813a6508495da5d599a49a97d
Judge: openai/gpt-5.6-luna
Cost: $0.7593 (lanes $0.7564 + judge $0.0029)
Lanes
openai/gpt-6.1-sol: ok (4 finding(s), 132.6s, 818334+5948 tokens (711890 cached), 8 tool round(s), via Azure, $0.44)z-ai/glm-5.3-flash: ok (3 finding(s), 561.0s, 7623774+86309 tokens (7223104 cached), 50 tool round(s), via Together, $0.32)
Findings
🔴 Issue 1 — Ledger reset missed during context confirmation
packages/application/src/evidence-reports.ts:1314 · bug · identified by openai/gpt-6.1-sol
A report query can return an old-epoch receipt after a reset completes during confirmAuthoringContext. Reset changes only the ledger head initially, leaving the old report row intact, so the final report-version comparison succeeds and the query returns the previously observed active ledger and retired receipt.
query performs its last headVersion check before context confirmation. Unlike the dispatcher's legacy path, its final owner-status read does not invoke status, which performs another active check. Recheck the ledger epoch/status after context confirmation and before the final status observation.
I checked reset, status, the legacy dispatcher sequence, and tests/report-query.test.ts. The existing reset race test resets at the second ledger read, not during the subsequent context confirmation. This finding does not require an atomic cross-collection snapshot: the reset completes before the query's final report observation.
🟠 Issue 2 — Principal revocation missed during final query work
packages/application/src/evidence-reports.ts:1303 · risk · identified by openai/gpt-6.1-sol
A direct factory caller can receive requirements and owner-only report status after its principal loses the required permissions during context confirmation or the fallback context read. The query's second current resolution has already completed, and the remaining work never resolves current principal authority again.
confirmContext checks the application's captured AccessContext, not resolvePrincipal; consequently, revoking the principal in the resolver during that await does not invalidate confirmation. Add a fresh same-principal authority check after the context work, before releasing query data.
I checked current, confirmContext, confirmAuthoringContext, and the query revocation tests. Those tests revoke at the second principal resolution, before this gap. A correctly composed HTTP/MCP host's final credential fence can prevent transport disclosure, but direct consumers of the exported report factory still encounter this risk; the application observation is explicitly not a credential-freshness check.
🔵 Issue 3 — Conflicting report-read authentication guidance
docs/EVIDENCE_REPORTS.md:55 · nit · identified by openai/gpt-6.1-sol
A host following the evidence-report guide must still refresh credentials before and after every report-port read, even though the updated agent API and workflow explicitly permit a request-local read group. This leaves consumers with contradictory composition requirements and can preserve the redundant authority I/O this change is intended to avoid.
The introductory paragraph still says wrappers must revalidate around every awaited report-port call. Update it to distinguish the permitted read-group alternative from the mandatory fresh write guards, preferably by linking to the exact boundary requirements in AGENT_API.md.
I compared this paragraph with the changed authentication sections in docs/AGENT_API.md, docs/AGENT_WORKFLOW.md, and packages/mcp/README.md; those documents consistently permit grouped pure reads.
🔵 Issue 4 — Stale release-summary date and receipt link
README.md:8 · nit · identified by openai/gpt-6.1-sol
Readers checking the README's release history are given a summary dated before the release it now claims, and the 0.1.2 verification link lands at the section whose first receipt is now 0.1.3.
The status block remains dated 2026-11-08, while the added 0.1.3 receipt in docs/BOOTSTRAP.md records qualification on 2026-11-09. Its existing 0.1.2 link also still uses #verified-knowledge-base-release rather than the new historical 0.1.2 heading or retained compatibility anchor. Refresh the date and pin that historical claim to its own receipt.
I checked the new Bootstrap headings and explicit current-verified-012-release compatibility anchor; the appropriate historical destinations exist.
🟠 Issue 5 — Application README retargets the retrieval contract link to unpublished main and keeps a stale v0.1.2 claim
packages/application/README.md:213 · risk · identified by z-ai/glm-5.3-flash
A host composing the verified release follows packages/application/README.md's retrieval pointer and implements candidate-only behavior against released packages.
- Line ~213 was changed from the tag-pinned
https://github.com/pegma-dev/knowledge-base/blob/v0.1.2/docs/RETRIEVAL.mdtohttps://github.com/pegma-dev/knowledge-base/blob/main/docs/RETRIEVAL.md, presented as "the exact API, limits, authority/reference fences, and evaluation boundary". ThemainRETRIEVAL.md this PR edits now documents the unpublished0.1.4maxBatchesparameter; a host building against the verified0.1.3artifacts and passingmaxBatchesper that linked contract gets theirrepairArticleIndex/repairRetrievalPagecalls rejected (objectInputthrowsTypeErroron the unknown field in the released code). - The same file still opens the section with "Existing versioned documentation links below describe the verified
v0.1.2release" (line 17) while the very next sentence (added by this PR) states the verified release isv0.1.3and the top-of-file link (line 12) still pins RETRIEVAL.md atv0.1.2. The file now contradicts itself: one sentence names 0.1.2 as verified, the next names 0.1.3, and the two retrieval links in the file point to different refs (one tag-pinned, one movingmain).
This sits directly against the file's own rule two paragraphs later: "The versioned contract references remain tag-pinned; the DEVELOPMENT link is a source-reader fallback" — the changed link is presented as the normative reference, not the fallback. Evidence: the diff hunk at packages/application/README.md lines 208-215 changed exactly this URL; the surrounding sentences quoted above are in the current checkout. Fix by pinning the line-213 link to v0.1.3 (or explicitly marking it as the DEVELOPMENT fallback) and updating the line-17 sentence to 0.1.3.
🔵 Issue 6 — Garbled "D1 Free50" term in the MCP README performance disclaimer
packages/mcp/README.md:115 · nit · identified by z-ai/glm-5.3-flash
packages/mcp/README.md line 115 reads "Fewer repeated reads do not establish a D1 Free50, CPU, physical-row or latency guarantee". Everywhere else this PR and the repo express the same disclaimer as "Workers Free 50-query" (README.md line 57, docs/EVIDENCE_REPORTS.md line 118, docs/HOST_COMPOSITION.md line 220) or "D1 query". "D1 Free50" is not a term defined anywhere in the repo; a reader cannot tell whether it means the 50-query/day Workers Free allowance, a D1-specific quota, or a typo. Cost: the README's central no-acceptance-claim disclaimer uses an undefined term, weakening the precise gating language this repo otherwise maintains. Fix: "a Workers Free 50-query / D1" or matching the phrasing used in docs/AGENT_API.md ("a D1 query, CPU, physical-row or wall-clock allowance").
🔵 Issue 7 — Missing spaces in two new test failure messages
tests/free-retrieval-step.test.ts:81 · nit · identified by z-ai/glm-5.3-flash
tests/free-retrieval-step.test.ts introduces two failure diagnostics with words run together: "Bounded synthetic article repair made no convergence within48 steps" (in converge, ~line 81) and "Repair barrier exceeded10seconds" (in reached, ~line 98). These strings surface verbatim when the bounded-repair convergence loop or the 10-second barrier guard fails, making the actual step count / timeout harder to read in CI logs. Cost is limited to diagnostics readability. Fix: "within 48 steps" and "exceeded 10 seconds".
|
r1-3: Addressed in r1-4: Addressed in Actual Node 24.18.0 types and all 93 report-query tests passed against real Memory, Azurite and D1, including all 48 new race cases. Formatting passed. Fresh full current-head Node 22/24 CI remains required before merge. |
|
@codex review |
|
@codex security review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: latest-commit (commit-range)
Mode: verify
Commit: e046afd7310d23f6bda4347d0c04df60a49d9251
Judge: openai/gpt-5.6-luna
Cost: $0.1167 (lanes $0.1165 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 29.6s, 116430+1115 tokens (92402 cached), 5 tool round(s), via Azure, $0.0885)z-ai/glm-5.3-flash: ok (0 finding(s), 271.5s, 552109+25974 tokens (468747 cached), 17 tool round(s), via OpenInference, $0.0280)
Round 2 resolution
- ✅
r1-1fixed correctly — Ledger reset missed during context confirmation: The query now rereads the ledger head and selected report after optimized confirmation or legacy context work, rejecting epoch/status changes and head-version drift before returning. New tests exercise reset with retained old report rows, completed reset/drain, and head-only changes across both paths and all store factories. - ✅
r1-2fixed correctly — Principal revocation missed during final query work: The query now callscurrent(access, evidenceSubmit)after its final awaited resource observations.currentchecks the same principal and every permission in the original restricted context against fresh authority, includingdraftRead, without replacing that context with owner authority. New tests cover principal suspension and permission revocation during both optimized and legacy final cont… - ✅
r1-5fixed correctly — Application README retargets the retrieval contract link to unpublishedmainand keeps a stalev0.1.2claim: The retrieval contract pointer is now pinned to verifiedv0.1.3rather than movingmain. The introduction explicitly identifies remainingv0.1.2links as historical contracts and distinguishes the unpublished0.1.4context/query guide from released documentation. - 4 nit finding(s) from earlier rounds retired (severity floor for follow-up rounds is
risk). - Open findings after this round: 0 (0 bug-severity).
No structured findings from the successful lane(s).
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
OpenRouter pull-request review
Verdict: clean
Scope: full-pr (full-pr)
Mode: verify
Commit: e046afd7310d23f6bda4347d0c04df60a49d9251
Judge: openai/gpt-5.6-luna
Cost: $0.6286 (lanes $0.6285 + judge $0.0001)
Lanes
openai/gpt-6.1-sol: ok (0 finding(s), 51.0s, 434968+2301 tokens (332791 cached), 4 tool round(s), via Azure, $0.34)z-ai/glm-5.3-flash: ok (0 finding(s), 383.8s, 7028553+54369 tokens (6584832 cached), 50 tool round(s), via Together, $0.29)
Round 3 resolution
- No prior findings were open.
- Open findings after this round: 0 (0 bug-severity).
No structured findings from the successful lane(s).
Governed authoring currently repeats complete article, policy and evidence reads across one request, while index repair can spend several transaction attempts inline. Add an operation-local authoring observation/confirmation pair and a body-free report query, prepare complete immutable read waves before I/O, and allow retrieval repair to resume with an explicit transaction-attempt budget.
The observations are opaque, application/actor-bound and single-use. Current permission and A/C/V head checks still fence reads and writes; complete admitted proof history and exact replay acknowledgements remain intact. The optional report/context path preserves the existing five MCP tools, three scopes, wire schemas and legacy factory behavior. Explicit repair bounds preserve durable partial progress and current-authority checks; omitted bounds retain existing behavior.
All four synchronized packages are the unpublished
0.1.4candidate. Review, trusted publication, exact registry verification and host acceptance remain separate gates. Provider batching and bounded attempts do not establish universal Workers Free query, CPU or traffic acceptance.Validation for R2: