# Vector Desk · P-02

Vector Desk is a **public preview** for local drafting from classified LAS/LAZ at `/vector-desk/`. Use top, split and profile views to place native-XYZ points, symbols, polylines, polygon outlines and approximate overhead wires. CSV, DXF and lightweight project JSON download locally. It does not classify a cloud, reproject coordinates or certify survey results.

## Work and saving

Open a projected cloud, check the CRS/units, then choose a layer and elevation source: supported class-2 ground, an exact retained cloud return or entered elevation. The contextual command rail, persistent layer/elevation controls, Project/Export menus, view emphasis, functional map colors and circular target cursor are retained from the revised upstream workbench. Orthophotos are local GeoTIFFs with matching projected EPSG and units; there are no remote basemaps.

Right-click in a view finishes and ends a valid polyline/polygon command. Enter/Finish commits and keeps it active. Incomplete drafts are discarded by right-click; invalid nonempty drafts remain recoverable. Escape cancels a draft or held vertex drag, including when an elevation input previously had focus. Valid vertex edits create one Undo entry. Editing a vertex does not resegment a subdivided line.

Working state lives in tab memory. Closing or refreshing loses it: save a project and export before leaving. Only `vector-desk-cursor` is stored in localStorage, for cursor style. No cloud, image, geometry or project is persisted in browser storage. Projects reference source identities without embedding source bytes. Restore needs matching source files; a mismatch or canceled reselection preserves the accepted cloud, linework, history, dirty state and imagery. Orthophotos must also be relinked locally.

## Privacy and security

Clouds, orthophotos, settings and exports stay on the user's computer. No upload, processing service, account, telemetry, analytics, remote imagery or runtime font CDN is used. The host serves static code and self-hosted fonts. The LAZ worker uses embedded decoder bytes, without a WASM fetch. `/vector-desk/*` replaces the default site CSP: `connect-src 'none'`, `form-action 'none'`, same-origin workers, local scripts/fonts, and `wasm-unsafe-eval` solely for WebAssembly compilation. No JavaScript eval, inline-script or analytics permission is granted. Blob/data images are allowed for local raster rendering; Blob workers are not needed.

Report bug opens the separate standard site form. Only text deliberately entered and submitted there is sent. The desk does not attach working data, filenames, coordinates or settings. Cloudflare may inject its analytics script into a preview response; the desk CSP blocks it before loading. Integration checks permit only that specifically blocked script and reject other CSP violations.

## Capacity and accuracy limits

- LAS point formats 0–10 are read; waveform content is ignored and COPC is unsupported. No coordinate reprojection or unit conversion occurs. Source acceptance is bounded at 150 million points.
- The retained cloud is deterministically decimated to at most 5 million returns. Ground fitting and snap operate on retained data. The workbench displays at most 180,000 candidates per view; bounded/culling snap searches are not a nearest-neighbor query against every source return. Exact picked XYZ remains exact for the retained return, but missing returns and thin features may be lost through decimation.
- Ground is a bounded class-2 regular-grid supported mesh, not a certified survey TIN. Unsupported cells/gaps do not provide ground picks. Interval subdivision and approximate Wire chords require independent review.
- LAZ is limited to 256 MB compressed input and retains decoding buffers. Large inputs need substantial RAM; an uncompressed LAS or clipped corridor is often preferable. The 150-million-point header cap is not a demonstrated capacity guarantee.
- Orthophoto decoding is bounded; unknown/mismatched CRS or units, unsupported TIFF encodings, malformed data, oversized allocations and nonoverlap are rejected. There is no arbitrary image georeferencing or live imagery.
- Real-survey accuracy/performance, maximum large-LAZ capacity, and opening/validating outputs in native CAD were **not repeated** for this integration. Synthetic/public small fixtures verify software behavior, not fitness for construction or survey deliverables. Chrome/Edge channel coverage is not claimed: this review uses system Chromium.

## Pinned source and refresh

The source pin is recorded in [VERSION](VERSION): `60c1117a952e09e7fa02e9719f4645eaa8c3fd16` from Point-Tools, following the `b101897` review. Upstream remains read-only. Preserve vendor licenses/notices. The public static tree includes small synthetic/public test fixtures and development checks; no user survey files are included. The app does not load test assets during normal use.

Site-owned shell files are `index.html`, `desk-chrome.css`, `tokens.css` and the font-loading removal in `app.css`. They use `shared/aa.css` and the site's Barlow/Spline fonts. Source drawing, history, surface, CRS, image and export logic is preserved. Two documented runtime packaging adaptations supply local decoder bytes: `src/worker.js` imports `../local-laz.js`, and `src/reader.js` passes `root.VectorDeskWasm` instead of fetching the vendor WASM. `local-laz.js` is generated; never hand-edit it.

To refresh, obtain the pinned Vector Desk folder, review all source differences, copy runtime `src/` and licensed `vendor/` assets, and update tests/fixtures. Reapply those two packaging lines and retain the site shell and privacy policy. Do not copy the upstream standalone/deployment outputs. The upstream `rule-ui` sequence is adapted in the site tests to explicitly restart Polyline after right-click now ends the command; upstream files are unchanged. Browser tests load development-only axe from its same-origin URL rather than injecting an inline script, so the real CSP remains enforced. The orthophoto network assertion accepts shared assets on the same origin rather than requiring them inside the desk folder. The legacy browser smoke opens the Display disclosure before selecting hidden controls. Restore waits in vertex-ui/ui-refinements require a replaced cloud object so an already-true pre-Restore condition cannot race the asynchronous project reader. Update VERSION and this document with the new verification evidence.

```sh
node vector-desk/build-laz.cjs
node vector-desk/build-laz.cjs --check
node vector-desk/test/run-all.cjs
node vector-desk/test/browser.cjs
node bug/test/run-all.js
node invert/test/run-all.js
node md/test/run-all.js
node tinker/test/run-all.js
```

There is no site-wide production build and no GitHub Actions. Use the existing reviewed PR/Cloudflare Pages preview process; merging publishes, so this preparation must remain a draft until separately authorized. Preserve production routing, domain/DNS and unrelated apps.

Node checks require Node and Python with Pillow/libtiff for generated TIFF fixtures. Browser checks need Playwright and system Chromium; set `PLAYWRIGHT_MODULE` and `CHROMIUM_PATH` if required. The upstream channel-based suites use a local Playwright launcher shim to force system Chromium when Edge/Chrome are unavailable. The supplied `test/chromium.cjs` shim takes `PLAYWRIGHT_PACKAGE` for your installed Playwright and `CHROMIUM_PATH` for your browser executable; set `PLAYWRIGHT_MODULE` to its absolute path. Generated files/screenshots live only in temporary directories; `VECTOR_KEEP_OUTPUT=1` retains local evidence. `VECTOR_BASE_URL` targets an actual Cloudflare preview; `VECTOR_SKIP_UPSTREAM=1` runs only shell/privacy/LAZ/export preview smoke checks. See [VALIDATION.md](VALIDATION.md) for actual passed, failed and unavailable checks.
