Decision-tree routing defects fixed, validator hardened
Auditing every treatment algorithm through the engine walker — rather than the loader — surfaced routing defects that were silently dropping selected indications from rendered plans.
Written retrospectively and published on July 19, 2026.
The knowledge base validated cleanly, and the plans still came out wrong in specific branches. The reason is that the loader checks whether a file is well-formed, while the engine walks the decision tree — and those are different questions. Walking every algorithm the way the engine does surfaced a class of defect the loader had no reason to catch.
The defects
- A YAML-octal step-id collision. In one follicular-lymphoma algorithm,
step: 01parsed as the integer 1 and collided with the existingstep: 1. The engine silently dropped the second-line rituximab-refractoriness step and misrouted first relapse into the third-line branch. - 34 missing
output_indicationsentries across 25 files. These indications were reachable through a decision-tree result, default or alternative, but absent from the algorithm'soutput_indicationslist. The plan engine builds tracks only from that list, so those indications were dropped from rendered plans — a real functional bug, not cosmetic. - 6 dead single-branch stubs using a
branch_targetfield the engine never reads, one unreachable no-op step, and one broken source reference.
Turning the audit into a gate
A one-time audit that is not enforced decays. The validator now treats five of these as hard contract errors: duplicate step ids, dangling next_step targets, a result outside output_indications, a default or alternative outside output_indications, and a result pointing at an indication that does not exist. Unreachable steps and null results are raised as warnings. Nine tests cover the checks.
Details are in commit 3f0b0d7e9f, merged to master as 161534aa73 (PR #629). Post-fix, the algorithm contract-error count is zero.
What was deliberately not auto-fixed
Roughly 237 treatment branches are gated by free-prose condition: text rather than structured rules, which makes them unreachable to the walker. Fixing those needs structured red-flag authoring plus two-reviewer clinical signoff, so they stay on the backlog rather than being rewritten by a tool.
Comments
Threads are public and indexed — please keep personal medical data out of them. Found a clinical error? Open an issue instead.
Comments are not switched on yet — the backend still needs to be configured.