feat(submissions): define bounded performance and scoped history contracts

This commit is contained in:
2026-10-11 03:35:12 +08:00
parent 5df3c370aa
commit 3cc90e4573
9 changed files with 976 additions and 2 deletions
+134
View File
@@ -195,6 +195,23 @@ export interface paths {
patch?: never;
trace?: never;
};
"/api/v1/submissions/{submission_id}/performance": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
/** Performance */
get: operations["performance_api_v1_submissions__submission_id__performance_get"];
put?: never;
post?: never;
delete?: never;
options?: never;
head?: never;
patch?: never;
trace?: never;
};
"/api/v1/submissions/{submission_id}/source": {
parameters: {
query?: never;
@@ -366,6 +383,43 @@ export interface components {
expires_at: string;
user: components["schemas"]["CurrentUser"];
};
/** PerformanceBucket */
PerformanceBucket: {
/** Count */
count: number;
/** End */
end: string;
/** Start */
start: string;
/** Upper Inclusive */
upper_inclusive: boolean;
};
/** PerformanceMetric */
PerformanceMetric: {
/** Available */
available: boolean;
/** Buckets */
buckets: components["schemas"]["PerformanceBucket"][];
/** Current */
current: string | null;
/** Oldest Sample At */
oldest_sample_at: string | null;
/** Reason */
reason: ("not_accepted" | "measurement_missing" | "environment_unverified" | "insufficient_samples") | null;
/** Sample Count */
sample_count: number;
/** Strictly Slower Count */
strictly_slower_count: number | null;
/** Tied Count */
tied_count: number | null;
/**
* Unit
* @enum {string}
*/
unit: "cpu_microseconds" | "bytes";
/** Window Truncated */
window_truncated: boolean;
};
/**
* PreparationKind
* @enum {string}
@@ -582,6 +636,53 @@ export interface components {
/** Next After */
next_after: string | null;
};
/** SubmissionPerformance */
SubmissionPerformance: {
/**
* As Of
* Format: date-time
*/
as_of: string;
/** Comparison Group */
comparison_group: string | null;
cpu: components["schemas"]["PerformanceMetric"];
/**
* Kind
* @default judge.performance
* @constant
*/
kind: "judge.performance";
language: components["schemas"]["kf_oj__contracts__judging_v2__Language"];
memory: components["schemas"]["PerformanceMetric"];
/**
* Minimum Samples
* @default 5
* @constant
*/
minimum_samples: 5;
/**
* Problem Version Id
* Format: uuid
*/
problem_version_id: string;
/**
* Schema Version
* @default 1
* @constant
*/
schema_version: 1;
/**
* Submission Id
* Format: uuid
*/
submission_id: string;
/**
* Window Limit
* @default 10000
* @constant
*/
window_limit: 10000;
};
/** SubmissionSource */
SubmissionSource: {
language: components["schemas"]["kf_oj__contracts__judging_v2__Language"];
@@ -920,6 +1021,8 @@ export interface operations {
query?: {
after?: string | null;
limit?: number;
problem_version_id?: string | null;
language?: components["schemas"]["Language-Input"] | null;
};
header?: never;
path?: never;
@@ -1042,6 +1145,37 @@ export interface operations {
};
};
};
performance_api_v1_submissions__submission_id__performance_get: {
parameters: {
query?: never;
header?: never;
path: {
submission_id: string;
};
cookie?: never;
};
requestBody?: never;
responses: {
/** @description Successful Response */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["SubmissionPerformance"];
};
};
/** @description Validation Error */
422: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": components["schemas"]["HTTPValidationError"];
};
};
};
};
source_api_v1_submissions__submission_id__source_get: {
parameters: {
query?: never;