Repository navigation
feat(bin): add captain queue, blocked, and rigs API reads - #39
Conversation
Add GET /captain-queue, GET /blocked, and GET /rigs so every dashboard read has an API answer. Parked decisions and blocked tasks come from the open-decision fold. Rigs come from crew-dispatch.json.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughAdded readers for decision and rig data, exposed ChangesAPI read endpoints
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The PR adds three localized read-only API endpoints with documented JSON contracts and verified empty and fixture responses, so no actionable merge-blocking risk remains after normal checks and review. Suggested reviewers: Sequence Diagram(s)sequenceDiagram
participant Client
participant API as bin/fm-api-server.mjs
participant Readers as bin/fm-api-reads.mjs
participant State as state files
participant Config as config/crew-dispatch.json
Client->>API: GET read endpoint
API->>Readers: Build response body
Readers->>State: Scan decision statuses
State-->>Readers: Decision rows
Readers->>Config: Read rig configuration
Config-->>Readers: Rig ladders
Readers-->>API: JSON response body
API-->>Client: HTTP response
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 30 functions across 5 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Intent
Build firstmate issue #30 (EvanAgee/firstmate): the rest of the read windows, queue, blocked, and rig (API ticket 4).
Read issue #30 in full. Parent spec is #26. The #27 front door is already merged; plug into that API shape.
What to build: the remaining reads. GET captain queue of parked decisions, GET blocked list, and GET rig ladders with their rungs. With these, every read the captain dashboard performs has an API answer.
Acceptance:
Constraints from #26 and #27:
This is firstmate shared tracked material. Follow firstmate-coding-guidelines: one-owner contracts, knowledge placement, one sentence per line in Markdown, plain dash, no agent co-author, shellcheck-clean bin scripts, colocated tests/.test.sh. Tests must exercise behavior through an executable or public interface and must never assert implementation-source bytes.
Gates are bash tests, not npm. Do not use the repo GATE_* npm/vitest lines.
What Changed
/captain-queue, GET/blocked, and GET/rigson the localhost API, assembled fromscan_open_decisionsandconfig/crew-dispatch.jsonso empty homes return empty collections.bin/fm-api-server.mjsand note the new reads in architecture and configuration docs.fm-api-readsinto the session-bootstrap test family.Risk Assessment
✅ Low: The three reads are small, follow the existing classify fold and dispatch file, and empty homes already return empty lists.
Testing
Ran the colocated bash HTTP suite, then started empty and fixture throwaway homes and captured live GET /captain-queue, /blocked, and /rigs. Empty home returned empty collections; the fixture home returned the parked decision, blocked task, and rig ladders with each rung enabled state; a non-loopback address was refused. These are JSON API windows, so evidence is HTTP transcripts rather than screenshots.
Evidence: Live HTTP from fixture home: captain queue, blocked list, and rigs
Source: Live HTTP from fixture home: captain queue, blocked list, and rigs
Evidence: Pretty JSON bodies for the three dashboard reads
Source: Pretty JSON bodies for the three dashboard reads
Evidence: Empty home returns empty collections, not errors
Source: Empty home returns empty collections, not errors
Evidence: Localhost bind: 127.0.0.1 HTTP 200, LAN IPv4 ECONNREFUSED
Source: Localhost bind: 127.0.0.1 HTTP 200, LAN IPv4 ECONNREFUSED
Evidence: JSON contracts documented on each endpoint
Source: JSON contracts documented on each endpoint
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
bin/fm-test-run.sh tests/fm-api-reads.test.shmanualfm-api.sh starton empty throwaway home, then GET/captain-queue,/blocked,/rigsmanualfm-api.sh starton fixture home with parked decision, blocked task, andcrew-dispatch.json, then GET/captain-queue,/blocked,/rigsbind check: GET/captain-queueon 127.0.0.1 vs non-loopback IPv4✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Summary by CodeRabbit
New Features
GETandHEADrequests with structured JSON responses.Bug Fixes
Documentation