# CHATPACK: mesh jacket, the mesh won: plan the road to `main` (2026-10-25)

Follows `docs/CHATPACK-mesh-r6b-hi3d-cuffs-2026-10-24.md`. Its answer, `BRIEF-mesh-jacket-round6b-hi3d-cuffs-2026-10-24.md`, ran to the end: R6b-M, R6b-B, O2, review gate, F8b. **F8b passed and the mesh wins over F2.**

**Return format:** ONE self-contained markdown brief, `BRIEF-mesh-jacket-to-main.md`, in the earlier briefs' shape: a decisions table (number from **#70**), ordered rounds, usage caps, numeric checks before renders, stop rules, an "unsure" section. I save it to `~/Downloads` and run `/adopt` on it in Claude Code, which fact-checks it against the repo first.

**Live progress board (read it):** https://jarviss-imac.tail5478a5.ts.net/
- `status.md`: branch, HEAD, recent commits, the current next step, the F8b record.
- `fixlist.md`: one line per owner shot. `shots/`: the 21 phone screenshots (JPEG).
- `chatpack.md`: this file.
- Refreshed each time a chatpack is made. It is a curated copy, not the repo. The 3D page itself is not public.

## Project
PC&C Embroidery is a client site for Heather (varsity letterman jackets and chenille patches, Redlands, CA).
- **Public site:** a static single-file `index.html` with a Three.js jacket builder (r185, vendored, no CDN).
- **Staff tool:** a small Flask app on Railway.
- **Maintainer:** solo beginner, so readable code beats clever code.
- **Production deploys from `main`.** Merging the mesh to `main` means customers get it.

## The spike in one paragraph
`?mesh=1` swaps the procedural jacket for a Hi3D (image-to-3D) mesh, recoloured in texture space by one shared material. That material reads two RGB label masks at 2048 px (rib, stripe, wool, leather and so on), plus shade, normal and metal/roughness maps. On the phone, F8b ran at 16 draw calls and 160,002 triangles. The alternative, F2 (a procedural rebuild), stays paused at step 1b-i and will not go to `main`.

## State (2026-10-25)
- **`spike-mesh-jacket` @ `0ad4d95`, pushed.** It holds rounds 0-6b. The cuff is the Hi3D cuff, cleaned in the bake by `CUFF_CLEAN`. The round-5 procedural tube is opt-in with `?cuff=tube`.
- **`main` @ `4d32467` is production.** There is no route for `/assets/jacket-mesh/`. On disk that folder is 14 MB: 4 GLBs, of which the default loads `jacket_parts_smooth.glb`, plus 2K and 4K maps.
- **Phone gates, all passed:** F8a fps (2026-10-23); O1 rib bleed (10-24); O2 cleaned cuffs (10-24); **F8b (10-24 and 10-25)**.
- **F8b numbers:** Samsung foldable, cover screen 1080×2520, Chrome. 1 s fps averages had a mean of 83.4 and a minimum of 60.3; 0 frames went over 100 ms. The 60 s fallback to the procedural jacket never fired. Presets switch with no reload and no WebGL context loss.
- **Known live defect on production:** the `backPoint` normal is mirrored, so shoulder-blade decals yaw 38°. Its fix was written on F2 (DECISIONS #36) and never cherry-picked.

## F8b look result (owner at the phone)
Navy & Ivory **pass**; White **pass** ("clean not blotchy", arms and cuffs pass); Scarlet black (red body, black leather, grey stripes) **pass** ("red is clean", "cuffs are ok", "same to similar fixes to the white body").

**The owner's rule:** "the shots i had you take are what my eye caught anything that wasnt taken is a pass so far (may change with later fixes)." Every shot is a fix, not a kill. Most were taken zoomed in.

The fix list, grouped (shot numbers are in `fixlist.md` and `shots/`):
1. **Ragged label edges wherever a light body meets the trim** (the biggest theme). On white, navy slivers and torn-looking edges show at the yoke under the collar, both raglan seams, the hem line above the waistband, the front placket and the pocket welts (04, 06, 08, 09, 10, 11). Red on black shows the same (14, 18). On Navy & Ivory, the default, it hides. Audit names: M-10 / D9.
2. **Body colour inside the back waistband rib:** white blocks on navy (13), and red blocks on black that are visible at default zoom (19-21). Rule #57 cannot kill this before B2 runs, and B1/B2 were skipped after O1 passed, so it is a fix with B1 (measure) → B2 (fix) as its route.
3. **Stripe colour on the white sleeve just under the collar,** on both sides (01, 08).
4. **A black blotch low on the underarm seam,** plus a ragged dark line up that seam to the neck (12 white, 18 red).
5. **Snaps:** a hard black crescent on one side of each silver snap, lumpy domes (16), and left/right snaps that don't match on Navy (02).
6. **Collar:** white specks and streaks on the stripe edges (M-17), and a **small rectangle at the collar's back centre**, to be checked against the removed logo (08).
7. **Leather:** hard triangle facets in the shading (N-5), and a gold tint in the black leather highlights. Unknown whether that is the warm key light or baked gold in the albedo (15).
8. **Cuff stripes on light stripe colours:** tan patches next to white on the same stripe, and one dark notch (17). The cause is the stripe slot, which draws Hi3D albedo × gain (#65), so the original cream/gold paint shows through.
9. Smaller items: dark smoky smears at the front opening on white (06, 07); a light angular patch mid-back (05).

## Locked decisions and rules (do not relitigate)
- **Project LOCKED:** varsity letterman jacket; 3D Three.js builder; 7 multi-select embroidery zones; no prices, cart or checkout; mobile-first; no runtime external calls except the quote POST; catalogs are data. The customer site must work with only `python3 -m http.server`.
- **Process:** topic branches off `spike-mesh-jacket`, merged only there until the release gate. Branch guard and preflight hooks. Every review gate ends in a real browser. Owner tests run on the phone, and Jarvis runs every gate.
- **#62:** the Hi3D cuff is the cuff. The tube (`?cuff=tube`, `make_cuff_tube.py`, `jacket_parts_nocuff.glb`) is removed in the pre-`main` cleanup.
- **#65:** each slot's mode is fixed by the frozen Hi3D mean (`MESH_LOOK_MEAN`). Stripe = albedo × gain; rib = catalog colour × shade.
- **#48 waistband guard:** ≤ 0.01% of band texels flipped, no cluster over 4. **#49:** bakes write a manifest (`manifest.py --check`). Masks are 2K; the 4K tier shares the 2K masks; maps are capped at 2K on phones.
- **#43/G:** baked-in artwork is painted out. **The collar logo never comes back.**
- **#50:** the odd 108-face snap is fixed after F8b and before `main` (a Blender geometry job).
- **#68:** the pinstripe comes after F8b, only if the mesh wins, as a shader highlight along the stripe-mask edge.
- **Pre-`main` rules from the round-5 brief (Q6):**
  - `MESH_BODY_SHADE` stays a named constant, with a one-line reason;
  - the `bodyshade=` override and the debug probe shader modes (UV encode, weights, `wsum`, `dbg=`) are removed;
  - the fps overlay and fixed views stay behind `debug=1`;
  - diag scripts stay in `tools/spike-mesh/diag/` and are excluded from deploy.
- Decisions run through #69. New ones start at **#70**.

## Constraints
- **Usage:** record % per round. Typical caps: measure ~3% (1 Sonnet, 0 renders); build ~10% (1 Sonnet + 1 Haiku grader, ≤ 8 renders per try, 2 tries). Numbers before pictures, Haiku reads each image once, stop after the last allowed try.
- **$0 new infrastructure.** No Hi3D regeneration: it throws away the mask work and costs credits.
- **Rights:** the Hi3D output was generated under CC BY 4.0, and the source photo's rights are unverified.
- **Tools:** the pinned bake pipeline in `tools/spike-mesh/look/` (`extract_atlas.py`, `bake_normal.py` on Blender 4.5, `build_mask.py` + `cuff_clean.py`, `band_field.py`, `manifest.py`); diag probes in `tools/spike-mesh/diag/` (`r6b_texel.py`, `r6b_screen.py`, `waist_guard.py` and others); the Samsung over adb, with screencaps and JS eval in its Chrome tab.

## Open questions for this chat (the point of this doc)
1. **What gates `main`?** Name the minimum release set. The candidates are the pre-`main` cleanup, the asset route, #50 snaps, and which of the F8b fixes above. Navy & Ivory, the default every customer sees first, hides most of them; white and red bodies show them. Which fixes block `main`, and which ship after?
2. **One pass for the ragged-edge theme (items 1 and 2)?**
   - The round-5 brief's B2 method 1 is a candidate: a morphological open/close on the label boundary in the bake, plus a `smoothstep` sharpen on the weights in the shader, applied to every light-body/trim boundary.
   - Or targeted per region.
   - Should B1 measure interior bleed on the back waistband first (red→white swap, ΔE > 10, ≤ 0.5% of rib pixels per fixed view, #53)?
   - What pass lines and caps? It must keep the waist guard and the cleaned cuffs intact.
3. **Sort items 3-9** into bake, shader or geometry work, and into before or after `main`. Two need a diagnosis first:
   - the gold tint in the leather (light or albedo?);
   - the collar rectangle (a logo remnant or not?).
   - For item 8: should the stripe slot stop using albedo × gain for light stripe colours?
4. **Snaps:** do #50 (the 108-face snap) and the owner's findings (crescent, lumps, mismatch) become one Blender job, or are the snaps replaced with simple procedural snaps?
5. **Release checks for production:**
   - the route serving only the files the page loads;
   - which GLB and tiers ship (4K?) and the first-load weight on a phone on mobile data;
   - whether the 60 s procedural fallback stays;
   - the 7 zones and decals verified on the mesh, including the live `backPoint` shoulder-blade defect: is it gone on the mesh path, or does it need its own fix?
6. **Rights before going public:** what has to be true before the Hi3D mesh is on production? An attribution line for CC BY 4.0, Heather's OK, the source photo's rights confirmed, or something else?
7. **Bookkeeping (quick calls):**
   - pinstripe #68 before or after `main`? (Heather's "white pinstripe on cuffs?" is unanswered);
   - close the `cuffL` slow-wave question, since the owner passed the cuffs on three bodies;
   - does `debug=1` ship as Q6 says?
   - the round-4 parked "two-scale shade": now unparked, or dropped?

## Parked ideas that touch this
- **After the decision (punch-list §5):** M-17 waistband seam and hard splices; M-16 bright stripe-edge line on light knits; N-2 at 821-879 px; the collar centre-back seam; collar stripes on the geometric layout; runtime trim patterns from `band_h` (partly answers M-14); M-01 geometry, only if Heather asks.
- **Blocked on Heather:** M-07 (supplier names vs hex), M-09 ("Navy & Ivory" / "cream" presets set plain White), M-14 (trim-pattern dropdown has no visible effect).

## What I want from this chat
Brainstorm the questions above with me, using the progress board's screenshots, then produce **`BRIEF-mesh-jacket-to-main.md`**: the ordered rounds from today's spike to the mesh merged into `main` and live, with the release checklist, caps and stop rules, numbering decisions from #70.
