feat(schema): add brief stage context to get_products#5521
Conversation
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
a16a4f4 to
2ea41a2
Compare
There was a problem hiding this comment.
Clean additive change. Optional field on additionalProperties: true request, scoped to brief/refine with wholesale-ignore in prose — old clients and old sellers both stay valid, so minor is the right shape.
Things I checked
- Wire impact matches the changeset.
brief_stageis an optional property; the request top level isadditionalProperties: trueand onlybuying_modeis required. No existing field, enum, or required-list touched.minoris correct (playbook L331: "add optional fields").ad-tech-protocol-expert: sound. - Schema construction.
planning_horizonusesanyOf: [{required:[start]},{required:[end]}]+additionalProperties:falseas siblings —additionalPropertiesdoesn't reach into theanyOfbranches (which carry onlyrequired, noproperties), so they compose cleanly. Emptyplanning_horizon: {}correctly fails both branches.code-reviewer: clean. - Test assertions are valid for the AJV in use. Missing-
phaseasserts substringphase(frommust have required property 'phase'at/brief_stage); empty-horizon assertsmust match a schema in anyOf— both AJV v8 defaults. BothexpectInvalidcases fail purely onbrief_stageconstraints, not on thebrief-required rule (which is prose-only, not schema-enforced), so neither passes for the wrong reason. - Schema↔docs coherence.
get_products.mdxtable (phaseYes,start/endNo*,response_deadlineNo), the footnote, the enum prose, and the MUST/MUST NOT seller rules match the schema one-to-one. The docs JSON example is byte-for-byte the passingvalidateExamplefixture. - No oneOf concern. Top level is
allOf+ one wholesaleif/then;brief_stageis a plain nested object, no discriminated union added. No baseline ratchet needed. - Right boundary on commitment. Field text keeps advisory metadata out of pricing/eligibility/availability and points commitment back at proposal
finalizeandcreate_media_buy. Mirrors the existingpush_notification_configscoping precedent in the same file.
Follow-ups (non-blocking — file as issues)
- Docs row types the field as
BriefStage(a named type), but the schema defines it inline. AdCP convention for reusable typed objects is a$ref(BrandRef→account-ref.json). It's not reused yet, so inline is fine — but if another task is expected to reference brief stage later, extract to/schemas/core/brief-stage.jsonnow to match prior art (ad-tech-protocol-expert). - The "buyer intent" → "product discovery mode" rewording is partial: the top-level and
buying_modedescriptions were changed, but therefinedescription still says "the buyer expressing intent to commit." Cosmetic, but if retiring the overloaded term was the goal, the pass is incomplete.
Minor nits (non-blocking)
- Loose error-substring assertion.
tests/example-validation-simple.test.cjsmissing-phase case asserts['phase']— would also match an unrelated error mentioningphase.["must have required property 'phase'"]is tighter. Non-blocking.
On test-plan honesty: the PR notes test:snippets still fails on that page, but the failures are pre-existing (missing local adcp Python package, a CJS named-export issue, a TS-parsed-as-JS assertion, a property_list timeout) — not the new field, which is schema-backed and passes test:json-schema. Worth noting the pre-commit hook was bypassed on an unrelated conformance-end-to-end flake; the wire-touching path here is covered by the schema and example tests.
LGTM. Follow-ups noted below.
|
Closing because this narrower brief-stage shape has been subsumed by PR #5523. The replacement model uses optional |
Summary
Adds optional
brief_stagetoget_productsrequests so buyers can declare where a brief sits in the pre-buy lifecycle without using the overloadedintentlanguage.The new context includes:
phase:exploratory,planning, oractive_sourcingplanning_horizon: advisory ISO date range for the opportunityresponse_deadline: advisory seller response/proposal update deadlineThe schema and docs make absence mean unknown, scope the field to
brief/refinerequests, require sellers to ignore it forwholesale, and prohibit usingbrief_stagefor price, rate card, product eligibility, inventory availability, or buyability.Expert review follow-up
Ran protocol, product/operator, and docs expert review. Follow-up changes tightened:
response_deadlineso it cannot imply firm pricing, availability confirmation, inventory hold, finalization, or commitmentactive_sourcingso it only means requesting seller responses/proposalscreate_media_buystay separatebrief_stage, missingphase, and emptyplanning_horizonFinal expert confirmation found no remaining protocol, product/operator, or docs clarity issues.
Validation
npm run test:schemasnpm run test:examplesnpm run test:json-schemanpm run build:schemasnpm run test:json-schema -- --file docs/media-buy/task-reference/get_products.mdxnpx --yes @changesets/cli@^2.31.0 status --since=origin/mainnode scripts/check-pr-title.cjs "feat(schema): add brief stage context to get_products"Notes:
npm run test:snippets -- --file docs/media-buy/task-reference/get_products.mdxstill fails on pre-existing executable snippets in that page: missing local Pythonadcppackage, an existing CommonJS named-export issue, an existing TypeScript non-null assertion parsed as JavaScript, and an existingproperty_listsnippet timeout. The new JSON example is schema-backed and passedtest:json-schema.npm run test:unitfailed in unrelatedserver/tests/unit/conformance-end-to-end.test.ts(evicts the session when the adopter disconnects, expected session to be undefined after 100ms).