Skip to main content

Harness Checklist

5 min read

Required and optional harnesses organized by pattern.

Required Harnesses by Pattern​

Table 1. Required and optional harnesses with priority by MSA pattern

PatternRequired HarnessesOptional HarnessesPriority
L1: CRUD- API contract verification
- Basic unit tests
- Integration tests
- Performance tests
- Security scans
P0
L2: Sync MSA- Service contract verification
- Timeout/retry
- Circuit breaker
- Contract Testing
- Chaos engineering
- Load tests
P1
L3: Async Events- Event schema verification
- Idempotency harness
- Event ordering verification
- Eventually Consistent tests
- Event replay
- Dead Letter Queue
P1
L4: Saga- Saga step verification
- Compensating transaction verification
- Failure scenario tests
- Timeout harness
- Distributed tracing
- Chaos engineering
P0
L5: Event Sourcing- Event schema verification
- Projection verification
- Event replay
- Event migration
- Snapshot strategy
- Performance tests
P0

Harness Implementation Examples​

Idempotency Harness (L3+)​

# harness/idempotency_test.py
def test_duplicate_event_handling():
"""Verify identical results when receiving same event multiple times"""
event = OrderCreatedEvent(orderId="123", userId="U1", items=[])

# First processing
result1 = event_handler.handle(event)
state1 = get_order_state("123")

# Second processing (duplicate)
result2 = event_handler.handle(event)
state2 = get_order_state("123")

# Results must be identical
assert result1 == result2
assert state1 == state2

Compensating Transaction Harness (L4+)​

# harness/saga_compensation_test.py
def test_saga_compensation():
"""Verify that compensation logic works correctly on Saga failure"""
saga = TravelBookingSaga()

# 1. Flight reservation success
saga.execute_step("ReserveFlight")
assert flight_service.is_reserved("flight123")

# 2. Hotel reservation success
saga.execute_step("ReserveHotel")
assert hotel_service.is_reserved("hotel456")

# 3. On payment failure the saga triggers compensation automatically
with pytest.raises(PaymentFailedException):
saga.execute_step("ChargePayment")

# 4. Verify the compensation the orchestrator ran on failure
assert saga.status == "compensated"
assert not hotel_service.is_reserved("hotel456") # cancelled
assert not flight_service.is_reserved("flight123") # cancelled

Projection Verification Harness (L5)​

# harness/projection_test.py
def test_projection_consistency():
"""Verify event sourcing projection accuracy"""
# AccountBalanceView.source = [AccountOpened, MoneyDeposited, MoneyWithdrawn]
# 1. Create events
events = [
AccountOpenedEvent(accountId="A1", balance=1000),
MoneyDepositedEvent(accountId="A1", amount=500),
MoneyWithdrawnEvent(accountId="A1", amount=200),
]

# 2. Store events
for event in events:
event_store.append(event)

# 3. Update projection
projection_service.rebuild("AccountBalanceView")

# 4. Verify Read Model
balance_view = read_db.get_account_balance("A1")
assert balance_view.balance == 1300 # 1000 + 500 - 200
assert balance_view.version == 3

Harness Priority Guide​

P0 (Required)​

Project failure results in data loss or serious business impact

  • Example: Compensating transaction verification, event schema verification

Project failure results in service outage or user experience degradation

  • Example: Timeout/retry, idempotency verification

P2 (Optional)​

Quality improvement or operational convenience

  • Example: Performance tests, chaos engineering

CI/CD Integration​

Automation Pipeline​

aidlc-cli is not a published tool; it is a placeholder for the ontology, harness and quality-gate validator that your organization must implement. No public CLI with this name was found (as of 2026-10-29), and the commands and options below are examples of the interface that validator should provide. Each GitHub Actions job runs on a separate runner, so for the quality-gate job to read the harness results, the run-harness job must upload the result files as an artifact and the quality-gate job must download them. needs: passes only the execution order and whether the earlier jobs succeeded.

# .github/workflows/aidlc-validation.yml
name: AIDLC Validation

on: [push, pull_request]

jobs:
validate-ontology:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Validate Ontology
run: |
aidlc-cli validate-ontology --path ontology/

run-harness:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Run Harness Tests
run: |
aidlc-cli run-harness --suite saga --output harness-results/saga.json
aidlc-cli run-harness --suite idempotency --output harness-results/idempotency.json
- name: Upload Harness Results
uses: actions/upload-artifact@v4
with:
name: harness-results
path: harness-results/

quality-gate:
runs-on: ubuntu-latest
needs: [validate-ontology, run-harness]
steps:
- name: Download Harness Results
uses: actions/download-artifact@v4
with:
name: harness-results
path: harness-results/
- name: Check Quality Gate
run: |
aidlc-cli quality-gate --threshold 80 --results harness-results/

Next Steps​