# Roof Job Brief Integration Plan

## Decision

The Roof Job Brief should become the production `/pricing-pack/[jobId]` document in `roover-takeoff-lite`.

It should not be copied in from the standalone HTML. The correct path is to promote the existing `/demo/pricing-pack/[jobId]` implementation because it already consumes real `TakeoffData`, `buildPricingPack()`, `canExportToRoofers()`, saved job state, and the demo `RoofFeatureDiagram`.

The standalone Cloudflare preview remains the visual/product reference. The app implementation must keep the existing data contracts and no-touch guardrails.

## What Gets Integrated

### 1. Roof Job Brief document layout

Owner: `roover-takeoff-lite`

Target:

- `src/app/pricing-pack/[jobId]/PricingPackView.client.tsx`
- shared components extracted from `src/app/demo/pricing-pack/[jobId]/DemoPricingPackView.client.tsx`
- `src/components/demo/RoofFeatureDiagram.tsx` promoted or renamed out of `demo` when reused by production

Integrate:

- forest-ink masthead and fact strip
- sticky contents/gate rail
- 00 homeowner intent and evidence
- 01-16 numbered section structure
- classified measurement diagram from real features
- grouped BOQ table with confidence chips
- print/PDF styling

Do not change:

- `src/lib/pricingPack.ts`
- `src/lib/boq.ts`
- `canExportToRoofers()`
- saved job resolution order
- QA gate behavior
- production-write boundaries

### 2. Measurement diagram

Owner: `roover-takeoff-lite`

Target:

- promote `RoofFeatureDiagram` and `roofFeatureDiagramModel` into a non-demo component namespace, for example `src/components/pricing-pack/`.

Integrate:

- production pricing pack section 07 should render the classified diagram from `takeoff.features`
- empty state remains explicit when geometry is missing
- line colors remain paired with labels, not color-only meaning
- report evidence carousel should include the promoted 3D, area, dimension, length, and slope diagrams from `assets/report-diagrams/`
- report diagrams support source review and reconciliation, but do not override the verified Takeoff Lite quantity basis when report headline values conflict with traced geometry

### 3. Measurement report evidence carousel

Owner: `roover-takeoff-lite`

Current standalone route:

- `src/app/job-spec/roof-job-brief/page.tsx`
- `public/job-spec/report-diagrams/`

Integrate into the production pricing-pack view after the main layout is promoted:

- 3D Image
- Area Diagram
- Dimension Diagram
- Length Diagram
- Slope Diagram

The production version should probably live near section 07/08 as a compact carousel or tabbed evidence viewer. It should carry clear wording that the diagrams are source-report evidence and that the final pricing basis still comes from the Takeoff Lite QA gate.

### 4. Roofer price action area

Owner: split.

In `roover-takeoff-lite`, it should stay as a preview/gated pricing-intake area only.

In `roover-pricing-pack`, it becomes the actual roofer submission interaction once the job brief contract is stable.

Integrate in Takeoff Lite:

- visual structure and fields for "Your price"
- disabled/gated behavior until export gate clears
- language: price submission / initial price / pre-site, not final quote

Do not integrate in Takeoff Lite yet:

- real roofer submission writes
- Make/HubSpot forwarding
- homeowner notification
- contractor-facing live route behavior

### 5. Takeoff Workbench Atlas shell

Owner: `roover-takeoff-lite`

Target:

- `src/app/takeoff/[jobId]/TakeoffEditor.client.tsx`
- `src/components/canvas/*`

Integrate after the Roof Job Brief is stable.

Scope:

- command bar
- left tool rail
- floating line-class dock
- floating inspector
- right rail Measure / BOQ / QA / Source tabs
- dark cockpit chrome

Do not change the editor state machine, geometry calculations, persistence, Nearmap proxy, or import/export contracts as part of the visual shell pass.

### 6. Aerial-to-brief walkthrough

Owner: reference/demo only for now.

Do not integrate into production Workbench or pricing pack directly.

Possible later use:

- internal operator training
- investor/product walkthrough
- a `/demo/job-brief-flow` static/reference route
- Roover Brain visual link

### 7. Roofer activation, daily pricing, workbook, and St Ives variants

Owner: `roover-pricing-pack`, after the Roof Job Brief contract is stable.

Do not integrate these into Takeoff Lite yet.

Reason:

- they are roofer-room / pricing-room interaction patterns
- they contain St Ives-specific and raw asset references in the source bundle
- the canonical product contract must be settled first in Takeoff Lite

## Implementation Order

1. Merge or base from the current Takeoff Lite branch that already contains `/demo/pricing-pack/[jobId]`.
2. Refactor demo pricing-pack view into reusable production components.
3. Replace or restyle `/pricing-pack/[jobId]` using the reusable Roof Job Brief components.
4. Promote the diagram component out of `demo`.
5. Add the report-diagram evidence carousel near section 07/08, sourced from the promoted report images.
6. Add focused tests around production pricing-pack rendering, gate state, empty geometry, report evidence presence, and BOQ grouping.
7. Run `npm test`, `npm run lint`, and `npm run build`.
8. Use browser screenshot comparison between:
   - Cloudflare static reference: `https://roover-job-spec-handoff.pages.dev/standalone/roof-job-brief-standalone`
   - local app: `/pricing-pack/[jobId]`
9. Only after review, deploy the app to `boq.roover.com` via `npm run cf:build && npm run cf:deploy`.

## Product Guardrails

- The Roof Job Brief is a pricing-stage document, not a final quote.
- The BOQ is a prefill / candidate until QA clears.
- Roofer pricing remains pre-site unless explicitly stated otherwise.
- No HubSpot, Make, Roover DB, customer messaging, or roofer dispatch writes are introduced in this pass.
- Real Nearmap / AppliCad / address-specific assets from the raw zip stay quarantined unless promoted deliberately.

## Recommended Next Build

Start a new implementation branch from the active Takeoff Lite branch:

`codex/productize-roof-job-brief`

First concrete milestone:

Promote `/demo/pricing-pack/[jobId]` into `/pricing-pack/[jobId]` with shared components and no behavior changes.

That is the highest-leverage step because it turns the design into the real product surface while preserving the current measurement, BOQ, QA, persistence, and no-touch system contracts.
