One library on prod: the Drive and Sheet data now lives in the platform
14 import packages from five projects landed on QA and then prod, each with a reversible batch and a backup taken first; the library now holds Trousers, Shirts and T-shirts designs, 349 master DXFs and 160 linked adaptation pairs, with 0 Drive links, and Pre-selection was fixed along the way.
The library on prod after the imports
Files each package put into S3 on prod (SHA-256 checked)
The V11b brand scenario, walked on prod in a real browser
- Home, Inventory, Imports, Smart Designs, Insights
All open; inventory shows 1,186 active records incl. the imported Trousers.
- Pre-selection
Auto-match all: 152 records with design options. Fixed today: results stay on screen, the bar counts them.
- Collection plan
Fixed today: one piece is no longer offered to 4 sizes at once (was 'over by 3').
- Approval and tech pack
Brand admin approved a 1-unit plan; the tech pack was generated.
- DXF pattern
Failed for a data reason: that raw material has no pattern DXF (1,080 of 1,193 RM records lack one).
Drive and Sheets in the platform code
Before (4 Nov morning)
- A script in the prod image downloaded SDA files from Drive
- The Drive importer sat in tools/ next to the app
- RM Trousers and five SDA tabs only in the Google Sheet
- Adapter pairs without RM patterns or masters in the library
After
- No runtime path reads Drive or a Sheet (script removed)
- One-time readers only under migration/, never built or tested
- Every source snapshot imported with sheet + row provenance
- Engines read pairs, references and coverage through the Library API
Pre-selection after the fix (QA)

Imported Trousers in the brand's inventory (QA)

A clean collection plan on prod after the allocation fix

Your decisions (open)
- Add categories Bermuda, Shorts and Skirts: 74 designs from the RM sheet are ready in a package and wait for them. Decide Tailcoats (26 rows).
- Lock the RM sheet tabs that are still edited (RM Trousers, SDA Trouser, SDA Shirts, SDA T-Shirts) and edit on the platform from now on; until then each change needs a new snapshot package.
- Approve an 'Adaptation pairs' screen so pattern makers record pairs in the platform instead of the blazer and trousers trackers (the two living trackers).
- Real adapted DXFs on prod: 1,080 of 1,193 RM records have no pattern DXF, and the 2 published SDAs are not in the adapter's rulebook. Pattern files, or an engine-known SDA published with Cost/RRP, or a pattern-maker review unblock it.
- Name the 0297-B 54/176 twin that was adapted (4 pairs), and give the missing 5233-T trouser row (colour, composition).
- Confirm the 11 adapter trouser designs against the sheet's SDA Trouser designs (possibly the same designs under two names).
- The V11b prototype in the repo hot-links 237 Drive images: archive it as a library reference without them, or keep it frozen.
What changed in the platform (PRs #45–#59)
- Migrations 0033–0034 (expand-only): reversible import batches with an undo log, reference files, adaptation-pair fields, height labels, retirement, extra measurements.
- Package importer (dry run, one batch per idempotency key, revert) following OperationalLayer's contract v1 additive; the spec is docs/library/packages.md.
- Library API: GET /examples (status filter), /references, /references/{id_or_slug}, /ops/coverage, /ops/imports; demo and ops keys see what the contract allows.
- Pre-selection: results of Auto-match all stay visible, the summary counts them, polling continues in a background tab, and allocation never exceeds a record's pieces.
- Released QA first, then prod: an RDS snapshot was taken before the prod imports, the QA image was promoted unchanged, and Amplify releases were run.
Verification
- Typecheck clean; npm test 55 backend + 33 frontend test files; real-PostgreSQL tests 5 files incl. new package tests; all Library API answers validated against the contract schemas.
- Every package passed the contract checker, then on QA and prod: dry run, apply, and a second run that changed nothing.
- Prod after: 170 adaptation pairs with 0 duplicates, 7 retired as the owner ordered on 21 Oct, 0 external links.
- Real-browser checks with the local browser-use CLI on QA and prod using temporary brand accounts, deactivated afterwards.
Kept on purpose
- The brand-facing photo-link import: brands may put a public photo link in their workbook; the platform fetches it once into S3 with SSRF guards. It is a product feature, not a library source.
- The 3 Nov bundle importer stays as library:import-bundle until the RM sheet is locked.