feat(judging): persist immutable per-language problem configurations
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/Language-Input"
|
||||
},
|
||||
"problem_version_id": {
|
||||
"format": "uuid",
|
||||
@@ -202,7 +202,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging__Language"
|
||||
},
|
||||
"problem_version_id": {
|
||||
"format": "uuid",
|
||||
@@ -247,10 +247,12 @@
|
||||
"title": "JobManifest",
|
||||
"type": "object"
|
||||
},
|
||||
"Language": {
|
||||
"Language-Input": {
|
||||
"enum": [
|
||||
"c17",
|
||||
"cpp20"
|
||||
"cpp20",
|
||||
"python313",
|
||||
"java21"
|
||||
],
|
||||
"title": "Language",
|
||||
"type": "string"
|
||||
@@ -306,6 +308,14 @@
|
||||
"title": "LoginResponse",
|
||||
"type": "object"
|
||||
},
|
||||
"PreparationKind": {
|
||||
"enum": [
|
||||
"compile",
|
||||
"syntax_check"
|
||||
],
|
||||
"title": "PreparationKind",
|
||||
"type": "string"
|
||||
},
|
||||
"ProblemDetail": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
@@ -314,9 +324,17 @@
|
||||
"title": "Id",
|
||||
"type": "string"
|
||||
},
|
||||
"language_configurations": {
|
||||
"default": [],
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/PublicLanguageConfiguration"
|
||||
},
|
||||
"title": "Language Configurations",
|
||||
"type": "array"
|
||||
},
|
||||
"languages": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"title": "Languages",
|
||||
"type": "array"
|
||||
@@ -326,7 +344,14 @@
|
||||
"type": "integer"
|
||||
},
|
||||
"run_limits": {
|
||||
"$ref": "#/components/schemas/RunLimits"
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/components/schemas/RunLimits"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"samples": {
|
||||
"items": {
|
||||
@@ -408,7 +433,7 @@
|
||||
},
|
||||
"languages": {
|
||||
"items": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"title": "Languages",
|
||||
"type": "array"
|
||||
@@ -554,6 +579,51 @@
|
||||
"title": "PublicJudgement",
|
||||
"type": "object"
|
||||
},
|
||||
"PublicLanguageConfiguration": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"compile_limits": {
|
||||
"$ref": "#/components/schemas/RunLimits"
|
||||
},
|
||||
"entrypoint": {
|
||||
"title": "Entrypoint",
|
||||
"type": "string"
|
||||
},
|
||||
"job_wall_time_us": {
|
||||
"title": "Job Wall Time Us",
|
||||
"type": "integer"
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"preparation_kind": {
|
||||
"$ref": "#/components/schemas/PreparationKind"
|
||||
},
|
||||
"run_limits": {
|
||||
"$ref": "#/components/schemas/RunLimits"
|
||||
},
|
||||
"runtime_version": {
|
||||
"title": "Runtime Version",
|
||||
"type": "string"
|
||||
},
|
||||
"source_name": {
|
||||
"title": "Source Name",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"language",
|
||||
"runtime_version",
|
||||
"source_name",
|
||||
"entrypoint",
|
||||
"preparation_kind",
|
||||
"compile_limits",
|
||||
"run_limits",
|
||||
"job_wall_time_us"
|
||||
],
|
||||
"title": "PublicLanguageConfiguration",
|
||||
"type": "object"
|
||||
},
|
||||
"PublicSample": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
@@ -674,7 +744,7 @@
|
||||
"type": "string"
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"problem_version_id": {
|
||||
"format": "uuid",
|
||||
@@ -740,7 +810,7 @@
|
||||
]
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"problem_version_id": {
|
||||
"format": "uuid",
|
||||
@@ -841,7 +911,7 @@
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"source": {
|
||||
"maxLength": 262144,
|
||||
@@ -890,7 +960,7 @@
|
||||
]
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/components/schemas/Language"
|
||||
"$ref": "#/components/schemas/kf_oj__contracts__judging_v2__Language"
|
||||
},
|
||||
"problem_version_id": {
|
||||
"format": "uuid",
|
||||
@@ -1052,6 +1122,24 @@
|
||||
],
|
||||
"title": "Verdict",
|
||||
"type": "string"
|
||||
},
|
||||
"kf_oj__contracts__judging__Language": {
|
||||
"enum": [
|
||||
"c17",
|
||||
"cpp20"
|
||||
],
|
||||
"title": "Language",
|
||||
"type": "string"
|
||||
},
|
||||
"kf_oj__contracts__judging_v2__Language": {
|
||||
"enum": [
|
||||
"c17",
|
||||
"cpp20",
|
||||
"python313",
|
||||
"java21"
|
||||
],
|
||||
"title": "Language",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"securitySchemes": {
|
||||
|
||||
@@ -0,0 +1,349 @@
|
||||
{
|
||||
"$comment": "Multi-runtime protocol. Also validate runtime/source/attempt bindings, startup and node budgets, canonical bounded class sets and result consistency.",
|
||||
"$defs": {
|
||||
"Language": {
|
||||
"enum": [
|
||||
"c17",
|
||||
"cpp20",
|
||||
"python313",
|
||||
"java21"
|
||||
],
|
||||
"title": "Language",
|
||||
"type": "string"
|
||||
},
|
||||
"RunLimits": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"cpu_time_us": {
|
||||
"maximum": 60000000,
|
||||
"minimum": 1000,
|
||||
"title": "Cpu Time Us",
|
||||
"type": "integer"
|
||||
},
|
||||
"file_bytes": {
|
||||
"maximum": 67108864,
|
||||
"minimum": 1,
|
||||
"title": "File Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"memory_bytes": {
|
||||
"maximum": 2147483648,
|
||||
"minimum": 1,
|
||||
"title": "Memory Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"open_files": {
|
||||
"maximum": 1024,
|
||||
"minimum": 3,
|
||||
"title": "Open Files",
|
||||
"type": "integer"
|
||||
},
|
||||
"processes": {
|
||||
"maximum": 128,
|
||||
"minimum": 1,
|
||||
"title": "Processes",
|
||||
"type": "integer"
|
||||
},
|
||||
"stack_bytes": {
|
||||
"maximum": 268435456,
|
||||
"minimum": 1,
|
||||
"title": "Stack Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"stderr_bytes": {
|
||||
"maximum": 16777216,
|
||||
"minimum": 1,
|
||||
"title": "Stderr Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"stdout_bytes": {
|
||||
"maximum": 16777216,
|
||||
"minimum": 1,
|
||||
"title": "Stdout Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"wall_time_us": {
|
||||
"maximum": 120000000,
|
||||
"minimum": 1000,
|
||||
"title": "Wall Time Us",
|
||||
"type": "integer"
|
||||
},
|
||||
"workdir_bytes": {
|
||||
"maximum": 268435456,
|
||||
"minimum": 1,
|
||||
"title": "Workdir Bytes",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"cpu_time_us",
|
||||
"wall_time_us",
|
||||
"memory_bytes",
|
||||
"stack_bytes",
|
||||
"processes",
|
||||
"open_files",
|
||||
"stdout_bytes",
|
||||
"stderr_bytes",
|
||||
"file_bytes",
|
||||
"workdir_bytes"
|
||||
],
|
||||
"title": "RunLimits",
|
||||
"type": "object"
|
||||
},
|
||||
"RuntimeCapability": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"compile_ceiling": {
|
||||
"$ref": "#/$defs/RunLimits"
|
||||
},
|
||||
"language": {
|
||||
"$ref": "#/$defs/Language"
|
||||
},
|
||||
"run_ceiling": {
|
||||
"$ref": "#/$defs/RunLimits"
|
||||
},
|
||||
"toolchain": {
|
||||
"$ref": "#/$defs/RuntimeIdentity"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"language",
|
||||
"toolchain",
|
||||
"compile_ceiling",
|
||||
"run_ceiling"
|
||||
],
|
||||
"title": "RuntimeCapability",
|
||||
"type": "object"
|
||||
},
|
||||
"RuntimeIdentity": {
|
||||
"additionalProperties": false,
|
||||
"description": "An exact identity matched against trusted configuration, never a host path.",
|
||||
"properties": {
|
||||
"image_digest": {
|
||||
"maxLength": 64,
|
||||
"minLength": 64,
|
||||
"pattern": "^[0-9a-f]{64}$",
|
||||
"title": "Image Digest",
|
||||
"type": "string"
|
||||
},
|
||||
"image_kind": {
|
||||
"enum": [
|
||||
"linux_gnu_cxx_x86_64_v1",
|
||||
"linux_cpython313_x86_64_v1",
|
||||
"linux_openjdk21_x86_64_v1"
|
||||
],
|
||||
"title": "Image Kind",
|
||||
"type": "string"
|
||||
},
|
||||
"image_revision": {
|
||||
"maximum": 4294967295,
|
||||
"minimum": 1,
|
||||
"title": "Image Revision",
|
||||
"type": "integer"
|
||||
},
|
||||
"runtime_version": {
|
||||
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.+-]{0,63}$",
|
||||
"title": "Runtime Version",
|
||||
"type": "string"
|
||||
},
|
||||
"toolchain_id": {
|
||||
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$",
|
||||
"title": "Toolchain Id",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"toolchain_id",
|
||||
"image_kind",
|
||||
"image_revision",
|
||||
"image_digest",
|
||||
"runtime_version"
|
||||
],
|
||||
"title": "RuntimeIdentity",
|
||||
"type": "object"
|
||||
},
|
||||
"Toolchain": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"image_kind": {
|
||||
"const": "linux_gnu_cxx_x86_64_v1",
|
||||
"title": "Image Kind",
|
||||
"type": "string"
|
||||
},
|
||||
"image_revision": {
|
||||
"maximum": 4294967295,
|
||||
"minimum": 1,
|
||||
"title": "Image Revision",
|
||||
"type": "integer"
|
||||
},
|
||||
"toolchain_id": {
|
||||
"pattern": "^[a-z0-9][a-z0-9_-]{0,63}$",
|
||||
"title": "Toolchain Id",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"toolchain_id",
|
||||
"image_kind",
|
||||
"image_revision"
|
||||
],
|
||||
"title": "Toolchain",
|
||||
"type": "object"
|
||||
},
|
||||
"kf_oj__contracts__judging__AdmissionPolicy": {
|
||||
"additionalProperties": false,
|
||||
"description": "Trusted node policy. A manifest never supplies or replaces this policy.",
|
||||
"properties": {
|
||||
"compile_ceiling": {
|
||||
"$ref": "#/$defs/RunLimits"
|
||||
},
|
||||
"max_concurrent_jobs": {
|
||||
"default": 1,
|
||||
"maximum": 64,
|
||||
"minimum": 1,
|
||||
"title": "Max Concurrent Jobs",
|
||||
"type": "integer"
|
||||
},
|
||||
"max_job_wall_time_us": {
|
||||
"maximum": 3600000000,
|
||||
"minimum": 1000,
|
||||
"title": "Max Job Wall Time Us",
|
||||
"type": "integer"
|
||||
},
|
||||
"max_package_bytes": {
|
||||
"maximum": 67108864,
|
||||
"minimum": 1,
|
||||
"title": "Max Package Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"max_retries": {
|
||||
"default": 2,
|
||||
"maximum": 4,
|
||||
"minimum": 0,
|
||||
"title": "Max Retries",
|
||||
"type": "integer"
|
||||
},
|
||||
"prefetch": {
|
||||
"default": 1,
|
||||
"maximum": 64,
|
||||
"minimum": 1,
|
||||
"title": "Prefetch",
|
||||
"type": "integer"
|
||||
},
|
||||
"run_ceiling": {
|
||||
"$ref": "#/$defs/RunLimits"
|
||||
},
|
||||
"toolchain": {
|
||||
"$ref": "#/$defs/Toolchain"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"max_job_wall_time_us",
|
||||
"max_package_bytes",
|
||||
"toolchain",
|
||||
"compile_ceiling",
|
||||
"run_ceiling"
|
||||
],
|
||||
"title": "AdmissionPolicy",
|
||||
"type": "object"
|
||||
},
|
||||
"kf_oj__contracts__judging_v2__AdmissionPolicy": {
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"capabilities": {
|
||||
"items": {
|
||||
"$ref": "#/$defs/RuntimeCapability"
|
||||
},
|
||||
"maxItems": 4,
|
||||
"minItems": 1,
|
||||
"title": "Capabilities",
|
||||
"type": "array"
|
||||
},
|
||||
"max_concurrent_jobs": {
|
||||
"default": 1,
|
||||
"maximum": 64,
|
||||
"minimum": 1,
|
||||
"title": "Max Concurrent Jobs",
|
||||
"type": "integer"
|
||||
},
|
||||
"max_job_wall_time_us": {
|
||||
"maximum": 3600000000,
|
||||
"minimum": 1000,
|
||||
"title": "Max Job Wall Time Us",
|
||||
"type": "integer"
|
||||
},
|
||||
"max_package_bytes": {
|
||||
"maximum": 67108864,
|
||||
"minimum": 1,
|
||||
"title": "Max Package Bytes",
|
||||
"type": "integer"
|
||||
},
|
||||
"max_retries": {
|
||||
"default": 2,
|
||||
"maximum": 4,
|
||||
"minimum": 0,
|
||||
"title": "Max Retries",
|
||||
"type": "integer"
|
||||
},
|
||||
"prefetch": {
|
||||
"default": 1,
|
||||
"maximum": 64,
|
||||
"minimum": 1,
|
||||
"title": "Prefetch",
|
||||
"type": "integer"
|
||||
},
|
||||
"schema_version": {
|
||||
"const": 2,
|
||||
"title": "Schema Version",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema_version",
|
||||
"max_job_wall_time_us",
|
||||
"max_package_bytes",
|
||||
"capabilities"
|
||||
],
|
||||
"title": "AdmissionPolicy",
|
||||
"type": "object"
|
||||
}
|
||||
},
|
||||
"$id": "urn:kf-oj:judge-registry:v2",
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"additionalProperties": false,
|
||||
"description": "Explicit operator opt-in for both protocol generations; no silent conversion.",
|
||||
"properties": {
|
||||
"legacy": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/kf_oj__contracts__judging__AdmissionPolicy"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"multi_runtime": {
|
||||
"anyOf": [
|
||||
{
|
||||
"$ref": "#/$defs/kf_oj__contracts__judging_v2__AdmissionPolicy"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
]
|
||||
},
|
||||
"schema_version": {
|
||||
"const": 2,
|
||||
"title": "Schema Version",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"schema_version",
|
||||
"legacy",
|
||||
"multi_runtime"
|
||||
],
|
||||
"title": "AdmissionRegistry",
|
||||
"type": "object"
|
||||
}
|
||||
Reference in New Issue
Block a user