OpenOnco
UA EN
← All news
July 15, 2026 knowledge-base engine quality

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: 01 parsed as the integer 1 and collided with the existing step: 1. The engine silently dropped the second-line rituximab-refractoriness step and misrouted first relapse into the third-line branch.
  • 34 missing output_indications entries across 25 files. These indications were reachable through a decision-tree result, default or alternative, but absent from the algorithm's output_indications list. 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_target field the engine never reads, one unreachable no-op step, and one broken source reference.
No clinical routing was changed. Every fix was structural or referential, per CHARTER §8.3 — an LLM does not get to choose regimens.

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.