Skip to content

[Codex] editor: preserve lot imports during hydration - #1188

Merged
Aymericr merged 1 commit into
mainfrom
fix/lot-import-hydration
Oct 28, 2026
Merged

Aymericr merged 1 commit into
mainfrom
fix/lot-import-hydration

Conversation

@Aymericr

@Aymericr Aymericr commented Oct 28, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

Lot import now reads terrain before applying the parcel to the current scene. If hydration replaces the scene during the read, the final site keeps the resolved parcel, address, provenance, contours and terrain together, while preserving the hydrated site ID, setbacks, zone and unrelated metadata.

How to test

  1. From packages/editor, run bun test src/lib/lot/drop-in.test.ts src/lib/lot/lot-patch.test.ts src/lib/lot/terrain.test.ts: 33 tests passed. The new test pauses elevation, hydrates a starter site, then checks the actual parcel and preserved settings after the response.
  2. From packages/editor, run tsgo --noEmit: passed locally.
  3. In a standalone checkout with its own frozen dependencies, run bun run check-types and the required CI. The local whole-repo command reached 13 passing packages, but the standalone app could not resolve its WebXR, landscape and bath-space dependencies from the hosted checkout's different dependency tree.

Screenshots / screen recording

N/A — non-visual change.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Authored by Codex. No provider calls or production writes were made during local verification.


Note

Medium Risk
Changes timing and single-write semantics for the shared lot import path used by multiple panels; behavior is covered by a new race test but async ordering regressions could still affect real imports.

Overview
Lot drop-in no longer writes the resolved parcel to the scene before the USGS elevation call finishes. Terrain is sampled first (without touching the store), then the current site is read again and parcel geometry, address, contours, and terrain are committed in one patch.

This closes a race where scene hydration (or a user edit) could replace the site while providers were still in flight—the old flow could leave a starter polygon or miss terrain on the hydrated site ID. sitePatchFromParcel still runs against the live site so owner setbacks, zone, and unrelated metadata stay intact while parcel facts update.

Adds a test that blocks elevation, hydrates a custom site mid-drop, and asserts the Gainesville parcel, terrain, and preserved settings land on that site.

Reviewed by Cursor Bugbot for commit d2054f2. Bugbot is set up for automated code reviews on this repo. Configure here.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T07:34:51.963264Z d2054f2 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Aymericr
Aymericr merged commit ae186c3 into main Oct 28, 2026
4 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.

2 participants