Repository navigation
fix(catalog): gate released v3 readers and row loss; strict publisher guards - #197189
Conversation
… guards - catalog:compare-released --check: run every release that ships a reader for the candidate's wire version (v1/v2/v3) and fail on rejection or on any row the publisher wrote that the release drops, beyond the loss it already had on the last published file. --allow-row-loss accepts an intended loss. - publish-model-catalog: unknown keys under inference fail publish; providers offered only on non-chat auth scopes must mark rows inference.chat: false; per-feed 90% size warning; --skip-oversized-v1 keeps v2/v3 publishing; --previous* shrink guard (5% rows or any provider) with --allow-shrink. Co-authored-by: obviyus <[email protected]>
… guards OpenClaw-Publication: 7ce306ca-a43c-4826-a4bb-8facebe1b849
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds released-reader row-loss checks, strict inference validation, catalog shrink guards, and safe publication when oversized v1 output is skipped. Example: A v2 catalog contains 1244 models, but [email protected] accepts only 1243 after encountering an unknown pricing status.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it addresses concrete catalog publication failures, preserves the existing publication owners, and fixes the earlier write-safety finding; no introduced correctness blocker was found. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe catalog publisher turns plugin manifests and upstream metadata into versioned JSON feeds; the comparison CLI serves candidates to isolated released readers before deployment. flowchart LR
A[Plugin manifests] --> C[Catalog publisher]
B[Upstream metadata] --> C
C --> D[Versioned candidate feeds]
D --> E[Released reader sandbox]
E --> F[Acceptance and row loss gate]
D --> G[Recoverable file publisher]
Technical reviewBest possible solution: Land the guards through the existing tooling owners, then adopt the documented invocation in the catalog publication workflow. Do we have a high-confidence way to reproduce the issue? Current source establishes the per-reader shared worker copy and missing inference-key, shrink, and row-loss checks; the PR supplies real CLI output for the released-reader loss case, which this read-only review did not rerun. Is this the best way to solve the issue? The smallest complete repair strengthens the existing publisher and comparison CLI, stages their shared worker once, and reuses the existing recoverable writer instead of introducing another publication owner. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against d546d06688ef. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +297, Docs +22, Other +424. Total +743 across 12 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 11, 2026, 7:54 AM ET / 12:54 UTC (Revision 3). |
Readers spawn in the same tick; copying the worker module per spawn truncates
the file a sibling is loading, which then runs an empty module and exits 0
without run.json ("released reader failed ... (exit 0)" in scheduled publishes).
Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: e1bd317c-c35d-4681-b4d3-b8634fb803e6
With an oversized v1 and --skip-oversized-v1, one versioned output can remain; it went through the truncating direct writer, so ENOSPC or an interruption could destroy the previous file. The v1-only direct writer is unchanged. Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: 4639135f-c808-402d-9d88-74f6f5425b50
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
…ests Table-drive the gate verdicts, share one fake-release runner, fold the four inference fixtures and the shrink cases into single regressions, and merge the decisions suite into the guards suite on one fixture. Every regression still fails on the code it guards. Allocate the remaining +297 test lines. Co-authored-by: obviyus <[email protected]>
OpenClaw-Publication: 150f0f2a-8400-4290-87aa-60819c94b012
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Problem
The catalog v3 pre-flip audit found six publisher and guard gaps:
scripts/released-readers.mjsinopenclaw/catalog) checksv1/v2only and passes anyupdated|unchanged|freshstatus. 2026.11.5-beta.1 read a v2 file with one unknownpricing.statusasupdated, keeping 1243 of 1244 models. Every v3 reader salvages rows this way, so a status-only v3 guard would pass files that silently lose models.inferencepublishes, and every reader treats it as chat (audit fixture 61).inference(fixtures 16, 17, 18, 29, 60).released reader failed … (exit 0)and no parser error (Actions runs 42933322733, 42755763377, 42519989192, 42499756640). Each reader copied the worker module to one shared path just before spawning; the readers spawn in the same tick, so on Linux a sibling could load the truncated file, run an empty module and exit 0 withoutrun.json.Fix
pnpm catalog:compare-released --checkis the new publish gate. It sits next to the released-reader sandbox it drives.schemaVersion.validateAndSanitizeRemoteModelCatalogBundleV<N>; all releases read v1. A test pins those names inremote-catalog-bundle.ts.no v3 reader, skippedfor each release. The first release that ships a v3 reader is checked on every publish, with no list to update.--baseline(the last published file).--allow-row-loss <n>accepts one intended loss.--dumpformat (<release>-baseline.json/-candidate.json) is unchanged.Publisher (
scripts/publish-model-catalog.mts):inferencedeclarations fail on any key Zod would strip, at any depth, and the error names the path. Runtime and reader schemas are unchanged.onboardingScopesdefault totext-inference.inference.chat: false.chat(the schema requires it).--skip-oversized-v1leaves an oversized v1 unwritten and keeps the previous v1; v2/v3 still publish.--previous,--previous-v2and--previous-v3name the last published files.--allow-shrinkis given.Tests and proof
test/scripts/publish-model-catalog-guards.test.tsholds the publisher regressions:chat: falsefor media-only providers;--skip-oversized-v1;publish-model-catalog-decisionssuite is merged into this file on one shared fixture.catalog-compare-released.test.tscovers:--checkskipping v3 by name.tsgo:scripts, oxlint, format and the test-lines ratchet also pass.config/test-lines-allocations/197189-catalog-v3-publisher-guards.txt.shrink guard v1/v2/v3: 0.0% each.v1 bundle 3872069 bytes is 92.3% of the 4194304-byte client limit.--checkagainst the released tarballs (2026.11.3, 2026.9.37, 2026.11.5-beta.1) in a sanitized environment:v2-11-unknown-rowfails the same way.no behavior changeon all three releases.--checktakes 5–13 s per feed with cached installs.Unverified: the v3 reader path cannot run end to end until a release ships a v3 reader. The detection rule is pinned by a test, and the verdict logic is unit-tested.
What
openclaw/catalogmust change--previous ../models/v1/catalog.json --previous-v2 ../models/v2/catalog.json --previous-v3 ../models/v3/catalog.json --skip-oversized-v1. Add--allow-shrinkonly through a manual dispatch input.v1 v2 v3on every run. Skip a feed whosecatalog.next.jsonis absent:::error::lines are already annotations.--allow-row-loss <n>can be a dispatch input.released-readers.mjscan be deleted.models/v1/catalog.next.json: keep the current v1 and move only the feeds that were written.Size: production about +400 lines, tests +297 net (allocated), docs +24. The noisy 2 MiB warning is removed.