Skip to content

feat(contract): project-scoped contract batch 1 (analytics, datasets and metrics, certification, configuration-run reads) - #775

Merged
nimrodbusany merged 21 commits into
developfrom
feat/project-scoped-contracts-batch-1
Nov 27, 2026
Merged

nimrodbusany merged 21 commits into
developfrom
feat/project-scoped-contracts-batch-1

Conversation

@nimrodbusany

Copy link
Copy Markdown
Contributor

feat(contract): project-scoped contract batch 1 (analytics reads, datasets and metrics, certification, configuration-run reads)

One combined contract change so the backend can re-pin once. Each family is described in its own changelog.d/ fragment.

Ticket: none (project-scoped canonical contracts, batch 1)
Security note: contract-only; new error bodies are closed (fixed codes and text, no client values echoed); request strings in the new certification contracts are bounded
Spine-Trail: st_0d23d1095dd4

What changes

  • Analytics reads (breaking, pre-release, acknowledged). Six project analytics reads move to /api/v1/projects/{project_id}/analytics/... and keep their operation ids; the old /api/v1/analytics/... entries are removed. The /api/v1beta/... analytics operations are unchanged.
  • Datasets and metrics (additive). Project-scoped dataset paths under /api/v1/projects/{project_id}/datasets/..., and metric.* operations for project and library metrics. Each unscoped dataset path that has a project-scoped replacement stays and is marked deprecated, with removal unscheduled.
  • Group run query (additive). experiment_group.query_group_runs declares its idempotency 409 responses (idempotency_conflict, idempotency_in_progress).
  • Certification (additive). Project-scoped certificate build-session readiness and abandonment, and process-record preparation, verification, retrieval and finalization. Certificates that carry a runlineage: reference stay on the existing certification routes, which are unchanged.
  • Configuration-run reads (additive) and alias removal (breaking, pre-release, acknowledged). Configuration-run measurement and status reads on the run's own reference; the two run-owned configuration aliases are removed from the contract.

Rollout notes

  • Operation ids equal the backend's operation ids by convention, including on the new canonical paths.
  • New paths that the backend does not serve yet are listed in the backend's pending-route allowlist when it re-pins to this contract; the backend moves for those families follow in their own changes.
  • The backend keeps serving the legacy /api/v1/experiment-runs/runs/{id}/configurations routes, which the portal still calls, until a later backend change retires them after the portal moves.
  • Analytics: the backend move lands in the same backend change as the re-pin to this contract; its release waits for the Python and JavaScript SDK updates.

Checks

  • scripts/local_gate.sh: passed (9023 passed, 2 skipped).
  • scripts/compile_changelog.py --check: 13 fragments valid.
  • scripts/breaking_schema_check.py --check --base-ref origin/develop: no unacknowledged breaking changes; the acknowledged ones are the analytics path moves, the alias removals and the group problem union gaining its two idempotency variants.
  • Parity and schema reachability regenerated with their generators; operation ids unique (307).
  • The pinned certification/certification_endpoints_v0.json is unchanged.

Review receipt

  • Each family passed its own independent model reviews before integration. The combined head had a final independent model review: one finding about the breaking-check acknowledgement format is a property of the checker and goes to its own change (the reviewer accepted that disposition); three changelog wording findings were fixed; final verdict: ship.

🤖 Generated with Claude Code

nimrodbusany and others added 20 commits November 27, 2026 04:56
… paths, keeping their operation ids

The six project analytics reads (under /api/v1/projects/{project_id}/analytics:
summary, pricing-catalog and the four dashboards) take the operation ids they
had on their old paths. The six old analytics-path entries are removed from the
contract as a reviewed breaking change, acknowledged in the breaking-change
allowlist; the backend retires them. Request, query and response schemas are
unchanged. Evaluator promotion is not part of this change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…contract

Adds canonical /api/v1/projects/{project_id}/... paths for 16 dataset and
dataset-version operations, reusing their request, response and error bodies,
with the backend operation ids as operationIds; the old unscoped paths are
marked deprecated and name their successor. Tenant-level lookups stay unscoped.

Adds the metric contract: project-scoped list and create, tenant-library list
and create, and get, update (PATCH) and delete by an opaque metric_ref. Write
bodies are closed and exclude evaluator fields (422 on violation). The legacy
measure list, get, delete and default-provisioning routes are deprecated; the
evaluator-capable legacy writes stay until the evaluator contract lands.

Spine-Trail: st_1804d64b88c6
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, 422 and 404 bodies; fragment refs resolve in the validator

The metric response uses the resolver scope values (project, shared, builtin),
requires project_id for project-owned rows, carries metric_ref, unit and version,
and reports domain and agent_types in the backend shape. Both metric lists
declare a collection body bound to the metric schema. The write 422 and the item
404 are closed bodies with fixed codes and messages. Write bodies accept unit and
version and no longer accept is_custom. The schema validator resolves
file#/pointer references, so the dataset-example update bodies validate.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d is always a number

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…n query

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…s under project paths

Add-only: new contracts; no existing entry changes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… codes and text for process-record retrieve and conflicts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…c configuration-run references; discriminated retained/not-retained companion; closed fallbacks

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ssuances; runlineage certificates stay on the existing routes

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…NMAPPED; define present primary metrics

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ration aliases retire

Adds GET /api/v1/projects/{project_id}/configuration-runs/{configuration_run_ref}/measurement
(operation id configuration_run.get_configuration_run_measurement): the stored measures of one
configuration run as one bounded, cursor-paged read, with a new response schema.

Removes the two run-owned configuration aliases under /api/v1/experiment-runs/runs/..., which
duplicated the canonical experiment-run configuration-runs collection. The removal is
acknowledged in the breaking-change allowlist. Changelog entries are fragments under changelog.d/.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… two idempotency variants

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…its two closed problem variants

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… 409 its own fragment, combine the configuration-run reads, note deprecated dataset paths

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ject-scoped replacements

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nimrodbusany
nimrodbusany requested a review from a team as a code owner November 27, 2026 05:03
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@nimrodbusany
nimrodbusany added this pull request to the merge queue Nov 27, 2026
Merged via the queue into develop with commit 29cd662 Nov 27, 2026
18 checks passed
@nimrodbusany
nimrodbusany deleted the feat/project-scoped-contracts-batch-1 branch November 27, 2026 07:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant