Repository navigation
Conversation
Aymericr
left a comment
There was a problem hiding this comment.
Thanks @kruschdev, this closes a real false-negative (#1255): floor-standing procedural-items now go through the same footprint and vertical-interval checks as items, and the bridge path no longer needs @pascal-app/nodes loaded. I ran the new suites locally on this branch: layout-clearance.test.ts 51/51 and check-collisions.test.ts 16/16.
A few small things before merge:
- Optional chaining on
recipe(check-collisions.ts): the name usesnode.recipe?.name, butsource.assetIdusesnode.recipe.name. Ifrecipeis always present by schema, drop the?.. If it isn't, guard both. - Skip reason for wall-hosted procedural items: a procedural item with
wallIdis skipped asparent_local_coordinateswhenfloorOnlyis false. It isn't in parent-local coordinates, it's wall-attached, sounsupported_attachmentseems more accurate in both modes. An agent reading the result will act on that reason. - Scope:
furniture-kind.ts(+81) isn't mentioned in the description. If it's needed for procedural footprints, a sentence on why would help. Otherwise it could be a separate PR.
CI for this fork is waiting on maintainer approval to run.
|
Thanks @Aymericr! I addressed all three points in e40f704:
|
Aymericr
left a comment
There was a problem hiding this comment.
[Maintainer] Thanks @kruschdev. Checking procedural-item footprints in check_collisions / verify_scene is the right fix for #1255 and the scope (floor-hosted first) is sensible. Bugbot has several Medium findings at bd0c21d that I think are valid and that would turn into false positives in verify_scene (which sets hasIssues), so please address or answer each before this lands:
door-clearance.ts: wall-side items are marked as checked butproceduralItemLevelPosereturns null for them, so they are reported as checked yet never paired. Either exclude them fromcheckedItemsor pose them.layout-clearance.ts:designedTogetheris still applied only when both nodes areitem; procedural chairs, stools and tables now go throughfindItemItemCollisionswith the default 0.08 m gap, so valid dining and bedside layouts getitem_too_close. Apply the designed-pair rule to procedural items too.layout-clearance.ts:isProceduralFloorUnderlayruns the rug check on the raw folded category, so snake_case ids likefloor_matare missed (the neighbouringpairRolenormalises[-_]+).furniture-kind.ts: pairing ignores specific procedural categories.- Ceiling-hosted items: three findings (mounting origin omitted in
item-space.ts, ceiling items false-colliding without heights, ceiling-hosted children counted in floor packing). If the intent is floor-only, filter ceiling hosts out up front.
Please add a test per fix: a dining set of procedural chairs around a procedural table that must not report item_too_close, a floor_mat under furniture, and a ceiling light above a table.
CI: GitHub Actions have not run on this head (fork workflows are waiting for maintainer approval), so I cannot call it green yet. Fixes #1255 looks right once the above is in.
|
Thanks @Aymericr! All five Bugbot items you listed were already fixed and covered by tests before
The branch merges cleanly with |
|
Review at
P0/P1: 2. Those need fixing before this can land. CI hasn't run on this fork PR yet because it needs a maintainer to approve the workflow run; it merges once that's green. |
…ve Codex review findings (pascalorg#1303)
… recipe guards, and cycle-safe host walks
bd0c21d to
71a9220
Compare
|
Thanks for the review and the architectural guidance from #1350. I rebased onto
Added 7 regression tests covering named-attachment penetration, spinning ceiling fan swept X/Z bounds, tilted procedural items, host cycles, renamed catalog chairs, non-bowtie corner winding, and |
Aymericr
left a comment
There was a problem hiding this comment.
[Maintainer] Thanks @kruschdev — I re-reviewed 71a92208. The earlier findings at bd0c21de are fixed: named-attachment penetration now uses STACK_TOLERANCE, plan corners project evaluated.reach, tilted items are dropped from footprints, itemHosts is cycle-safe, catalog role matching reads node.asset, and evaluations are reused through evalCache / preEvaluated. GitHub Actions and a local CI run (install, lint, i18n, types, test, build, smoke, mcp, viewer-live) are green at this head. Cursor Bugbot also reported no issues.
One remaining P1 is blocking:
- P1 —
packages/core/src/agent-operations/layout-clearance.ts:857-861: After the child’s bottom clears the named support surface, the pair is skipped entirely. That is correct for a lamp on a tabletop (the surface is the host’s top, so the ordinary stack check would also waive it). It is wrong for a mid-height surface: a 60 cm vase attached to a bookcase shelf with only a 40 cm opening still produces no collision, even though it intersects the next board. Please waive contact with the supporting surface only, and still test the child against host parts that extend above it. Add a fixture with a short vase that fits and a too-tall vase that must reportoverlap.
Non-blocking follow-ups, not required for this merge:
itemVerticalIntervalstill resolves script manifest bounds only for direct level or ceiling parents (layout-clearance.ts:407-413, fallback at:619).hostedToLevelalready walks procedural hosts; wiring it into the height path would catch a script lamp whose model extends below its attachment origin. The same gap already exists for catalog-item hosts.findBlockedDoorsis still catalog-itemonly (door-clearance.ts:717), unchanged from main.- Floor-standing recipes still have no motion
reach(this PR expands reach to ceiling designs only). - The 16-step spin sampler can miss about 4 mm between samples on the fan fixture.
- Core
planarRotationrequires exact 0 pitch/roll; MCP inspection allows1e-6. - Ground lift is sampled at the footprint center; the renderer uses the node origin.
- Elected slab support uses bare elevation, not
floorFinishTopAt(same catalog limitation). - The renamed-chair test filters on
issue.code, butLayoutIssueexposestype, so the assertion would pass even if the exemption broke.
Please address the P1 and I will approve and merge.
| if ( | ||
| supportY !== undefined && | ||
| attachedChildToHost.childY !== undefined && | ||
| attachedChildToHost.childY.min >= supportY - STACK_TOLERANCE | ||
| ) { | ||
| continue |
There was a problem hiding this comment.
P1: this waives the child against the entire host once childY.min clears the named surface. That hides a too-tall object on a mid-height shelf (for example a 60 cm vase in a 40 cm opening) that still intersects boards above the support. Waive contact with the supporting surface only, and still test the child against host parts that extend above it. Please add a short-vase / too-tall-vase fixture.
…e the named support surface
|
Thanks for the review and for running CI. I pushed
Verified green locally with |
|
Pushed
Verified green locally with |
Aymericr
left a comment
There was a problem hiding this comment.
Review at 5fdc85c6, run with Codex (gpt-6.2-astra) over two rounds: a full review, then each finding re-checked against the code. Only the verified blocker is requested below.
The two latest fixes check out:
a77b31bf: a child whose bottom clears the named support is no longer skipped against the whole host. The bookcase fixture covers a short 30 cm vase that fits the 40 cm bay, a 60 cm vase that hits the shelf above, a side-panel hit, and a vase that slices the upper board.5fdc85c6:planarRotationnow uses the sharedPLANAR_ROTATION_EPSILON(1e-6). Near-zero Euler tilt stays in the collision pass; a 0.2 rad tilt is still skipped.
P1 — packages/core/src/agent-operations/layout-clearance.ts (scriptItemBoundsInLevel / itemHeightsInLevel): A script-backed catalog item attached to a procedural host still cannot use the manifest-height resolver, which only accepts a level or ceiling parent. The fallback, itemLevelHeightRange, treats the node origin as the model bottom and uses catalog height. With identity asset corrections and manifest bounds from −0.20 m to +0.10 m, a lamp at local Y = 0 on the bookcase mid-shelf occupies Y = 0.22–0.52 m and passes through the 0.40–0.42 m board, but the fallback puts its bottom at 0.42 m, so the support check waives the board and reports no overlap. Transform the manifest corners through the corrective asset pose, attachment frame, and host floor lift before deciding that the child is resting on the surface (and before waiving that surface).
Non-blocking follow-ups: the new host-part check extrudes each part as a prism, so a diagonal brace can false-overlap a vase it only crosses above; MIN_OVERLAP_AREA (0.001 m²) can hide a complete hit on a 20×20 mm upright; only a direct attached child gets the shelf-part check (a small item sitting on the vase false-overlaps the whole bookcase box); catalog itemLevelHeightRange still requires exactly zero pitch/roll, so a 1e-7 tilt loses the height interval and falls back to the whole-host box; procedural ground sampling still uses the footprint center rather than the node origin.
Not merging at this head.
…ame and floor lift
|
Thanks for the review and for re-running CI. I pushed
Verified locally with |
Aymericr
left a comment
There was a problem hiding this comment.
[Maintainer] Re-reviewed at 46ce24eebdbd30927ed4d3d00b302879a3bb78b2 (the 5fdc85c6..46ce24ee delta, then the full PR) with Codex (gpt-6.2-astra) in two rounds. The second round re-traced every finding and reproduced it with in-memory probes on the merged tree. GitHub CI is green at this head (the viewer/ifc timing flake passed on rerun).
My earlier P1 is fixed. A script-backed item attached directly to a procedural shelf now takes its height from the manifest, composed through the host's named surface and frame, and no longer falls back to itemLevelHeightRange. I found no yaw-sign error, no double floor lift and no cycle loop, and the near-zero rotation tolerance is right. Thanks for the fast turnaround.
Three P1s remain on valid scenes. I reproduced each one.
packages/core/src/agent-operations/layout-clearance.ts:985(classification falls to:1075) — a nested item that fits inside a shelf bay is reported as colliding with the bookcase. The host-part check only recognizes a direct child. With a 4 cm tray on the middle shelf and a 20 cm script lamp on the tray, both fit below the next board, butgap: 0returns a bookcase ↔ lamp collision, andverifyScenereports it too. Fix: walk from the descendant up to the child attached directly to this host, use that child's named surface, and test the descendant's bounds against the host parts above that surface. Don't blanket-exempt ancestors: a taller lamp must still hit the upper board. Add a tall-lamp control.layout-clearance.ts:323and:295— floor support disagrees with the renderer.:323returns the bare slab elevation, but the renderer uses the finish top at the footprint point (hooks/spatial-grid/floor-placed-elevation.ts:112). With a 0.050 m slab and a 0.100 m finish the renderer's support is 0.151 m, but clearance used 0.050 m. The nested lamp was measured at [0.510, 0.710] instead of [0.611, 0.811], which hides 61 mm of overlap with a ceiling-hosted obstruction at 0.750 m. The ground fallback at:295also samples the footprint center, where the renderer samples the node origin (floor-placed-elevation.ts:105). For an off-center recipe on sloping terrain I got 0.750 m instead of 0.500 m. Fix: keep the snapshot slab election, applyfloorFinishTopAtat the elected point, and sample ground at the node origin. Add a test with a slab plus finish (the existing shelf test uses a bare slab).layout-clearance.ts:860and:1031— the named-attachment check ignores moving host parts. Each shape is tested at rest and the pair is then waived. A ceiling-mounted host with a panel that slides 0.28 m into its attached item passed relation validation, andverifyScenereturnedvalid: truewith no overlap. Placing the same panel at its travel endpoint reports the overlap. Fix: use per-part swept bounds for moving parts, or fall back conservatively to the host's swept bounds when rest geometry can't prove separation.
P2
door-clearance.ts:731— a supplied height resolver that returnsnull(unknown) is turned back intoitemLevelHeightRange, so an animated script can dodge a blocked-door finding. Use the catalog range only when no resolver was supplied.door-clearance.ts:223andfurniture-kind.ts:106—node.source?.manifest.boundsthrows ifsourceexists withoutmanifest.verifyScenerejects that scene first (schema_invalid), so it only hits raw callers, but please guard both accesses.layout-clearance.ts:952—boxSolidcallsitemLevelPosewithout the built record or frame cache, which copies the whole node map per lookup (item-space.ts:82). Pass{ nodes, frameCache }and memoize box solids by ID.
P3: the cycle test at layout-clearance.test.ts:1898 only calls itemHosts; assert on the collision and script-bounds entry points as well, and add a rotated two-hop fixture with nonzero X/Z offsets. MCP check_collisions still skips non-level parents (mcp/src/tools/check-collisions.ts:262), so the hosted fix only helps scene verification.
Once these three are fixed with tests I'll re-review quickly. I'm not pushing to your fork.
…ng host parts, and door height nulls
…loorOnly host guards
|
Thanks for the thorough re-review and the concrete probes. I pushed
Verified locally with |
Aymericr
left a comment
There was a problem hiding this comment.
Re-review at e8b192b4 (previous review was at 46ce24ee). Thanks @kruschdev: all three original P1s are fixed, and so are the P2s. One new P1 remains, and it comes from the nested-attachment fix. I'd like that closed before merge.
What I checked. I ran two Codex rounds on the 46ce24ee..e8b192b4 diff and the full PR. The second round verified every finding against the code with in-memory probes. I also ran the full local CI: install, lint, i18n, skills, types, test, build, render-bundle, smoke, mcp and viewer-live all pass. GitHub CI is green at this head (9/9), so the only blocker is the one below.
Original P1s: fixed
- Nested shelf item: the 20 cm lamp on the 4 cm tray is now clear in both
findItemItemCollisionsandverifyScene. The 45 cm control still hits the upper board. The old code reported bookcase↔lamp at gap 0. - Floor support: the nested lamp now sits at [0.611, 0.811] m, not [0.510, 0.710] m, so it hits the 0.750 m obstruction. The off-centre sloping-terrain probe is 0.500 m, sampled at the node origin, as the renderer does.
- Moving host part: the +0.28 m sliding panel now reports the same overlap as its frozen endpoint, including
item_overlapinverifyScene. The −0.28 m control stays clear.
P2s: fixed
- A
nullheight resolver no longer falls back to the catalog range. source: {}without a manifest no longer throws (door-clearance.ts,furniture-kind.ts).boxSolidno longer copies the node map per lookup.
P3: satisfied. Production-entry cycle tests and the rotated two-hop fixture are in. Note that they also pass on the old code, so they pin existing behaviour rather than a fixed defect.
Blocker (P1, new regression): a moving descendant of a named-attachment surface passes through the host
Repro, reproduced at e8b192b4 and confirmed by the second round:
- Fixture: bookcase → 4 cm tray on the middle shelf, with a procedural riser child that slides 0.31 m upward through the board above.
- At
e8b192b4,findItemItemCollisions(gap: 0)returns[]andverifyScenereturnsvalid: true, issues: []. - With the riser frozen at its +0.31 m endpoint, the same code reports bookcase↔riser, a 0.006 m² overlap.
46ce24eereported the pair in both cases. That was only because the coarse host box covered the whole thing, not because it detected the motion. So the pair was flagged, and now it is silently cleared.
Why: the new above-the-surface test sweeps the host's parts but uses the child's rest height. childY comes from the rest evaluation (layout-clearance.ts ~738), the upper board is then dropped by the childY.max <= y0 + 1e-3 skip (~902), and the pair is waived when aboveSolids.length === 0 (~1093). The named shelf permits contact with the support surface, not penetration of the board above it. It is agent-reachable too: three place_design-accepted v1 designs with a procedural tray with a named top reproduce it, and verifyScene misses the overlap.
Fix: before waiving the pair, take the descendant's swept bounds (Y and X/Z, the same sweep you already apply to host parts) and use them for childY and the solids test. If separation can't be proved, keep the conservative collision. Add a regression next to the short-lamp fit control: a riser sliding +0.31 m must report the collision, and a riser sliding −0.31 m or one that stays under the board must stay clear. Please check that the new test fails on e8b192b4.
Non-blocking follow-ups (P2/P3, fine as a follow-up PR)
- P2, MCP
floorOnlydisagrees with core. A level-parented item withroofSegmentIdis checked bycheck_collisions({floorOnly:true})and reports an overlap with floor furniture. Core excludes it. MCP uses the narrower guard atpackages/mcp/src/tools/check-collisions.ts~263–275, compared withlayout-clearance.ts:184anddoor-clearance.ts~250. Share the host guard and reportunsupported_attachment. - P2, perf. The ancestry helper runs before spatial rejection (
layout-clearance.ts~1049, with aSetallocated per call at ~1019). For 1,000 disjoint procedural items it is called 999,000 times.findItemItemCollisionsmedian is 70 → 134 ms at 1,000 all-procedural items and 16 → 19 ms at 200. Precompute named ancestors per footprint, or reject on bounds first. - P2, pre-existing and also present at
46ce24ee. A spinning ceiling-fan blade is sampled in 16 steps (recipe.ts~1315,door-clearance.ts~349). With initial yaw π/16 the swept maxX is 1.7674 m against a true 1.800 m, so a cabinet starting at 1.780 m is missed at gap 0. Use analytic extrema or a conservative envelope. This is not a blocker for this PR. - P3. The rotation tolerance differs between
item-space.ts:58anddoor-clearance.ts:243. At 5e-6 rad,proceduralItemLevelPosereturns a pose but collection rejects the item. I found no production collision disagreement.
Once the swept-descendant fix and its regression test land, this is an approve from me.
|
Thanks for the review @Aymericr! I pushed In For the follow-ups, I precomputed In |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e7c1406. Configure here.
| reading: aabbsOverlap(aBroadAabb, bBroadAabb, 0) | ||
| ? boxReading(aBroadAabb, bBroadAabb, gap) | ||
| : { overlapAreaM2: roundMm(MIN_OVERLAP_AREA) }, | ||
| } |
There was a problem hiding this comment.
Unproven motion invents overlap
Medium Severity
When a named-attachment pair has unproven procedural motion, the check emits overlap even if the swept plan bounds do not intersect. The reading then uses a stand-in area of MIN_OVERLAP_AREA rather than a measured intersection, so verify_scene can report item_overlap for pieces that never meet.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit e7c1406. Configure here.


What does this PR do?
Fixes #1255
check_collisionsandlayout-clearance(collectOccupiedFootprintsandfindItemItemCollisions, used byverify_scene,furnish_room, andplace_in_room) previously filtered strictly onnode.type === 'item'. As a result, overlapping floor-standingprocedural-itemnodes returnedstatus: "checked"with emptycheckedItems,skippedItems, andcollisions, whileverify_scenereportedhasIssues: false.I updated
@pascal-app/coreand@pascal-app/mcpso floor-standingprocedural-itemnodes participate in plan footprint and vertical-interval collision checks under the same contract asitemnodes:door-clearance.ts,item-space.ts): AddedproceduralNodePlanCorners,proceduralNodePlanAabb,inspectProceduralItemPlanFootprint, andproceduralItemLevelPoseusing@pascal-app/core/procedural-itemsdirectly so standalone MCP bridges without@pascal-app/nodesloaded still evaluate recipe bounds accurately, including off-center recipe datums under yaw, named surface attachment host chains, and consistentunsupported_attachmentskipping forwall-sideandceilingmounting designs parented to a level.layout-clearance.ts,furniture-kind.ts): Includedprocedural-itemincollectOccupiedFootprintsandfindItemItemCollisions, extendeddesignedTogethertoProceduralItemNodeso procedural dining/bedside pairs within the 0.08 m clearance band are not false-positived asitem_too_close, addedproceduralHeightsInLeveland shared floor-lift election (electFloorPlacedLift) so items hosted on or resting atop procedural surfaces still honorSTACK_TOLERANCE, filtered flat procedural rug underlays, and guardedItemNode-only helpers (isWallDressing,itemSolidsInLevel,boxSolid).check_collisions(check-collisions.ts): Scoped, inspected, and gatedprocedural-itemalongsideitemwithcatalog: "procedural"source metadata, recordingunsupported_attachment,parent_local_coordinates, andnon_planar_rotationinskippedItems(insufficient_evidenceorpartial) and excluding skipped procedural nodes fromfindItemItemCollisions.How to test
bunx biome checkon the modified files inpackages/coreandpackages/mcp(0 errors, 0 warnings).bunx turbo run build check-types test --filter=@pascal-app/core --filter=@pascal-app/mcpand verify the new#1255regression cases pass inpackages/core/src/agent-operations/layout-clearance.test.tsandpackages/mcp/src/tools/check-collisions.test.ts.level_0, place two floor-standing2 m x 2 m x 0.9 mprocedural-itemnodes at[0, 0, 0]and callcheck_collisions({ levelId, minimumClearance: 0, floorOnly: true })andverify_scene({}):check_collisionsnow reportscheckedItemslength 2 (catalog: "procedural") and 1overlapcollision, andverify_scenereportshasIssues: truewithitem_overlap.Screenshots / screen recording
N/A (MCP and core layout-clearance logic; verified locally in both
bun devand production build).Checklist
bun devbun checkto verify)mainbranchNote
Medium Risk
Large refactor of collision, height, and host-chain resolution paths used by agent layout tools; behavioral changes are extensive but heavily regression-tested.
Overview
Extends layout clearance and MCP collision checks to floor-standing
procedural-itemnodes, matching catalogitembehavior forverify_scene,furnish_room,place_in_room, andcheck_collisions.Core changes add recipe-driven plan footprints (
proceduralNodePlanCorners,inspectProceduralItemPlanFootprint) and level poses vianodeLevelFrame, with stricter planar rotation checks and shared rug /designedTogetherheuristics for procedural nodes.layout-clearancenow collects procedural occupied footprints, resolves heights with swept motion (jointReach), named surface attachments (waive resting contact but flag penetration into shelves above), improved floor/slab finish lift sampling at node origin, and richer script-item host chains on procedural parents.evaluateRecipegrowsreachfor moving floor designs, not only ceiling mounts.check_collisionsinspects and reports procedural items (catalog: "procedural") and feeds them intofindItemItemCollisionswith the same skip reasons as catalog items.Reviewed by Cursor Bugbot for commit e7c1406. Bugbot is set up for automated code reviews on this repo. Configure here.