# Estimate Quality Control Audit — Feature Specification

## Purpose

A recent estimate was shared with a client containing duplicate line items, inconsistent pricing for identical work, quantity discrepancies, and scope conflicts.

This feature must prevent any estimate from being shared until it passes a complete Quality Control audit.

The audit applies to the **entire estimate**, including every area, division, trade, allowance, scope document, and uploaded supporting document. It must not be limited to estimates organized by area.

---

## Feature Location

Inside:

**4 · Client Documents & Contracts**

Add a button labeled:

**Audit Estimate**

The **Generate Shareable Link** action must remain disabled until the required audit conditions are satisfied.

---

## Source Documents

The audit must review all available estimate-related data together:

- Estimate Matrix
- Finalized Scope of Work
- Good Faith Estimate
- Proposal
- All documents uploaded to the estimate
- Takeoffs, drawings, worksheets, and supporting documents when available

The system must never audit only one document when additional estimate documents exist.

---

## AI Role

You are a Senior Commercial Construction Estimator and Quality Control Manager with more than 25 years of experience reviewing multimillion-dollar commercial construction estimates.

Your job is not to create the estimate. Your job is to audit the estimate before client release.

Assume the estimate will be reviewed by experienced owners, architects, project managers, consultants, and competing general contractors looking for errors and inconsistencies.

Be extremely critical. Do not assume the estimate is correct.

---

## Audit Objective

Perform a complete Quality Control audit.

The estimate must not be approved for client release until pricing inconsistencies, missing scope, duplicate rows, quantity mismatches, unit-price inconsistencies, mathematical errors, and cross-document conflicts have been identified and resolved or explicitly accepted by an authorized user.

Do not approve an estimate merely because the grand total appears reasonable.

---

# Required Audit Modules

## 1. Duplicate Line Item Audit

Search the full estimate matrix for exact and near-duplicate rows.

Compare trade, description, area, quantity, unit, unit rate, labor, material, equipment, subcontract, allowance, and notes.

For every suspected duplicate, show the original row, suspected duplicate row, why the rows were flagged, and estimated financial impact.

User actions:

- Delete Duplicate
- Merge Rows
- Keep Both
- Edit
- I'll Do This Myself

If the user selects **Keep Both**, require a written justification.

If the user approves deletion or merging, update the matrix and recalculate all affected totals.

Never automatically delete scope without user approval.

---

## 2. Unit Price Consistency Audit — Critical

Compare identical or materially equivalent work across the entire estimate, regardless of area or division.

Calculate applicable unit rates including price per SF, LF, EA, CY, fixture, window, door, room, panel, outlet, and light.

For each inconsistency, display the work item, area or division, current quantity, current unit, current unit rate, comparable unit rates, variance percentage, suggested rate or range, reason, and financial impact.

User actions:

- Accept Suggested Change
- Edit Rate
- Keep Current Rate
- Ignore with Reason
- I'll Do This Myself

A different rate may be valid because of access, phasing, mobilization, finish level, material specification, location, minimum charges, or other conditions. The audit must allow justified exceptions instead of forcing all prices to be identical.

Accepted changes must update every affected extension, subtotal, area total, division total, and grand total.

---

## 3. Scope Completeness Audit

Cross-reference all estimate documents and confirm that every required scope item appears in the matrix.

Identify missing work items, quantities, labor, material, equipment, subcontractor costs, allowances, mobilization, cleanup, supervision, permits or fees, overhead and profit, scope included in documents but absent from pricing, and pricing included without supporting scope.

User actions:

- Add to Matrix
- Add to Scope
- Edit
- Ignore with Reason
- I'll Do This Myself

---

## 4. Quantity Validation

Validate quantities across the matrix, scope, takeoffs, drawings, and uploaded documents.

Identify missing quantities, zero quantities, duplicate quantities, conflicting quantities, unit mismatches, unusually high or low quantities, quantities that do not scale with the described work, and quantities that differ across documents.

For each issue, display the current value, conflicting source or comparison, suggested value when supported, reason, and cost impact.

User actions:

- Accept
- Edit
- Keep Current
- Ignore with Reason
- I'll Do This Myself

Accepted quantity changes must update both the matrix and finalized scope where applicable.

---

## 5. Mathematical Audit

Recalculate quantity × unit rate extensions, labor, material, equipment, subcontract, allowances, markups, contingency, overhead and profit, tax when applicable, area subtotals, division totals, construction subtotal, and grand total.

Verify no arithmetic errors, broken formulas, missing extensions, hidden excluded rows included in totals, rounding errors beyond tolerance, double-applied markup, or omitted markup.

Mathematical corrections may be made automatically when the source values are unambiguous.

Show the previous value, corrected value, formula used, and financial impact.

---

## 6. Pricing Outlier Detection

Identify line items and areas priced significantly above or below comparable work.

For each outlier, show the work item, area, actual rate or price, comparable rates, variance percentage, suggested price or range, and possible reasons.

User actions:

- Accept
- Edit
- Keep Current
- Ignore with Reason
- I'll Do This Myself

Do not treat a statistical outlier as an automatic error. Require context review.

---

## 7. Allowance Review

Find every allowance and verify it is clearly labeled, supported by scope language, not duplicated elsewhere, not hidden inside another line item, included in the correct subtotal, and accompanied by sufficient clarification.

Suggest clarification language where needed.

---

## 8. Exclusion Review

Cross-reference exclusions against the matrix and scope.

Verify excluded work is not priced unless clearly identified as an allowance, alternate, or owner-responsibility item.

For every conflict, show the exclusion language, conflicting priced item, affected documents, and recommended correction.

---

## 9. Cross-Document Consistency Audit

Compare the Matrix, Finalized Scope, GFE, Proposal, and uploaded documents.

Verify no missing areas, renamed areas without mapping, missing descriptions, inconsistent quantities, conflicting notes, different material specifications, different inclusions or exclusions, unreconciled area totals, or unreconciled grand totals.

---

## 10. Cost Distribution Analysis

Evaluate whether project costs are balanced and proportional across similar hallways, restrooms, offices, rooms, exterior scopes, concrete scopes, landscaping scopes, and repeated trades.

Flag unexplained cost distribution differences and show the comparison basis and variance percentage.

---

## 11. Constructability Review

Identify scope conflicts, access constraints, sequencing problems, occupied-facility concerns, trade coordination issues, missing temporary protection, missing phasing, hidden-condition exposure, long-lead materials, and inspection or code risks.

---

## 12. Change Order Risk Review

Identify items likely to generate change orders because of undefined quantities, allowances, TBD selections, missing field verification, incomplete drawings, conflicting scope, owner-furnished materials, existing-condition assumptions, permit or code requirements, or structural/MEP/fire uncertainty.

Suggest clarification language.

---

## 13. Professional Estimator Challenge Review

Review the estimate as if you were a competing estimator or owner's representative.

Ask:

> If I were challenging this estimate, where would I question the pricing, scope, quantities, assumptions, or exclusions?

List every material weakness and recommend a correction or clarification.

---

# Audit Results

Display an Executive Summary with Overall Quality Score 0–100, status of Pass, Conditional Pass, or Fail, total findings, total potential cost impact, and counts of unresolved critical, major, and minor issues.

Group findings into Critical Errors, Major Issues, and Minor Issues.

Include tables for Missing Scope, Duplicate Scope, Unit Price Inconsistencies, Quantity Issues, Pricing Outliers, Mathematical Errors, Allowance Issues, Exclusion Conflicts, Cross-Document Conflicts, Constructability Risks, and Change Order Risks.

---

# Finding Workflow

Every finding must include a unique finding ID, audit category, severity, description, affected area/trade/document/matrix rows, current value, suggested value or correction, explanation, financial impact, status, resolution history, and user comments.

Available actions:

- Accept
- Edit
- Ignore with Reason
- I'll Do This Myself

---

# Manual Resolution Queue

When the user selects **I'll Do This Myself**, move the finding into a Manual Resolution Queue.

Statuses:

- Pending
- In Progress
- Ready for Recheck
- Resolved
- Accepted Exception

Available actions:

- Recheck Item
- Recheck Selected
- Recheck All

Resolved findings are removed from the active queue but retained in the audit history.

---

# Shareable Link Quality Gate

Block generation of a shareable estimate link until the audit passes.

Minimum thresholds:

| Category | Minimum Score |
|---|---:|
| Scope Completeness | 90% |
| Quantity Accuracy | 90% |
| Unit Price Consistency | 90% |
| Mathematical Validation | 100% |
| Allowances | 90% |
| Exclusions | 90% |
| Cross-Document Consistency | 90% |
| Overall Confidence | 90% |

Also require:

- No unresolved Critical findings
- No unresolved mathematical errors
- No unresolved duplicate rows
- All ignored findings include a reason and authorized user
- Any justified unit-rate exception includes supporting notes

When blocked, display:

> **Estimate Quality Control Failed**
>
> This estimate contains unresolved issues that must be addressed before it can be shared with the client.

---

# Final Recommendation

Return one of:

- **Approved for Client Release**
- **Conditional Approval — Authorized Exceptions Required**
- **Requires Revision Before Release**

Approval is only allowed when every scope item has been reviewed, quantities validated, repeated work uses consistent pricing or documented justification, no duplicate or omitted scope remains unresolved, calculations are correct, documents are internally consistent, and the estimate is defensible.

---

# Important System Rules

1. Never delete, merge, or materially change scope without user approval.
2. Mathematical errors may be corrected automatically only when the intended formula is unambiguous.
3. Always show a before-and-after comparison before applying pricing or quantity changes.
4. Maintain a complete audit log of AI suggestions, user decisions, edits, exceptions, and timestamps.
5. An ignored finding is not automatically considered resolved.
6. A different unit rate is acceptable when supported by documented project conditions.
7. The audit applies to every estimate type, whether organized by area, division, phase, trade, room, building, or another structure.
