fix(marketplaces): allow trusted feed key rotation#108342
Conversation
49292a4 to
4aa135f
Compare
|
Codex review: needs maintainer review before merge. Reviewed July 20, 2026, 5:15 PM ET / 21:15 UTC. Summary PR surface: Source +39, Tests +120. Total +159 across 3 files. Reproducibility: yes. for the reported regression: the submitted real SQLite scenario creates Q2, Q3, and Q4 key transitions and demonstrates acceptance, rollback rejection, and retained-snapshot reload. I could not independently execute that path in the read-only command sandbox. Review metrics: 1 noteworthy metric.
Stored data model Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review detailsBest possible solution: Document and approve a narrow policy that retained metadata from a previously accepted signed feed may enforce rollback protection after ordinary key rotation, while defining the explicit revocation or emergency-recovery path that can invalidate that metadata. Do we have a high-confidence way to reproduce the issue? Yes for the reported regression: the submitted real SQLite scenario creates Q2, Q3, and Q4 key transitions and demonstrates acceptance, rollback rejection, and retained-snapshot reload. I could not independently execute that path in the read-only command sandbox. Is this the best way to solve the issue? Unclear until a maintainer confirms the revocation policy. Using authenticated persisted monotonic state is a focused solution to ordinary key rotation, but it must not silently define emergency key-revocation behavior. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 21bfc75648d1. Label changesLabel justifications:
Evidence reviewedPR surface: Source +39, Tests +120. Total +159 across 3 files. View PR surface stats
Security concerns:
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (3 earlier review cycles) |
4aa135f to
607890c
Compare
|
Durable proof is now on the current head. The regression uses the real SQLite snapshot store under Node 24.15.0 / SQLite 3.51.3: Q2 sequence 8 persists, Q3 sequence 9 survives key rotation, Q4 sequence 7 is rejected, and the Q3 snapshot remains readable. This run exposed and fixed a real read-path defect where accepted monotonic metadata was written but not reconstructed from SQLite. Full catalog suite: 37/37. @clawsweeper re-review |
607890c to
6286335
Compare
|
Rebased onto upstream |
6286335 to
6f45b91
Compare
|
CI diagnostics on |
6f45b91 to
651b415
Compare
|
Restacked onto upstream @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
5620aed to
30f0642
Compare
Summary - compare newly verified signed feeds against persisted accepted monotonic metadata - avoid requiring an old snapshot to verify under a newly rotated key merely to perform rollback comparison - retain fail-closed fallback behavior when the old snapshot does not satisfy the current trust policy - restore persisted monotonic metadata when signed snapshots are loaded from SQLite - cover successful key rotation, lower-sequence rejection, and retained snapshot fallback through the durable store - preserve merged #110037 policy: live feeds require standard DSSE while persisted beta snapshots remain readable ## Real behavior proof Behavior or issue addressed: A newly valid higher-sequence hosted feed could be rejected after trusted signing keys rotated because OpenClaw reverified the old snapshot with the new key before comparing sequences. The durable proof also exposed that SQLite stored accepted monotonic metadata but dropped it when reconstructing a snapshot. Real environment tested: Windows checkout using Node 24.15.0 and SQLite 3.51.3. The production hosted-catalog loader and real SQLite snapshot store were exercised with a temporary state database and generated Ed25519 Q2/Q3/Q4 key pairs. Network responses used the existing guarded-fetch harness so the signed bytes and trust transitions were deterministic. Exact steps or command run after this patch:
powershell & "$env:LOCALAPPDATA\pnpm\store\v11\links\@\node\24.15.0\4b86559dec5f3e7def9c585f1a41d64f741f7930cf3b31f21bf2b4e73beef981\node_modules\node\bin\node.exe" scripts/run-vitest.mjs src/plugins/official-external-plugin-catalog.test.ts --runThe durable regression: 1. Opens the real SQLite marketplace state store. 2. Accepts sequence 8 signed byacme-root-2026-q2. 3. Reopens the persisted snapshot, replaces configured trust withacme-root-2026-q3, and accepts sequence 9. 4. Replaces configured trust withacme-root-2026-q4and rejects sequence 7. 5. Reloads the retained sequence 9 snapshot under the Q3 policy. Evidence after fix: The full catalog suite reported 46 tests passed. The key-rotation case persisted each accepted revision through SQLite and verified the retained snapshot after the rollback attempt. Observed result after fix: Sequence 9 was accepted under the rotated Q3 key. Sequence 7 under Q4 failed closed with the rollback diagnostic. Sequence 9 remained persisted and readable under its accepted Q3 policy. Persisted signed snapshots now reconstruct their accepted monotonic record from the authenticated body; unsigned rows cannot acquire that authority. What was not tested: A production publisher endpoint or production key-management system was not used. The proof intentionally uses generated keys and deterministic guarded network responses while exercising the real production loader and durable SQLite implementation. ## Validation - full hosted catalog suite on Node 24.15.0 / SQLite 3.51.3: 50 passed - targetedoxfmt --check- targeted type-awareoxlint-git diff --check- finalcodex review --base upstream/main: no actionable correctness issuesMaintainer decision
Approved for ordinary hosted-feed key rotation. Previously accepted signed-feed monotonic metadata may remain rollback-authoritative across routine configured-key rotation, while every newly fetched feed must verify under the current trust set. Emergency key compromise or revocation is a separate operator recovery path that clears or rebuilds local hosted-feed snapshot state.