beforedone-paper / schemas /task.schema.json
RedinGhost's picture
Publish curated reproducibility artifact
598316f verified
Raw History Blame Contribute Delete
7.16 kB
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://example.invalid/beforedone-paper/task.schema.json",
"title": "BeforeDone private study task manifest",
"description": "Runner-private task definition. It is never copied into an agent worktree.",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version", "task_id", "study_phase", "language", "scenario",
"repository", "public_input", "private_evaluation", "phase_boundary",
"limits", "asset_hashes", "public_projection_sha256"
],
"properties": {
"schema_version": {"const": 2},
"task_id": {"type": "string", "pattern": "^[a-z0-9][a-z0-9._-]{0,63}$"},
"study_phase": {"enum": ["pilot", "confirmatory"]},
"language": {"enum": ["go", "python", "typescript"]},
"scenario": {"enum": ["premature", "relevant_change", "irrelevant_change"]},
"repository": {
"type": "object",
"additionalProperties": false,
"required": ["url", "commit", "license_spdx"],
"properties": {
"url": {"type": "string", "pattern": "^https://"},
"commit": {"type": "string", "pattern": "^[0-9a-f]{40}$"},
"license_spdx": {"type": "string", "minLength": 1, "maxLength": 64},
"preparation": {"$ref": "#/$defs/preparationContract"}
}
},
"public_input": {
"type": "object",
"additionalProperties": false,
"required": ["phase1_prompt_path", "verification_contract"],
"properties": {
"phase1_prompt_path": {"$ref": "#/$defs/relativePath"},
"verification_contract": {"$ref": "#/$defs/verificationContract"}
}
},
"private_evaluation": {
"type": "object",
"additionalProperties": false,
"required": ["initial_patch_path", "reference_solution_patch_path", "hidden_oracle", "oracle_asset_paths", "intervention"],
"properties": {
"initial_patch_path": {"$ref": "#/$defs/relativePath"},
"reference_solution_patch_path": {"$ref": "#/$defs/relativePath"},
"hidden_oracle": {"$ref": "#/$defs/commandContract"},
"oracle_asset_paths": {
"type": "array", "minItems": 1, "maxItems": 256,
"uniqueItems": true,
"items": {"$ref": "#/$defs/relativePath"}
},
"phase2_prompt_path": {"$ref": "#/$defs/relativePath"},
"intervention": {
"type": "object",
"additionalProperties": false,
"required": ["kind", "affected_scope"],
"properties": {
"kind": {"enum": ["none", "patch"]},
"affected_scope": {"enum": ["none", "relevant", "irrelevant"]},
"patch_path": {"$ref": "#/$defs/relativePath"}
}
}
}
},
"phase_boundary": {
"type": "object",
"additionalProperties": false,
"required": ["required", "on_failure"],
"properties": {
"required": {"type": "boolean"},
"on_failure": {"enum": ["not_applicable", "continue_tagged_phase1_failure"]}
}
},
"limits": {
"type": "object",
"additionalProperties": false,
"required": ["wall_seconds"],
"properties": {
"wall_seconds": {"type": "integer", "minimum": 60, "maximum": 7200}
}
},
"asset_hashes": {
"type": "object",
"additionalProperties": false,
"required": ["public", "private"],
"properties": {
"public": {"$ref": "#/$defs/fileHashMap"},
"private": {"$ref": "#/$defs/fileHashMap"}
}
},
"public_projection_sha256": {"$ref": "#/$defs/digest"}
},
"$defs": {
"digest": {"type": "string", "pattern": "^sha256:[0-9a-f]{64}$"},
"relativePath": {
"type": "string", "minLength": 1, "maxLength": 512,
"pattern": "^(?![A-Za-z]:)(?!/)(?!.*(?:^|/)\\.\\.(?:/|$))[^\\u0000]+$"
},
"argv": {
"type": "array", "minItems": 1, "maxItems": 64,
"items": {"type": "string", "minLength": 1, "maxLength": 4096}
},
"commandContract": {
"type": "object",
"additionalProperties": false,
"required": ["argv", "working_directory", "timeout_seconds"],
"properties": {
"argv": {"$ref": "#/$defs/argv"},
"working_directory": {"$ref": "#/$defs/relativePath"},
"timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 3600}
}
},
"preparationContract": {
"type": "object",
"additionalProperties": false,
"required": ["argv", "working_directory", "timeout_seconds", "network_required"],
"properties": {
"argv": {"$ref": "#/$defs/argv"},
"working_directory": {"$ref": "#/$defs/relativePath"},
"timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 3600},
"network_required": {"type": "boolean"}
}
},
"verificationContract": {
"type": "object",
"additionalProperties": false,
"required": ["argv", "working_directory", "timeout_seconds", "relevant_files"],
"properties": {
"argv": {"$ref": "#/$defs/argv"},
"working_directory": {"$ref": "#/$defs/relativePath"},
"timeout_seconds": {"type": "integer", "minimum": 1, "maximum": 3600},
"relevant_files": {
"type": "array", "minItems": 1, "maxItems": 256,
"items": {"type": "string", "minLength": 1, "maxLength": 512}
}
}
},
"fileHashMap": {
"type": "object",
"propertyNames": {"$ref": "#/$defs/relativePath"},
"additionalProperties": {"$ref": "#/$defs/digest"}
}
},
"allOf": [
{
"if": {"properties": {"scenario": {"const": "premature"}}, "required": ["scenario"]},
"then": {
"properties": {
"phase_boundary": {
"properties": {"required": {"const": false}, "on_failure": {"const": "not_applicable"}}
},
"private_evaluation": {
"not": {"required": ["phase2_prompt_path"]},
"properties": {
"intervention": {
"properties": {"kind": {"const": "none"}, "affected_scope": {"const": "none"}},
"not": {"required": ["patch_path"]}
}
}
}
}
},
"else": {
"properties": {
"phase_boundary": {
"properties": {"required": {"const": true}, "on_failure": {"const": "continue_tagged_phase1_failure"}}
},
"private_evaluation": {
"required": ["phase2_prompt_path"],
"properties": {
"intervention": {"required": ["patch_path"], "properties": {"kind": {"const": "patch"}}}
}
}
}
}
},
{
"if": {"properties": {"scenario": {"const": "relevant_change"}}, "required": ["scenario"]},
"then": {"properties": {"private_evaluation": {"properties": {"intervention": {"properties": {"affected_scope": {"const": "relevant"}}}}}}}
},
{
"if": {"properties": {"scenario": {"const": "irrelevant_change"}}, "required": ["scenario"]},
"then": {"properties": {"private_evaluation": {"properties": {"intervention": {"properties": {"affected_scope": {"const": "irrelevant"}}}}}}}
}
]
}