Self-Healing Code Agent — Post-Implementation Verification Suite
Run every verification step sequentially. For each step, execute the command or script,
capture the output, and report PASS or FAIL with details. If a step fails, log the
error clearly but continue to the next step — do NOT stop on first failure.
At the end, produce a summary table of all steps with their status.
The current project directory (Self-Healing-Code-Agent)
Run every step in order. Do not skip any step.
If a step fails, log the full error output, mark it FAIL, and continue to the next step.
Do not attempt to fix anything during verification — only observe and report.
At the end, produce a SUMMARY TABLE with columns: Step Number, Step Name, Status (PASS/FAIL), Notes.
Use LLM_PROVIDER=mock for all test commands unless the step explicitly says otherwise.
For steps that require running Python scripts, use the project root as the working directory.
Capture and display both stdout and stderr for every command.
python3 --version
Python 3.11 or higher
pip install -r requirements.txt 2>&1 | tail -20
All packages install without errors. Note any version conflicts or failures.
If chromadb fails to install, note it but continue — tests are designed to skip when chromadb is absent.
LLM_PROVIDER=mock pytest -v --tb=short 2>&1
All tests pass. The report from Claude Code said 44 passed, 3 skipped.
Verify the exact count. Skipped tests should only be chromadb-related.
No test should have status "ERROR" (as opposed to "FAIL" or "SKIP").
Total passed count matches or exceeds 44
Skipped tests are only in test_memory_store.py
Zero failures
Zero errors
"running" does NOT appear as an accepted terminal status in test_graph_mock.py output
10, f'{r}: system prompt too short ({len(prompt)} chars)'
print(f' {r}: prompt={len(prompt)} chars, schema_keys={list(schema.get(\"properties\", {}).keys())}')
# Verify new templates exist
templates_to_check = [
('generator', 'initial'),
('generator', 'repair'),
('qa_adversarial', 'generate'),
('qa_adversarial', 'generate_from_spec'),
('debugger', 'diagnose'),
('debugger', 'react_diagnose'),
('memory_summarizer', 'summarize'),
('critic', 'review'),
]
for role, template_key in templates_to_check:
raw = get_raw_template(role, template_key)
assert len(raw) > 20, f'{role}/{template_key}: template too short'
print(f' {role}/{template_key}: {len(raw)} chars OK')
print('ALL YAML CHECKS PASSED')
"
]]>
All 5 roles found. All templates load. No KeyError or FileNotFoundError.
')
print(f' Graph built OK: {edge_count} edges')
except Exception as e:
print(f' GRAPH BUILD FAILED: {e}')
import traceback
traceback.print_exc()
print('GRAPH BUILD CHECKS COMPLETE')
"
]]>
All three presets build without errors.
Development should have the fewest edges.
Production should have the most edges.
0, 'No code generated'
assert len(state.get('events', [])) > 0, 'No events emitted'
print('SINGLE TASK TEST PASSED')
asyncio.run(test())
"
]]>
Status is "success" or "max_iterations_reached". Code is non-empty. Events are emitted.
0, 'No events streamed'
for e in events:
assert 'type' in e, f'Event missing type field: {e}'
assert 'message' in e, f'Event missing message field: {e}'
print('STREAM AGENT TEST PASSED')
asyncio.run(test())
"
]]>
Multiple events streamed. Each event has "type" and "message" fields.
= {len(rendered)}'
assert 'TRUNCATED' in result, 'Missing TRUNCATED marker'
print(f'Test 1 PASSED: {len(rendered)} chars -> {len(result)} chars')
# Test 2: Small input passes through unchanged
small_var = 'def f(): pass'
rendered_small = template.format(code=small_var)
result_small = build_context(rendered_small, {'code': small_var}, template_str=template, max_context_tokens=5000)
assert result_small == rendered_small, 'Small input was incorrectly modified'
print(f'Test 2 PASSED: small input unchanged')
# Test 3: Fallback without template_str
result_fallback = build_context(rendered, {'code': huge_var}, max_context_tokens=100)
assert len(result_fallback) < len(rendered), 'Fallback truncation failed'
print(f'Test 3 PASSED: fallback truncation works')
print('CONTEXT BUILDER TESTS ALL PASSED')
"
]]>
All three tests pass. This confirms Fix 1 (the original bug) is actually fixed.
Fallback is used. Result contains role-specific safe defaults with low confidence.
list[list[int]]:
\"\"\"Merge overlapping intervals.\"\"\"
if not intervals:
return []
return sorted(intervals)
'''
result = inspect_function(code, 'merge_intervals')
assert 'merge_intervals' in result, f'inspect_function failed: {result}'
assert 'intervals' in result, f'inspect_function missing args: {result}'
print(f'inspect_function: {result.strip()[:200]}')
# Test diff_iterations
v1 = 'def f(x):\n return x\n'
v2 = 'def f(x):\n return x + 1\n'
result = diff_iterations(v1, v2)
assert 'return x + 1' in result or '+' in result, f'diff failed: {result}'
print(f'diff_iterations: {result.strip()[:200]}')
# Test call_tool dispatch
result = await call_tool('run_snippet', {'code': 'print(42)'})
assert '42' in result, f'call_tool dispatch failed: {result}'
print(f'call_tool dispatch: OK')
# Test unknown tool
result = await call_tool('nonexistent_tool', {})
assert 'Unknown' in result, f'Unknown tool should return error: {result}'
print(f'Unknown tool handling: OK')
print('ALL TOOL TESTS PASSED')
asyncio.run(test())
"
]]>
All three tools produce correct output. call_tool dispatches correctly. Unknown tools return error message.
All four edge cases handled correctly.
All sandbox isolation tests pass including timeout, syntax error, import error capture.
All three presets have correct field values. Default constructor works.
= 0
print(f'NodeMetrics: latency={nm.latency_seconds}s cost=\${nm.estimated_cost_usd:.6f}')
# RunMetrics
rm = RunMetrics(task_id='test_task', node_metrics=[nm])
d = rm.to_dict()
assert d['task_id'] == 'test_task'
assert 'nodes' in d
assert len(d['nodes']) == 1
assert d['nodes'][0]['name'] == 'test'
print(f'RunMetrics.to_dict(): {list(d.keys())}')
print('METRICS MODULE CHECKS PASSED')
"
]]>
NodeMetrics computes latency and cost. RunMetrics serializes correctly.
= not > in merge condition.', 'interval_merging', 'off_by_one', 'test002')
print(f'Stored 2 lessons. Total: {store.total_lessons}')
# Retrieve by semantic query
results = store.retrieve_relevant_lessons('empty list edge case')
assert len(results) > 0, 'No lessons retrieved'
print(f'Retrieved {len(results)} lessons for query \"empty list edge case\"')
print(f' Top result: {results[0][:80]}')
# Retrieve with category filter
results_filtered = store.retrieve_relevant_lessons('merge condition', task_category='interval_merging')
print(f'Retrieved {len(results_filtered)} lessons with category filter')
# Deduplication (store same lesson again)
store.store_lesson('Always handle empty inputs before indexing.', 'interval_merging', 'boundary', 'test001')
assert store.total_lessons == 2, f'Dedup failed: expected 2, got {store.total_lessons}'
print('Deduplication: PASS')
print('MEMORY STORE CHECKS PASSED')
"
]]>
If chromadb is installed: store, retrieve, and dedup all work. If not installed: gracefully skipped.
0, f'{name}: empty formatted output'
print(f' {name}: type={d[\"type\"]} formatted={formatted[:80]}')
print('ALL EVENT AND STREAMING CHECKS PASSED')
"
]]>
All event constructors produce valid dicts. All formatters produce non-empty timeline strings.
50, f'{preset}: mermaid too short ({len(mermaid)} chars)'
assert '-->' in mermaid, f'{preset}: no edges in mermaid'
edge_count = mermaid.count('-->')
print(f'{preset}: {edge_count} edges, {len(mermaid)} chars')
print('GRAPH VISUALIZATION CHECKS PASSED')
"
]]>
All three presets generate valid Mermaid diagrams with edges. Production has more edges than development.
Both adapter functions work correctly without needing the actual HumanEval dataset file.
= 40, f'Expected at least 40 total assertions, got {total_ref_tests}'
print('BENCHMARK REFERENCE TESTS CHECK PASSED')
"
]]>
All 8 tasks have reference_test_code with at least 5 assertions each. Total >= 40.
Generator routes to default. memory_summarizer routes to override.
test.yml exists, is valid YAML, runs pytest with LLM_PROVIDER=mock.
README mentions all major new concepts. Any missing items should be noted but are not blockers.
All modules import without circular import errors or missing dependency errors.
pip install ruff 2>&1 | tail -3 && ruff check . --statistics 2>&1
Zero errors is ideal. Minor warnings (unused imports, line length) are acceptable.
Report the total count and categories of any issues found.
All 15 new files exist. Total test files should be 8+. Total prompt YAML files should be 5.
After running all 25 steps, produce a summary table in this exact format:
| Step | Name | Status | Notes |
|------|------|--------|-------|
| 1 | Verify Python Version | PASS/FAIL | ... |
| 2 | Install Dependencies | PASS/FAIL | ... |
| ... | ... | ... | ... |
| 25 | Verify All Expected Files Exist | PASS/FAIL | ... |
Then add a final line:
**Overall: X/25 PASSED, Y/25 FAILED, Z/25 SKIPPED**
If any steps failed, list them with a brief explanation of what went wrong.