Five-Gate Pipeline
Every test Quell generates must pass all 5 gates before it's written to disk. This is what makes WRITTEN tests trustworthy.
The gates
| # | Name | Description | Failure → |
|---|---|---|---|
| 1 | AST Valid | Parses to valid Python AST | Regenerate |
| 2 | Original | Not already in any test file | Skip (duplicate) |
| 3 | Secure | No shell calls, no filesystem writes, no network | FLAGGED |
| 4 | Passes Correct | Runs against original (correct) code — must pass | SCAFFOLDED |
| 5 | Fails Violated | Runs against violated code — must fail | SCAFFOLDED |
Gate 4: Passes Correct
Quell runs the generated test against your original, unmodified source code. The test must pass.
If it fails, the test has a bug — Quell won't write it.
Gate 5: Fails Violated (THE MOAT)
This is what separates Quell from coverage tools.
Quell injects a violation into the source code — removes the guard, changes the condition — then runs the test. The test must fail.
If the test passes even with the violation, it doesn't catch the bug. Quell won't write it.
The source is always restored in a finally block after gate 5. No permanent changes.
Example: gate 5 in action
# Gate 4: runs against original code
def process_payment(amount: float) -> dict:
if amount <= 0: # guard intact
raise ValueError(...)
# → test passes ✓
# Gate 5: violation injected
def process_payment(amount: float) -> dict:
# if amount <= 0: # guard removed
# raise ValueError(...)
pass
# → test fails ✗ (violation detected!)
What happens when a gate fails
- Gates 1–3: attempt to regenerate or mark as SCAFFOLDED
- Gate 4: mark as SCAFFOLDED (test has a bug)
- Gate 5: mark as SCAFFOLDED (test doesn't catch the violation)
A SCAFFOLDED result is not a failure — it's an honest acknowledgment that Quell couldn't prove this one automatically.