Files
VianoBugAnalysis/src/viano_bug_analysis/schemas/case-v1.schema.json
T

698 lines
15 KiB
JSON

{
"type": "object",
"required": [
"format",
"format_version",
"builder_version",
"case",
"bug",
"human_observations",
"expected_behavior",
"reproduction",
"entities",
"runtime_facts",
"database_context",
"source_context",
"research",
"data_quality",
"inputs"
],
"properties": {
"format": {
"const": "viano-case"
},
"format_version": {
"type": "integer",
"const": 1
},
"builder_version": {
"const": "1"
},
"case": {
"type": "object",
"required": [
"case_id",
"package_id",
"analysis_revision",
"source_generation",
"project"
],
"properties": {
"case_id": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"package_id": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"analysis_revision": {
"type": "integer",
"minimum": 1
},
"source_generation": {
"type": "integer",
"minimum": 0
},
"project": {
"type": "object"
}
}
},
"bug": {
"type": "object",
"required": [
"reports"
],
"properties": {
"reports": {
"type": "array",
"items": {
"type": "object",
"required": [
"source_ref",
"title",
"summary"
],
"properties": {
"source_ref": {
"type": "string",
"minLength": 1
},
"title": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
{
"type": "null"
}
]
},
"summary": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
{
"type": "null"
}
]
},
"origin": {
"$ref": "#/$defs/origin"
}
}
}
}
}
},
"human_observations": {
"type": "object",
"required": [
"observations",
"comments",
"tester_hypotheses"
],
"properties": {
"observations": {
"type": "array",
"items": {
"$ref": "#/$defs/record"
}
},
"comments": {
"type": "array",
"items": {
"$ref": "#/$defs/record"
}
},
"tester_hypotheses": {
"type": "array",
"items": {
"$ref": "#/$defs/record"
}
}
}
},
"expected_behavior": {
"type": "object",
"required": [
"statements",
"completeness",
"provenance"
],
"properties": {
"statements": {
"type": "array",
"items": {
"$ref": "#/$defs/record"
}
},
"completeness": {
"enum": [
"missing",
"unspecified",
"reported_complete",
"reported_partial",
"conflicting"
]
},
"provenance": {
"enum": [
"tester",
"none"
]
}
}
},
"reproduction": {
"type": "object",
"required": [
"records"
],
"properties": {
"records": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"source_ref",
"steps",
"events_ref",
"attachments"
],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"source_ref": {
"type": "string",
"minLength": 1
},
"steps": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
}
},
"events_ref": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"attachments": {
"type": "array",
"items": {
"type": "string",
"minLength": 1
}
},
"origin": {
"$ref": "#/$defs/origin"
}
}
}
}
}
},
"entities": {
"type": "array",
"items": {
"type": "object",
"required": [
"type",
"id",
"roles",
"provenance"
],
"properties": {
"type": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"id": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"roles": {
"type": "array",
"items": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
}
},
"provenance": {
"type": "array",
"items": {
"$ref": "#/$defs/provenance"
}
}
}
}
},
"runtime_facts": {
"type": "object",
"required": [
"facts",
"raw_refs"
],
"properties": {
"facts": {
"type": "array",
"items": {
"type": "object",
"required": [
"id",
"name",
"provenance"
],
"oneOf": [
{
"required": [
"value"
],
"not": {
"required": [
"value_ref"
]
}
},
{
"required": [
"value_ref"
],
"not": {
"required": [
"value"
]
}
}
],
"properties": {
"id": {
"type": "string",
"pattern": "^F[0-9]{4,}$"
},
"name": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"value": {},
"value_ref": {
"type": "object",
"required": [
"source_ref",
"json_pointer"
],
"properties": {
"source_ref": {
"type": "string",
"minLength": 1
},
"json_pointer": {
"type": "string",
"pattern": "^/"
}
}
},
"provenance": {
"$ref": "#/$defs/provenance"
}
}
}
},
"raw_refs": {
"type": "array",
"items": {
"$ref": "#/$defs/raw"
}
}
}
},
"database_context": {
"type": "object",
"required": [
"refs"
],
"properties": {
"refs": {
"type": "array",
"items": {
"$ref": "#/$defs/raw"
}
}
}
},
"source_context": {
"type": "object",
"required": [
"refs"
],
"properties": {
"refs": {
"type": "array",
"items": {
"$ref": "#/$defs/raw"
}
}
}
},
"research": {
"type": "object",
"required": [
"refs",
"performed"
],
"properties": {
"refs": {
"type": "array",
"items": {
"$ref": "#/$defs/raw"
}
},
"performed": {
"const": false
}
}
},
"data_quality": {
"type": "object",
"required": [
"issues",
"coverage"
],
"properties": {
"issues": {
"type": "array",
"items": {
"type": "object",
"required": [
"code",
"message",
"refs"
],
"properties": {
"code": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"message": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"refs": {
"type": "array",
"items": {
"type": "object",
"required": [
"source_ref",
"json_pointer"
],
"properties": {
"source_ref": {
"type": "string",
"minLength": 1
},
"json_pointer": {
"type": "string"
}
}
}
}
}
}
},
"coverage": {
"type": "object",
"required": [
"reports",
"reproductions",
"observations"
],
"properties": {
"reports": {
"type": "integer",
"minimum": 0
},
"reproductions": {
"type": "integer",
"minimum": 0
},
"observations": {
"type": "integer",
"minimum": 0
}
}
}
}
},
"inputs": {
"type": "object",
"required": [
"index_ref",
"records",
"unclassified",
"prior_cases",
"request_hash"
],
"properties": {
"index_ref": {
"anyOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "null"
}
]
},
"records": {
"type": "array",
"items": {
"type": "object",
"required": [
"path",
"sha256",
"size",
"role"
],
"properties": {
"path": {
"type": "string",
"minLength": 1
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"size": {
"type": "integer",
"minimum": 0
},
"role": {
"enum": [
"index",
"report",
"reproduction",
"runtime",
"database",
"source",
"research",
"attachment"
]
}
}
}
},
"unclassified": {
"type": "array",
"items": {
"$ref": "#/$defs/raw"
}
},
"prior_cases": {
"type": "array",
"items": {
"$ref": "#/$defs/raw"
}
},
"request_hash": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
}
}
}
},
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$defs": {
"provenance": {
"type": "object",
"required": [
"kind",
"source_ref",
"json_pointer",
"author",
"observed_at"
],
"properties": {
"kind": {
"enum": [
"tester",
"reproduction_record",
"report"
]
},
"source_ref": {
"type": "string",
"minLength": 1
},
"json_pointer": {
"type": "string",
"pattern": "^(|/.*)$"
},
"author": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
{
"type": "null"
}
]
},
"observed_at": {
"type": [
"string",
"null"
],
"format": "date-time"
},
"origin": {
"$ref": "#/$defs/origin"
}
}
},
"claim": {
"type": "object",
"required": [
"key",
"value"
],
"properties": {
"key": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"value": {}
}
},
"raw": {
"type": "object",
"required": [
"path",
"sha256",
"size"
],
"properties": {
"path": {
"type": "string",
"minLength": 1
},
"sha256": {
"type": "string",
"pattern": "^[0-9a-f]{64}$"
},
"size": {
"type": "integer",
"minimum": 0
}
}
},
"record": {
"type": "object",
"required": [
"id",
"text",
"provenance"
],
"properties": {
"id": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"text": {
"type": "string",
"minLength": 1,
"pattern": "\\S"
},
"provenance": {
"$ref": "#/$defs/provenance"
},
"claim": {
"$ref": "#/$defs/claim"
}
}
},
"origin": {
"type": "object",
"required": [
"source_ref",
"json_pointer"
],
"properties": {
"source_ref": {
"type": "string",
"minLength": 1
},
"json_pointer": {
"type": "string",
"pattern": "^(|/.*)$"
},
"archive_ref": {
"type": "string",
"minLength": 1
},
"member_name": {
"type": "string"
},
"decoded_json_pointer": {
"type": "string",
"pattern": "^(|/.*)$"
},
"source_timestamp": {
"type": "string"
}
}
}
}
}