Repository navigation
web: pin-bound Export and BOM chrome (#12) - #19
Conversation
Export stays the inspector tab (§22.7) and keeps every data-export-*
selector. Header chrome next to the pin now offers Export (six formats,
as-built, same artifact_ref) and BOM. Sourcing reads only process,
stock_form, blank_size, and material_spec from GET /parts/{part}/properties
— no vendor catalog, no invented conform_to field.
Tracking #12. Does not close #4.
Co-authored-by: Vel <Code4me2@users.noreply.github.com>
History is oldest-first. The prior STEP row is already a visible [data-export-download], so .last() can still be that STEP after the route has recorded the new STL. Wait for the blob that was not in GET /exports before this run, then click that button. Co-authored-by: Vel <Code4me2@users.noreply.github.com>
Code4me2
left a comment
There was a problem hiding this comment.
MERGE
Adversarial review of pin-bound Export/BOM chrome (issue #12) vs main at 722da04. Scope: Export/BOM bound to the pinned artifact (not a second source of truth); no new export write path that bypasses the tool/store contract; G4/G5 not weakened. No merge-blocking bug in this PR’s scope. No fix pushed.
Export is bound to the workspace pin
useExportActions reads WorkspaceState.artifact_ref and pin_mode. ExportChrome puts that ref on the subject line (Fact source="workspace.artifact_ref") before any format button, and the submission is { …CHROME_SUBMISSION, format, artifactRef: pinned }. onExport sends submission.artifactRef verbatim to runExport — never null, never GET /parts/{part}/build at click time, never “current” resolved from the header’s useBuild.
exportBlocker / submissionKeyFor are the inspector tab’s. Chrome is as-built only (six EXPORT_FORMATS). A chrome STEP and an inspector as-built STEP of the same pin share one key, which is the §22.2 contract, not a second exporter.
BOM is declared fields, not a second authority
SourcingPanel is a read of GET /parts/{part}/properties filtered to SOURCING_FIELDS = {process, stock_form, blank_size, material_spec}. No conform_to, no vendor catalog (data-sourcing-catalog="none"). data-field is the declared subset only; description/finish/joint stay on Properties.
The panel attributes two refs separately: workspace.artifact_ref (the pin) and properties.build_artifact_ref (what the projection was evaluated with). Field values stay on properties.*. That is the existing properties surface, not a storefront and not a client-invented join. There is no pin-parameterized properties route; fabricating one in the browser would be the derived fact §1 forbids.
No new export write path
Chrome calls the extracted useExportActions → runExport → POST /parts/{part}/export with the same Idempotency-Key map. No new HTTP verb, no new tool, no client-side tessellation, no bytes URL. Drawings/docs/nested-sheet/kerf/history stay on [data-panel="export"]. Existing data-export-* selectors used by G10A (export.spec.ts) remain scoped to that panel.
G4/G5 not weakened
| Clause | Why this PR does not loosen it |
|---|---|
| G4.3 | Still [data-inspector-panel='properties'] [data-field] set-equality. Sourcing’s data-field cannot leak: Inspector mounts one tab; Popover returns null when closed. |
| G4.2 / G4.4 / G4.X / G4.D | Untouched. Stream data-field stays chip-scoped. |
| G4.5 | Header chrome is outside the viewport mask. Drawer canvas-height e2e still uses the original five G4 tabs. |
| G5.6 | hold / followCurrent / observeCurrent unchanged. Chrome does not write the pin. Workspace G5.6 tests unchanged; sourcing URL round-trip is additive. |
| G10A pin-after-B | export.spec.ts still asserts source_artifact_ref === pinA after B. The follow-up commit tightens download: wait for the new STL blob, then [data-export-download="${recordedBlob}"], instead of .last() against oldest-first history. |
INSPECTOR_TABS 6→7 and POST /context accepting inspector_tab: sourcing are the client navigation vocabulary tracking the new tab (same pattern as export). Not a G4/G5 clause. Smith/Arche appear in prose only.
Non-blocking (not merge-blocking)
- Chrome Export is mutation-only. Run commits the file; bytes still require the inspector two-step. That matches §22.7 and the PR scope. The chrome control uses the download icon, which can read as “I got a file.”
- Held-pin vs properties artifact is displayed, not warned. If
pin_mode === "pinned"on an older build, BOM values can be the currentbuild_recordwhile the subject line shows the held pin. Honest dualFacts; the sourcing unit test setspinned = properties.build_artifact_ref, so it does not exercise divergence. - Chrome e2e pin check is
GET /build, which equals the workspace pin only under defaultpin_mode=current. The interesting held-pin case is covered by the chrome unit test (pinned="artifact:build:sha256:aaaa"), not by Playwright. - No chrome-wire e2e that a chrome Run POST body is
WorkspaceState.artifact_ref. Acceptable because the write is the shared hook; G10A already covers that hook from the inspector. - INTERFACE.md “Both still send
WorkspaceState.artifact_ref” is slightly wrong for BOM (BOM is a read).
Do not merge from this comment. Decision is MERGE on the three review questions.
Tracking: #12. Parent: #4. Does not close #4.
Why
Export was an inspector tab only. This puts a simple Export control (and BOM) in header chrome next to the pin, bound to the artifact on screen. Sourcing is only the manufacturing fields the part already declares.
What this PR ships
Export chrome, bound to the pin
export_partformats, then Run.artifact_refisWorkspaceState.artifact_refverbatim — nevernull, never resolved at click time.exportBlockerand submission-key map as the inspector tab. Chrome is as-built only; drawings, documents, nested-sheet blanks, kerf, and history stay on the inspector Export tab (data-panel="export"selectors unchanged).BOM / sourcing inspector
sourcingplus the same panel in the BOM dialog.GET /parts/{part}/propertiesonly.process,stock_form,blank_size,material_spec. There is noconform_toon thepart.*surface; this client does not invent one.data-fieldis the declared subset only. Description / finish / joint stay on Properties.data-sourcing-catalog="none"— no vendor catalog, no storefront.Server
POST /contextacceptsinspector_tab: sourcingso the composer envelope tracksINSPECTOR_TABS.Out of this PR
Provider attach (Stage 10B/C). Appearance / tree sections / composer model picker / CLI verbs / Timeline engine. Restyling every panel. Live vendor catalogs.
Test
406 unit tests passed (including chrome pin-binding, six formats, sourcing field-set equality, and no-catalog). Typecheck, lint, and the production bundle succeeded. Existing
data-export-*and G4.3data-fieldselectors are unchanged.New e2e:
web/e2e/chrome.spec.ts— chrome visible on viewport, Export dialog pin equalsGET /parts/{part}/build, BOM fields equal the declared sourcing subset ofGET /parts/{part}/properties.G4/G5/G10A are not weakened. Smith/Arche appear in prose only.
CI follow-up
export.spec.tsdownload used[data-export-download].last()against the first.stlinGET /exports. History is oldest-first; the prior STEP row is already a visible download button, so.last()can still be that STEP after the route has recorded the new STL. The test now waits for the blob that was not in the listing before this run, then clicks that button.The
providers.spec.tssign-out409is left alone: that spec is attach/stream/sign-out (Stage 10B/C), out of this PR.