---
name: lfo-intake-gate
description: Phase 1 priority-chain runner. For each of the 6 standing intake questions (scope / site exposure / labour rate / margin+contingency / adverse weather / LAFHA) plus any RFQ-derived bid-specific questions, runs the §5.0 decision priority chain (standing context → lessons → precedent → methodology → web research → educated assumption). Auto-decides at confidence ≥60%; flags lower-confidence rows for the Rocky-review gate via the assumptions log (per orchestrator CLAUDE.md §11). Falls through to Rocky ONLY on the 7 hard cases per §6.
model: claude-sonnet-4-6
phase: 1
invoked_by: orchestrator at session start when a job ID is named
preconditions:
  - orchestrator session log written (frontmatter + session_id + job_no)
  - read order completed (CLAUDE.md, standing-context.md, intake-gate-questions.md)
  - assumptions log opened at `_Internal/assumptions-log-{job-id}.md` per §11 format
inputs:
  - job_no
  - job folder path
  - any prior orchestrator-session for the same job (if exists, re-use any sealed assumptions log rows)
outputs:
  - intake_envelope (markdown block; structured-context block prepended to every worker prompt)
  - assumptions log populated with auto-decided + flagged-for-Rocky + open-question rows
  - orchestrator session log updated with priority-chain trace per question
side_effects:
  - blocks worker-side prompt drafting only on (a) flagged rows awaiting Rocky resolution, or (b) one of the 7 hard cases per §6
authored_by: claude-code-orchestrator
created: 2026-05-08
updated: 2026-05-08 (semantics realigned from "ask all 6 unconditionally" → "priority-chain runner")
---

# lfo-intake-gate

Run the Phase 1 intake gate as the priority-chain runner. Auto-decide where confidence ≥60%; flag where lower; surface ONE batched review gate to Rocky at the end (not per-question). The skill is the orchestrator-side implementation of the §5.0 decision priority chain for the 6 standing questions + any RFQ-derived bid-specific questions.

## Procedure

### 1. Pre-screen

Read prior context:
- Check `_Internal/orchestrator-sessions/` for any existing session on this `job_no`. If found AND the session has a sealed `intake_envelope`, surface to Rocky:
  > "Prior intake envelope from `<session_id>` exists. Re-use as-is, re-run priority chain, or fresh start?"
  If Rocky says re-use, copy envelope + assumptions log to current session log and skip to step 5.
- Read `00-brief.md`, `00-Bid-Prep.md` (if exists), the RFQ email. Extract: HC name, end client, site address, postcode, project type, scope items mentioned, design maturity (IFC vs 90% vs 60%), drawing-spec material flags (stainless reo, marine cement, sulphate-resistant) for downstream gap-watch.

### 2. Open the assumptions log

Write `_Internal/assumptions-log-{job-id}.md` with the §11 format frontmatter + four empty section headers (Auto-decided, Flagged for Rocky review, Open questions, Web research log, Override history). Stamp `created: <timestamp>`.

### 3. Run the priority chain on each question

The 6 standing questions:
- **Q-1 Scope confirmation** — which of the 4 standard items + any bid-specific scope additions
- **Q-2 Site exposure category** — `immersed` / `tidal` / `coastal-air` / `inland`
- **Q-3 Labour rate** — default $95/hr blended; any override?
- **Q-4 Margin + contingency rules** — defaults locked at labour 1.10×1.15 / materials 1.15×1.10 = 1.265; any override?
- **Q-5 Adverse weather posture** — exclude as variation OR include 1 day per fortnight in prelims
- **Q-6 LAFHA** — in / out / flag

Plus any bid-specific questions discovered during pre-screen (e.g. "do drawings spec saw cuts within 24h?", "is concrete site-batched or dispatched?", "above-tide-line vs tidal classification per drawings").

For EACH question, walk the §5.0 priority chain:
- **Step 1** — `standards/standing-context.md` §1–§12 + auto-decision rules in §13. If a §13 rule deterministically resolves the question (e.g. §13.1 LAFHA-via-Botany-distance), apply at the rule's stated confidence floor. Cite §13.X in the assumptions log row.
- **Step 2** — `C:\Users\mclou\lfcs-lessons-learned\` and `_Internal/lessons-learned/`. If a lesson explicitly answers this question, apply. Cite the lesson file + date.
- **Step 3** — invoke `lfo-precedent-finder` skill with inputs (current_job_no, scope_items, hc_name, site_postcode, site_type, design_maturity, question). Skill returns top-3 precedents + decision + confidence. If `flag_for_rocky=false` and confidence ≥60%, apply.
- **Step 4** — query Airtable `_methodology_*` tables. If a single high-confidence row matches (`confidence != Needs review`), apply.
- **Step 5** — invoke `WebSearch` / `WebFetch` for site-specific facts or industry best practice. One specific query per call, cap 5,000 tokens, max 10 calls per bid (track in assumptions log web research section).
- **Step 6** — educated assumption based on partial signals. State assumption explicitly + assess confidence honestly (50–80% typical). If <60%, flag for Rocky.

Stop at the first step yielding ≥60% confidence. Cite the step and source in the assumptions log row.

### 4. Populate the assumptions log

For each question, write one row to the log:

| # | Question | Decision | Source | Confidence | Risk if wrong |

Example row from a 2631 dry-run:

| 6 | LAFHA | OUT | §13.1 LAFHA-via-Botany-distance: Botany→Hornsby 50 min via Google Maps 2026-05-08 | 95% | $44K underprice if wrong (10 weeks × 4 crew × $110/day) |

Auto-decided rows (confidence ≥60% AND not material-risk flag) → table 1.
Flagged rows (confidence ≥60% but material-risk OR confidence 60-80% AND >$5K impact) → table 2.
Open rows (confidence <60% from step 6 OR genuinely unknowable from steps 1-5) → table 3.

### 5. Run gap-watch checkpoints on the auto-decided rows

- **G2-shadow:** if Q-2 = `coastal-air` AND drawing-spec keywords (stainless 316, marine cement, sulphate-resistant) found in pre-screen → log spec/exposure distinction, drop confidence -15%, may flip to flagged-for-Rocky.
- **G6-shadow:** if Q-1 omits a scope item drawings clearly show, surface once.
- **Auto-decision rule contradiction:** if a §13 rule says X but a step-3 precedent says Y → log contradiction, default to §13 rule (deterministic > precedent), flag the row.

### 6. Build the intake envelope

Structured markdown block with the same format as the prior 6-question envelope, but provenance tagged per row (`source: §13.1` vs `source: precedent-2629` vs `source: web-research-2026-05-08`). Envelope is prepended to every worker prompt thereafter.

### 7. Surface the assumptions log to Rocky — ONE batched gate

Use `AskUserQuestion` once with summary:
> "Auto-decided N intake questions. M flagged for review (confidence <80% OR material risk). K open (need Rocky). Open the assumptions log to verify, push through, or override individual rows?"

Allow Rocky to override individual rows. Each override:
- Logs to override-history table in the assumptions log
- Queues a candidate lessons-learned write for `_Internal/lessons-learned/proposals-pending.md` so future bids learn from the override

### 8. Exit

Phase 2 (`lfo-standard-exclusions-apply`) opens unless one of these blocks:
- A flagged row remains unresolved AND its decision affects pricing rate-build (e.g. flagged labour rate)
- One of the 7 hard cases per §6 fired
- Rocky explicitly held the gate

## Failure modes

- **No precedents available + no §13 rule + web research budget exhausted (10 calls):** falls to step 6 with low confidence, flags for Rocky per §6 trigger 4.
- **Rocky abandons mid-review (some rows accepted, some left blank):** orchestrator does NOT proceed. Re-prompt remaining rows next time Rocky engages. Saved state in session log.
- **`AskUserQuestion` tool unavailable:** fall back to plain prompt asking Rocky to read the assumptions log file directly + reply with row numbers to override.
- **Conflict between §13 auto-decision rule and a Rocky-locked prior answer:** §6 trigger 2 (locked decisions contradict) — surface, ask which stands.

## Output schema (intake_envelope)

See `standards/intake-gate-questions.md` § "Intake envelope (post-priority-chain)" for full YAML schema. Keys per row: `question`, `decision`, `source` (priority chain step + specific citation), `confidence`, `flagged`, `material_risk_aud`.

## Assumptions log — template + discipline

Full template + append-only discipline rules: `standards/assumptions-log-template.md`. Always use that template — do NOT freestyle the structure. Frontmatter, four section headers (Auto-decided / Flagged for Rocky review / Open questions / Web research log / Override history / Mid-bid additions), source-citation-mandatory rule, risk-if-wrong column, surfacing-pattern (one batched gate via `AskUserQuestion`).

## Reference — §5.0 priority chain (canonical)

This is the canonical decision framework applied at EVERY Rocky-input question (intake-gate, mid-bid clarifications, ad-hoc choices). Stop at the first step yielding ≥60% confidence; otherwise fall through. Stop and ask Rocky ONLY when one of the 7 hard cases per orchestrator CLAUDE.md §6 fires.

**Step 1 — Standing context + auto-decision rules.** Read `standards/standing-context.md` for locked facts (§1–§12). Apply auto-decision rules in §13 if inputs match. Rules are deterministic with stated confidence floors. Example: LAFHA-via-Botany-distance (§13.1) returns IN/OUT/flag from Google Maps drive time + thresholds.

**Step 2 — Lessons learned.** Read `C:\Users\mclou\lfcs-lessons-learned\` and `_Internal/lessons-learned/`. Pattern-match the question against prior lessons. If a lesson explicitly answers this question, apply it. Cite the lesson file in the assumptions log.

**Step 3 — Past job precedent.** Run `lfo-precedent-finder` skill. Inputs: scope items, HC, site postcode, site type, design maturity, the question itself. Skill returns top-3 precedents with similarity scores + the decision each precedent took on this question + final confidence. If `flag_for_rocky=false` and confidence ≥60%, apply.

**Step 4 — Methodology base.** Query Airtable `_methodology_*` tables: `Rate_Templates` for rates, `Productivity_Benchmarks` for output, `Common_Misses_Patterns` for risk-flag mapping, `Exclusion_Library` for boilerplate exclusions. If a single high-confidence row matches (`confidence != Needs review`), apply.

**Step 5 — Web research.** Use Claude Code's `WebSearch` / `WebFetch` for site-specific facts (drive distances, regional supplier lists, postcode coastal classification) and industry best practice (AS3600/AS5100/AS3610 cover/clauses, regional weather data). Constraints:
- One specific query per call (e.g. `"Botany NSW to Wollongong NSW one-way drive time"`, NOT `"research this job site"`).
- Cap: 5,000 tokens per research call.
- Budget: max 10 research calls per bid. If exceeded, stop and ask Rocky.
- Capture: factual answer + source URL(s) + timestamp + confidence assessment, all logged into the assumptions log.

**Step 6 — Educated assumption.** When 1–5 yield nothing, apply judgement based on the partial signals available. State the assumption explicitly. Assess confidence honestly (50–80% range typical). If <60%, surface to Rocky per §6 trigger 4.

**Confidence threshold for auto-decide:** 60%. Below 60%, even a step-6 educated assumption must be flagged to Rocky before pricing depends on it.

### Worked examples

| Question | Step that resolves it | Confidence | Assumption-log row |
|---|---|---|---|
| LAFHA for 2631 (Hornsby site, postcode 2077) | Step 1 §13.1 → Botany→Hornsby ~50 min → OUT | 95% | "LAFHA OUT — Botany→Hornsby 50 min via Google Maps" |
| Site exposure for 2630 (North Beach Wollongong) | Step 5 web research (postcode 2500 + drawing review for tide line) → coastal-air-above-tide-line | 75% | "Coastal-air, above-tide-line — postcode 2500 coastal zone, S141 sea-level diagram shows slab above MHW" |
| Labour rate for 2632 (TCE bid) | Step 1 standing-context default $95/hr blended → applied | 90% | "Labour rate $95/hr blended per §1.5 default" |
| Adverse weather for 2632 (10-week open-deck bridge) | Step 3 precedent-finder finds 2630 (include 1 day/fortnight) → applied | 85% | "Include 1 day/fortnight per 2630 precedent (similar 12-week open-deck)" |

## Rocky-gate stall escalation (paired-mode with daemon running)

When the orchestrator enters one of the 7 hard cases per orchestrator §6 (or surfaces a flagged-for-Rocky row), it sets `state.json.rocky_gate_active=true` + `rocky_gate_question=<text>` + `rocky_gate_opened_at=<iso now>`. The handoff daemon then:
- **30 minutes idle** → first phone notification (priority `high`).
- **60 minutes idle** → second phone notification (priority `urgent`).
- **90 minutes idle** → third phone notification (priority `urgent`) + daemon writes a stall diagnostic block to `pricer-to-orch.md` so the diagnostic is visible in both terminals + halts further notifications until the gate is resolved.

When Rocky responds, orchestrator clears `rocky_gate_active=false` + `rocky_gate_question=null` + `rocky_gate_escalations_sent=0`. See `standards/notification-config.md` for topic + subscription instructions.
