Skip to content

feat(models): publish v2 catalog beside unchanged v1 - #156530

Merged
vincentkoc merged 2 commits into
mainfrom
feat/catalog-v2-publisher-20260923
Sep 23, 2026
Merged

vincentkoc merged 2 commits into
mainfrom
feat/catalog-v2-publisher-20260923

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Sep 23, 2026 •

Copy link
Copy Markdown
Member

What Problem This Solves

The publisher only emits v1's provider-nested catalog and detached pricing map. This adds an optional --out-v2 <file> beside the existing --out <v1-file>, producing both versions from one assembly and cached upstream snapshot.

User Impact

v1 output remains byte-for-byte unchanged for identical inputs. v2 contains supported metadata rows with native id first, explicit provider, and inline USD-per-million-token pricing. It preserves partial rates and context tiers, distinguishes authoritative free prices from zero placeholders, and keeps unknown or withdrawn-price models without inventing rates.

Unmatched lookup-only prices are omitted from v2. The frozen audit of 1,062 metadata rows preserves all 764 resolvable catalog tuples; 298 remain without known pricing. It excludes 14,458 additional lookup keys, without claiming those keys have observed usage. v1 keeps them.

Why This Change Was Made

Pricing provenance is recorded where the existing enrichment policy selects it. Source identifiers remain extensible; hydrated prices are never mislabeled as manifest prices. Both outputs validate and pass size checks before writes, and missing output directories are created. Paired publication belongs to the hosting commit/deployment.

Depends on the merged schema in #156518 (squash 6b3eb02). Related to #156507. v1 keeps its existing minimum client version. v2 omits a release floor until its first supporting release is assigned; schemaVersion: 2 identifies its compatibility boundary. This change does not switch clients or deploy a catalog.

Evidence

  • Restacked onto the landed schema without source or test changes. The full-index publisher patch before and after restacking has SHA256 395e6fc484b842318bc1bb45136e189a9d73aaa3e2437b9e1b03558b95cd5127; independent review confirmed all four schema/publisher source and test files are byte-identical. Existing focused proof applies. Final-head CI passed all 107 jobs with 18 intentional skips: https://github.com/openclaw/openclaw/actions/runs/35873576038. Both required openclaw/ci-gate checks passed; exact head 62b245c was squash-merged as a87f01c.
  • Single-worker timing: pnpm test test/scripts/publish-model-catalog-v2.test.ts --maxWorkers=1 passed all 4 tests in 2.663 seconds wall time (Vitest duration 1.53s). The 14 schema tests also passed in 2.541 seconds wall time. Measured on Blacksmith Testbox, Linux/Node24.19.0, at exact published head c959f023611659b06fd556aa93ce75b16dcafb16, with all source/test/package/lock hashes verified before and after. Setup/hydration excluded. Run: https://github.com/openclaw/openclaw/actions/runs/35871382280. This addresses the ClawSweeper timing rank-up item; merge CI remains separate.
  • All 77 focused publisher tests passed (73 existing and 4 new) on Blacksmith Testbox. New coverage exercises paired output, unchanged v1 bytes, one metadata/pricing fetch, provenance, known zero, withdrawal, partial/tier rates, tuple identity, deterministic key order, unmatched-price pruning, dry-run, and failed-source output preservation.
  • Scoped autoreview and independent owner/hosting contract review found no actionable issue.
  • Changed gates passed typechecking, formatting, patch guards, declaration/exports checks, and Knip. Final affected proof passed all 14 schema tests, 4 publisher tests, targeted production/test lint, formatting, assertion safety, and diff checks: https://github.com/openclaw/openclaw/actions/runs/35866741685. The small test-lint follow-up was independently reviewed and its 4 tests/lint/format passed on exact candidate bytes before commit.
  • The final hosting pair was genuinely generated once from clean landed main d9bf2a3, a descendant of publisher squash a87f01c. Both files record that actual source and generatedAt: 1790174816318 (2026-09-23T14:46:56.318Z). This is newer than the immutable consumer build at 2026-09-23T14:25:49.105Z in the still-unmerged feat(models): use the v2 catalog and price each route by who bills it #156535. Native Blacksmith Testbox run: https://github.com/openclaw/openclaw/actions/runs/35876085332. Clean source and publisher/schema/package/lock/workspace/workflow/loader hashes were verified before and after; no commit or timestamp override was used.
  • The final pair contains the same 1,065 model tuples and 44 providers. v2 has 767 known prices (766 positive, 1 known free), 289 unknown, and 9 unavailable; 14,500 unmatched v1 lookup keys are omitted. Both outputs validate below 4 MiB; v1 is 2,475,651 bytes and v2 is 566,752 bytes.
  • Final artifact SHA256: v1 66c21b02feac782df4817fe3d6f9eb6e2feb7c42a023495de72f4de7558be05e; v2 64557847de7598c0a7a72cf08c8fff187794238a0697f8c7888d6ec98e69799f. Native download hashes match; the hosting owner receives the unchanged bytes.
  • Production delta: +130/-6 lines; tests: +243 lines. The added production code owns the second versioned artifact and records pricing-selection facts without a second pricing policy.

@vincentkoc vincentkoc self-assigned this Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added scripts Repository scripts size: M labels Sep 23, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 23, 2026
@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 23, 2026, 10:28 AM ET / 14:28 UTC (Revision 3).

ClawSweeper review

What this changes

Adds an optional v2 model-catalog output with inline pricing alongside the existing v1 output, generated from the same upstream snapshot.

Merge readiness

✅ Ready for maintainer review

Keep open: the publisher remains necessary, and the reviewed patch has no blocking correctness findings. Verified artifact contents and unchanged source bytes support carrying the prior proof forward.

Priority: P2
Reviewed head: 62b245cecc98e3c32e1b998db2c518f934751dd0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused implementation with verified real artifacts, useful boundary tests, and no blocking findings.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (linked_artifact): The reported real publisher run produced both inspected artifacts with matching hashes, generation identity, model metadata, and known rates; its production bytes match the reviewed head. Separate v2 output and unchanged v1 generation establish compatibility without an existing-state migration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (linked_artifact): The reported real publisher run produced both inspected artifacts with matching hashes, generation identity, model metadata, and known rates; its production bytes match the reviewed head. Separate v2 output and unchanged v1 generation establish compatibility without an existing-state migration.
Evidence reviewed 8 items Introduced scope and compatibility: The pinned introduced patch adds opt-in v2 projection and serialization, records pricing selections without changing the selection policy, and validates both artifacts before writes. Existing v1 serialization and its minimum client version remain intact; paired deployment remains hosting-owned.
Still needed on current main: The fetched main publisher still emits only schemaVersion 1 and has no --out-v2 option. The merged schema prerequisite establishes the contract, not the publisher implementation.
Latest release check: Inspection of the supplied latest release commit also shows only the v1 publisher; this capability is not already supplied by v2026.9.5.
Findings None None.
Security None None.

How this fits together

The catalog publisher combines provider-plugin manifests with public model metadata and pricing feeds. It produces versioned JSON artifacts for hosting and subsequent OpenClaw catalog refreshes.

flowchart TD
  A[Provider manifests] --> C[Catalog publisher]
  B[Public metadata and prices] --> C
  C --> D[Shared snapshot and pricing selection]
  D --> E[Existing v1 artifact]
  D --> F[Optional v2 artifact]
  E --> G[Catalog hosting]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +243, Other +124. Total +367 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 243 0 +243
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 1 130 6 +124
Total 2 373 6 +367

Review metrics

Metric Value Why it matters
Publisher options 1 opt-in flag; 0 client-default changes --out-v2 adds a separate artifact without activating a client migration.
Paired-artifact parity 1,063 matching model tuples across 44 providers Independent artifact comparison confirms preserved metadata and known rates.

Root-cause cluster

Relationship: partial_overlap
Canonical: #156507
Summary: This publisher implements one bounded part of the catalog-v2 program; schema and client ingestion are separate steps.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep one publisher and pricing-selection policy, with explicitly versioned artifacts that preserve existing v1 consumers.

Do we have a high-confidence way to reproduce the issue?

Not applicable to a defect: this adds a versioned publication capability, and the supplied real generation is corroborated by inspected artifacts.

Is this the best way to solve the issue?

Yes. Extending the existing publisher and recording its pricing decisions avoids a second enrichment policy while preserving the v1 contract.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a5fe21a5e742.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded catalog-format improvement with an opt-in publisher path and unchanged existing client behavior.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (linked_artifact): The reported real publisher run produced both inspected artifacts with matching hashes, generation identity, model metadata, and known rates; its production bytes match the reviewed head. Separate v2 output and unchanged v1 generation establish compatibility without an existing-state migration.
  • proof: sufficient: Contributor real behavior proof is sufficient. The reported real publisher run produced both inspected artifacts with matching hashes, generation identity, model metadata, and known rates; its production bytes match the reviewed head. Separate v2 output and unchanged v1 generation establish compatibility without an existing-state migration.

Evidence

What I checked:

  • Introduced scope and compatibility: The pinned introduced patch adds opt-in v2 projection and serialization, records pricing selections without changing the selection policy, and validates both artifacts before writes. Existing v1 serialization and its minimum client version remain intact; paired deployment remains hosting-owned. (scripts/publish-model-catalog.mts:864, 62b245cecc98)
  • Still needed on current main: The fetched main publisher still emits only schemaVersion 1 and has no --out-v2 option. The merged schema prerequisite establishes the contract, not the publisher implementation. (scripts/publish-model-catalog.mts:86, a5fe21a5e742)
  • Latest release check: Inspection of the supplied latest release commit also shows only the v1 publisher; this capability is not already supplied by v2026.9.5. (scripts/publish-model-catalog.mts:86, ec9c1a13db89)
  • Review continuity: GitHub contents blob identities match the checkout for all four publisher/schema source and test files at previously reviewed c959f023611659b06fd556aa93ce75b16dcafb16. Publisher and schema production blobs also match generation commit 55d5902a9de680a1a7f5c67f6e768ea1f0c5803a. Local historical-object reads failed, so GitHub contents reads supplied these comparisons. The captured previous review has no findings; the body supplies the requested single-worker timing. (scripts/publish-model-catalog.mts, c959f0236116)
  • Inspected real paired artifacts: Read the artifacts at the hosting draft's pinned head and independently verified the reported SHA-256 values: v1 56db0f66a561fbd2a2106c03ddebff1d030b743ed167b1515c1c9ff87944b74c and v2 cd85ff1606afddbc66334460e24c3feeec723a344a9bf2704666528557dce85d. Both record generation 1790170178886 and the reported producer commit. Comparison confirms identical 1,063 model tuples, 44 providers, all metadata, and all known rates; v2 has 765 known, 289 unknown, and 9 unavailable prices. Artifact sizes are 2,468,706 and 565,860 bytes. Hosting evidence: feat(hosting): publish versioned v2 catalog catalog#6. (models/v2/catalog.json, 0d7d5d510c1c)
  • Focused behavioral coverage: The four new tests exercise paired publication, v1 byte equality with and without v2, authoritative zero and withdrawal, partial/tiered pricing, native tuple identity, deterministic ordering, source reuse, dry-run, and preservation on source failure. The captured body reports 77 focused publisher tests passing and 2.663 seconds single-worker wall time for the new file. No tests were executed during this read-only review. (test/scripts/publish-model-catalog-v2.test.ts:149, 62b245cecc98)

Likely related people:

  • unknown: The claimed source-line change could not be verified from bounded local history. (role: source history unknown; confidence: low)
  • Ayaan Zaidi: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (2 earlier review cycles)
  • reviewed 2026-09-23T13:29:03.597Z sha 55d5902a9de680a1a7f5c67f6e768ea1f0c5803a :: needs changes before merge. :: none
  • reviewed 2026-09-23T14:13:47.786Z sha c959f023611659b06fd556aa93ce75b16dcafb16 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added the proof: sufficient ClawSweeper judged the real behavior proof convincing. label Sep 23, 2026
Base automatically changed from feat/catalog-v2-schema-20260923 to main September 23, 2026 14:19
@vincentkoc
vincentkoc force-pushed the feat/catalog-v2-publisher-20260923 branch from c959f02 to 62b245c Compare September 23, 2026 14:20
@vincentkoc
vincentkoc marked this pull request as ready for review September 23, 2026 14:21
@vincentkoc

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Final head: 62b245c. This is a mechanical restack onto merged schema 6b3eb02. The full-index publisher patch and all schema/publisher source and test bytes match reviewed c959f023611659b06fd556aa93ce75b16dcafb16; independent restack review is clean. The PR body retains the real paired-artifact proof and measured single-worker timing. Please review this final head; no repair or merge automation is requested.

@clawsweeper

clawsweeper Bot commented Sep 23, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@vincentkoc
vincentkoc enabled auto-merge (squash) September 23, 2026 14:33
@vincentkoc
vincentkoc merged commit a87f01c into main Sep 23, 2026
211 of 212 checks passed
@vincentkoc
vincentkoc deleted the feat/catalog-v2-publisher-20260923 branch September 23, 2026 14:37
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash auto-merge.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 24, 2026
* feat(models): publish v2 catalog beside unchanged v1

* test(models): satisfy catalog publisher fixture lint
roboclaw-bot added a commit that referenced this pull request Sep 27, 2026
Apply explicitly requested #158863 / 09a6051,
crediting Ayaan Zaidi (obviyus). Reuse Vincent Koc's dormant parser (#156518)
and opt-in paired generator (#156530). Retain only the optional wire-schema
and negative-test compatibility from #156535, not runtime/client/store
activation, StandalonePricing infrastructure or billing policy.

Provider recommendations preserve order and trim/validate IDs against the
same provider. Invalid optional manifest lists are omitted; strict v2 rejects
invalid remote lists. V1 output excludes the field and keeps its released
contract. No bundled manifest or runtime/picker activates recommendations.

Fix the review-exposed paired-output failure: prepare both candidate/previous
sets before replacing final paths and retain cross-referenced recovery after
interruption or uncertain publication. Do not automatically roll back over
foreign replacements. Cleanup after success warns without claiming failure.
This is recoverability, not multi-file atomicity or power-loss durability.

Fixed-input actual default/priced v1 output remains byte-identical; v2 output
remains identical across the settlement repair, and the parser matches the
requested upstream source. 59 focused and165 caller cases pass; settlement
adds real boundary/interruption proof,13 paired tests and73 publisher tests.
Affected types, lint, format, MDX/docs links and frozen eb377ac ratchets pass.
Final independent P0-P2 review is scoped-clean on exact tree
2e67a78.

No SQLite schema, package version, dependency, runtime activation or public
publication change. Version remains2026.9.6 and fs-safe0.20.0. Requested npm
preflight/stable FRV still require their separate source/version/admission
gates; no CI run or platform clearance is claimed by this commit.

## Work sessions

- Original discussion, review and integration:
  https://team.openclaw.ai/chat/roboclaw/dashboard/db4d78ac-b19b-4f64-adfb-0ca7973a62e4
- Dormant catalog implementation and verification:
  https://team.openclaw.ai/chat/roboclaw/subagent/5bc0e124-d2e6-4193-9f9b-d2767d326b30
- Paired-output correction and verification:
  https://team.openclaw.ai/chat/roboclaw/subagent/90593a20-97bf-4134-9221-ff30d55a618a

Co-authored-by: Ayaan Zaidi <[email protected]>
Co-authored-by: Vincent Koc <[email protected]>
Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>
Co-authored-by: steipete <[email protected]>
Co-authored-by: jalehman <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant