feat: finish meticulous REST endpoint expansion - #2
Conversation
|
Warning Review limit reached
More reviews will be available in 3 minutes and 55 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughExpands ChangesREST Endpoint Expansion
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (2)
packages/meticulous-client/integration/read.integration.test.ts (1)
5-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winReuse the exported client contract here. The local
ReadClientshape plusas unknown asbypasses type checking againstcreateMeticulousClient(). ImportMeticulousClientand usePick<MeticulousClient, ...>(or just type the variable directly) so API drift is caught at compile time.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/meticulous-client/integration/read.integration.test.ts` around lines 5 - 16, The local ReadClient type and the double cast are bypassing compile-time checks against createMeticulousClient(), so replace the ad hoc shape with the exported MeticulousClient contract. Update the integration test to import MeticulousClient and type the client variable as MeticulousClient or Pick<MeticulousClient, ...> for only the read methods used, so any API drift is caught automatically; keep the existing method references like getCurrentHistory, getHistory, getLastHistory, getLastProfile, getMachine, getProfile, getSettings, and listProfiles aligned with the exported interface.packages/meticulous-client/integration/write.integration.test.ts (1)
5-15: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winUse
Pick<MeticulousClient, ...>for the write suite.The local
WriteClientduplicates the exported API, and theas unknown ascast sidesteps it, so signature changes can slip through here. Reuse the public client type instead.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/meticulous-client/integration/write.integration.test.ts` around lines 5 - 15, The local WriteClient type is duplicating the public MeticulousClient API and is being bypassed by the cast, so changes to the real client signature may not be caught. Replace the ad hoc WriteClient definition in write.integration.test.ts with a Pick<MeticulousClient, ...> covering the needed write methods, and update the test setup to use that shared type instead of the current as unknown as workaround. Refer to the WriteClient alias and the write suite client variable when making the change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/plans/2026-06-28-meticulous-client-rest-endpoint-expansion.md`:
- Around line 265-315: The plan’s protocol snippets are stale and conflict with
the current client/protocol contract. Update the Step 3/Step 4 examples in this
plan to match the verified symbols and endpoints used elsewhere in the PR,
especially `POST /action/preheat`, the suspected `GET /action/start`, `GET
/action/stop`, `GET /action/purge`, and the absence of `saveProfile`/`GET
/profile/save`. Make sure the referenced protocol examples are explicitly
superseded or rewritten so they can’t be copied back into `docs/protocol.md` as
the wrong contract.
In `@docs/protocol.md`:
- Around line 99-112: The subsection headings in the protocol markdown are
duplicated, which triggers MD024 and creates ambiguous anchors. Update the
repeated headings in the documented action/profile sections to unique names,
using the existing “Actions” and “Profiles” headings as the identifiers to
rename, so each subsection has a distinct anchor.
In `@packages/meticulous-client/src/index.ts`:
- Line 106: The triggerAction URL is using the raw dynamic action name, which
can alter the request path; update the triggerAction function in the client
index to encode the name segment before interpolating it into the action URL.
Follow the same pattern used by getProfile() and loadProfile(), and wrap name
with encodeURIComponent() so only the intended /action/<name> endpoint is
called.
In `@packages/meticulous-client/src/integration-config.ts`:
- Around line 11-16: The validation for METICULOUS_BASE_URL in
optionalTrimmedStringSchema should reject non-HTTP(S) values instead of only
checking generic URL parseability. Update the refine logic used by
optionalUrlStringSchema in integration-config.ts to require http:// or https://
schemes (while still allowing null/empty as currently intended), and keep the
existing error message or adjust it to reflect the stricter protocol
restriction.
---
Nitpick comments:
In `@packages/meticulous-client/integration/read.integration.test.ts`:
- Around line 5-16: The local ReadClient type and the double cast are bypassing
compile-time checks against createMeticulousClient(), so replace the ad hoc
shape with the exported MeticulousClient contract. Update the integration test
to import MeticulousClient and type the client variable as MeticulousClient or
Pick<MeticulousClient, ...> for only the read methods used, so any API drift is
caught automatically; keep the existing method references like
getCurrentHistory, getHistory, getLastHistory, getLastProfile, getMachine,
getProfile, getSettings, and listProfiles aligned with the exported interface.
In `@packages/meticulous-client/integration/write.integration.test.ts`:
- Around line 5-15: The local WriteClient type is duplicating the public
MeticulousClient API and is being bypassed by the cast, so changes to the real
client signature may not be caught. Replace the ad hoc WriteClient definition in
write.integration.test.ts with a Pick<MeticulousClient, ...> covering the needed
write methods, and update the test setup to use that shared type instead of the
current as unknown as workaround. Refer to the WriteClient alias and the write
suite client variable when making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 111e3faa-7598-4221-90e4-4f94a559ac4b
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (16)
docs/ROADMAP.mddocs/plans/2026-06-27-meticulous-client-rest-foundation.mddocs/plans/2026-06-27-repo-tooling-foundation.mddocs/plans/2026-06-28-meticulous-client-rest-endpoint-expansion.mddocs/protocol.mdpackages/meticulous-client/README.mdpackages/meticulous-client/integration/read.integration.test.tspackages/meticulous-client/integration/write.integration.test.tspackages/meticulous-client/package.jsonpackages/meticulous-client/src/index.test.tspackages/meticulous-client/src/index.tspackages/meticulous-client/src/integration-config.test.tspackages/meticulous-client/src/integration-config.tspackages/meticulous-client/tsconfig.build.jsonpackages/meticulous-client/vitest.config.tspackages/meticulous-client/vitest.integration.config.ts
💤 Files with no reviewable changes (2)
- docs/plans/2026-06-27-repo-tooling-foundation.md
- docs/plans/2026-06-27-meticulous-client-rest-foundation.md
Finish the `REST endpoint expansion` roadmap step for `@shotlab/meticulous-client` by confirming the remaining REST routes against the real machine, expanding the public client for the confirmed surface, and documenting the result. - Added an opt-in integration harness with a single Zod-backed env/config boundary and separate read/write suites. - Confirmed the real-machine REST surface for machine, settings, history, profile, and action routes, then updated the protocol notes to match the verified behavior. - Expanded the public client with the confirmed helpers, including current/last history, last profile, profile load/get, settings update, and a dedicated `preheat()` helper. - Kept the guarded write suite non-brewing: it never calls `start`, and it performs best-effort `stop` cleanup after profile-load and preheat checks so the machine returns to a neutral state. - Updated the README and checked off the roadmap item because this PR completes the REST endpoint expansion step. - Validation used: - `yarn workspace @shotlab/meticulous-client format:check` - `yarn workspace @shotlab/meticulous-client lint` - `yarn workspace @shotlab/meticulous-client test` - `METICULOUS_RUN_INTEGRATION=1 yarn workspace @shotlab/meticulous-client test:integration` - `METICULOUS_RUN_INTEGRATION=1 METICULOUS_ALLOW_WRITE_TESTS=1 yarn workspace @shotlab/meticulous-client test:integration:write` - None. - [x] Tests added or updated - [x] README and TSDoc updated if the public API changed - [x] Breaking changes called out (if any) - [x] Roadmap item checked off if this PR completes one <!-- This is an auto-generated comment: release notes by coderabbit.ai --> - **New Features** - Expanded the client to support more REST actions, including history, profile, settings, and additional action requests. - Added optional integration test support for validating read-only and guarded write flows. - **Documentation** - Updated the protocol docs and client README to reflect newly confirmed endpoints and expanded usage examples. - Added a roadmap update and implementation plans for the broader REST rollout. - **Tests** - Added and expanded automated coverage for the new client methods and integration scenarios. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Overview
Finish the
REST endpoint expansionroadmap step for@shotlab/meticulous-clientby confirming the remaining REST routes against the real machine, expanding the public client for the confirmed surface, and documenting the result.Details
preheat()helper.start, and it performs best-effortstopcleanup after profile-load and preheat checks so the machine returns to a neutral state.yarn workspace @shotlab/meticulous-client format:checkyarn workspace @shotlab/meticulous-client lintyarn workspace @shotlab/meticulous-client testMETICULOUS_RUN_INTEGRATION=1 yarn workspace @shotlab/meticulous-client test:integrationMETICULOUS_RUN_INTEGRATION=1 METICULOUS_ALLOW_WRITE_TESTS=1 yarn workspace @shotlab/meticulous-client test:integration:writeRelated Tickets and/or Pull Requests
Checklist
Summary by CodeRabbit
New Features
Documentation
Tests