BOLT-1322 [4/7] domains/device sendCommand: short-circuit non-Tesla for vehicle:check-pairing-status
completedWhen the command slug is 'vehicle:check-pairing-status' and the target device's manufacturer is NOT 'tesla', sendCommand must NOT publish to Kafka. Instead it returns a synthetic completed command synchronously.
Where: domains/device/src/services/command/sendCommand.ts (around the parsedSlug / deviceOnWorkspace block — see lines ~75-110 in the current file).
Logic:
if (parsedSlug === 'vehicle:check-pairing-status' && device.manufacturer !== 'tesla') {
// synthetic command — persist with status='completed' and output={ keyPaired: null, applicable: false }, but do NOT publish CommandIssuedEvent
create command row with status='completed', output={ keyPaired: null, applicable: false }
return { success: true, message: 'vehicle:check-pairing-status is not applicable for this manufacturer; returning N/A', data: synthCommand }
}
For Tesla: fall through to existing publish path. Do not break the existing flow for other commands.
Tests:
- non-Tesla device + vehicle:check-pairing-status → returns success=true with output.applicable=false, no CommandIssuedEvent emitted (mock eventBus.publish + assert not called)
- Tesla device + vehicle:check-pairing-status → existing path runs, CommandIssuedEvent IS published, no synthetic output written
Branch: havoc/bolt-1322-send-command-shortcircuit
Worktree: ../mono-bolt-1322-send-command-shortcircuit
Depends on: [1/7] [2/7] [3/7] (slug must exist, output field must exist on schema + Command DAO)
Done when: branch builds, both new test cases pass, existing sendCommand tests still pass.
Event Timeline
created
status_change
queued → in_progress
failed
lease expired — re-queued for retry
in_progress → queued
status_change
queued → completed