# Phase Branches Example URL: /examples/phase-branches The upstream phase_branches.py example — an operator picks a device stage, a PhaseDiagnoser turns the answer into a Diagnosis, and BranchSequence runs only the matching phases, including a nested branch. An interactive test whose path depends on operator input. A diagnoser converts a measurement into a `Diagnosis`; `BranchSequence` nodes run only when their `DiagnosisCondition` holds. Based on `examples/phase_branches.py`, lightly shortened. Answer `evt` instead and only the two EVT phases run; the record's `branches[]` lists each `BranchSequence` with whether its condition was taken. The set of possible diagnoses. Values must be unique across all diagnosers in a test. Diagnoses → The diagnoser receives the finished `PhaseRecord` and returns zero or more `Diagnosis` objects; `@htf.diagnose` attaches it to a phase. Runs its nodes only when `condition.check(store)` is true at that point in the sequence. Branches nest, as the prototype branch shows. Branch sequences → Boolean combinations over the diagnoses recorded so far. Condition types → `OperatorError` on bad input ends the test with outcome `ERROR`. Add it to `failure_exceptions` in Test Options if you would rather record a `FAIL`. Records the phase as `SelectTestingBranchPhase`. Override phase name →