---
name: lfo-blind-driver
description: Drive blind comparison protocol per lfcs-pricing CLAUDE.md §4.5. Pre-flight (path exclusions, methodology quarantine, inbound whitelist), sealed-reasoning capture, REVEAL gate (Rocky-typed only), reveal-phase comparison.
model: claude-sonnet-4-6
phase: 5
invoked_by: orchestrator when Rocky says "blind compare {job} against={comparator}"
preconditions:
  - intake envelope sealed (Phase 1)
  - exclusions skeleton seeded (Phase 2)
inputs:
  - job_no
  - comparator_name (e.g. "Hasibul Khan", "Liam Fitzgerald")
  - comparator_artefact_paths (list of files NOT to read)
outputs:
  - BCS pre-flight envelope (markdown block with path exclusions + methodology quarantine list + inbound whitelist + sibling folders ignored)
  - sealed_reasoning_block (after first-pass + sanity-check, before reveal)
  - blind-comparison-{job}-{date}.md (after REVEAL)
  - methodology corrections proposals queued to lessons-learned/proposals-pending.md
side_effects:
  - sets BCS Airtable row status (via worker write)
  - blocks reveal until Rocky-typed `REVEAL`
  - quarantines methodology rows (via worker write)
authored_by: claude-code-orchestrator
created: 2026-05-08
---

# lfo-blind-driver

Drive the blind-comparison state machine. Five sub-phases: pre-flight, blind-period, seal, reveal, unquarantine. Reveal gate is Rocky-typed `REVEAL` only — never inferred.

## Sub-phase 1 — Pre-flight (BEFORE any worker prompt)

1. **Build path exclusions list.** Include:
   - Friend-vault any-2630-related files (entire friend-vault read-only per CLAUDE.md §2.1; off-limits)
   - Local filename patterns: `*<comparator-handle>*<job>*`, `*<job>*<comparator-handle>*`, `*<job>*quote*`, `*<job>*price*`, `*<job>*_v-CW*`
   - Any explicitly-named comparator artefact path Rocky lists

2. **Build inbound whitelist.** Folder(s) Rocky says read freely (e.g. `C:/Users/mclou/lfcs-inbound-artefacts/{job}/Issued for Construction-{date}/`). Extracted IFC drawings are fine. Sibling folders (As-Built, Shop Drawings) often ignored — confirm with Rocky.

3. **Methodology quarantine — narrow vs broad list:**
   - **Narrow:** rows in `_methodology_Productivity_Benchmarks` + `_methodology_Rate_Templates` where `source_attribution` references `{job}` directly OR derived from `{job}` specifically.
   - **Broad:** all rows tagged `[source: friend-vault] {comparator-handle} ...`.
   - Surface both lists to Rocky. Default = narrow. Rocky chooses (don't apply broad without confirmation).

4. **Open BCS row** (worker writes via `lfcs-airtable-sync`). Capture: session_id, job_record_id, bid_a (comparator) record id (often null until reveal), bid_b (new blind) record id (null until first-pass complete), comparator_name, new_pricer_name, comparator_artefact_paths, quarantined_methodology_record_ids, blind_phase_started_at.

5. **Write pre-flight envelope** to `_Internal/audit-trail/session-{uuid}.md` (cross-job source-of-truth). Format follows `_Internal/audit-trail/session-e57c7d98-c90d-48ed-b874-23bf35f19be8.md` (the canonical pre-flight example).

## Sub-phase 2 — Blind period (Phases 2–4 of orchestrator workflow)

During Phases 2–4, every prompt drafted by `lfo-prompt-pricing` is filtered:

- Strip any inadvertent reference to comparator paths
- Strip any reference to quarantined methodology row IDs
- Refuse to reference the comparator's prior pricing (even from memory)

Worker output similarly filtered before relay back to orchestrator.

If breach detected (orchestrator OR worker reads an excluded path mid-session): IMMEDIATELY abort the BCS:
- Mark BCS row `status: ABORTED-BREACH`
- Do NOT write corrections, do NOT unquarantine
- Notify Rocky
- Re-run requires fresh session_id + Rocky-confirmed clean window

## Sub-phase 3 — Seal (after first-pass + sanity-check, before reveal)

Before any reveal: write the agent's full pre-comparison reasoning trail to BCS row `pre_comparison_sealed_reasoning`:

- Phase 0 grill answers (post-intake-envelope-merge)
- Productivity adjustments applied (multiplier rationale)
- Complexity tags applied per element
- Exclusions invoked (Tier 1/2/3 confirmed-in items + carve-outs)
- Total ex GST direct + loaded
- Per-line variance vs Rate Card baseline (where applicable)

Mark BCS phase `sealed`. Surface to Rocky:
> "Pre-comparison reasoning sealed. Awaiting your `REVEAL` trigger. Type REVEAL exactly to proceed."

## Sub-phase 4 — Reveal (Rocky-typed `REVEAL` only)

ONLY proceed if Rocky's exact next message contains `REVEAL` (case-insensitive accepted; typo not).

On reveal:
1. Set BCS `blind_phase_ended_at` + `comparison_capture_at` timestamps.
2. Open the comparator paths (now permitted).
3. Run side-by-side comparison. Write `_Brain/blind-comparison-{job}-{date}.md`:
   - Bid_A total ex GST + line-by-line breakdown + methodology basis used (which Rate Templates / complexity factors / exclusions tier)
   - Bid_B (new blind) total ex GST + line-by-line breakdown + methodology basis used
   - Per-line variance: `delta_pct = (bid_b - bid_a) / bid_a × 100`
   - Patterns observed (free text, 1–3 paragraphs)
4. **Methodology corrections queued — NOT auto-applied:**
   - For each line where bid_a reveals signal bid_b missed (or vice versa), draft correction proposal
   - Write to `_Internal/lessons-learned/proposals-pending.md` with: source session, line ID, proposed Rate Template `base_rate_aud` change, evidence, qualifying overrides
   - Each proposal also creates a `Bid Line Item Overrides` row via worker (`reviewer_type=Trades-Internal-{name}`, `linked_session_log={bcs_session_uuid}`)
   - Rocky reviews each proposal individually. NEVER auto-apply.

## Sub-phase 5 — Unquarantine

Only AFTER Rocky-confirmed corrections written + accepted:
1. Worker clears `_internal_quarantined_for_session_id` field on each previously-quarantined methodology row
2. Set BCS `unquarantined_at`
3. Methodology rows return to active selection pool

## Failure modes

- Rocky types reveal-shaped word but not exact (e.g. "reveal it", "go ahead reveal") → orchestrator asks for exact `REVEAL` confirmation. No partial trigger.
- Comparator artefact arrives mid-session via new email or upload → treat as new file in `comparator_artefact_paths`. If already read inadvertently: abort breach.
- Quarantined methodology row is the only available template for a scope → STOP, ask Rocky. Don't silently fall back to Rate Card hourly basis without documented decision.
- Reveal proceeds but corrections are voluminous (>10 proposals) → batch-surface to Rocky in groups of 5; don't queue dozens of pending proposals at once.
