fix(navigation): block desk_cubicle in nav grid with zero padding to prevent walk-through (#75)
- desk_cubicle now has blocksNavigation: true with navPadding: 0 (tight blocking, no inflation — aisles stay clear) - buildNavGrid reads per-item navPadding from ITEM_METADATA - getDeskLocations targets y-5 (chair position, above desk blocked zone) - Agents route AROUND desks instead of through them - Chair stays passable so agents can reach their sitting position Fixes object passthrough for desks. Other large passable items (doors, lamps) unchanged — they remain non-blocking by design. Co-authored-by: Neo (subagent) <neo@openclaw.local> Co-authored-by: Luke The Dev <252071647+iamlukethedev@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
4b7b295846
commit
464a49bb6d
@@ -203,17 +203,19 @@ describe("buildNavGrid + astar – full pathfinding integration (issue #4)", ()
|
||||
});
|
||||
|
||||
describe("buildNavGrid – specific non-blocking item types (issue #4)", () => {
|
||||
it("desk_cubicle does NOT block navigation — agents stand at these", () => {
|
||||
it("desk_cubicle blocks navigation with zero padding — agents route around desks", () => {
|
||||
/*
|
||||
* desk_cubicle has blocksNavigation: false in ITEM_METADATA.
|
||||
* Agents interact with desks by standing beside them; the desk itself
|
||||
* is not a solid blocker in the pathfinding grid.
|
||||
* desk_cubicle has blocksNavigation: true with navPadding: 0 in ITEM_METADATA.
|
||||
* The desk body is blocked in the nav grid so agents route around it,
|
||||
* but zero padding keeps aisles between desks navigable.
|
||||
* Agents sit at the chair position (y - 5), which is above the blocked zone.
|
||||
*/
|
||||
const item = makeItem("desk_cubicle", 400, 300);
|
||||
const grid = buildNavGrid([item]);
|
||||
expect(isBlocked(grid, 400, 300)).toBe(false);
|
||||
expect(isBlocked(grid, 400, 300)).toBe(true);
|
||||
// Confirm via metadata as the authoritative source.
|
||||
expect(ITEM_METADATA["desk_cubicle"]?.blocksNavigation).toBe(false);
|
||||
expect(ITEM_METADATA["desk_cubicle"]?.blocksNavigation).toBe(true);
|
||||
expect(ITEM_METADATA["desk_cubicle"]?.navPadding).toBe(0);
|
||||
});
|
||||
|
||||
it("door does NOT block navigation — agents must be able to walk through doors", () => {
|
||||
|
||||
Reference in New Issue
Block a user