You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First slice of the decentralized fine-tuning plan: make a versioned dataset a first-class type=dataset ServiceOffer so the existing controller→Middleware→HTTPRoute→ForwardAuth→catalog pipeline publishes and gates it with no new serving code. This PR is declarations + pipeline glue + parity tests only — it deliberately does not build the dataset server, version log, or download client (later phases).
What it adds
Surface
Change
CRD (internal/monetizeapi/types.go)
dataset added to spec.type enum; new ServiceOfferDataset{manifestHash, version, fileHash, sizeBytes} spec block (mirrors ServiceOfferAgent); PriceTable.PerMB; IsDataset() helper
Verifier extras (internal/x402)
RouteRule.Dataset* fields; routeRuleFromOffer dataset branch (hashes lowercased); effectivePriceperMB case; mergeDatasetExtras() adds accepts[].extra.dataset{manifestHash,version,fileHash,sizeBytes} to the 402, wired after mergeAgentExtras
Catalog (internal/schemas, render.go)
dataset in the catalog type enum + perMB in priceUnit enum + 3 additive dataset* properties; ServiceCatalogEntry.Dataset* fields; populated in buildServiceCatalogJSON; perMB handled in offerPriceRawAndUnit + describeOfferPrice
Generated
serviceoffer-crd.yaml + zz_generated.deepcopy.go regenerated via just generate (committed)
Deliberately unchanged (parity with http)
normalizeOfferType folds dataset → http render branch (a download isn't chat-completions) → generic 402 copy + bazaarGenericJSON. No bespoke datasetCopy() / chat schema. Dataset metadata reaches buyers only via extra.dataset.
No obol sell dataset CLI, no server, no download/versionlog — those are P2/P3.
TestHTMLAware_DatasetUsesGenericHTTPCopy (pins the http-fold)
Status
just generate clean (no drift), go build ./... clean, go vet clean, full go test ./... green. Net diff: 15 files, +415/−11 (~190 LOC production, rest tests + generated).
…s wiring
P1 of the decentralized fine-tuning plan: make a versioned dataset a
first-class type=dataset ServiceOffer so the existing
controller -> Middleware -> HTTPRoute -> ForwardAuth -> catalog pipeline
publishes and gates it with no new serving code. Declarations + pipeline
wiring + parity tests only; the dataset server/versionlog/download client
are later phases.
- CRD: dataset enum value; ServiceOfferDataset{manifestHash,version,
fileHash,sizeBytes} spec block (mirrors ServiceOfferAgent);
PriceTable.PerMB; IsDataset(); regenerated serviceoffer-crd.yaml + deepcopy.
- x402: RouteRule.Dataset* fields; routeRuleFromOffer dataset branch
(hex digests lowercased); effectivePrice perMB; mergeDatasetExtras()
adds accepts[].extra.dataset{...} to the 402, wired after mergeAgentExtras.
- catalog: schema type enum + perMB priceUnit + additive dataset* properties;
ServiceCatalogEntry.Dataset*; buildServiceCatalogJSON population; perMB in
offerPriceRawAndUnit + describeOfferPrice.
- dataset folds to the http render branch in normalizeOfferType (a download
is not chat-completions): generic 402 copy + bazaarGenericJSON, no bespoke
copy. Version metadata reaches buyers only via extra.dataset.
- parity tests across CRD fields/block, mergeDatasetExtras, route-rule,
catalog surface + omitempty, bazaar, fallbackOfferType, describeOfferPrice
(incl. perMB precedence), and the HTML 402 copy fold.
go build/vet, full go test ./..., and just generate (idempotent) all green.
who's the buyer of datasets? what datasets are particularly suited to x402 + discover and purchase from an unknown party? what aspects need a new type versus selling it under http?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
P1 —
ServiceOffertype=dataset(declarations + pipeline wiring)First slice of the decentralized fine-tuning plan: make a versioned dataset a first-class
type=datasetServiceOffer so the existing controller→Middleware→HTTPRoute→ForwardAuth→catalog pipeline publishes and gates it with no new serving code. This PR is declarations + pipeline glue + parity tests only — it deliberately does not build the dataset server, version log, or download client (later phases).What it adds
internal/monetizeapi/types.go)datasetadded tospec.typeenum; newServiceOfferDataset{manifestHash, version, fileHash, sizeBytes}spec block (mirrorsServiceOfferAgent);PriceTable.PerMB;IsDataset()helperinternal/x402)RouteRule.Dataset*fields;routeRuleFromOfferdataset branch (hashes lowercased);effectivePriceperMBcase;mergeDatasetExtras()addsaccepts[].extra.dataset{manifestHash,version,fileHash,sizeBytes}to the 402, wired aftermergeAgentExtrasinternal/schemas,render.go)datasetin the catalogtypeenum +perMBinpriceUnitenum + 3 additivedataset*properties;ServiceCatalogEntry.Dataset*fields; populated inbuildServiceCatalogJSON;perMBhandled inofferPriceRawAndUnit+describeOfferPriceserviceoffer-crd.yaml+zz_generated.deepcopy.goregenerated viajust generate(committed)Deliberately unchanged (parity with
http)normalizeOfferTypefoldsdataset→httprender branch (a download isn't chat-completions) → generic 402 copy +bazaarGenericJSON. No bespokedatasetCopy()/ chat schema. Dataset metadata reaches buyers only viaextra.dataset.obol sell datasetCLI, no server, no download/versionlog — those are P2/P3.Tests (matching the other types)
TestServiceOfferCRD_Fieldsextended (enum + spec fields) + newTestServiceOfferCRD_DatasetFields(dataset block schema +perMB)dataset_extras_test.go: noop / all-fields / nil-extra / omit-zero / additive-preservation (mirrorsagent_extras_test.go)TestRouteRuleFromOffer_DatasetAdvertisesDatasetMetadata(lowercasing +perMBprice + all 4 fields)TestBuildServiceCatalogJSON_DatasetOfferSurfacesVersion+…_NonDatasetOmitsDatasetFields(omitempty)TestBuildBazaarExtensiondataset case;TestFallbackOfferTypedataset case;TestDescribeOfferPriceperMB(USDC + OBOL)TestHTMLAware_DatasetUsesGenericHTTPCopy(pins the http-fold)Status
just generateclean (no drift),go build ./...clean,go vetclean, fullgo test ./...green. Net diff: 15 files, +415/−11 (~190 LOC production, rest tests + generated).