Repository navigation
Agents: units in author_scene and shared unit tools; opening frames follow the wall - #1186
Conversation
Aymericr
left a comment
There was a problem hiding this comment.
Thanks, this is a solid pair of changes. Moving the unit tools into shared core contracts and operations is a nice cleanup, and routing every frame-depth reader through resolveOpeningFrameDepth is the right shape. A few things before it can merge:
- Merge conflicts. GitHub reports the branch as conflicting with
main, so it needs a rebase (no force-push needed from our side, just update the branch) and a green CI run after. - Screenshots here, please. The before/after of auto frames on a 0.2 m wall vs the explicit 0.07 m frame lives in the private-editor PR, which outside contributors and reviewers of this repo can't see. Could you attach them (or a short recording of the Depth (auto) / Auto reset flow in the door and window panels) on this PR too?
- Wall thickness changes. Auto depth now depends on the host wall's thickness at render time. Please confirm that changing a wall's thickness after the openings exist marks its doors and windows dirty so their frames re-resolve, and ideally add a test for it. If the wall system already re-dirties child openings on any wall change, a pointer to that is enough.
- Small one, non-blocking. In
authorSceneChecks, theCOMMON_ROOMregex matches substrings, so a room named e.g. "Hall bedroom" or "Storage loft" inside an apartment would be treated as common area and slip pastrooms_in_units. A word-boundary match, or only counting rooms with no unit on levels that are mostly units, would make the check a bit stricter. Fine to leave as a follow-up.
Nothing in here exposes the hosted architect harness, so no concerns there. Once it's rebased and green with the screenshots, I'm happy to approve and merge.
…one; common area is named by common-area words only Review of #1186: unit_split_room was recorded on a room id, so the floors check counted it as a failed floor cover (Bugbot). And the common-area test matched substrings, so "Hall bedroom" or "Storage loft" inside an apartment slipped past rooms_in_units (Aymeric); a room is common area when every word of its name is a common-area word or a qualifier (Entry hall, Stair landing 2). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
cb9e7f7 to
1726496
Compare
|
Thanks for the review. Done on the branch (rebased on main, force-pushed):
🤖 Generated with Claude Code |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1726496. Configure here.
…one; common area is named by common-area words only Review of #1186: unit_split_room was recorded on a room id, so the floors check counted it as a failed floor cover (Bugbot). And the common-area test matched substrings, so "Hall bedroom" or "Storage loft" inside an apartment slipped past rooms_in_units (Aymeric); a room is common area when every word of its name is a common-area word or a qualifier (Entry hall, Stair landing 2). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
1726496 to
c50891f
Compare
…bers / list_units shared by both surfaces A person asking for a condo, an apartment building or a hotel got rooms and no units: author_scene had no unit field, and the unit tools lived on the MCP only, so the chat and Pro could not group rooms into dwellings. - author_scene: a room names its `unit`; the payload's `units` types or colours them. The operation makes one UnitNode per distinct name under the building, holding the zones of the rooms that name it (after open-plan joining; seeds of one enclosure naming different units are the defect `unit_split_room` and the room is in none), reports `units` and `ids['unit/<name>']`, and mints through the conversion's seed so a revision keeps an unchanged unit's id and drops one no longer named. `authorSceneChecks` gains `rooms_in_units`: where units are named, every room on a level with units is in one or is common area by name. - create_unit, set_unit_members and list_units are shared contracts (`agent-tools/units.ts`) and pure operations (`agent-operations/units.ts`): buildingId optional (the viewed floor's building), refusals building_not_found / zone_not_found / zone_outside_building / unit_not_found / zone_in_other_unit (naming the unit; `move: true` moves the zone). Their edge cases are a case table (`__fixtures__/unit-cases.ts`) the core, MCP and chat runners read; the MCP registers them through SHARED_TOOLS with its previous output schemas and loses its one-off handlers and test. - get_zones answers each zone's unitId and unit name (null: common area). - The pascal-3d skill says what a unit is, top-down (author_scene) and bottom-up (the three tools). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A door's or window's `frameDepth` was a fixed 0.07 m schema default while walls are 0.1 m by default and often thicker, so the wall's cut faces showed around every frame the AI or the tools created. `frameDepth` is now optional: left out, the frame is the host wall's thickness plus a 1 cm lip on each face (`resolveOpeningFrameDepth` in core); a stored number stays what it was, so old scenes render unchanged. Every reader goes through the resolver with the host wall's thickness: the door and window systems (hit box, frame, leaf offsets, sill, glass and dividers), the move tools' ghosts and facing pose, the plan symbol's offset plane, the schedules and the door documentation. The placement tools stop writing `frameDepth`, so new openings are auto; the panels show the resolved value as "Depth (auto)" and an Auto pill clears an explicit one. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
… schema page Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…ion removes one the payload drops Since #1178 the conversion's baseline is read from each level's authorSceneWritten; a unit is a child of the building, so a renamed unit stayed behind on a revision. The building now lists what it holds itself, and the baseline reads it back. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…one; common area is named by common-area words only Review of #1186: unit_split_room was recorded on a room id, so the floors check counted it as a failed floor cover (Bugbot). And the common-area test matched substrings, so "Hall bedroom" or "Storage loft" inside an apartment slipped past rooms_in_units (Aymeric); a room is common area when every word of its name is a common-area word or a qualifier (Entry hall, Stair landing 2). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
c50891f to
1d5e6ea
Compare
#1186 landed after the previous merge. The compiled en and en-XA catalogs are regenerated again with i18n:extract and i18n:compile.

What does this PR do?
Two things the hosted AI agents needed (owner, 2026-10-27):
Units for agents. A condo, apartment building or hotel asked of the agent came back as rooms only: no chat tool could create a unit and
author_scenehad no way to name one.author_scene: a room takesunit: "Apartment 2B", the payload an optionalunitslist (kind, colour). OneUnitNodeper name under the building, members across levels (a duplex), defectunit_split_roomwhen one open-plan room names two units, warningunit_no_rooms, checkrooms_in_units,report.unitsandreport.ids['unit/<name>']. Units ride the building's ownauthorSceneWrittenlist so a revision removes one the payload drops (the per-level baseline of author_scene: keep its bookkeeping in pieces live collaboration accepts #1178 never saw them).create_unit,set_unit_members,list_unitsbecome shared core contracts (agent-tools/units.ts) and operations (agent-operations/units.ts, 16-case table), registered on the MCP throughshared-tools.ts; the MCP-only files are gone.get_zonesanswers each room's unit.pascal-3dskill says what a unit is, top-down (unitin the payload) and bottom-up (create_unitafter the rooms exist).Opening frame depth follows the wall.
frameDepthon doors and windows was a fixed 0.07 m default while walls are 0.1–0.35 m, so the wall's cut faces showed around every frame.frameDepthis now optional: left out, the frame is the host wall's thickness plus a 1 cm lip on each face (resolveOpeningFrameDepth, corelib/opening-frame-depth.ts); a stored number stays explicit (E-003, nothing migrates). Every reader (viewer door/window systems, move tools, plan offset, documentation, schedules) goes through the resolver; the manual tools andplanWallOpeningstop writing it; the panels show "Depth (auto)" with an Auto reset; MCP templates drop their hardcoded value. Catalog entries for the new panel copy are drafts awaiting review.How to test
bun run ci(run on this branch in a clean clone: check, i18n, skills, types, tests, build all pass).author_scenewith two rooms namingunit: "Apartment A"/"Apartment B"→ two units under the building, the report countsunits: 2;list_unitsreads them;set_unit_membersmoves a room.Screenshots / screen recording
Auto frames on a 0.2 m wall (door and window, no reveal):
The same wall with the old explicit 0.07 m frame (the grey reveal around both):
(Branch
evidence/agent-units, orphan, two PNGs.)Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Medium Risk
Changes core
author_sceneconversion and bookkeeping, global opening rendering/schedules, and agent tool contracts used by MCP and chat—broad surface area but mostly additive with parity tests.Overview
Adds building units to the agent stack and makes door/window frame depth follow host wall thickness by default.
Units:
author_sceneaccepts per-roomunitnames and an optionalunitslist (kind, color), createsUnitNodes under the building (including multi-storey duplexes), and reports defects likeunit_split_roomplus a newrooms_in_unitsscene check.create_unit,set_unit_members, andlist_unitsare implemented once in core (agent-operations/units.ts,agent-tools/units.ts) with a shared fixture table; MCP drops bespoke handlers and wires them throughshared-tools.ts.get_zonesnow returns each room’sunitId/unitname.Opening frames:
frameDepthon doors and windows is optional; when omitted, depth resolves to wall thickness plus 1 cm per face viaresolveHostedOpeningFrameDepth, with editor panels showing “Depth (auto)” and schedules/templates updated accordingly. Explicit stored depths are unchanged.Reviewed by Cursor Bugbot for commit 1d5e6ea. Bugbot is set up for automated code reviews on this repo. Configure here.