ワンクリックで
elevator-sim
Run the universal button emulator simulator with preset scenarios for testing elevator integration logic
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
メニュー
Run the universal button emulator simulator with preset scenarios for testing elevator integration logic
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
SOC 職業分類に基づく
Pre-flight validation checklist before deploying Accelerate Robotics to production
Scaffold a new Express API route with validation, auth middleware, test, and server.js registration
Preview a SQLite schema change and its impact before applying it to a production database
| name | elevator-sim |
| description | Run the universal button emulator simulator with preset scenarios for testing elevator integration logic |
User wants to test elevator integration logic — ride state machine transitions, arrival verification, degraded-mode fallback, multi-robot contention — without needing real hardware.
POST /api/elevator/simulate (single ride) and POST /api/elevator/coordinate (fleet scheduling). Start the server first — see /start-dev — then drive the endpoints with curl.NODE_ENV !== production) the requireAuth middleware passes through as an admin, so a plain curl against http://localhost:3000 works with no cookie. Use the actual PORT if it isn't 3000.src/services/elevator/{simulator,ride-machine,routing,fleet}.js; HTTP glue in src/routes/elevator.js.docs/30-integrations/elevator/keenon-ebox.md.Ask the user which scenario to run. Each maps to a real endpoint + key:
| # | Scenario | Endpoint | Key / shape | Expected outcome |
|---|---|---|---|---|
| 1 | Single robot, single call — baseline happy path | /simulate | scenario: "happy" | completed |
| 2 | Two robots, same floor — contention, should batch into one ride | /coordinate | two same-direction requests | one trip, both robotIds, merged stops |
| 3 | Two robots, opposite directions — should serialize | /coordinate | two opposite-direction requests, cars: 1 | two trips on car 0 (serialized); pass cars: 2 to run in parallel |
| 4 | Elevator stuck in WAITING — car never arrives, timeout escalation | /simulate | scenario: "waiting_timeout" | completed_via_fallback |
| 5 | RFID / arrival read failure mid-ride — floor detection fallback | /simulate | scenario: "verify_fail" (recovers) or scenario: "verify_timeout_abort" (fail-closed) | completed_after_reroute / aborted |
| 6 | LoRa / comms loss between E-Box master and slave — degraded mode | /simulate | scenario: "comms_loss" | completed_via_fallback |
Bonus: scenario: "safety_interrupt" → completed_after_safety (safety event interrupts mid-move, resolves, resumes).
/simulate scenario keys (full list): happy, verify_fail, verify_timeout_abort, comms_loss, waiting_timeout, safety_interrupt.
Possible outcomes: completed, completed_after_reroute, completed_via_fallback, completed_after_safety, aborted.
curl -s http://localhost:3000/api/elevator/scenarios returns the scenario + path catalog. If it fails, start the dev server first.curl below.outcome matches the expected value in the table abovefinalState is a terminal state (RELEASED for completions, ABORTED for fail-closed)trace shows state transitions in the expected order (each entry is { from, to, event })/coordinate: same-direction requests batched into one trip; opposite directions serialized (one car) or split across cars (multi-car)POST /api/elevator/simulate# Scenario 1 — happy path, robot requests floor 5 via the emulator path
curl -s http://localhost:3000/api/elevator/simulate \
-H 'Content-Type: application/json' \
-d '{"path":"accelerate_emulator","scenario":"happy","requestedFloor":5}'
# → { "path":"accelerate_emulator", "scenario":"happy", "requestedFloor":5,
# "finalState":"RELEASED", "outcome":"completed", "trace":[ {from,to,event}, ... ] }
# Scenario 5 — RFID/arrival read failure that recovers (re-select + re-verify)
curl -s http://localhost:3000/api/elevator/simulate \
-H 'Content-Type: application/json' \
-d '{"scenario":"verify_fail","requestedFloor":5}'
# → outcome: "completed_after_reroute"
# Scenario 5 (fail-closed) — verification times out, ride aborts (no roll-out)
curl -s http://localhost:3000/api/elevator/simulate \
-H 'Content-Type: application/json' \
-d '{"scenario":"verify_timeout_abort"}'
# → outcome: "aborted", finalState: "ABORTED"
# Scenario 6 — LoRa/comms loss → degrade to E-Box fallback → complete
curl -s http://localhost:3000/api/elevator/simulate \
-H 'Content-Type: application/json' \
-d '{"scenario":"comms_loss"}'
# → outcome: "completed_via_fallback"
# Scenario 4 — car never arrives → waiting timeout → fallback → complete
curl -s http://localhost:3000/api/elevator/simulate \
-H 'Content-Type: application/json' \
-d '{"scenario":"waiting_timeout"}'
# → outcome: "completed_via_fallback"
Defaults if omitted: path → accelerate_emulator, scenario → happy, requestedFloor → 5.
Valid path values: accelerate_emulator, keenon_ebox, oem_api.
POST /api/elevator/coordinate# Scenario 2 — two robots, same direction (both going up) → batched into ONE trip
curl -s http://localhost:3000/api/elevator/coordinate \
-H 'Content-Type: application/json' \
-d '{"cars":1,"requests":[
{"robotId":"r1","fromFloor":1,"toFloor":5,"priority":"routine"},
{"robotId":"r2","fromFloor":2,"toFloor":7,"priority":"high"}
]}'
# → one "up" trip, robotIds ["r1","r2"], stops merged + sorted, priority "high"
# Scenario 3 — opposite directions, single car → SERIALIZED into two trips
curl -s http://localhost:3000/api/elevator/coordinate \
-H 'Content-Type: application/json' \
-d '{"cars":1,"requests":[
{"robotId":"r1","fromFloor":1,"toFloor":8,"priority":"routine"},
{"robotId":"r2","fromFloor":9,"toFloor":2,"priority":"emergency"}
]}'
# → two trips, both on car 0; emergency "down" trip ordered before the "up" trip
# Bump "cars":2 and the two trips split across cars to run in parallel.
Response shape: { cars, trips:[ { direction, robotIds, stops, priority, car } ] }.
Trips are ordered highest-priority first (emergency > high > routine), ties broken up-before-down. Each trip is assigned to the least-loaded car.
pages/elevator-button-emulator.html page is a separate planner UI, not the test runner. It's auth-gated and reachable from the admin Command Center under Elevator Research → Hardware.)src/services/elevator/ride-machine.js, so every scenario is implicitly validated against the legal-transition table.docs/20-architecture/software-stack.md section 3, and the routing rules in docs/20-architecture/adr/0007-elevator-integration-strategy.md.