Files
portal/docs/router-procedure.md
T
Дмитрий 8a2e701ff2 docs(router): router-procedure.md v1.0 — explicit 5-step routing
Single SoT for task→node routing. Replaces implicit routing scattered
across Pravila/PSR_v1/Tooling/routing-off-phase.md. ADR-011.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-19 04:57:33 +03:00

3.6 KiB
Raw Blame History

Router procedure v1.0

Status: active (introduced 2026-05-19, spec dd5bded, ADR-011)

Owner: Claude Code automatic at session start.

Purpose

Single source of truth for «task → node(s)» routing. Replaces implicit routing scattered across Pravila §12/§14/§15, PSR_v1 R0R15, Tooling §3, and routing-off-phase.md by explicitly listing the procedure executed every turn.

Inputs

  1. Active task from user prompt.
  2. Node registry: docs/Tooling_v8_3.md Прил. Н §4.X (9 obligatory attributes per row — see §4.1 spec).
  3. Off-phase routing table: docs/routing-off-phase.md.
  4. Hard-floor rules: Pravila §12 / §14 / §15.
  5. ADR boundaries: docs/adr/*.md.

Procedure (5 steps, executed per turn)

Step 1 — Hard-floor check (Pravila §12 / §14 / §15)

  • Does the prompt contain queen / королева? → Pravila §14 (currently dormant per §14.9).
  • Is the task in Pravila §12.2 map (TDD / debug / brainstorm / writing-plans / verification / discovery / migration / commit / review / UI-feature / arch-decision / refactor / parallel-sessions / worktree / writing-skills)? → invoke skill FIRST (hard-rule).
  • Will any of the 8 normative files be edited? → §15.2 pre-flight sync MANDATORY.
  • Subagent + git tasks? → §15.1 Sonnet/Opus only (NEVER Haiku).

If any hard-floor rule applies and is skipped — this is a violation, regardless of subsequent steps.

Step 2 — Classification

  • Phase-active (0/1/2/3) or off-phase?
  • Type: TDD / debug / brainstorm / writing-plan / verification / discovery / migration / commit / review / UI-feature / arch-decision / refactor / docs / sync / other.
  • Identify task triggers (keywords, file types touched, output requested).

Step 3 — Trigger-based node selection

  • Scan Tooling Прил. Н §4.X for rows whose triggers attribute matches the classified task.
  • If ≥2 nodes match — apply ADR boundaries (the boundaries attribute points to the relevant ADR-NNN).
  • If conflict remains — apply PSR_v1 R15.3 (specificity priority).

Step 4 — Canonical chain check (if applicable)

  • If the matched node-set corresponds to one of L1L12 chains in routing-off-phase.md §4 — invoke the chain.
  • If no chain matches — execute as ad-hoc combination. Observer will record path_type: improvised.

Step 5 — Execution

  • Invoke skill (if §12 applies) or apply selected node(s) by trigger.
  • Document boundary decisions in inline comments OR in the observer log.

What this procedure does NOT consult

  • No cache of «verified chains» (history-based records). Such a cache was explicitly rejected in brainstorming turn 8 (2026-05-19).
  • No last-used-on-real-task attribute on registry rows. Unused-status is not used to choose or skip a node (capability-readiness — see memory/feedback_brain_unused_tools_not_problem.md).
  • No forced-choice gate. Nodes that don't match triggers are silently skipped.

When this procedure is consulted

Every turn — implicitly by Claude at session start, explicitly when routing is ambiguous.

Relationship to other documents

  • Pravila §12/§14/§15 — hard-floor; this procedure step 1 enforces them.
  • PSR_v1 R0R14 — UI-stack apparatus; consulted in step 3 when task touches UI.
  • PSR_v1 R15 — off-phase routing extension; consulted in step 3 for off-phase nodes.
  • Tooling §3 / §4.X — node registry; the input to step 3.
  • routing-off-phase.md — chains L1L12; consulted in step 4.

Changelog

  • v1.0 (2026-05-19) — initial fixation. Replaces implicit-scattered routing. ADR-011.