Skip to content

docs(skill): repair topology (doors/windows) from the access graph - #5

Merged
ChanMeng666 merged 1 commit into
mainfrom
docs/agent-topology-repair
Jun 30, 2026
Merged

docs(skill): repair topology (doors/windows) from the access graph#5
ChanMeng666 merged 1 commit into
mainfrom
docs/agent-topology-repair

Conversation

@ChanMeng666

Copy link
Copy Markdown
Owner

Summary

Documents a verified agent-layer procedure for making every room reachable and every bedroom lit by adding doors/windows — the design choice the core deliberately won't make (a door's position is a choice among valid options; per ADR 0005 that belongs above compile()). No core code change.

arch repair fixes furniture; this closes the remaining gap — the topology faults (W_ROOM_UNREACHABLE, W_ROOM_DISCONNECTED, W_NO_ENTRANCE, W_BATH_VIA_BEDROOM, W_BEDROOM_NO_WINDOW) — by teaching the agent to drive off the facts describe --json already exposes.

The procedure (in SKILL.md, pointer in arch spec)

  1. Read describe: access.rooms[].reachable, room bbox/uses/adjacent, building extent = min/max of room boxes (a room edge on it = exterior wall).
  2. Connect each unreachable room — priority: exterior entrance into a cut-off living/kitchen > door on a shared wall to a reachable non-bedroom > never route a bath only through a bedroom.
  3. Exact on-centerline at arithmetic for exterior doors, shared-wall doors, and bedroom windows.
  4. Re-repair (furniture clears new swings/landings) → validate --strict until ok: true.
  5. Addendum: an existing off-wall door/window (W_DOOR_OFF_WALL etc.) is a separate mis-coordinate — snap onto a wall or delete.

Verified end-to-end (two different topologies)

  • Example B (bath+living cut off; bedroom held the only entrance) → exterior entrance into the living/kitchen + bedroom window → repairvalidate --strict ok: true, fully clean.
  • Example C (bath reachable; living+bed cut off) → exterior entrance + bed↔living door + bedroom window → all rooms reachable, 2 entrances (residual W_DOOR_OFF_WALL is a pre-existing generator mis-coordinate — hence the addendum).

This completes the loop: geometry-blind AI plan → arch repair (furniture) + access-graph door/window procedure → a sound, fully-validated drawing.

Verification: 466 tests still pass; no generated-file drift.

🤖 Generated with Claude Code

Adding a door/window is choosing where — a design decision the core must not make
(ADR 0005). So this is agent-layer guidance, not a code change. SKILL.md (and a
pointer in the generated spec.llm.md / `arch spec`) now documents a concrete procedure
for an agent to make every room reachable and every bedroom lit:

- read describe --json (access.rooms[].reachable, room bbox/uses/adjacent, building
  extent = min/max of room boxes → a room edge on it is an exterior wall);
- connect each unreachable room, priority: an exterior entrance into a cut-off
  living/kitchen > a door on the shared wall to a reachable non-bedroom > never route a
  bath only through a bedroom;
- exact on-centerline `at` arithmetic for exterior doors, shared-wall doors, and
  bedroom windows;
- re-run `arch repair` (furniture clears the new swings/landings) then
  `arch validate --strict` until ok:true;
- addendum: an existing off-wall door/window (W_DOOR_OFF_WALL etc.) is a separate
  mis-coordinate — snap onto a wall or delete.

Verified end-to-end on two ArchCanvas plans (broken AI plan -> repair + this procedure
-> fully clean / all rooms reachable). No core code change; 466 tests still green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 30, 2026 05:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@ChanMeng666
ChanMeng666 merged commit b43f929 into main Jun 30, 2026
4 checks passed
@ChanMeng666
ChanMeng666 deleted the docs/agent-topology-repair branch June 30, 2026 05:40
@github-actions

Copy link
Copy Markdown

⏱️ Benchmark (median ms, informational — not a gate)

Plan Stage Current Baseline Δ
BALANCED compile 10.91 12.92 -16%
BALANCED parse 0.09 0.08 +10%
BALANCED resolve 0.00 0.00
BALANCED render 8.11 12.83 -37%
ROOM_HEAVY compile 2.58 4.14 -38%
ROOM_HEAVY parse 0.10 0.09 +7%
ROOM_HEAVY resolve 0.00 0.00
ROOM_HEAVY render 2.33 4.05 -42%
OPENING_HEAVY compile 16.83 26.11 -36%
OPENING_HEAVY parse 0.08 0.07 +10%
OPENING_HEAVY resolve 0.00 0.00
OPENING_HEAVY render 16.72 23.21 -28%

No stage regressed past the warning threshold.

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