Skip to content

feat: bound compute replicas in scale command - #169

Merged
Fermionic-Lyu merged 1 commit into
mainfrom
codex/same-region-replicas
Sep 2, 2026
Merged

feat: bound compute replicas in scale command#169
Fermionic-Lyu merged 1 commit into
mainfrom
codex/same-region-replicas

Conversation

@Fermionic-Lyu

@Fermionic-Lyu Fermionic-Lyu commented Sep 2, 2026

Copy link
Copy Markdown
Member

Summary

  • describe compute scaling as same-region replica scaling
  • validate the platform-supported replica range of 1–10 before making an API request
  • cover both range boundaries and invalid counts

Verification

  • npm run typecheck
  • npm test (692 tests)
  • npx tsx src/index.ts services scale --help

Summary 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.

  • Tests cover both range boundaries and invalid counts.

Written for commit 2cebd66. Summary will update on new commits.

Review in cubic

@agent-zhang-beihai agent-zhang-beihai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-codesrc/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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

@agent-zhang-beihai agent-zhang-beihai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-codesrc/index.ts:163, src/commands/services.ts:24-32, CONTRIBUTING.md:41-44, InsForge/insta-skills insta/cli-reference.md:221

@Fermionic-Lyu

Copy link
Copy Markdown
Member Author

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.

@jwfing jwfing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - approved.

@agent-zhang-beihai agent-zhang-beihai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@Fermionic-Lyu
Fermionic-Lyu merged commit 7dd9306 into main Sep 2, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants