---
skill: lfcs-bid-vs-qs-compare
version: 1
status: live (lightweight v1; full feature set deferred to milestone 2 v2)
model: claude-haiku-4-5-20251001
inputs:
  - bid_record_id (Bids rec ID with Status=Submitted)
outputs:
  - per-line pricing-history MD files at Operations/lfcs-standards/pricing-history/{job}-{boq_section}-{slug}.md
  - qs_unit_rate_aud populated where Commercial-External-* override exists
implementation: HQ-Vault/11_OpsMan_LFCS/Codebase/lfcs-pricing-agent/lib/bid_vs_qs.py
---

# lfcs-bid-vs-qs-compare (lightweight v1)

Triggered on Bid.Status=Submitted. Per Stage 5 milestone 1 § 5.

For each Bid Line Item on the Submitted bid, write a pricing-history MD file
matching the existing per-line schema. Populate `qs_unit_rate_aud` if any
external-QS override exists (reviewer_type starts `Commercial-External-`).

## v1 scope (this version)

- Per-line pricing-history MD files written
- `qs_share_status: shared-verbal` if external-QS override exists
- `qs_share_status: not-asked` otherwise

## v2 deferred (milestone 2)

- Cross-bid lookup query (`lfcs-pricing-history-lookup`)
- Anonymised QS counterparty hashing (per Stage 4 "Open Decision (b)-7")
- Per-category aggregation feeding calibration view
- Pricing-history append on EVERY Submitted bid (currently invoked per-bid)

## Run

```python
from pathlib import Path
from lib.bid_vs_qs import export_pricing_history_for_bid

paths = export_pricing_history_for_bid("recXXXXXXXXXXXXXX")
for p in paths:
    print(p)
```

## Related

- `lfcs-override-capture` (source of `Commercial-External-*` overrides)
- `lfcs-feedback-aggregator` (downstream aggregation)
