feat(connect): add bounded health service job

This commit is contained in:
Chris
2026-09-27 02:50:49 +08:00
committed by GitHub
parent 8741bb77ea
commit 31ac243865
17 changed files with 2160 additions and 11 deletions
@@ -1,3 +1,5 @@
29c93b4c8c27164896c5197e1df4ba03175425ccf5b12dc8e3f3d8d6bf19dc51 accept-vectors.json
9423c9fd02b47940cfe54915e0f90706469de2111176053d8ac0c86f30e443ff health-service-accept-vectors.json
166fbfb022ab7e6780547b21c53ca36f357e74b56355c84c8174393449942dfa health-service-reject-vectors.json
fef527fdd89aa87fa9f81394eab6484fc2ac05a31559e1589149716193b336fb receipt-vectors.json
219749ea7bdf73461108320e13ba14b604a1967e32139c5317a017ad95dab000 reject-vectors.json
@@ -0,0 +1,123 @@
{
"protocolVersion": "v1",
"fixtureSet": "diagnostic-scheduler",
"fixture": "health-service-accept-vectors",
"vectors": [
{
"id": "health-service.job.explicit-freshness",
"schema": "job-envelope.schema.json",
"value": {
"jobId": "018cc251-f400-7abc-8def-0123456789ab",
"protocolVersion": "v1",
"jobType": "health.check",
"schemaVersion": 1,
"organizationName": "organizations/018cc251-f400-7abc-8def-0123456789ab",
"clusterName": "organizations/018cc251-f400-7abc-8def-0123456789ab/clusters/018cc251-f400-7abc-8def-0123456789ac",
"deviceName": "organizations/018cc251-f400-7abc-8def-0123456789ab/clusters/018cc251-f400-7abc-8def-0123456789ac/clusterDevices/018cc251-f400-7abc-8def-0123456789ad",
"createTime": "2030-01-01T00:00:00Z",
"expireTime": "2030-01-01T00:00:30Z",
"nonce": "BwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwcHBwc",
"requiredCapabilities": ["health.check.service@1"],
"authorization": {
"actorType": "BROWSER_USER",
"actorName": "users/018cc251-f400-7abc-8def-0123456789ab",
"requestId": "123e4567-e89b-42d3-a456-426614174001"
},
"limits": {
"timeoutSeconds": 30,
"maxOutputBytes": 262144,
"maxMemoryBytes": 67108864,
"maxCpuMillis": 5000
},
"parameters": {
"artifactUid": "018cc251-f400-7abc-8def-0123456789ae",
"consentUid": "018cc251-f400-7abc-8def-0123456789af",
"consentPolicyRevision": 1,
"consentExpiresAt": "2030-01-01T00:01:00Z",
"maxEvidenceAgeSeconds": 300
},
"signature": {
"algorithm": "Ed25519",
"keyId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
}
},
{
"id": "health-service.result.current-partial-catalog",
"schema": "health-service-result.schema.json",
"value": {
"schemaVersion": 1,
"runUid": "018cc251-f400-7abc-8def-0123456789ab",
"toolId": "health.check",
"capability": "health.check.service@1",
"outcome": "PARTIAL",
"reasonCode": "CATALOG_PARTIAL",
"durationMillis": 25,
"provenance": {
"repository": "rustfs/rustfs",
"sourceCommit": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
"executableSha256": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
"rustfsVersion": "1.0.0",
"osFamily": "LINUX",
"architecture": "x86_64",
"buildFeatures": []
},
"coverage": {
"requestedUnits": 13,
"completedUnits": 2,
"unsupportedUnits": 11,
"unit": "CHECK"
},
"data": {
"catalogVersion": 1,
"resourceAlias": "cluster-1",
"observations": {
"capacity": {
"source": "LIVE_DISK_PROBE",
"observedAt": "2030-01-01T00:00:00Z",
"freshness": "CURRENT",
"complete": true,
"totalBytes": 100,
"usedBytes": 50
},
"coarseFlags": {
"source": "LIVE_DISK_PROBE",
"observedAt": "2030-01-01T00:00:00Z",
"freshness": "CURRENT",
"complete": true,
"values": []
}
},
"checks": [
{
"checkId": "capacity.exhausted",
"outcome": "PASS",
"reasonCode": "CAPACITY_REMAINING",
"resourceAlias": "cluster-1"
},
{
"checkId": "cluster.reportedFlags",
"outcome": "PASS",
"reasonCode": "NO_COARSE_CONDITION_REPORTED",
"resourceAlias": "cluster-1"
}
],
"unsupportedChecks": [
{ "checkId": "memory.reportedPressure", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "tls.validity", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "cpu.sufficiency", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "swap.pressure", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "drive.health", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "inode.available", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "filesystem.compatibility", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "osKernel.compatibility", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "launch.permissions", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "version.consistency", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" },
{ "checkId": "kubernetes.configuration", "reasonCode": "EVIDENCE_CONTRACT_UNAVAILABLE" }
]
}
}
}
]
}
@@ -0,0 +1,20 @@
{
"protocolVersion": "v1",
"fixtureSet": "diagnostic-scheduler",
"fixture": "health-service-reject-vectors",
"baseFixture": "health-service-accept-vectors.json",
"vectors": [
{ "id": "health-service.job.old-node-capability", "base": "health-service.job.explicit-freshness", "path": "/requiredCapabilities/0", "replacement": "health.check@1", "reason": "UNSUPPORTED_TOOL" },
{ "id": "health-service.job.missing-capability", "base": "health-service.job.explicit-freshness", "path": "/requiredCapabilities", "replacement": [], "reason": "UNSUPPORTED_TOOL" },
{ "id": "health-service.job.missing-freshness-policy", "base": "health-service.job.explicit-freshness", "path": "/parameters/maxEvidenceAgeSeconds", "remove": true, "reason": "LIMIT_EXCEEDED" },
{ "id": "health-service.job.profile-parameter", "base": "health-service.job.explicit-freshness", "path": "/parameters/durationMillis", "replacement": 1000, "reason": "INVALID" },
{ "id": "health-service.job.oversized-result-budget", "base": "health-service.job.explicit-freshness", "path": "/limits/maxOutputBytes", "replacement": 262145, "reason": "LIMIT_EXCEEDED" },
{ "id": "health-service.job.wrong-target", "base": "health-service.job.explicit-freshness", "path": "/deviceName", "replacement": "organizations/018cc251-f400-7abc-8def-0123456789ab/clusters/018cc251-f400-7abc-8def-0123456789ac/clusterDevices/018cc251-f400-7abc-8def-0123456789ae", "reason": "TARGET_MISMATCH" },
{ "id": "health-service.job.wrong-nonce", "base": "health-service.job.explicit-freshness", "path": "/nonce", "replacement": "invalid", "reason": "INVALID" },
{ "id": "health-service.job.wrong-signature", "base": "health-service.job.explicit-freshness", "path": "/signature/value", "replacement": "invalid", "reason": "SIGNATURE_INVALID" },
{ "id": "health-service.job.revoked-consent", "base": "health-service.job.explicit-freshness", "path": "/parameters/consentExpiresAt", "replacement": "2029-12-31T23:59:59Z", "reason": "EXPIRED" },
{ "id": "health-service.result.raw-admin-data", "base": "health-service.result.current-partial-catalog", "path": "/data/rawAdmin", "replacement": { "endpoint": "forbidden" }, "reason": "UNKNOWN_FIELD" },
{ "id": "health-service.result.missing-unsupported", "base": "health-service.result.current-partial-catalog", "path": "/data/unsupportedChecks/10", "remove": true, "reason": "INCOMPLETE_COVERAGE" },
{ "id": "health-service.result.path-leak", "base": "health-service.result.current-partial-catalog", "path": "/data/observations/capacity/path", "replacement": "/customer/data", "reason": "UNKNOWN_FIELD" }
]
}
@@ -1,6 +1,6 @@
975c1ca53eefeef6766a6fc0b3d3281f7408255342b0686e5e2aee5ad055414c duplicate.json
963529a38a02849c6c2acc6d72668dca9f63218b49c89fae41a451b584850411 overflow.json
60300d053dd3746a3aceb327315e8c5abe292fb6505dd02a64b8d6279fb56c09 producer-capabilities.json
5d8ec114a5c3d9633d14ea3a227a0fdf6dfc04aca5de1fce39fce7d139b3dc08 producer-capabilities.json
e3adeee1c8a19aa17e70894896fb79c072e3785bea3611b93c11e79f039ed5af stale.json
22cc7337f545271ebf11ca6b76e7e479d62c51278ac001a8d870b07d0fa9884e unknown.json
b06a72ff1d964efe65e996797705ec2ef72574a813aec5d8e9aff26c899f1352 valid.json
@@ -9,6 +9,7 @@
"inventory.environment@1"
],
"producerCapabilities": [
"health.check.service@1",
"performance.client@1",
"performance.drive@1",
"performance.network@1",
@@ -33,6 +34,7 @@
"heartbeat",
"diagnostics.policy.v1",
"inventory.environment@1",
"health.check.service@1",
"performance.client@1",
"performance.drive@1",
"performance.network@1",
+2 -2
View File
@@ -1,13 +1,13 @@
a499742c06046e9cf2f781fc17d8b4cf95e018ab45fa41ee5944ba15b0e2902c auth
9b54e39584a442270ae486e8378df1d6f168c45d0c59baba9459b46bb212d2df version
159d116e965b51771f1687fc6ec9bdfbf2a4a0e6d6aa26d3f1046b3dac2697dd registration
9b3862f5160968a2ff281afb3ea519a3d49ae1bc3d767153d70f309d2a7457a7 heartbeat
8a92d233dd164f2648905595c9a31d533cc35b3bfcb4a79babd1f81a297332e6 heartbeat
cc6c3f3bf5e6a938f2e00b8ce42d8fa7bfb974f4eb2927101d4ede4ebdc10dd5 inventory
0207458ec9b97b368e2f347da112511a3aabd27d752890cacda4fa2408e7f19e object-performance
a464d4c695d76dd985c0f2abf68c2135c080221098ad2427022f85243a7bf6ae network-performance
813cbbf209e8fc9ddaafaeb4eb4745024b1c0edcb26634073a85023844141477 site-replication-performance
fad21eec58d4d4d547893af9050cdc5eaf9d4f84b15fb423214b16be50e7ff7a telemetry
484da2e7599148d36e1ac19d0ae5d305c4a96da7a00495a8ea202d3bae240a88 diagnostic-scheduler
4f51f7916c8534ca6258785c0d90c83ea1465fba276ba180c73720ded2b71cd4 diagnostic-scheduler
a2557ab1f7f70fb86a8affc8451596c272478fd2d5500c367b8f9e8385d72578 offline-enrollment
8b6fd07759d1264489a8bb54d2dda4836ad0f59b5ee5d52966365918b3de4c9e bundle
42cc936dc8fe87335ebff5abe01e3ebf85bdada7f37b43bfd8add46435c9d6f9 redaction
@@ -0,0 +1,237 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://connect.rustfs.com/schemas/agent/v1/health-service-result.schema.json",
"title": "RustFS bounded health service result v1",
"type": "object",
"additionalProperties": false,
"required": ["schemaVersion", "runUid", "toolId", "capability", "outcome", "reasonCode", "durationMillis", "provenance", "coverage", "data"],
"properties": {
"schemaVersion": { "const": 1 },
"runUid": { "$ref": "#/$defs/uuid7" },
"toolId": { "const": "health.check" },
"capability": { "const": "health.check.service@1" },
"outcome": { "const": "PARTIAL" },
"reasonCode": {
"enum": ["CATALOG_PARTIAL", "EVIDENCE_INCOMPLETE", "EVIDENCE_STALE", "EVIDENCE_FRESHNESS_UNKNOWN", "CLOCK_SKEW"]
},
"durationMillis": { "type": "integer", "minimum": 0, "maximum": 30000 },
"provenance": { "$ref": "#/$defs/provenance" },
"coverage": { "$ref": "#/$defs/coverage" },
"data": { "$ref": "#/$defs/data" }
},
"$defs": {
"uuid7": {
"type": "string",
"format": "uuid",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$"
},
"provenance": {
"type": "object",
"additionalProperties": false,
"required": ["repository", "sourceCommit", "executableSha256", "rustfsVersion", "osFamily", "architecture", "buildFeatures"],
"properties": {
"repository": { "const": "rustfs/rustfs" },
"sourceCommit": { "type": "string", "pattern": "^[0-9a-f]{40}$" },
"executableSha256": { "type": "string", "pattern": "^[0-9a-f]{64}$" },
"rustfsVersion": { "type": "string", "minLength": 1, "maxLength": 64 },
"osFamily": { "enum": ["LINUX", "DARWIN", "WINDOWS", "FREEBSD", "OTHER"] },
"architecture": { "enum": ["x86_64", "aarch64", "other"] },
"buildFeatures": {
"type": "array",
"items": { "type": "string", "pattern": "^[A-Za-z0-9._-]{1,64}$" },
"maxItems": 64,
"uniqueItems": true
}
}
},
"coverage": {
"type": "object",
"additionalProperties": false,
"required": ["requestedUnits", "completedUnits", "unsupportedUnits", "unit"],
"properties": {
"requestedUnits": { "const": 13 },
"completedUnits": { "const": 2 },
"unsupportedUnits": { "const": 11 },
"unit": { "const": "CHECK" }
}
},
"data": {
"type": "object",
"additionalProperties": false,
"required": ["catalogVersion", "resourceAlias", "observations", "checks", "unsupportedChecks"],
"properties": {
"catalogVersion": { "const": 1 },
"resourceAlias": { "const": "cluster-1" },
"observations": { "$ref": "#/$defs/observations" },
"checks": {
"type": "array",
"prefixItems": [
{ "$ref": "#/$defs/capacityCheck" },
{ "$ref": "#/$defs/flagsCheck" }
],
"items": false,
"minItems": 2,
"maxItems": 2
},
"unsupportedChecks": {
"type": "array",
"prefixItems": [
{ "$ref": "#/$defs/unsupportedMemory" },
{ "$ref": "#/$defs/unsupportedTls" },
{ "$ref": "#/$defs/unsupportedCpu" },
{ "$ref": "#/$defs/unsupportedSwap" },
{ "$ref": "#/$defs/unsupportedDrive" },
{ "$ref": "#/$defs/unsupportedInode" },
{ "$ref": "#/$defs/unsupportedFilesystem" },
{ "$ref": "#/$defs/unsupportedOsKernel" },
{ "$ref": "#/$defs/unsupportedLaunch" },
{ "$ref": "#/$defs/unsupportedVersion" },
{ "$ref": "#/$defs/unsupportedKubernetes" }
],
"items": false,
"minItems": 11,
"maxItems": 11
}
}
},
"observations": {
"type": "object",
"additionalProperties": false,
"required": ["capacity", "coarseFlags"],
"properties": {
"capacity": { "$ref": "#/$defs/capacityObservation" },
"coarseFlags": { "$ref": "#/$defs/flagsObservation" }
}
},
"capacityObservation": {
"type": "object",
"additionalProperties": false,
"required": ["source", "observedAt", "freshness", "complete", "totalBytes", "usedBytes"],
"properties": {
"source": { "const": "LIVE_DISK_PROBE" },
"observedAt": { "type": ["string", "null"], "format": "date-time" },
"freshness": { "$ref": "#/$defs/freshness" },
"complete": { "type": "boolean" },
"totalBytes": { "$ref": "#/$defs/nullableCounter" },
"usedBytes": { "$ref": "#/$defs/nullableCounter" }
},
"allOf": [
{
"if": { "properties": { "complete": { "const": true } } },
"then": {
"properties": {
"observedAt": { "type": "string", "format": "date-time" },
"totalBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 },
"usedBytes": { "type": "integer", "minimum": 0, "maximum": 9007199254740991 }
}
}
}
]
},
"flagsObservation": {
"type": "object",
"additionalProperties": false,
"required": ["source", "observedAt", "freshness", "complete", "values"],
"properties": {
"source": { "const": "LIVE_DISK_PROBE" },
"observedAt": { "type": ["string", "null"], "format": "date-time" },
"freshness": { "$ref": "#/$defs/freshness" },
"complete": { "type": "boolean" },
"values": {
"oneOf": [
{ "type": "null" },
{
"type": "array",
"items": {
"enum": ["capacity.critical", "capacity.warning", "clock.skew", "cluster.degraded", "cluster.healing", "cluster.readonly", "drive.offline", "node.offline"]
},
"maxItems": 8,
"uniqueItems": true
}
]
}
},
"allOf": [
{
"if": { "properties": { "complete": { "const": true } } },
"then": {
"properties": {
"observedAt": { "type": "string", "format": "date-time" },
"values": {
"type": "array",
"items": {
"enum": ["capacity.critical", "capacity.warning", "clock.skew", "cluster.degraded", "cluster.healing", "cluster.readonly", "drive.offline", "node.offline"]
},
"maxItems": 8,
"uniqueItems": true
}
}
}
}
]
},
"freshness": { "enum": ["CURRENT", "STALE", "UNKNOWN"] },
"nullableCounter": {
"type": ["integer", "null"],
"minimum": 0,
"maximum": 9007199254740991
},
"capacityCheck": {
"allOf": [
{ "$ref": "#/$defs/check" },
{
"properties": {
"checkId": { "const": "capacity.exhausted" },
"reasonCode": {
"enum": ["CAPACITY_EXHAUSTED", "CAPACITY_REMAINING", "CAPACITY_UNAVAILABLE", "EVIDENCE_MISSING", "INVALID_EVIDENCE", "EVIDENCE_STALE", "EVIDENCE_FRESHNESS_UNKNOWN", "CLOCK_SKEW"]
}
}
}
]
},
"flagsCheck": {
"allOf": [
{ "$ref": "#/$defs/check" },
{
"properties": {
"checkId": { "const": "cluster.reportedFlags" },
"reasonCode": {
"enum": ["COARSE_CONDITION_REPORTED", "NO_COARSE_CONDITION_REPORTED", "EVIDENCE_MISSING", "INVALID_EVIDENCE", "EVIDENCE_STALE", "EVIDENCE_FRESHNESS_UNKNOWN", "CLOCK_SKEW"]
}
}
}
]
},
"check": {
"type": "object",
"additionalProperties": false,
"required": ["checkId", "outcome", "reasonCode", "resourceAlias"],
"properties": {
"checkId": { "type": "string" },
"outcome": { "enum": ["PASS", "FAIL", "UNKNOWN"] },
"reasonCode": { "type": "string" },
"resourceAlias": { "const": "cluster-1" }
}
},
"unsupported": {
"type": "object",
"additionalProperties": false,
"required": ["checkId", "reasonCode"],
"properties": {
"checkId": { "type": "string" },
"reasonCode": { "const": "EVIDENCE_CONTRACT_UNAVAILABLE" }
}
},
"unsupportedMemory": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "memory.reportedPressure" } } }] },
"unsupportedTls": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "tls.validity" } } }] },
"unsupportedCpu": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "cpu.sufficiency" } } }] },
"unsupportedSwap": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "swap.pressure" } } }] },
"unsupportedDrive": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "drive.health" } } }] },
"unsupportedInode": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "inode.available" } } }] },
"unsupportedFilesystem": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "filesystem.compatibility" } } }] },
"unsupportedOsKernel": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "osKernel.compatibility" } } }] },
"unsupportedLaunch": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "launch.permissions" } } }] },
"unsupportedVersion": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "version.consistency" } } }] },
"unsupportedKubernetes": { "allOf": [{ "$ref": "#/$defs/unsupported" }, { "properties": { "checkId": { "const": "kubernetes.configuration" } } }] }
}
}
+362
View File
@@ -0,0 +1,362 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://connect.rustfs.com/schemas/agent/v1/job-envelope.schema.json",
"title": "RustFS Connect Agent Job Envelope v1",
"type": "object",
"additionalProperties": false,
"required": [
"jobId",
"protocolVersion",
"jobType",
"schemaVersion",
"organizationName",
"clusterName",
"deviceName",
"createTime",
"expireTime",
"nonce",
"requiredCapabilities",
"authorization",
"limits",
"parameters",
"signature"
],
"properties": {
"jobId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"protocolVersion": { "const": "v1" },
"jobType": { "enum": ["health.check", "profile.cpu", "profile.memory", "profile.threads", "performance.drive", "performance.network", "top.api", "top.locks", "top.rpc"] },
"schemaVersion": { "const": 1 },
"organizationName": { "type": "string", "pattern": "^organizations/[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"clusterName": { "type": "string", "pattern": "^organizations/[0-9a-f-]{36}/clusters/[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"deviceName": { "type": "string", "pattern": "^organizations/[0-9a-f-]{36}/clusters/[0-9a-f-]{36}/clusterDevices/[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"createTime": { "type": "string", "format": "date-time" },
"expireTime": { "type": "string", "format": "date-time" },
"nonce": { "type": "string", "pattern": "^[A-Za-z0-9_-]{43}$" },
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "enum": ["health.check.service@1", "profile.cpu@1", "profile.memory.service@1", "profile.threads@1", "performance.drive@1", "performance.network@1", "top.api@1", "top.locks@1", "top.rpc@1"] }],
"items": false,
"minItems": 1,
"maxItems": 1,
"uniqueItems": true
},
"limits": {
"type": "object",
"additionalProperties": false,
"required": ["timeoutSeconds", "maxOutputBytes", "maxMemoryBytes", "maxCpuMillis"],
"properties": {
"timeoutSeconds": { "type": "integer", "minimum": 1, "maximum": 30 },
"maxOutputBytes": { "type": "integer", "minimum": 1, "maximum": 524288 },
"maxMemoryBytes": { "type": "integer", "minimum": 1, "maximum": 67108864 },
"maxCpuMillis": { "type": "integer", "minimum": 1, "maximum": 30000 }
}
},
"authorization": {
"type": "object",
"additionalProperties": false,
"required": ["actorType", "actorName", "requestId"],
"properties": {
"actorType": { "const": "BROWSER_USER" },
"actorName": { "type": "string", "pattern": "^users/[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"requestId": { "type": "string", "format": "uuid", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" }
}
},
"parameters": {
"type": "object",
"additionalProperties": false,
"required": ["artifactUid", "consentUid", "consentPolicyRevision", "consentExpiresAt"],
"properties": {
"artifactUid": { "type": "string", "format": "uuid", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"consentUid": { "type": "string", "format": "uuid", "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$" },
"consentPolicyRevision": { "type": "integer", "minimum": 1 },
"consentExpiresAt": { "type": "string", "format": "date-time" },
"durationMillis": { "type": "integer", "minimum": 1, "maximum": 30000 },
"samplePeriodMicros": { "type": "integer", "minimum": 1, "maximum": 30000000 },
"maxEvidenceAgeSeconds": { "type": "integer", "minimum": 1, "maximum": 86400 },
"targetAlias": { "const": "drive-1" },
"scratchBytes": { "const": 524288 },
"blockBytes": { "const": 65536 },
"trafficBytes": { "type": "integer", "minimum": 1, "maximum": 1048576 }
}
},
"signature": {
"type": "object",
"additionalProperties": false,
"required": ["algorithm", "keyId", "value"],
"properties": {
"algorithm": { "const": "Ed25519" },
"keyId": { "type": "string", "minLength": 1 },
"value": { "type": "string", "minLength": 43 }
}
}
},
"allOf": [
{
"if": { "properties": { "jobType": { "const": "health.check" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "health.check.service@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": {
"timeoutSeconds": { "const": 30 },
"maxOutputBytes": { "const": 262144 },
"maxMemoryBytes": { "const": 67108864 },
"maxCpuMillis": { "const": 5000 }
}
},
"parameters": {
"type": "object",
"required": ["maxEvidenceAgeSeconds"],
"not": {
"anyOf": [
{ "required": ["durationMillis"] },
{ "required": ["samplePeriodMicros"] },
{ "required": ["targetAlias"] },
{ "required": ["scratchBytes"] },
{ "required": ["blockBytes"] },
{ "required": ["trafficBytes"] }
]
}
}
}
},
"else": {
"properties": {
"parameters": {
"type": "object",
"required": ["durationMillis", "samplePeriodMicros"],
"not": { "required": ["maxEvidenceAgeSeconds"] }
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "performance.drive" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "performance.drive@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": { "maxCpuMillis": { "type": "integer", "maximum": 5000 } }
},
"parameters": {
"type": "object",
"required": ["targetAlias", "scratchBytes", "blockBytes"],
"properties": {
"durationMillis": { "const": 5000 },
"targetAlias": { "const": "drive-1" },
"scratchBytes": { "const": 524288 },
"blockBytes": { "const": 65536 }
},
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
},
"else": {
"properties": {
"parameters": {
"type": "object",
"not": {
"anyOf": [
{ "required": ["targetAlias"] },
{ "required": ["scratchBytes"] },
{ "required": ["blockBytes"] }
]
}
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "performance.network" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "performance.network@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": { "maxCpuMillis": { "type": "integer", "maximum": 5000 } }
},
"parameters": {
"type": "object",
"required": ["trafficBytes"],
"properties": { "trafficBytes": { "type": "integer", "minimum": 1, "maximum": 1048576 } }
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "profile.cpu" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "profile.cpu@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"parameters": {
"type": "object",
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "profile.memory" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "profile.memory.service@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": {
"maxCpuMillis": { "type": "integer", "maximum": 5000 },
"maxMemoryBytes": { "const": 67108864 }
}
},
"parameters": {
"type": "object",
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "profile.threads" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "profile.threads@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"parameters": {
"type": "object",
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "top.api" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "top.api@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": { "maxCpuMillis": { "type": "integer", "maximum": 5000 } }
},
"parameters": {
"type": "object",
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "top.rpc" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "top.rpc@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": { "maxCpuMillis": { "type": "integer", "maximum": 5000 } }
},
"parameters": {
"type": "object",
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
}
},
{
"if": { "properties": { "jobType": { "const": "top.locks" } } },
"then": {
"properties": {
"requiredCapabilities": {
"type": "array",
"prefixItems": [{ "const": "top.locks@1" }],
"items": false,
"minItems": 1,
"maxItems": 1
},
"limits": {
"type": "object",
"properties": { "maxCpuMillis": { "type": "integer", "maximum": 5000 } }
},
"parameters": {
"type": "object",
"not": {
"type": "object",
"properties": { "trafficBytes": true },
"required": ["trafficBytes"]
}
}
}
}
}
]
}