DocsReferenceGates

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

#NameDescriptionFailure →
1AST ValidParses to valid Python ASTRegenerate
2OriginalNot already in any test fileSkip (duplicate)
3SecureNo shell calls, no filesystem writes, no networkFLAGGED
4Passes CorrectRuns against original (correct) code — must passSCAFFOLDED
5Fails ViolatedRuns against violated code — must failSCAFFOLDED

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.