Skip to content

web: pin-bound Export and BOM chrome (#12) - #19

Merged
Code4me2 merged 3 commits into
mainfrom
cursor/export-pin-chrome-2065
Aug 31, 2026
Merged

Code4me2 merged 3 commits into
mainfrom
cursor/export-pin-chrome-2065

Conversation

@Code4me2

@Code4me2 Code4me2 commented Aug 31, 2026 •

Copy link
Copy Markdown
Member

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

  • Header cluster next to the artifact pin: Export and BOM.
  • Export opens a compact dialog: subject (part + pin) first, then the six export_part formats, then Run. artifact_ref is WorkspaceState.artifact_ref verbatim — never null, never resolved at click time.
  • Same exportBlocker and 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).
  • “Drawings, documents, and export history” switches the inspector to Export.

BOM / sourcing inspector

  • New inspector tab sourcing plus the same panel in the BOM dialog.
  • Reads GET /parts/{part}/properties only.
  • Closed field set: process, stock_form, blank_size, material_spec. There is no conform_to on the part.* surface; this client does not invent one.
  • data-field is the declared subset only. Description / finish / joint stay on Properties.
  • data-sourcing-catalog="none" — no vendor catalog, no storefront.

Server

  • POST /context accepts inspector_tab: sourcing so the composer envelope tracks INSPECTOR_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

pnpm --dir web typecheck && pnpm --dir web lint && pnpm --dir web test && pnpm --dir web build

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.3 data-field selectors are unchanged.

New e2e: web/e2e/chrome.spec.ts — chrome visible on viewport, Export dialog pin equals GET /parts/{part}/build, BOM fields equal the declared sourcing subset of GET /parts/{part}/properties.

G4/G5/G10A are not weakened. Smith/Arche appear in prose only.

CI follow-up

export.spec.ts download used [data-export-download].last() against the first .stl in GET /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.ts sign-out 409 is left alone: that spec is attach/stream/sign-out (Stage 10B/C), out of this PR.

Open in Web Open in Cursor 

cursoragent and others added 2 commits August 31, 2026 01:02
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 Code4me2 left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

  1. 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.”
  2. Held-pin vs properties artifact is displayed, not warned. If pin_mode === "pinned" on an older build, BOM values can be the current build_record while the subject line shows the held pin. Honest dual Facts; the sourcing unit test sets pinned = properties.build_artifact_ref, so it does not exercise divergence.
  3. Chrome e2e pin check is GET /build, which equals the workspace pin only under default pin_mode=current. The interesting held-pin case is covered by the chrome unit test (pinned="artifact:build:sha256:aaaa"), not by Playwright.
  4. 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.
  5. 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.

@Code4me2
Code4me2 marked this pull request as ready for review August 31, 2026 02:20
@Code4me2
Code4me2 merged commit 72f104f into main Aug 31, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

web: Smith-class operator session (simple UI, CLI is the agent core)

2 participants