# Phase 0 — Reconnaissance Evidence (2026-06-10)

Read-only. No commits. Generated by root orchestrator + 4 parallel lanes
(omk-explorer ×3, omk-planner ×1) under goal
`.omk/goals/omk-remediation-hardening-phase-0-recon-evidence-phase-a-repo-hy-*.json`.

## 0.1 Repo shape
- tracked files: 1157
- tracked `*.js`: **3** — all hand-written Chrome-extension templates
  (`templates/web-bridge/chrome-extension/{background,content-script,popup}.js`)
- `.git`: size 27.05 MiB, **size-pack 80.19 MiB** (history bloat, not worktree)
- untracked local dirs (NOT in git index): `lobehub/`, `headroom/`,
  `continuous-claude-v3/`, `agent-skills/`

## 0.2 God files (src/**/*.ts, top offenders)
| file | LOC | role |
|---|---|---|
| src/commands/init.ts | 2712 | init scaffold/flow/prompts |
| src/util/fs.ts | 2006 | fs utility grab-bag |
| src/mcp/omk-project-server.ts | 1873 | project MCP server |
| src/commands/mcp.ts | 1872 | mcp CLI command |
| src/commands/init/content.ts | 1794 | init doc content |
| src/providers/provider-task-runner.ts | 1524 | provider exec |
| src/commands/design.ts | 1486 | design cmd |
| src/goal/control-loop.ts | 1433 | goal loop |
| src/commands/chat/native-root-loop.ts | 1424 | root chat loop |
| (… ~25 files total > 600 LOC) | | |

## 0.3 Weight vectors (verbatim locations)
| vector | file:line | Σ(+) | Σ\|·\| | normalized |
|---|---|---|---|---|
| Router V2 composite | src/runtime/router-v2-scoring.ts:136–144 | 0.95 | **1.20** | NO ← the ≈1.20 |
| RELEASE_GATE_WEIGHTS | src/runtime/contracts/weakness-remediation.ts:35–45 | **1.20** | 1.20 | NO ← exactly 1.20 |
| INTENT_CAPABILITY_WEIGHTS ×9 | router-v2-scoring.ts:29–37 | 0.65–0.85 | same | NO (per-intent) |
| scoreRoute | src/orchestration/routing.ts:551–552 | 1.00 + localFit bonus ≤0.08 | 1.08 | core yes, bonus leaks |
| interview ranking | src/goal/interview-scoring.ts:29 | 1.00 abs | 1.00 | yes (doc match) |
| ETS weights | src/evidence/evidence-trust-score.ts:121–126 | 1.00 | 1.00 | yes |
| provider maturity | src/runtime/provider-maturity-gate.ts:51–58 | 1.00 | 1.00 | yes |
| shadow v1 composite | src/benchmark/shadow-mode.ts:50–54 | 1.00 | 1.00 | yes (but inline, drift risk) |

## 0.4 Evidence flow (B2)
- Routing consumes per-adapter **history**: Beta(1,1)-smoothed cumulative pass
  rate (router-v2-scoring.ts:111–118); v1 router reads persisted graph memory,
  cached per instance (runtime-router.ts:116–137). Not EWMA.
- Gate consumes **current-run** artifacts only (evidence-gate.ts:357–373);
  τ checks live in advanced-control-loop.ts:186–218.
- **Verdict: no same-turn self-feedback path** (ordering + cache + no writer of
  `successful_fix`/`failure_pattern` kinds). Dead path: provider-stats.ts
  `computeProviderRouteScore` (no production caller).

## 0.5 Hygiene
- root `*.md` count: **20** (target ≤10); `AGENTS.md.test` exists (11 B).
- Inbound links to movers: OMK_CLI_V2_RUNTIME_ARCHITECTURE.md ← AGENTS.md:28,
  ARCHITECTURE_ANALYSIS_CODEGRAPH.md:104; headroom-omk-* cross-link only each
  other; root codex-oauth-setup.md is an unlinked duplicate of docs/ copy.
- `crates/omk-safety`: **725 LOC real Rust**, built by `native:build`
  (scripts/build-native.mjs:61), self-tested, shipped at
  `dist/native/<platform>/omk-safety`, consumed by src/util/native-safety.ts.
- Stray: `tests/model-tabs.test.ts` (duplicates canonical `test/`).

## Discrepancies vs prompt
1. **A1 premise wrong for worktree**: no compiled JS tracked. The 28.9% JS bar
   stems from `.git` history (80 MiB pack) and/or linguist counting; remedy is
   `.gitattributes linguist-vendored` + a history-rewrite decision doc, not
   `git rm --cached`.
2. **A4 premise wrong**: omk-safety is not scaffolding — it ships. Path (a).
3. **B1 confirmed twice**: the "≈1.20" exists in BOTH Router V2 composite
   (abs) and RELEASE_GATE_WEIGHTS (positive sum exactly 1.20).
4. **B2 premise partially wrong**: no same-turn double-count today; work item
   is formalizing ρ_a (EWMA) vs p_t + invariant tests, plus guarding the dead
   provider-stats path before anyone wires it.
