Notes for bf-2xah: Bot registration endpoint already wired to matchmaking
The POST /api/register endpoint sets status='active' for newly registered bots, and the matchmaker queries for all active bots. Integration is complete; no code changes required. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
03ec821e48
commit
f693afd562
1 changed files with 28 additions and 0 deletions
28
notes/bf-2xah.md
Normal file
28
notes/bf-2xah.md
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
# Bot Registration to Matchmaking Integration
|
||||
|
||||
## Task
|
||||
Verify that POST /api/register is wired up to active matchmaking for third-party bots.
|
||||
|
||||
## Analysis
|
||||
|
||||
### Registration Flow (cmd/acb-api/server.go:215-216)
|
||||
```go
|
||||
INSERT INTO bots (bot_id, name, owner, endpoint_url, shared_secret, status, debug_public)
|
||||
VALUES ($1, $2, $3, $4, $5, 'active', $6)
|
||||
```
|
||||
Bots registered via the API are immediately set to `status = 'active'`.
|
||||
|
||||
### Matchmaking Query (cmd/acb-matchmaker/tickers.go:163)
|
||||
```sql
|
||||
WHERE b.status = 'active'
|
||||
AND (b.cooldown_until IS NULL OR b.cooldown_until < NOW())
|
||||
```
|
||||
The matchmaker queries for all active bots (not on cooldown) as eligible candidates.
|
||||
|
||||
## Conclusion
|
||||
The integration is **already complete**. No code changes are required:
|
||||
- Third-party bots register → get `status = 'active'`
|
||||
- Matchmaker includes all active bots in the pool
|
||||
- Bots immediately become eligible for pairing
|
||||
|
||||
The "deferred" note in docs/plan/plan.md (lines 79-84, 311) refers to the Go API service not being deployed for v1, not to missing integration code. When the API deploys, third-party bots will work immediately.
|
||||
Loading…
Add table
Reference in a new issue