---
name: lfo-reverse-engineer-budget
description: Estimate the LFCS labour-only budget envelope by working backwards from the Head Contractor's public contract value. Subtracts HC margin and the value of items LFCS has explicitly excluded (HC pays for separately). Quarantined output; revealed at sanity check (Phase 4) for comparison against bottom-up sealed price.
model: claude-sonnet-4-6
phase: 3.5 (after exclusions locked + take-off pricing sealed; before sanity check)
invoked_by: orchestrator after Phase 3 first-pass priced take-off completes
preconditions:
  - exclusions list locked at `_Internal/exclusions/exclusions-{job-id}.md`
  - bottom-up first-pass priced take-off SEALED (orchestrator must NOT see it before this skill runs to keep envelope independent)
  - HC name + project name + site location known
inputs:
  - job_no
  - hc_name (e.g. "TCE Contracting")
  - end_client (e.g. "City of Wollongong", or null if private)
  - project_name (e.g. "North Beach Seawall Stage 2")
  - site_location (e.g. "Cliff Road, North Beach, Wollongong NSW")
  - exclusions_list_path (path to locked exclusions file)
  - scope_category (one of: civil-concrete / bridge / wastewater / commercial-slab / seawall / stormwater-pit / other)
outputs:
  - envelope_low_aud (integer, lower bound)
  - envelope_high_aud (integer, upper bound)
  - sources_cited (list of URLs / contract awards / news releases)
  - allocation_pct_used (e.g. "12-18% of HC contract value")
  - hc_margin_pct_used (e.g. "12% default for tier-2-civil")
  - exclusion_deductions_aud (sum of items HC pays for, itemised)
  - confidence (0-100)
  - quarantine_path (default `_Internal/quarantined/budget-envelope-{job-id}.md`)
side_effects:
  - writes envelope estimate to `_Internal/quarantined/budget-envelope-{job-id}.md`
  - appends quarantine entry to orchestrator session log
  - adds `_Internal/quarantined/budget-envelope-{job-id}.md` to pricer's path-exclusion patterns until Phase 4 reveal
authored_by: claude-code-orchestrator
created: 2026-05-08
---

# lfo-reverse-engineer-budget

Independent top-down estimate of the LFCS labour-only budget envelope. Derived from the HC's public contract value, allocation %, HC margin, and the value of items LFCS excludes. Quarantined until Phase 4 reveal so it cannot bias the bottom-up take-off.

## Why this exists

Bottom-up pricing answers "what is this scope worth at LFCS rates × quantities?" but not "what does the HC actually have available for this sub-package?" The two should be in the same ballpark; if they're not, one of them is wrong. Reverse-engineered envelope is the cheap external sanity check Robert Logan QS-style firms run on every quote — codify it and run it on every bid.

Worked example: 2630 North Beach Seawall. Public contract value $7.2M (City of Wollongong tender award). Marine-seawall projects allocate 25-35% to FRP scope. HC margin 12%. LFCS-excluded items (concrete supply, stainless reo, plant, surveying, geotech, asbestos, demolition, earthworks, piling, precast, mech/elec, landscape, waterproofing, etc.) = ~55% of the HC's allocation. → LFCS labour envelope sits around $X-Y. Compare to bottom-up.

## Procedure

### 1. Verify preconditions

- Bottom-up first-pass take-off must be SEALED. Orchestrator confirms in session log: `take_off_sealed_at: <timestamp>`. If the orchestrator has the bottom-up total in working context, this skill is biased — abort and run from a fresh agent context.
- Exclusions list locked. Read `_Internal/exclusions/exclusions-{job-id}.md`.

### 2. Web research the public contract value (priority chain step 5)

Query targets (max 5 calls per envelope build):
- `"<end_client> <project_name> tender award contract value"`
- `"<end_client> Council meeting agenda <project_name> $"` (Council minutes often disclose award value)
- `"<hc_name> <project_name> contract awarded"` (news releases)
- `"<project_name> tenderlink OR vendorpanel OR etender contract award"`
- `"<site_location> Stage 2 <client_org> capital works budget"`

Capture for each hit:
- Contract value (AUD ex GST if disclosed; convert if inc-GST)
- Source URL + date
- Confidence in the figure (Council disclosure > news release > industry rumour)

If multiple values disclosed (e.g. tender estimate $X, awarded value $Y, contract sum $Z), use the awarded/contract value preferentially.

If NO public value found:
- Fall through to scope-comparable benchmarking: find a published similar project (same site type, similar scale) and use its disclosed value as a proxy with a confidence haircut (-20%).
- If still nothing: skill returns `confidence: 30` and a wide envelope band; orchestrator decides whether to proceed or skip envelope step.

### 3. Apply allocation % for FRP scope on the project type

v1 allocation table (refine over time per past-job precedent):

| Scope category | LFCS package allocation % of HC contract |
|---|---|
| Civil concrete (slabs, pits, footings) | 10–25% |
| Bridge (FRP package on a bridge structure) | 30–40% |
| Wastewater treatment (slabs + walls + complex geometry) | 15–20% |
| Commercial slab (warehouse, industrial floor) | 10–15% |
| Seawall (marine concrete + promenade + bleachers) | 25–35% |
| Stormwater pit (cast-in-situ pit detail) | 30–50% (small package, high % of small contract) |
| Other / mixed | 15–25% (default) |

Pick the band matching `scope_category`. Use the midpoint as base; the band itself becomes the envelope width before further refinement.

**Refinement signals (narrow the band):**
- If contract value is dominated by non-FRP work (e.g. seawall is mostly armour rock + marine plant): shift to lower end of band (-5%)
- If contract value is mostly the FRP package (e.g. small stormwater pit on a brownfield): shift to upper end of band (+5%)
- If past precedent jobs (`lfo-precedent-finder` step 3 output) had a known allocation %, weight toward that figure

### 4. Subtract HC margin

v1 HC margin table:

| HC tier | Default margin |
|---|---|
| Tier-1 head civil (CPB, Acciona, Lendlease, Fulton Hogan, John Holland) | 8–12% |
| Tier-2 head civil (TCE, Vaughan Civil, Mack Civil, Solutions Plus) | 10–15% |
| Tier-3 head civil / specialist (smaller subcontractors) | 12–18% |
| Council direct (rare for LFCS-scope work) | 6–10% |

Apply to the HC's allocation amount: `lfcs_pre_excl = hc_allocation × (1 - hc_margin_pct)`.

If past precedent has a known HC-specific margin (e.g. "TCE consistently runs 12% on bridge jobs"), use that.

### 5. Subtract exclusion deductions (items HC pays separately)

Read the locked exclusions list. For each item HC pays for (Standard Exclusions tier + Preliminaries tier + Detailed Exclusions tier), estimate its dollar value as a percentage of the HC's total allocation. v1 deduction table:

| Exclusion category | Typical deduction from HC's FRP-package allocation |
|---|---|
| Concrete supply (HC-supplied) | 15–20% (large pours); 8–12% (small pours) |
| Reinforcement supply (Grade 500N standard) | 5–8% |
| Stainless / duplex reo (premium grades) | 10–15% (replaces standard reo) |
| Cast-in items (anchors, sleeves, conduits) | 1–3% |
| Plant (cranage, pumps, trucks) | 8–15% |
| Professional services (surveyor, engineer, geotech, NATA) | 3–6% |
| Site management (traffic, ESCP, permits, asbestos) | 2–4% |
| Site amenities | 1–2% |
| Earthworks (bulk excavation, backfill, blinding placement) | 5–10% (when in package) |
| Piling | 8–15% (when in package) |
| Demolition (partial / select) | 3–6% (when in package) |
| Precast supply + install | 8–15% (when in package) |
| Mech/Elec/Hydraulic/Fire | 5–12% (when in package) |
| Landscape (planting, hardworks, paving units) | 3–8% (when in package) |
| Waterproofing (FRC, bitumen, polyurethane) | 2–5% (when in package) |

Sum the % deductions for items the locked exclusions list confirms HC pays for. Cap total deductions at 75% of HC allocation (sanity check — if deductions exceed 75%, double-check; LFCS can't have <25% of allocation as labour-only).

### 6. Compute envelope band

```
hc_allocation_low = hc_contract × (allocation_pct_low / 100)
hc_allocation_high = hc_contract × (allocation_pct_high / 100)

post_margin_low = hc_allocation_low × (1 - hc_margin_pct_high / 100)
post_margin_high = hc_allocation_high × (1 - hc_margin_pct_low / 100)

envelope_low = post_margin_low × (1 - exclusion_deduction_pct_high / 100)
envelope_high = post_margin_high × (1 - exclusion_deduction_pct_low / 100)
```

Round to nearest $5K.

### 7. Confidence calculation

| Signal | Modifier |
|---|---|
| Public contract value verified from primary source (Council disclosure, ASX) | +30 |
| Public contract value from secondary source (news release, industry article) | +15 |
| Public contract value from rumour / scope-comparable proxy | +0 |
| Allocation % within v1 table band | +20 |
| Allocation % calibrated against past precedent | +15 |
| HC margin from past precedent (HC-specific) | +10 |
| HC margin from default tier table | +5 |
| Exclusion deductions itemised from locked list | +15 |
| Exclusion deductions estimated globally | +0 |
| Envelope band width <25% (tight envelope) | +10 |
| Envelope band width >40% (wide envelope) | -10 |

Cap at 100. Floor at 30. If <60, log "envelope confidence too low for sanity-check comparison; surface to Rocky."

### 8. Output format

Standard one-paragraph envelope summary:

```
Reverse-engineered envelope: $X.XM – $Y.YM ex GST.
Source: public contract $Z.ZM (City of Wollongong tender award 2025-MM-DD,
        url: <url>).
Allocation: A%–B% (seawall scope category, midpoint <C>%).
HC margin: <D>% (TCE tier-2-civil default).
Exclusion deductions: <E>% of HC allocation
        (concrete supply <F>%, stainless reo <G>%, plant <H>%,
         pro services <I>%, earthworks <J>%, piling <K>%,
         precast <L>%, mech/elec <M>%, landscape <N>%,
         waterproofing <O>%, etc.).
Confidence: <P>%.
Comparable past job: <job_no> <site> ($value, allocation%, deductions%).
```

Plus a structured assumptions block (job_no / contract_value / allocation_pct / hc_margin_pct / deduction_pct / envelope_low / envelope_high / confidence / sources).

### 9. Quarantine

Default behaviour: write to `_Internal/quarantined/budget-envelope-{job-id}.md`. Add this path to the pricer's path-exclusion patterns. The bottom-up take-off cannot reference it. Reveal happens at Phase 4 sanity-check entry (orchestrator unquarantines + invokes the comparison step).

**Skip-quarantine mode:** when running retrospectively (the bottom-up price already exists and is known to all parties), set `skip_quarantine=true`. Output goes directly to a comparison file `_Internal/{job-id}-budget-envelope-retrospective.md` with the bottom-up + envelope side-by-side. Used for back-testing and methodology calibration only — NEVER for an active bid.

## Phase 4 reveal step (called by orchestrator, not by this skill)

When sanity-check opens:
1. Orchestrator unquarantines the envelope file.
2. Reads bottom-up sealed total ex GST from the Bid record (`final_submitted_total_ex_gst` or `_internal_first_pass_total_ex_gst` if pre-submission).
3. Computes delta vs envelope midpoint.
4. Writes `_Internal/budget-envelope-comparison-{job-id}.md` with:
   - Bottom-up: $X
   - Envelope: $Y–Z (mid $M)
   - Delta vs midpoint: ±N%
   - Outcome flag (one of):
     - **Inside envelope (±15%)** → "confident submission. Bottom-up consistent with reverse-engineered HC allocation post-deductions."
     - **Bottom-up below envelope (>15% under)** → "potential underprice OR HC margin pad larger than assumed. Review labour rates, productivity assumptions, and exclusion deductions before submission. Could mean LFCS leaving money on the table."
     - **Bottom-up above envelope (>15% over)** → "potential overprice OR HC has under-allocated to FRP package. Review scope assumptions, complexity factors, and contingency. Could mean bid won't be competitive at this number."

## Failure modes

- **No public contract value found AND no comparable proxy:** return confidence 30 with empty envelope; orchestrator decides whether to skip envelope step or web-research more.
- **Web research budget exceeded (>5 calls):** stop calling, return what's gathered, log budget-cap-hit in session.
- **Bottom-up total leaks into orchestrator context:** abort. Re-run from fresh agent.
- **Locked exclusions list missing or incomplete:** skill returns confidence 50 max with a flag — exclusion deductions can only be estimated globally, not itemised.

## Notes

- v1 allocation %, margin %, and deduction % tables are calibration starters. Refine after every 3 bids — track in lessons-learned if envelope and bottom-up diverge >25% on a Rocky-confirmed-correct bid.
- Skill is ONE input to sanity-check, not THE answer. Bottom-up always wins as the authored price; envelope is the external sanity-check.
- Public contract values are not always disclosed. Council projects in NSW typically disclose; private head-civil contracts often don't. When undisclosed, this skill drops to lower confidence and the orchestrator weights it less.
- Quarantine is non-negotiable for live bids. Skipping quarantine biases the bottom-up. Skip-quarantine mode is RETROSPECTIVE-ONLY.
