73 lines
2.5 KiB
JSON
73 lines
2.5 KiB
JSON
{
|
|
"description": "Verify NATS JetStream streams for the ops contract exist with required configuration and that ops-controller is registered as the sole WorkQueue consumer (ADR-037).",
|
|
"id": "validate-ops-contract",
|
|
"params": {
|
|
"nats_creds_path": "",
|
|
"nats_url": "nats://127.0.0.1:4222",
|
|
"workspace": "libre-wuji"
|
|
},
|
|
"steps": [
|
|
{
|
|
"actor": "Agent",
|
|
"cmd": "nats stream info OPS_PENDING_{workspace} OPS_CMD_{workspace} OPS_AUDIT_{workspace} --server={nats_url}",
|
|
"depends_on": [],
|
|
"id": "check_streams_exist",
|
|
"name": "Verify OPS_PENDING / OPS_CMD / OPS_AUDIT streams exist",
|
|
"on_error": "abort"
|
|
},
|
|
{
|
|
"actor": "Agent",
|
|
"cmd": "nats stream info OPS_PENDING_{workspace} --server={nats_url} --json | jq -e '.config.retention == \"workqueue\"'",
|
|
"depends_on": [
|
|
"check_streams_exist"
|
|
],
|
|
"id": "check_pending_retention",
|
|
"name": "OPS_PENDING stream uses WorkQueue retention",
|
|
"on_error": "abort"
|
|
},
|
|
{
|
|
"actor": "Agent",
|
|
"cmd": "nats stream info OPS_AUDIT_{workspace} --server={nats_url} --json | jq -e '.config.retention == \"limits\" and .config.storage == \"file\"'",
|
|
"depends_on": [
|
|
"check_streams_exist"
|
|
],
|
|
"id": "check_audit_retention",
|
|
"name": "OPS_AUDIT stream uses Limits retention with replay=instant",
|
|
"on_error": "warn"
|
|
},
|
|
{
|
|
"actor": "Agent",
|
|
"cmd": "nats consumer ls OPS_CMD_{workspace} --server={nats_url} --json | jq -e 'length == 1'",
|
|
"depends_on": [
|
|
"check_streams_exist"
|
|
],
|
|
"id": "check_single_consumer",
|
|
"name": "Verify ops-controller is the only active WorkQueue consumer on OPS_CMD",
|
|
"on_error": "abort"
|
|
},
|
|
{
|
|
"actor": "Agent",
|
|
"cmd": "nats consumer info OPS_CMD_{workspace} {workspace}-ops-controller --server={nats_url} --json | jq -e '.config.ack_policy == \"explicit\"'",
|
|
"depends_on": [
|
|
"check_single_consumer"
|
|
],
|
|
"id": "check_consumer_ack_policy",
|
|
"name": "ops-controller consumer must use AckPolicy=explicit",
|
|
"on_error": "abort"
|
|
},
|
|
{
|
|
"actor": "Agent",
|
|
"cmd": "echo 'ops-contract validation complete for workspace={workspace}'",
|
|
"depends_on": [
|
|
"check_pending_retention",
|
|
"check_audit_retention",
|
|
"check_consumer_ack_policy"
|
|
],
|
|
"id": "summary_report",
|
|
"name": "Emit validation summary",
|
|
"on_error": "warn"
|
|
}
|
|
],
|
|
"strategy": "Override",
|
|
"version": "1.0"
|
|
}
|