Skip to content

OSSS.ai.orchestration.routers.refiner

OSSS.ai.orchestration.routers.refiner

should_run_data_query_after_refiner(state)

Decide whether the next step after refiner should be data_query.

Keep this conservative and state-derived only. No planning mutation, no graph assumptions.

Sources of truth (in priority order): 1) routing_signals (if planner attached them) 2) query_profile heuristic (legacy)

should_end_after_refiner(state)

Optional: for patterns that allow early termination. Usually False unless you have explicit state flags for it.

refiner_route_query_or_end(state)

Legacy export name used by RouterRegistry bootstrap and older wiring.

Must return only legal branch keys for the refiner conditional edge in the data_query pattern: {"data_query", "final"}.

Delegate to the canonical implementation in routers.builtins.

route_refiner_query_or_final(state)

Router for patterns where refiner branches
  • data_query if strong signals
  • otherwise final

route_refiner_query_or_reflect(state)

Router for patterns where refiner branches
  • data_query if strong signals
  • otherwise reflect (a virtual key resolved by GraphFactory)

route_refiner_query_or_end(state)

Router for patterns where refiner branches
  • data_query if strong signals
  • otherwise END (stop)

✅ Planned-final invariant: If exec_state indicates planned_agents includes "final", this router MUST NOT return END. It should return "final" instead.