Phase 6 of Eiffel Spec Kit. Generates adversarial tests, stress tests, and edge case tests. AI chain suggests attack vectors. Use with /eiffel.harden command.
Phase 6 of Eiffel Spec Kit. Generates adversarial tests, stress tests, and edge case tests. AI chain suggests attack vectors. Use with /eiffel.harden command.
allowed-tools
Read, Grep, Glob, Edit, Write, Bash, Task
/eiffel.harden - Phase 6: Adversarial Testing
Purpose: Break the implementation with adversarial inputs, stress tests, and edge cases.
feature -- Model Queries
items_model: MML_MAP [K, V]
-- Mathematical model of stored items.
do
create Result.make_empty
across internal_table as ic loop
Result := Result.extended (@ic.key, @ic.item)
end
end
Strengthen postconditions with frame conditions:
ensure
-- What changed
key_added: items_model.has (a_key)
value_set: items_model [a_key] = a_value
-- What did NOT change (frame condition)
others_unchanged: items_model.removed (a_key) |=| old items_model.removed (a_key)
MML Checklist:
Collection attributes have model queries (MML_SET, MML_MAP, MML_SEQUENCE)
Postconditions use |=| for equality comparisons
Frame conditions specify what did NOT change
Old expressions capture pre-state: old items_model
# Adversarial Test Suggestions## Contracts
[PASTE src/*.e]
## Current Tests
[PASTE test/*.e]
## Suggest Tests For:1. Boundary values (0, 1, MAX_INT, empty strings)
2. Capacity limits (full, zero capacity)
3. SCOOP concurrent access
4. State transitions in unexpected order
5. Resource exhaustion
Step 2: Human Submits to AI (Optional)
User may submit prompt to external AI for adversarial suggestions.
Step 3: Generate Adversarial Tests
Add tests like:
test_with_zero_capacity
test_same_key_repeatedly
test_stress_many_operations
test_concurrent_access_scoop
Step 4: Compile and Run All Tests
CRITICAL: You MUST cd to the project directory before compiling. The EIFGENs folder is created in the current working directory, not where the ECF file is located. Compiling from the wrong directory pollutes other folders with build artifacts.
ZERO WARNINGS POLICY: If the compiler reports obsolete call warnings or any other warnings, FIX THEM IMMEDIATELY. Do not note them and move on. Do not defer them. Fix them right now before proceeding.
Why: This catches integration issues that don't appear in standalone compilation. A library with concurrency=scoop may compile fine but cause VUAR(2) errors in consumer libraries.
Create mock consumer project (temporary, can delete after test):
Load entire ecosystem or multiple libraries into context
Keep large file contents in working memory
DO:
Use Task tool with Explore agent for ecosystem questions
Ask targeted questions when adversarial tests need to understand attack vectors from similar libraries
Release context after getting answers
Example - Ecosystem Query:
Need ideas for stress testing patterns? Don't read all test files in ecosystem.
Instead: Task(subagent_type=Explore) → "What adversarial test patterns exist in simple_container tests?"
The sub-agent searches, summarizes, and returns ONLY what you need. Your context stays focused on this project.
Completion
Phase 6 COMPLETE: Hardening passed.
Project: <project-path>
All tests: PASS
Next: Run /eiffel.ship <project-path> for final checklist.