Repository navigation
Conversation
…ground they make
For discussion, not for merge: the lab's terrain work cut onto main, first layer.
Three node kinds join AnyNode, each a stored-scene format to agree on:
- terrain-tile: a 32 m tile of 65 x 65 quantized height samples (base64 Int16),
child of the site; authored ground is written as tiles, not into site.terrain.
- terrain-break: a vertical boundary in site XZ metres (cliff, retaining or soil),
open straight line or convex CCW ring, numeric or 'ground' sides; strict mutations,
relation checks refuse crossing or touching breaks.
- ramp: a site-owned centreline ramp with endpoint heights and a cut-and-fill receipt
(terrainEffect) the ground can be restored from.
Slab gains an optional terrainMode ('flat' | 'draped'): a draped outdoor surface
follows the ground, its elevation read as clearance.
The terrain authority reads one ground from the legacy field, the tiles, the breaks,
the ramps' cuts and a continuation past the field; previews are made once per edit.
The spatial grid, stair rise and floor-placed elevation read a draped slab's height
at the point. A floor plate put back under its own underside moves whole and is never
stored thinner than a slab.
Taken from the lab line because terrain needs them: createSceneSpatialGrid (a 5-line
helper over createSnapshotSpatialGrid), getWallTopLowest in services/storey, and
live-previews moved from store/ to lib/ so the terrain source reads it without
loading the store.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sixteen shared tools in AGENT_TOOL_CONTRACTS, with their operations: - reads: read_site_terrain, sample_terrain_line, read_terrain_contours, describe_terrain_under_house, read_terrain_facts; - writes: set_site_lot, shape_site_terrain, carve_terrain_pad, grade_around_house, add_terrain_break, add_ramp, seat_house (strategies: balance, walk-out, hillside, areaway, retaining), set_terrain_plane, grade_along_line, add_steps_to_ground, add_terraces. verify_scene reports terrain_break_straddled (a slab or a wall across a break, with both sides' heights and the drop); get_node on a break or a site adds the break facts; delete_node of a ramp gives its ground back. A walk-out's ground level is no longer called unseated by verify_scene. No switch: the in-page panel lists core's contracts, so it serves these tools as soon as they are here. The lab's tool switch is not in this repository. Differs from the lab: the roof-wall guards are left out of the unguarded-drop reading (they need the lab's roof body), the zone-along-wall stretches the terrain facts read are a small file of their own, six tools read lengths in metres only (METRES_ONLY_TOOLS: the one notation, N1, is owed on them), and five tests that need add_site_surface or add_steps (siblings not carried) are skipped with the reason. get_site past a far-off field reads the field's context plane, as the lab changed that case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The eye under the ground is measured against the ground the site actually draws: the sculpted lot to its property line, and past the line the horizon disc under the block's base (groundPastLot, set by the site renderer). groundHeightAt takes the scene's nodes, so the underground ambiance reads tiles and breaks, not only site.terrain. The orbit rests on the floor of a seated house, not on the datum (level-orbit-floor), and on Solid the sculpted ground holds the eye inside the property line only; the walkthrough stands on a walk-out's floor where the ground is drawn open over it. undergroundLook gains ground: 'drawn' | 'implied'. 'drawn' (the default) is what main does today; 'implied' draws no ground under the ground on any lot, so the inside of a hill looks like the underside of a flat lot. Off by default. Past the property line the eye is measured against the disc, not the field. This moves where the dark mode starts on every sculpted lot: a look decision for the team. The first-person collider reaches past the lot as well as the field: its test's expectation moves from +-1008 m to +-1015 m (the default 30 x 30 m lot reaches past the 16 m field), as the lab changed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…th break ground behind a switch
The site renderer draws one composite ground when a site has tiles, breaks or a live
stroke: patches cut to the lot, a skirt along the property line, the horizon disc
past it, holes for ramps and recessed slabs, and the faces of each terrain break
(cliff in stone, retaining wall, soil). A tile wholly outside the property line is
kept and not drawn. A stroke reads and uploads only the skirt points and meshes it
can reach.
Renderers and definitions for the three kinds: terrain-tile (no tool of its own),
terrain-break (draw tool, 2D tool, panel), ramp (draw tool, 2D tool, panel, site-plan
outline). A draped slab is built on the ground under it.
Switch: the ground beside a terrain break is faceted by default (as in the lab);
setTerrainBreakGround('smooth') or NEXT_PUBLIC_PASCAL_TERRAIN_BREAK_GROUND=smooth
shades it smooth. A switch for the implied earth under the ground follows the viewer's
undergroundLook.ground, off by default.
Differs from the lab: the 2D tools of ramp and terrain break draw in the floor-plan
frame only (the lab reads a drawingType main's FloorplanToolContext does not have).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sculpt tool, its grid, cursor and panel write strokes against the scene's terrain authority (tiles, breaks, the continuation past the field), and the panel grades along a line (editor/lib/terrain-grade). Site-scoped kinds (ramp, terrain break) draw their own outline on the site plan. The Build palette gains a Terrain break tile. Not switched: the palette tile and the sculpt panel's additions. The palette label's i18n id (app.lib.buildPalette.terrainBreak) is not extracted into the catalogs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sixteen terrain tools join SHARED_TOOLS with their output schemas and annotations (read-only reads, destructive writes, add_steps_to_ground additive), and the OpenAI annotation policy and justifications list them. measure of a break or a site against itself adds the break facts; a ramp, a terrain tile and a terrain break each resolve a world point. No switch: the editor MCP and the hosted MCP serve these tools as soon as they are here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…less rooms and split floors on terrain A reconcile against an older baseline (the editor's reconciliation paused for an agent call, then resumed) read a floor plate the derivation itself had merged into another as a plate the person deleted, and switched its rooms' floor off: delete_zone keep on the shell room, then the room drawn again, left the garage with hasFloor false. A room a standing plate still carries now keeps its floor; a plate deleted by hand is still recorded by the store's own deletion intent. read_terrain_facts read only walls with a floor plate on one side: the walls and doors of a room with no floor plate (a garage, hasFloor false) were skipped. They are now read, a wall with no plate inside it from its own foot, and the room is named (room_without_floor). seat_house says such a room is not seated and keeps its findings after the seat. A floor split by the ground is said: shared base plates of one floor at different heights, and a room whose stored floor elevation stayed behind while the ground moved the floor that rests on it (floor_split). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d only within one house floor_split now names a room whose own floor elevation stands more than the floor-lift limit (0.15 m) off the floor the ground has moved, not only past half a metre: a 5 % rise that leaves the living room 0.40 m under the rest is said. Shared base plates at different heights are compared only when a room joins them or they touch: a detached shed on the same level, on its own ground, is another floor and no longer keeps an open finding after every seat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Read stored room heights relative to an automatic shared ground-following base, with 0.05 m as the unchanged flat-ground datum. Keep authored steps, explicit foundations, separate room floors and suspended floors meaningful. Already-split saved houses regain their living floor on reconciliation; stored room intent is not rewritten by a terrain change. Replace the tests that pinned rooms to absolute heights as the ground rose. They now assert continuous floors, preserved intended steps and a floor_split finding only for genuine requested differences beyond tolerance. Exercise saved synthetic splits, conversion roundtrips and the editing readers too. Carry attached floorless-room walls at the house plate without generating a floor, grade beneath their wings, and read open porches in terrain facts. Co-Authored-By: Codex (gpt-6-astra) via omp <noreply@openai.com>
…ing regression Read an explicit room height before the separate base fallback so infeasible own-floor edits are still refused and depressed garage doorways retain their floor cut. The shared ground-following test now keeps its stored 0.42 m intent and 0.37 m step instead of pinning a sunken plate while wall support rises. Give the roof test that requires an unregistered kind a distinct fixture kind. It must not depend on the package-local registry reset when the whole core suite is invoked from the repository root. Keep its framing assertions intact. The slab rendering regression now checks the intended 0.55 m platform step and raycast top above the moving base, instead of the former fixed 0.60 m top. Cover the editor's shared-floor summary at flat and raised base heights, and verify a geometric handle height converts back to relative room intent. Co-Authored-By: Codex (gpt-6-astra) via omp <noreply@openai.com>
Replace whole-tool exemptions with reviewed bare-number paths and protect notation-aware ramp and shaping inputs with fixed conversions. Co-Authored-By: Codex (gpt-6-astra) via omp <noreply@openai.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft, for discussion, not for merge. This is the lab's whole terrain work, cut onto
main(abd6eee9f). It is here so the team can look at it, run it and decide how to take it. It is not a request to merge it.Branch
cut/terrain-for-discussion-20261116, 11 commits: 6 layers, then 5 repairs found while making the pictures (D41, D43, the notation guard).What it is for
Today the editor's ground is one height field on the site (
site.terrain), and you shape it with a brush. A house sits at height 0 whatever the ground does under it.This branch lets a person, or an agent, work with ground that is not flat:
seat_houseputs the house on the ground with a full-height storey. It has strategies: balance, walk-out, hillside, an areaway, retaining walls. It also re-solves the steps to the doors.terrain-break).add_terracesbuilds stepped terraces.unmet).read_terrain_factssays where water runs to a wall, which doors and windows are below ground, which faces are unheld, and which drives are too steep.verify_scenereports a slab or a wall that straddles a terrain break.Size
git diff --shortstat upstream/main...HEAD: 253 files, +32,986 / -736. Code is +19,129 / -574 (168 files). Tests and fixtures are +13,857 / -162 (85 files, 42 %).The per-package and per-layer tables below were measured on the first 6 commits; the 5 repair commits add about 530 code and 1,000 test lines in core, nodes and editor.
By commit:
0e7b7b33db0e3deda151b441bfc3b95a39f84267fc1aeeab0951f42d15eb4fa,b23b94ded6120b27d0,f032655ee83f02924dEvery commit builds on its own. At each one, core, viewer, nodes and mcp build (
tsc --build), and editorcheck-typesshows no error beyond main's two.The order puts the agent operations before nodes and editor because the terrain-break draw tool and the panel's grading call them.
By feature (added lines, approximate, by path):
What the team must agree on: node kinds and stored format
Four format changes. Each one is stored in scenes, so it is hard to take back once shipped.
terrain-tile(new kind, child of the site). A 32 m tile holding 65 × 65 Int16 height samples, base64 encoded, with a quantizationstep(default 0.01 m). Authored ground is written as tiles. The tools no longer writesite.terrain. The old field stays as a frozen legacy layer that the tiles override.terrain-break(new kind, child of the site). Alinein site XZ metres, akind(cliff,retainingorsoil), andleftandrightsides, each a height or'ground'. The line is either open and straight or a simple convex counter-clockwise ring. The kind hasstrictMutations, and the relation check refuses breaks that cross or touch.ramp(new kind, child of the site). A centreline made of line and arc segments, with heights at both ends, transitions, a width and optional retaining sides. It also carries aterrainEffectreceipt: the cut and fill it applied, so deleting the ramp gives the ground back. Why it is here: the terrain authority reads ramp cuts as part of the ground, so the kind has to be inAnyNode. EveryAnyNodekind needs a definition, so the ramp comes whole, with its renderer, tools andadd_ramp. It could be a PR of its own (see the split below).slab.terrainMode('flat' | 'draped', optional). A draped outdoor slab follows the ground, and its elevation is read as clearance above it. This changes support election in the spatial grid for every scene that has a draped slab. There is no tool and no UI for it in this branch. Onmainnothing writes it yet.Ground reading changes too. The authority now continues past the field as the field's own context plane instead of holding the edge height. Two existing expectations change because of this, as the lab changed them:
get_siteon a far-off field now reads 0 m of fall, and the first-person collider reaches ±1015 m (the lot) instead of ±1008 m.Switches, and what has no switch
Off by default:
setTerrainBreakGround('smooth')orNEXT_PUBLIC_PASCAL_TERRAIN_BREAK_GROUND=smooth.useViewer.undergroundLook.ground:'drawn'by default,'implied'to turn it on.No switch. All of the following are on as soon as this lands:
AGENT_TOOL_CONTRACTSand the MCP. That means the editor MCP, the hosted MCP and the in-page panel all serve them. The lab's tool switch is not in this repository.paletteSection: 'structure'and a floor-plan tool, it is listed byapps/editor/lib/build-palette.ts.verify_scenefindingterrain_break_straddled. It only fires on scenes that have breaks.get_nodeandmeasureon a site now addbreaks: [], or the break facts.Changes to main's own code that need a decision first
terrain-support-query.ts, lab commit832c718a5):if (!isSiteDatum(baseWorldY) && building?.groundLevelId !== levelId) return null. A house that names its ground level and stands on piers opens differently after this change. This is open lab decision 11, and defect D24 has not been rendered.e9defc6e4:floor-foundation-datum.ts,floor-intent-changes.ts,derived-node-guard.ts). A floor put back under its own underside moves whole and is never stored thinner than a slab. The arithmetic it fixes is onmain, but nomainpath has been shown to reach it.verify_scene: a ground level is no longer called unseated when the level under it is partly below grade.groundHeightAt(site, nodes, x, z): this exported core function takes the scene's nodes now, so that it reads tiles and breaks. Any caller outside this repository breaks.underground-ambiance.Non-terrain lab code this branch had to take
Each item is here because the terrain code would not build or pass without it:
AnyNodeneeds a renderer for every kind. Comes withadd_rampand the release of ramp ground ondelete_node.createSceneSpatialGrid: a 5-line helper overcreateSnapshotSpatialGrid, used by the drape tests.getWallTopLowestinservices/storey: the unguarded-drop reading uses it.live-previewsmoved fromstore/tolib/. The terrain source reads it without loading the store;structure-reconcile's clean-bundle test checks this.unguarded-drop-observations.ts: terrain-break observations use it. It is not wired intoverify_sceneon its own.rock/material.ts: the stone colour of a cliff face.b1929b5bf: spatial grid, item support, stair rise, circulation and layout clearance, and slab geometry. Terrain facts read draped surfaces. The slab panel's drape toggle was not taken, becausemainhas rewritten that panel.Where this differs from the lab
unguarded-drop-observations.tsleaves out the roof-wall guards. They need the lab's roof body and outline (a large non-terrain chain), so roof parapets are not counted as guards here.building/zone-wall-stretches.ts). They are copied verbatim from the lab'sroom-light-check.ts, which drags in the roof chain.main'sFloorplanToolContexthas nodrawingType.verify_scenewalk-out check readslevelGradeStandinginstead of the lab's per-level field.add_ramp,add_terrain_break,read_site_terrain,read_terrain_contours,sample_terrain_line,shape_site_terrain). The notation test lists those exact field paths (written from the input schemas, each checked to still exist and still be bare); every other field of those tools stays under the guard, and their unit-aware fields have fixed conversion cases. Seven ratio and percent fields joinNOT_LENGTHS.terrain-facts: 2 needadd_site_surfaceand 1 needsadd_steps.terrain-seated-ground: 2 needadd_steps..json.gz) and their tests were left out:seated-scene-load.test.ts,terrain-block-base.test.ts,stored-seated-scene-open.test.ts, and one case ofterrain-bounds.test.ts.run_batch(BATCHABLE_TOOLS). Revealing tiles when a lot grows (lot-growth.tswith therevealRelatedcapability). MCP README and agent-guide text.add_site_surface,add_steps,add_rockandguard_edges.app.lib.buildPalette.terrainBreakis not extracted into the catalogs. The terrain-break and ramp panels use plain English strings.Gates on this branch
All run one test process at a time, after a clean rebuild of core, viewer, nodes and mcp. The baseline is an untouched
mainworktree. The table was taken on the 6-layer head; after the repairs and the rebase onabd6eee9f, core is 7,802 pass, 8 skip, 0 fail and nodes 5,613 pass, 2 skip, 0 fail (re-run by the reviewer).tsc --build)check-types(contracts)check-typescheck-types(next typegen && tsc)bun test srcbun test srcbun testbun test srcbun testbun test libscripts/openai-tool-annotation-policy.test.tsNotes on the table:
check-types: main's two errors are both inceiling-bracket-batch.test.ts.useExhaustiveDependenciesin the ground renderers.document.bodyundefined).terrain-reveal.test.ts, a cost probe that runs only whenSCENE_JSONpoints at a scene file.bun run check:render-bundlepasses on the head.theme.csswas not copied into the baseline'sdist.get_siteon a far-off field, and the first-person collider's ±1015 m. Both are explained in the commits.Known defects and what is not done
From the lab's terrain audit (the defects found in the picture series are listed further down):
grade_around_house {}. It fills a plinth, or digs a pit under a basement. The tool is unchanged on purpose;seat_houseis the cure.steep_bank) says so.add_terracestakes only a straight line and rectangles.Pictures
All pictures are of a plain test house built by the tools (an L of 9 x 16 m, rooms named Living, Room 1, Room 2, Garage), never a client scene. Rendered in a real editor tab on the lab head this branch was cut from.
undergroundLook.ground'drawn' and 'implied'.Known defects found after the build (from the picture series)
Severity: S2 = wrong result a person would not notice; S3 = wrong or missing, visible; S4 = cosmetic.
verify_scenedoes not see buried openings or earth against walls; onlyread_terrain_factslists them.verify_scenesays nothing (onlyhouse_at_drop_edgein the facts).unmet.add_terracesraisestair_has_no_landing(4 and 6) inverify_scene.unmet.drainsblock andverify_scenehas no swale finding.verify_scenesays nothing about ramps; 18 % passes without a warning.Fixed on this branch after the build
create_story_shellkept its shell's floor elevation on one zone; when the ground rose under the house, the floor split into plates 2 m apart and a room was left with no floor. Now a room's stored floor elevation E is read relative to the automatic base B that follows the ground: it resolves to E + B − 0.05 m, so the intended step (E − 0.05) is kept. On flat ground (B = 0.05) nothing changes. A stored scene that was already lifted and split is repaired on its next reconcile. Authored foundation heights, keyed floors, suspended floors and manual slabs keep their rules.floor_splitstays as a guard for real steps beyond tolerance. Also: walls of a floorless room on a lifted house stand at the plate;seat_housegrades under a floorless wing like the rest of the house; floorless open rooms (a porch) are read by the terrain facts.Existing tests this PR changes
28 test files that exist on
mainare modified (63 hunks). Each hunk was classified: 44 add cases only, 8 update a count or an inventory for the added kinds and tools, 15 change an existing expectation because the behaviour deliberately changes, 0 loosen an expectation to fit the code (the one found was restored to exact paths). The 15 behaviour changes:scene-view.test.ts: the missing-plugin roof case uses a genuinely unregistered roof-plane kind; its expected frame is unchanged.notation.test.ts: tolerates the listed metres-only field paths of six terrain tools (exact paths only).site-ground-height.test.ts:groundHeightAtis passed the scene's nodes so it sees tiles and breaks; every expected height is unchanged.structure-reconcile.test.ts: a stored 0.42 m room intent above a 0.65 m moving base gives a 1.02 m platform (a 0.37 m step) instead of an absolute 0.42 m sunken plate (D41).terrain-source.test.ts: returns a cached composite terrain authority instead of the identical input field; the sampled 2.5 m height is unchanged.room-built-on.test.ts: with the 0.15 m shared base, the neighbouring stored-0.30 room walks at 0.40 m (D41).7-10.
terrain-sculpt.test.ts: a half-metre editing lattice covering the lot; the brush minimum no longer grows with a larger lot or a coarse imported base; the flatten read includes the scene's nodes (expected 3 m unchanged).11-12.
raised-room.test.ts: a fixed 0.55 m step above the moving base instead of a fixed absolute 0.60 m platform top, in the store and in the rendered raycast (D41).build-collider-world.test.ts: the walkable skirt reaches the full 30 m lot (X bounds ±1008 m to ±1015 m), with the matching Z bounds.(Some items cover two hunks of the same file, hence 15 hunks in 13 items.)
Open questions for the team
terrain-tilekind, the tiled authority, the continuation past the field, and the live-preview move. About 2.1k code and 1.4k tests. Changes no tool.terrain-breakkind, validation, the split ground (faceted by default, smooth behind the switch), the break faces, the draw tool, andadd_terrain_break. About 2.7k code and 2.8k tests; tests to trim, including the golden hashes.shape_site_terrain,carve_terrain_pad,grade_around_house,set_site_lot) and the sculpt panel. About 2.5k code.seat_house,set_terrain_plane,grade_along_line,add_steps_to_ground,add_terraces,read_terrain_facts), with the floor-plate and piers rules once decided. About 5k code and 5k tests; needs the most trimming.site.terrain: is the team fine with a frozen legacy layer plus tiles, and with a 0.01 m quantization? Should breaks and ramps be site children?main(MCP, hosted MCP, in-page panel), or offered only in a "casquette" (trade-focused mode) or Landscaper context?🤖 Generated with Claude Code