Skip to main content

pm_routing_block

Function pm_routing_block 

Source
pub fn pm_routing_block(card: &str) -> Option<&str>
Expand description

The routing block’s inner text, or None when the markers are absent.

Why: two callers need the same span — the routing tests, and #8293’s shared-source lift, which has to read the block out of whichever card it is migrating. Returning None rather than the whole prompt is deliberate: a card that lost its markers must fail the routing test, not silently pass by matching agent names elsewhere in the body. What: the text between PM_ROUTING_BLOCK_BEGIN and PM_ROUTING_BLOCK_END, exclusive of both markers, trimmed. None when either marker is missing or they appear out of order. Test: assets::tests::pm_routing_block_names_only_delegable_roster_agents, prompt::tests::delegate_mode_prompt_carries_the_routing_table.