From 8a2e701ff21522b86948fdeb1e675b442bfc3ba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Tue, 19 May 2026 04:57:33 +0300 Subject: [PATCH] =?UTF-8?q?docs(router):=20router-procedure.md=20v1.0=20?= =?UTF-8?q?=E2=80=94=20explicit=205-step=20routing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- docs/router-procedure.md | 72 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 docs/router-procedure.md diff --git a/docs/router-procedure.md b/docs/router-procedure.md new file mode 100644 index 00000000..4db49b68 --- /dev/null +++ b/docs/router-procedure.md @@ -0,0 +1,72 @@ +# 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 R0–R15, 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`](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`](routing-off-phase.md). +4. Hard-floor rules: [Pravila §12 / §14 / §15](Pravila_raboty_Claude_v1_1.md). +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 L1–L12 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 R0–R14 — 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 L1–L12; consulted in step 4. + +## Changelog + +- **v1.0 (2026-05-19)** — initial fixation. Replaces implicit-scattered routing. ADR-011.