# Phase 21 — pipeline/lib → pipeline/_lib rename

**Captured:** 2026-05-07 (BUILD_SPEC console-v2-overhaul Phase 21 partial)
**Driver:** scope-boundary deferral (Law 14)

## Decision
DEFERRED to a dedicated future phase (not Phase 22 of this build).

## Why deferred (not rejected)

The rename touches 65 `from lib.X` import sites inside `recoil/pipeline/` plus has bootstrap interactions:
- `ensure_pipeline_importable()` adds `recoil/pipeline/` to sys.path so `from lib.X` resolves to `recoil/pipeline/lib/X` (a 2-arg lookup that depends on the dir name).
- Renaming to `_lib` requires the `from lib.X` → `from _lib.X` (or `from recoil.pipeline._lib.X`) sweep PLUS bootstrap update.
- 65 sites is a sweeping change with significant blast radius — bigger than any single completed phase in this build.

The spec also called for `generate.py` and `client_generate.py` CLI rewires (broken module imports `pipeline.production_loop` etc.). Those need module-existence audit first; deferring with the rename keeps the substrate intact.

## What WAS done in Phase 21

`recoil/console-v2/packages/desktop/src/lib/focus_walker.ts` already exists and exports `findFocusPath` (different signature than the spec proposed — returns `FocusPath | null` object instead of `string[]`, but the export point is in place and shipped working code uses it).

## Resolution path

1. Inventory all 65 `from lib.X` import sites (already scoped by spec to `recoil/pipeline/`).
2. Audit `generate.py` and `client_generate.py` for module-existence — confirm each `from pipeline.X` import maps to a live module, comment out + TODO any genuine dead imports.
3. Single dedicated phase: rename + sed sweep + bootstrap update + grep guard expansion + full pytest run.
4. Preserve the rename atomicity — one commit, all-or-nothing rollback.

## Cited by
- BUILD_SPEC §Phase 21
- Build log entry for Phase 21 (PARTIAL)

## Status
- [x] Substantive deferral with concrete resolution path (Law 14)
