backbeat: add module sources

This commit is contained in:
anthonyrawlins
2025-10-17 08:56:25 +11:00
parent 627d15b3f7
commit 4b4eb16efb
48 changed files with 11636 additions and 0 deletions

View File

@@ -0,0 +1,275 @@
[
{
"description": "Missing required field 'from_beat'",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["from_beat is required"]
},
{
"description": "Missing required field 'agents_reporting'",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["agents_reporting is required"]
},
{
"description": "Invalid window_id format (too short)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["window_id must be exactly 32 hex characters"]
},
{
"description": "Invalid window_id format (non-hex characters)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4g5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["window_id must match pattern ^[0-9a-fA-F]{32}$"]
},
{
"description": "Negative from_beat",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": -1,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["from_beat must be >= 0"]
},
{
"description": "Negative agents_reporting",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": -1,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["agents_reporting must be >= 0"]
},
{
"description": "Negative on_time_reviews",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": -1,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["on_time_reviews must be >= 0"]
},
{
"description": "Too many issues (over 100)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"issues": []
},
"note": "This would need 101 issues to properly test, generating dynamically in actual test"
},
{
"description": "Issue with invalid severity",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"issues": [
{
"severity": "invalid_severity",
"category": "timing",
"count": 1,
"description": "Some issue"
}
]
},
"expected_errors": ["issue.severity must be one of: info, warning, error, critical"]
},
{
"description": "Issue with invalid category",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"issues": [
{
"severity": "warning",
"category": "invalid_category",
"count": 1,
"description": "Some issue"
}
]
},
"expected_errors": ["issue.category must be one of: timing, failed_tasks, missing_agents, resource_exhaustion, network_partition, credential_failure, data_corruption, unknown"]
},
{
"description": "Issue with zero count",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"issues": [
{
"severity": "warning",
"category": "timing",
"count": 0,
"description": "Some issue"
}
]
},
"expected_errors": ["issue.count must be >= 1"]
},
{
"description": "Issue with description too long (over 512 chars)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"issues": [
{
"severity": "warning",
"category": "timing",
"count": 1,
"description": "This is a very long description that exceeds the maximum allowed length of 512 characters for issue descriptions in BACKBEAT BarReport messages. This constraint is in place to prevent excessively large messages and ensure that issue descriptions remain concise and actionable. The system should reject this message because the description field contains more than 512 characters and violates the schema validation rules that have been carefully designed to maintain message size limits and system performance characteristics."
}
]
},
"expected_errors": ["issue.description must be at most 512 characters"]
},
{
"description": "Issue with too many affected agents (over 50)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"issues": [
{
"severity": "warning",
"category": "timing",
"count": 1,
"description": "Too many affected agents",
"affected_agents": [
"agent1", "agent2", "agent3", "agent4", "agent5", "agent6", "agent7", "agent8", "agent9", "agent10",
"agent11", "agent12", "agent13", "agent14", "agent15", "agent16", "agent17", "agent18", "agent19", "agent20",
"agent21", "agent22", "agent23", "agent24", "agent25", "agent26", "agent27", "agent28", "agent29", "agent30",
"agent31", "agent32", "agent33", "agent34", "agent35", "agent36", "agent37", "agent38", "agent39", "agent40",
"agent41", "agent42", "agent43", "agent44", "agent45", "agent46", "agent47", "agent48", "agent49", "agent50",
"agent51"
]
}
]
},
"expected_errors": ["issue.affected_agents must have at most 50 items"]
},
{
"description": "Wrong message type",
"message": {
"type": "backbeat.wrongtype.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1
},
"expected_errors": ["type must be 'backbeat.barreport.v1'"]
},
{
"description": "Extra unknown properties (should fail with additionalProperties: false)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 150,
"on_time_reviews": 147,
"help_promises_fulfilled": 12,
"secret_rotations_ok": true,
"tempo_drift_ms": -2.1,
"unknown_field": "should not be allowed"
},
"expected_errors": ["Additional property unknown_field is not allowed"]
}
]

View File

@@ -0,0 +1,190 @@
[
{
"description": "Healthy cluster with good performance",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"from_beat": 240,
"to_beat": 359,
"agents_reporting": 978,
"on_time_reviews": 942,
"help_promises_fulfilled": 87,
"secret_rotations_ok": true,
"tempo_drift_ms": 7.3,
"issues": [
{
"severity": "warning",
"category": "timing",
"count": 12,
"description": "Some agents consistently reporting 50ms+ late",
"affected_agents": ["worker:batch-03", "indexer:shard-7"],
"first_seen_beat": 245,
"last_seen_beat": 358
}
],
"performance": {
"avg_response_time_ms": 45.2,
"p95_response_time_ms": 125.7,
"total_tasks_completed": 15678,
"total_tasks_failed": 23,
"peak_concurrent_agents": 1203,
"network_bytes_transferred": 67890123
},
"health_indicators": {
"cluster_sync_score": 0.94,
"resource_utilization": 0.67,
"collaboration_efficiency": 0.89,
"error_rate": 0.001
}
}
},
{
"description": "Small development cluster with perfect sync",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "a1b2c3d4e5f6789012345678901234ab",
"from_beat": 0,
"to_beat": 119,
"agents_reporting": 5,
"on_time_reviews": 5,
"help_promises_fulfilled": 2,
"secret_rotations_ok": true,
"tempo_drift_ms": -0.1,
"issues": []
}
},
{
"description": "Cluster with multiple serious issues",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "fedcba9876543210fedcba9876543210",
"from_beat": 1200,
"to_beat": 1319,
"agents_reporting": 450,
"on_time_reviews": 380,
"help_promises_fulfilled": 15,
"secret_rotations_ok": false,
"tempo_drift_ms": 125.7,
"issues": [
{
"severity": "critical",
"category": "credential_failure",
"count": 3,
"description": "Failed to rotate database credentials",
"affected_agents": ["db-manager:primary", "backup:secondary"],
"first_seen_beat": 1205,
"last_seen_beat": 1318
},
{
"severity": "error",
"category": "network_partition",
"count": 1,
"description": "Lost connection to east coast data center",
"affected_agents": ["worker:east-01", "worker:east-02", "worker:east-03"],
"first_seen_beat": 1210,
"last_seen_beat": 1319
},
{
"severity": "warning",
"category": "resource_exhaustion",
"count": 45,
"description": "High memory usage detected",
"affected_agents": ["ml-trainer:gpu-01"],
"first_seen_beat": 1200,
"last_seen_beat": 1315
}
],
"performance": {
"avg_response_time_ms": 180.5,
"p95_response_time_ms": 450.0,
"total_tasks_completed": 5432,
"total_tasks_failed": 123,
"peak_concurrent_agents": 487,
"network_bytes_transferred": 23456789
},
"health_indicators": {
"cluster_sync_score": 0.72,
"resource_utilization": 0.95,
"collaboration_efficiency": 0.45,
"error_rate": 0.022
}
}
},
{
"description": "High-frequency cluster report (8 BPM tempo)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "0123456789abcdef0123456789abcdef",
"from_beat": 960,
"to_beat": 1079,
"agents_reporting": 2000,
"on_time_reviews": 1985,
"help_promises_fulfilled": 156,
"secret_rotations_ok": true,
"tempo_drift_ms": 3.2,
"issues": [
{
"severity": "info",
"category": "timing",
"count": 15,
"description": "Minor timing variations detected",
"first_seen_beat": 965,
"last_seen_beat": 1078
}
],
"performance": {
"avg_response_time_ms": 25.1,
"p95_response_time_ms": 67.3,
"total_tasks_completed": 45678,
"total_tasks_failed": 12,
"peak_concurrent_agents": 2100,
"network_bytes_transferred": 123456789
},
"health_indicators": {
"cluster_sync_score": 0.98,
"resource_utilization": 0.78,
"collaboration_efficiency": 0.92,
"error_rate": 0.0003
},
"metadata": {
"reverb_version": "1.3.0",
"report_generation_time_ms": 45.7,
"next_window_id": "fedcba0987654321fedcba0987654321"
}
}
},
{
"description": "Minimal valid bar report (only required fields)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "1111222233334444555566667777888",
"from_beat": 600,
"to_beat": 719,
"agents_reporting": 1,
"on_time_reviews": 1,
"help_promises_fulfilled": 0,
"secret_rotations_ok": true,
"tempo_drift_ms": 0.0
}
},
{
"description": "Empty issues array (valid)",
"message": {
"type": "backbeat.barreport.v1",
"window_id": "9999aaaa0000bbbb1111cccc2222dddd",
"from_beat": 480,
"to_beat": 599,
"agents_reporting": 100,
"on_time_reviews": 98,
"help_promises_fulfilled": 25,
"secret_rotations_ok": true,
"tempo_drift_ms": -1.5,
"issues": [],
"performance": {
"avg_response_time_ms": 50.0,
"total_tasks_completed": 1000,
"total_tasks_failed": 2
}
}
}
]

View File

@@ -0,0 +1,152 @@
[
{
"description": "Missing required field 'beat_index'",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"downbeat": false,
"phase": "execute",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["beat_index is required"]
},
{
"description": "Invalid phase value",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "invalid_phase",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["phase must be one of: plan, execute, review"]
},
{
"description": "Invalid HLC format (wrong number of segments)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["hlc must match pattern ^[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}$"]
},
{
"description": "Invalid HLC format (non-hex characters)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "gggg:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["hlc must match pattern ^[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}$"]
},
{
"description": "Invalid window_id format (too short)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d"
},
"expected_errors": ["window_id must be exactly 32 hex characters"]
},
{
"description": "Invalid tempo_bpm (too low)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 0.05,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["tempo_bpm must be at least 0.1"]
},
{
"description": "Invalid tempo_bpm (too high)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 1001.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["tempo_bpm must be at most 1000"]
},
{
"description": "Invalid beat_index (negative)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": -1,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["beat_index must be >= 0"]
},
{
"description": "Wrong message type",
"message": {
"type": "backbeat.wrongtype.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
},
"expected_errors": ["type must be 'backbeat.beatframe.v1'"]
},
{
"description": "Extra unknown properties (should fail with additionalProperties: false)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "test",
"beat_index": 0,
"downbeat": false,
"phase": "plan",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:00:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5",
"unknown_field": "should not be allowed"
},
"expected_errors": ["Additional property unknown_field is not allowed"]
}
]

View File

@@ -0,0 +1,82 @@
[
{
"description": "Standard beat frame during execute phase",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "chorus-prod",
"beat_index": 1337,
"downbeat": false,
"phase": "execute",
"hlc": "7ffd:0001:abcd",
"deadline_at": "2025-09-05T12:30:00Z",
"tempo_bpm": 2.0,
"window_id": "7e9b0e6c4c9a4e59b7f2d9a3c1b2e4d5"
}
},
{
"description": "Downbeat starting new bar in plan phase",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "dev-cluster",
"beat_index": 0,
"downbeat": true,
"phase": "plan",
"hlc": "0001:0000:cafe",
"deadline_at": "2025-09-05T12:00:30Z",
"tempo_bpm": 4.0,
"window_id": "a1b2c3d4e5f6789012345678901234ab"
}
},
{
"description": "High-frequency beat with metadata",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "fast-cluster",
"beat_index": 999999,
"downbeat": false,
"phase": "review",
"hlc": "abcd:ef01:2345",
"deadline_at": "2025-09-05T12:00:07.5Z",
"tempo_bpm": 8.0,
"window_id": "fedcba9876543210fedcba9876543210",
"metadata": {
"pulse_version": "1.2.3",
"cluster_health": "healthy",
"expected_agents": 150
}
}
},
{
"description": "Low-frequency beat (1 BPM = 60 second beats)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "slow-batch",
"beat_index": 42,
"downbeat": true,
"phase": "plan",
"hlc": "FFFF:FFFF:FFFF",
"deadline_at": "2025-09-05T13:00:00Z",
"tempo_bpm": 1.0,
"window_id": "0123456789abcdef0123456789abcdef",
"metadata": {
"pulse_version": "2.0.0",
"cluster_health": "degraded",
"expected_agents": 5
}
}
},
{
"description": "Minimal valid beat frame (no optional fields)",
"message": {
"type": "backbeat.beatframe.v1",
"cluster_id": "minimal",
"beat_index": 1,
"downbeat": false,
"phase": "execute",
"hlc": "0000:0001:0002",
"deadline_at": "2025-09-05T12:01:00Z",
"tempo_bpm": 2.0,
"window_id": "1234567890abcdef1234567890abcdef"
}
}
]

View File

@@ -0,0 +1,189 @@
[
{
"description": "Missing required field 'beat_index'",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"state": "executing",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["beat_index is required"]
},
{
"description": "Missing required field 'state'",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["state is required"]
},
{
"description": "Missing required field 'hlc'",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing"
},
"expected_errors": ["hlc is required"]
},
{
"description": "Invalid state value",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "invalid_state",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["state must be one of: idle, planning, executing, reviewing, completed, failed, blocked, helping"]
},
{
"description": "Invalid progress value (negative)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"progress": -0.1,
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["progress must be between 0.0 and 1.0"]
},
{
"description": "Invalid progress value (greater than 1.0)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"progress": 1.1,
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["progress must be between 0.0 and 1.0"]
},
{
"description": "Invalid beats_left (negative)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"beats_left": -1,
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["beats_left must be >= 0"]
},
{
"description": "Invalid beats_left (too high)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"beats_left": 1001,
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["beats_left must be <= 1000"]
},
{
"description": "Invalid beat_index (negative)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": -1,
"state": "executing",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["beat_index must be >= 0"]
},
{
"description": "Invalid HLC format",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"hlc": "invalid-hlc"
},
"expected_errors": ["hlc must match pattern ^[0-9a-fA-F]{4}:[0-9a-fA-F]{4}:[0-9a-fA-F]{4}$"]
},
{
"description": "Notes too long (over 256 characters)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"notes": "This is a very long notes field that exceeds the maximum allowed length of 256 characters. This should fail validation because it contains too much text and violates the maxLength constraint that was set to keep status messages concise and prevent excessive message sizes in the BACKBEAT system.",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["notes must be at most 256 characters"]
},
{
"description": "Too many dependencies (over 50)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "blocked",
"hlc": "7ffd:0001:abcd",
"dependencies": [
"dep1", "dep2", "dep3", "dep4", "dep5", "dep6", "dep7", "dep8", "dep9", "dep10",
"dep11", "dep12", "dep13", "dep14", "dep15", "dep16", "dep17", "dep18", "dep19", "dep20",
"dep21", "dep22", "dep23", "dep24", "dep25", "dep26", "dep27", "dep28", "dep29", "dep30",
"dep31", "dep32", "dep33", "dep34", "dep35", "dep36", "dep37", "dep38", "dep39", "dep40",
"dep41", "dep42", "dep43", "dep44", "dep45", "dep46", "dep47", "dep48", "dep49", "dep50",
"dep51"
]
},
"expected_errors": ["dependencies must have at most 50 items"]
},
{
"description": "Invalid agent_id format (empty)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "",
"beat_index": 100,
"state": "executing",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["agent_id must be at least 1 character"]
},
{
"description": "Agent_id too long (over 128 characters)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "this_is_a_very_long_agent_id_that_exceeds_the_maximum_allowed_length_of_128_characters_and_should_fail_validation_because_it_is_too_long_for_the_system_to_handle_properly",
"beat_index": 100,
"state": "executing",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["agent_id must be at most 128 characters"]
},
{
"description": "Wrong message type",
"message": {
"type": "backbeat.wrongtype.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"hlc": "7ffd:0001:abcd"
},
"expected_errors": ["type must be 'backbeat.statusclaim.v1'"]
},
{
"description": "Extra unknown properties (should fail with additionalProperties: false)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "test:agent",
"beat_index": 100,
"state": "executing",
"hlc": "7ffd:0001:abcd",
"unknown_field": "should not be allowed"
},
"expected_errors": ["Additional property unknown_field is not allowed"]
}
]

View File

@@ -0,0 +1,135 @@
[
{
"description": "Worker executing a batch processing task",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "search-indexer:worker-03",
"task_id": "index-batch:20250905-120",
"beat_index": 1337,
"state": "executing",
"beats_left": 3,
"progress": 0.65,
"notes": "processing batch 120/200",
"hlc": "7ffd:0001:beef",
"resources": {
"cpu_percent": 85.0,
"memory_mb": 2048,
"disk_io_ops": 1250,
"network_kb": 512
}
}
},
{
"description": "Failed backup agent with error details",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "agent:backup-runner",
"beat_index": 1338,
"state": "failed",
"beats_left": 0,
"progress": 0.0,
"notes": "connection timeout to storage backend",
"hlc": "7ffe:0002:dead",
"metadata": {
"agent_version": "2.1.0",
"error_code": "STORAGE_TIMEOUT",
"retry_count": 3
}
}
},
{
"description": "ML trainer helping another node",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "ml-trainer:gpu-node-1",
"beat_index": 1336,
"state": "helping",
"progress": 1.0,
"notes": "completed own work, assisting node-2 with large model",
"hlc": "7ffc:0005:cafe",
"dependencies": ["ml-trainer:gpu-node-2"]
}
},
{
"description": "Idle agent waiting for work",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "worker:standby-01",
"beat_index": 1339,
"state": "idle",
"progress": 0.0,
"hlc": "8000:0000:1111"
}
},
{
"description": "Agent in planning phase",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "coordinator:main",
"task_id": "deploy:v2.1.0",
"beat_index": 1340,
"state": "planning",
"beats_left": 5,
"progress": 0.2,
"notes": "analyzing dependency graph",
"hlc": "8001:0001:2222",
"resources": {
"cpu_percent": 15.0,
"memory_mb": 512
}
}
},
{
"description": "Reviewing agent with completed task",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "quality-checker:auto",
"task_id": "validate:batch-45",
"beat_index": 1341,
"state": "reviewing",
"beats_left": 1,
"progress": 0.9,
"notes": "final verification of output quality",
"hlc": "8002:0002:3333"
}
},
{
"description": "Completed agent ready for next task",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "processor:fast-01",
"task_id": "process:item-567",
"beat_index": 1342,
"state": "completed",
"beats_left": 0,
"progress": 1.0,
"notes": "item processed successfully",
"hlc": "8003:0003:4444"
}
},
{
"description": "Blocked agent waiting for external dependency",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "data-loader:external",
"task_id": "load:dataset-789",
"beat_index": 1343,
"state": "blocked",
"beats_left": 10,
"progress": 0.1,
"notes": "waiting for external API rate limit reset",
"hlc": "8004:0004:5555",
"dependencies": ["external-api:rate-limiter"]
}
},
{
"description": "Minimal valid status claim (only required fields)",
"message": {
"type": "backbeat.statusclaim.v1",
"agent_id": "simple:agent",
"beat_index": 1344,
"state": "idle",
"hlc": "8005:0005:6666"
}
}
]