Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelog.d/run-leaderboard.added.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- **`experiment_run.get_run_leaderboard`: run leaderboard declared on an experiment-run reference, paginated; the analytics-path GET deprecated (additive, contract only).** `GET /api/v1/projects/{project_id}/experiment-runs/{experiment_run_ref}/leaderboard` (operation id `experiment_run.get_run_leaderboard`) takes the server-issued reference `^experiment_run_[0-9a-f]{32}$` and the explicit project. Query: `limit` (default 20, maximum 100; this replaces the backend's historical default 50 and maximum 200 of the query), `cursor` (opaque sealed string, at most 512 base64url characters, bound to caller, project, run and query) and the backend's own `objective` (`weighted` default, `quality`, `cost`, `latency`), `weights` and `constraints` (JSON-object strings, at most 50 keys, bounded here to 8192 characters) and `request_count` (1 to 1000000, default 1); every other parameter, including retired `page` and `offset`, is the closed 400. The 200 is the new `analytics/experiment_run_leaderboard_response_schema.json`: `data` carries `run_id` (the experiment_run_ref), `ranking_basis` (`objective`, `weights`, `constraints`), `items`, `warnings` and `pagination` (`limit`, `next_cursor` nullable, `has_more` true if and only if `next_cursor` is non-null, required integer `total`), mirroring the backend leaderboard computation. Each item has `rank`, `trial_ref`, `composite_score`, `measures`, `confidence`, `risk_flags` and `recommendation`. The ranking is computed over the full eligible population and only then paginated: non-disqualified first, descending composite score, ranks assigned after that order, so `rank` is unique across pages. The cap of 10000 counts ALL the run's scoped configuration rows before any metric processing (above it the closed 503). The cursor also seals the `analysis_revision` (a per-run monotonic counter bumped in the same transaction as any ranking-relevant configuration or metric write, read from the same snapshot as the ranked rows); a stale or foreign cursor is the closed 400 `invalid_cursor`, echoing nothing. Measure values and scores are any finite JSON number; `warnings` are the builder's four forms and `risk_flags` its four tags. The 1 MiB limit is enforced on the serialized envelope (closed 503); the schema gives no static byte bound. Canonical projection omits config_id: internal configuration-run id (replaced by the shared persisted `trial_ref`, `^(trial_[0-9a-f]{16}|configuration_run_[0-9a-f]{32})$` (both issued formats), via `experiment_run_trial_ref_schema.json`; a run with any unissued reference is the closed 503). Canonical projection omits label: the builder falls back to `Trial <config_id>`, which embeds the internal id. `data.run_id` is the experiment_run_ref. Errors are the closed problems of `analytics/leaderboard_problem_schema.json`. `GET /api/v1/analytics/runs/{run_id}/leaderboard` stays declared, marked `deprecated` and naming the successor; its project beta mount `/api/v1beta/projects/{project_id}/analytics/runs/{run_id}/leaderboard` retires with it. `run_leaderboard_schema.json` and `run_leaderboard_response_schema.json` are unchanged. Removal follows the backend retirement PR after the client receipt. One name policy `^[^\x00-\x1f\x7f]{1,128}$` for every measure name wherever echoed (a query key outside it is the closed 400, a stored metric name outside it the closed 503 for the run); each weight is a number in [0, 1000] (a negative or larger weight is the closed 400, replacing the builder's silent exclusion of negative weights) and the composite is computed over weights normalized to sum to 1, so it is finite. At least one weight must be greater than 0 when weights is given (all-zero, e.g. `{"accuracy": 0}`, is the closed 400 with no echo; omitting weights keeps the default objective path). Each measure's min-max normalization is computed without overflow (values scaled by the largest absolute finite value before subtracting, or an equivalent exact method), so equal values score equal; the composite is a convex combination of normalized terms in [0, 1]. The ranking sorts by the unrounded binary64 composite; equal composites are ordered by the raw values of the weighted measures in descending weight order, ties between equal weights broken by measure name ascending (lexicographic), each compared in that measure's better direction, with a missing raw value ordered after any present value at that step; any remaining tie is broken by ascending trial_ref (lexicographic). The positive-weight rule applies only to a weights map supplied in the request; the response's effective `ranking_basis.weights` may be empty. The response description names both issued `trial_ref` formats.
- **`experiment_run.get_run_leaderboard`: run leaderboard declared on an experiment-run reference, paginated; the analytics-path GET deprecated (additive, contract only).** `GET /api/v1/projects/{project_id}/experiment-runs/{experiment_run_ref}/leaderboard` (operation id `experiment_run.get_run_leaderboard`) takes the server-issued reference `^experiment_run_[0-9a-f]{32}$` and the explicit project. Query: `limit` (default 20, maximum 100; this replaces the backend's historical default 50 and maximum 200 of the query), `cursor` (opaque sealed string, at most 512 base64url characters, bound to caller, project, run and query) and the backend's own `objective` (`weighted` default, `quality`, `cost`, `latency`), `weights` and `constraints` (JSON-object strings, at most 50 keys, bounded here to 8192 characters) and `request_count` (1 to 1000000, default 1); every other parameter, including retired `page` and `offset`, is the closed 400. The 200 is the new `analytics/experiment_run_leaderboard_response_schema.json`: `data` carries `run_id` (the experiment_run_ref), `ranking_basis` (`objective`, `weights`, `constraints`), `items`, `warnings` and `pagination` (`limit`, `next_cursor` nullable, `has_more` true if and only if `next_cursor` is non-null, required integer `total`), mirroring the backend leaderboard computation. Each item has `rank`, `trial_ref`, `composite_score`, `measures`, `confidence`, `risk_flags` and `recommendation`. The ranking is computed over the full eligible population and only then paginated: non-disqualified first, descending composite score, ranks assigned after that order, so `rank` is unique across pages. The cap of 10000 counts ALL the run's scoped configuration rows before any metric processing (above it the closed 503). The cursor also seals the `analysis_revision` (a per-run monotonic counter the backend increments in the same transaction as any insert or delete of the run's configuration rows, and any update that changes a configuration row's analysis content (its status, measures, summary_stats, experiment_parameters or metadata); writes that change none of these (timestamps, workflow metadata, public-reference backfill, identical rewrites) do not change it, read from the same snapshot as the ranked rows); a stale or foreign cursor is the closed 400 `invalid_cursor`, echoing nothing. Measure values and scores are any finite JSON number; `warnings` are the builder's four forms and `risk_flags` its four tags. The 1 MiB limit is enforced on the serialized envelope (closed 503); the schema gives no static byte bound. Canonical projection omits config_id: internal configuration-run id (replaced by the shared persisted `trial_ref`, `^(trial_[0-9a-f]{16}|configuration_run_[0-9a-f]{32})$` (both issued formats), via `experiment_run_trial_ref_schema.json`; a run with any unissued reference is the closed 503). Canonical projection omits label: the builder falls back to `Trial <config_id>`, which embeds the internal id. `data.run_id` is the experiment_run_ref. Errors are the closed problems of `analytics/leaderboard_problem_schema.json`. `GET /api/v1/analytics/runs/{run_id}/leaderboard` stays declared, marked `deprecated` and naming the successor; its project beta mount `/api/v1beta/projects/{project_id}/analytics/runs/{run_id}/leaderboard` retires with it. `run_leaderboard_schema.json` and `run_leaderboard_response_schema.json` are unchanged. Removal follows the backend retirement PR after the client receipt. One name policy `^[^\x00-\x1f\x7f]{1,128}$` for every measure name wherever echoed (a query key outside it is the closed 400, a stored metric name outside it the closed 503 for the run); each weight is a number in [0, 1000] (a negative or larger weight is the closed 400, replacing the builder's silent exclusion of negative weights) and the composite is computed over weights normalized to sum to 1, so it is finite. At least one weight must be greater than 0 when weights is given (all-zero, e.g. `{"accuracy": 0}`, is the closed 400 with no echo; omitting weights keeps the default objective path). Each measure's min-max normalization is computed without overflow (values scaled by the largest absolute finite value before subtracting, or an equivalent exact method), so equal values score equal; the composite is a convex combination of normalized terms in [0, 1]. The ranking sorts by the unrounded binary64 composite; equal composites are ordered by the raw values of the weighted measures in descending weight order, ties between equal weights broken by measure name ascending (lexicographic), each compared in that measure's better direction, with a missing raw value ordered after any present value at that step; any remaining tie is broken by ascending trial_ref (lexicographic). The positive-weight rule applies only to a weights map supplied in the request; the response's effective `ranking_basis.weights` may be empty. The response description names both issued `trial_ref` formats.
2 changes: 1 addition & 1 deletion changelog.d/run-pareto.added.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
- **`experiment_run.get_run_pareto`: run Pareto analysis declared on an experiment-run reference, paginated; the analytics-path GET deprecated (additive, contract only).** `metrics` keys use the shared measure-name class `^[^\x00-\x1f\x7f]{1,100}$` (the same as `x_measure` and `y_measure`, so names such as `review score` are valid); a stored metric name outside it makes the run's response the closed 503, never truncated or sanitized. The shared `trial_ref` accepts both issued formats, `trial_` plus 16 hex and `configuration_run_` plus 32 hex; every pattern in the report and Pareto schemas and in their query and path parameters ends in `$` (not the absolute end `(?![\s\S])`, because Pydantic v2's rust-regex engine refuses lookahead; trailing-newline hardening is applied by the Python-side validators). The cursor seals caller, project, run, query and `analysis_revision` (a per-run monotonic counter the backend increments in the same transaction as any insert, update or delete of the run's configuration rows or their metrics); a stale or foreign cursor is the closed 400 `invalid_cursor` (declared in the problem schema). Frontier ties break by ascending `trial_ref` (lexicographic) before ranks are assigned; dominated entries are ordered by ascending `trial_ref` (lexicographic). The 10000 cap counts ALL scoped configuration rows before any metric processing (above it the closed 503). Metric values are any finite JSON number (the earlier 1e15 bound is removed). `has_more` is true if and only if `next_cursor` is non-null. `warnings` are constrained to the builder's three tag forms. The deprecation names the full beta route `/api/v1beta/projects/{project_id}/analytics/runs/{run_id}/pareto`. `GET /api/v1/projects/{project_id}/experiment-runs/{experiment_run_ref}/pareto` (operation id `experiment_run.get_run_pareto`) takes the server-issued reference `^experiment_run_[0-9a-f]{32}$` and the explicit project. Query: `limit` (default 20, maximum 100), `cursor` (opaque sealed string, at most 512 base64url characters, bound to caller, project, run and query), and the backend's own `x_measure`, `y_measure` (1-100 characters, defaults `cost` and `quality`) and `request_count` (1 to 1000000, default 1) from the backend's query; every other parameter, including retired `page` and `offset`, is the closed 400. The 200 is the new `analytics/experiment_run_pareto_response_schema.json`: `data` carries `run_id` (the experiment_run_ref), `measures`, `shape`, `knee_ref`, `frontier_total`, `dominated_total`, `warnings`, `items` and `pagination` (`limit`, `next_cursor` nullable, `has_more` and a required integer `total`), mirroring the backend Pareto computation. The ranking, frontier, knee and shape are computed over the full eligible population (at most 10000 configurations; more is the closed 503) and only then paginated, ordered frontier first by ascending rank then dominated, with ascending `trial_ref` (lexicographic) as the stable tie-breaker; the historical 500/1000 truncation is replaced by pagination. At most 100 items per page, metrics at most 5 names. The 1 MiB limit (`x-max-response-bytes` 1048576) is enforced on the serialized envelope: the handler measures the final serialized bytes, sends those same bytes, and returns the closed 503 over the limit; the schema gives no static byte bound. Canonical projection omits config_id: internal configuration-run id (replaced by the run-scoped `trial_ref` of `analytics/experiment_run_trial_ref_schema.json`, `^(trial_[0-9a-f]{16}|configuration_run_[0-9a-f]{32})$`: `trial_ref` is the configuration run's issued public reference (sessions issue trial_ plus 16 hex, an issued reference is never re-minted, unique per tenant, NULL until the reference backfill). Two issued formats exist: trial_ plus 16 hex (issued by sessions) and configuration_run_ plus 32 hex (minted by the backend). Issued once, never re-minted, so it is stable across views, pages and deletion of other configurations. The internal id is never emitted. A canonical view of a run with any configuration whose reference is not yet issued is the closed 503 until the backfill completes (never a positional or synthetic stand-in)). Canonical projection omits project_id: the explicit URL project. Canonical projection omits run_id as a historical id: `data.run_id` is the experiment_run_ref. `dominated_by` is a `trial_ref`, never an internal id. The closed schema rejects these properties. Errors are the closed problems of `analytics/pareto_problem_schema.json` (400 malformed reference, limit or query echoing no value, and the closed `invalid_cursor` 400 for any invalid or stale cursor, 401, 403, one identical 404, 429, 500, 503). `GET /api/v1/analytics/runs/{run_id}/pareto` stays declared, marked `deprecated` and naming the successor; its project beta mount retires with it. `run_pareto_schema.json` and `run_pareto_response_schema.json` are unchanged. Removal follows the backend retirement PR after the client receipt.
- **`experiment_run.get_run_pareto`: run Pareto analysis declared on an experiment-run reference, paginated; the analytics-path GET deprecated (additive, contract only).** `metrics` keys use the shared measure-name class `^[^\x00-\x1f\x7f]{1,100}$` (the same as `x_measure` and `y_measure`, so names such as `review score` are valid); a stored metric name outside it makes the run's response the closed 503, never truncated or sanitized. The shared `trial_ref` accepts both issued formats, `trial_` plus 16 hex and `configuration_run_` plus 32 hex; every pattern in the report and Pareto schemas and in their query and path parameters ends in `$` (not the absolute end `(?![\s\S])`, because Pydantic v2's rust-regex engine refuses lookahead; trailing-newline hardening is applied by the Python-side validators). The cursor seals caller, project, run, query and `analysis_revision` (a per-run monotonic counter the backend increments in the same transaction as any insert or delete of the run's configuration rows and any update that changes a configuration row's analysis content); a stale or foreign cursor is the closed 400 `invalid_cursor` (declared in the problem schema). Frontier ties break by ascending `trial_ref` (lexicographic) before ranks are assigned; dominated entries are ordered by ascending `trial_ref` (lexicographic). The 10000 cap counts ALL scoped configuration rows before any metric processing (above it the closed 503). Metric values are any finite JSON number (the earlier 1e15 bound is removed). `has_more` is true if and only if `next_cursor` is non-null. `warnings` are constrained to the builder's three tag forms. The deprecation names the full beta route `/api/v1beta/projects/{project_id}/analytics/runs/{run_id}/pareto`. `GET /api/v1/projects/{project_id}/experiment-runs/{experiment_run_ref}/pareto` (operation id `experiment_run.get_run_pareto`) takes the server-issued reference `^experiment_run_[0-9a-f]{32}$` and the explicit project. Query: `limit` (default 20, maximum 100), `cursor` (opaque sealed string, at most 512 base64url characters, bound to caller, project, run and query), and the backend's own `x_measure`, `y_measure` (1-100 characters, defaults `cost` and `quality`) and `request_count` (1 to 1000000, default 1) from the backend's query; every other parameter, including retired `page` and `offset`, is the closed 400. The 200 is the new `analytics/experiment_run_pareto_response_schema.json`: `data` carries `run_id` (the experiment_run_ref), `measures`, `shape`, `knee_ref`, `frontier_total`, `dominated_total`, `warnings`, `items` and `pagination` (`limit`, `next_cursor` nullable, `has_more` and a required integer `total`), mirroring the backend Pareto computation. The ranking, frontier, knee and shape are computed over the full eligible population (at most 10000 configurations; more is the closed 503) and only then paginated, ordered frontier first by ascending rank then dominated, with ascending `trial_ref` (lexicographic) as the stable tie-breaker; the historical 500/1000 truncation is replaced by pagination. At most 100 items per page, metrics at most 5 names. The 1 MiB limit (`x-max-response-bytes` 1048576) is enforced on the serialized envelope: the handler measures the final serialized bytes, sends those same bytes, and returns the closed 503 over the limit; the schema gives no static byte bound. Canonical projection omits config_id: internal configuration-run id (replaced by the run-scoped `trial_ref` of `analytics/experiment_run_trial_ref_schema.json`, `^(trial_[0-9a-f]{16}|configuration_run_[0-9a-f]{32})$`: `trial_ref` is the configuration run's issued public reference (sessions issue trial_ plus 16 hex, an issued reference is never re-minted, unique per tenant, NULL until the reference backfill). Two issued formats exist: trial_ plus 16 hex (issued by sessions) and configuration_run_ plus 32 hex (minted by the backend). Issued once, never re-minted, so it is stable across views, pages and deletion of other configurations. The internal id is never emitted. A canonical view of a run with any configuration whose reference is not yet issued is the closed 503 until the backfill completes (never a positional or synthetic stand-in)). Canonical projection omits project_id: the explicit URL project. Canonical projection omits run_id as a historical id: `data.run_id` is the experiment_run_ref. `dominated_by` is a `trial_ref`, never an internal id. The closed schema rejects these properties. Errors are the closed problems of `analytics/pareto_problem_schema.json` (400 malformed reference, limit or query echoing no value, and the closed `invalid_cursor` 400 for any invalid or stale cursor, 401, 403, one identical 404, 429, 500, 503). `GET /api/v1/analytics/runs/{run_id}/pareto` stays declared, marked `deprecated` and naming the successor; its project beta mount retires with it. `run_pareto_schema.json` and `run_pareto_response_schema.json` are unchanged. Removal follows the backend retirement PR after the client receipt.
Loading
Loading