189 lines
5.9 KiB
JSON
189 lines
5.9 KiB
JSON
[
|
|
{
|
|
"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"]
|
|
}
|
|
] |