[codex] Make signal coverage scalar optional#5102
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
LGTM. Surgical relaxation of an already-deprecated field; coverage_forecast is the authoritative discovery surface and the scalar stays fallback-only.
Things I checked
static/schemas/source/signals/get-signals-response.jsonandstatic/schemas/source/core/wholesale-feed-event.json: only therequiredarrays dropcoverage_percentage.type: number,minimum: 0,maximum: 100, anddeprecated: trueare preserved verbatim. Descriptions updated to namecoverage_forecastauthoritative.presence: "present"withoutsignal_valueis schema-legal perstatic/schemas/source/core/forecast-point-dimensions.json— the conditional only constrains the type ofsignal_valuewhen present, doesn't promote it to required. New test attests/schema-validation.test.cjs:662-679pins this shape.completeExclusiveCoverageRatesPartitionrewrite attests/schema-validation.test.cjs:787-796iterates low/mid/high, skips a level if every point omits it, fails if some points have it and others don't. Right invariant.- Changeset exists at
.changeset/signal-coverage-legacy-scalar.mdwithminor. Defensible —.changeset/4796-review-followups.mdis the precedent (dropping arequiredarray entry on a deprecated field shipped asminor). Field has been advertiseddeprecated: truesince #5088 landed in the same cycle, so strict consumers had a window. - Compliance YAML:
signal-marketplace/index.yamldrops thefield_present: signals[0].coverage_percentageassertion.signal-owned/index.yamlnever had an equivalent assertion (its validations at L134-153 only coversignal_agent_segment_id,pricing_options,context,signal_id.source) — symmetric with marketplace by construction.universal/schema-validation-signals.yamlnarrative correctly trimmed to schema-required fields. - No doc surface still calls
coverage_percentagerequired.
Follow-ups (non-blocking — file as issues)
- Strict-validator adopter-action row. Codegen consumers (Pydantic, quicktype, OpenAPI) will see the field flip required→optional and need fixture refreshes. Worth a row in
docs/reference/release-notes.mdxmatching the precedent set by #4796. - Storyboard assertions trail the narrative.
signal-marketplace/index.yaml:118andsignal-owned/index.yaml:118expected:blocks now describecoverage_forecastas the disclosure surface but neither validatessignals[0].coverage_forecastpresence. The prose moved ahead of the assertions. min_coverage_percentagerequest filter.docs/signals/tasks/get_signals.mdx:711still documents it as operating on the legacy scalar. With the scalar now optional, the filter's denominator semantics get muddier — a sentence on filter behavior when the scalar is absent would help.
Minor nits (non-blocking)
- Vacuous-pass on empty partition.
tests/schema-validation.test.cjs:787-796returnstrueif every point omits all of low/mid/high. Pre-existed in themid-only version, inherited here. TrackinganyLevelPresentand returningfalseif no level had numeric data on any point closes the gap. - Idiomatic clone.
tests/composed-schema-validation.test.cjs:732buildssignalListingCoreWithoutLegacyCoveragevia spread+delete;const { coverage_percentage: _legacy, ...rest } = signalListingCoreis one line. Pure style.
Approving on the strength of the surgical required-array trim plus the new low/high partition coverage. Safe to merge.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Makes deprecated
coverage_percentageoptional inget_signalsand wholesale signal feed payloads while keepingcoverage_forecastauthoritative for signal-level coverage. Updates signal docs, compliance storyboards, and schema tests to cover aggregate present buckets, low/high coverage bounds, and wholesale payloads without the legacy scalar.Validation
Ran
npm run test:schemas,npm run test:composed,npm run test:json-schema,npm run build:schemas,npm run build:compliance, precommit checks, pre-push storyboard matrices, and docs broken-link validation.npm run test:snippetsis still known-red for unrelated auth/live-fixture drift; tracked separately in #5100.Closes #5089.