feat: bound compute replicas in scale command - #169
Conversation
There was a problem hiding this comment.
Reviewed by Wang Miao
The scale command now rejects replica counts above 10 locally instead of letting the server do it, and the help text and success line say "replica" rather than "machine". The ceiling matches the platform exactly — MAX_COMPUTE_REPLICAS = 10 in insta-platform src/provisioning/services.ts:79, enforced on both the user route and the admin route — so nothing that worked before is refused now, and mirroring a server-enforced bound in a throwing parser is what parsePort and parseTimeoutSec already do here. No findings; this is fine to merge.
What I checked
read-the-code — src/commands/services.ts:24-32,207-219 (the only parseCount call site, confirmed by rg across src/), src/index.ts:163, test/services.test.ts:21-32, src/commands/compute.ts:509-516,623-633 (existing bound-mirroring parsers); cloned InsForge/insta-platform and read src/provisioning/services.ts:79, src/server.ts:1776, src/server.ts:4844-4849 to confirm the server ceiling is a hard-coded 10, not env- or tier-dependent.
There was a problem hiding this comment.
Reviewed by Yang Dong
This correctly bounds compute scaling to 1–10 same-region replicas and updates the CLI terminology. However, it leaves the canonical agent-facing command contract stale, so I would not merge it as it stands.
The new replica contract is missing from the canonical agent command reference
important · judgement · conventions · src/index.ts:163
CONTRIBUTING.md explicitly requires every command change to be mirrored in InsForge/insta-skills, but its reference still describes this as an unrestricted machine count and omits the same-region semantics. Update insta/cli-reference.md:221 there to specify the 1–10 replica contract in the same change set.
Evidence
read-the-code — src/index.ts:163, src/commands/services.ts:24-32, CONTRIBUTING.md:41-44, InsForge/insta-skills insta/cli-reference.md:221
|
The canonical command reference is updated in companion PR InsForge/insta-skills#71: InsForge/insta-skills#71 It now names same-region replicas and documents the inclusive 1–10 range. |
There was a problem hiding this comment.
Reviewed by Yang Dong
This adds client-side enforcement of the platform’s 1–10 compute-replica range and aligns the command’s help and success output with same-region replica terminology. The implementation matches the control-plane contract and companion CLI-reference update, so I approve with no findings.
Summary
Verification
npm run typechecknpm test(692 tests)npx tsx src/index.ts services scale --helpSummary by cubic
The compute scale command now treats machine counts as same-region replicas and accepts only 1–10, instead of allowing any positive integer. Invalid counts are rejected before an API request, and the CLI help and success output use replica terminology.
Written for commit 2cebd66. Summary will update on new commits.