Skip to content

docs(spec,deploy/sbx): SBX0 idle lifetime follow-ups (#770) - #847

Merged
pdettori merged 3 commits into
rossoctl:mainfrom
pdettori:docs/sbx-idle-lifetime-followups
Nov 17, 2026
Merged

pdettori merged 3 commits into
rossoctl:mainfrom
pdettori:docs/sbx-idle-lifetime-followups

Conversation

@pdettori

Copy link
Copy Markdown
Member

Summary

Follow-ups to #770 after #837, #842 and #843 merged. Small changes only.

  • Spec and registry. docs/specs/2026-11-16-sbx-idle-lifetime-design.md moves to v0.2. Its status is now implemented (feat(control-plane): SBX0 idle lifetime - activity mints slide the deadline (#770) #837, feat(mocactl,sandbox-client): SBX0 idle lifetime - the activity hint and --lifetime (#770) #842, feat(deploy/sbx): SBX0 idle lifetime - SBX_MAX_LIFETIME_DAYS and the workers' idle (#770) #843), shipping in v0.11.0, where it is tested. It records what the build decided:

    • sliding starts only once SH_SANDBOX_MAX_LIFETIME_SECONDS is set;
    • doctor's check counts as use;
    • sbx env mints without activity, while sbx token and --renew-every count;
    • SBX_MAX_LIFETIME_DAYS=off;
    • a lowered maximum keeps the workers' idle until SBX_LOWER_WORKSPACE_IDLE=1.

    The registry row reads "implemented (v0.11.0)".

  • setup.sh log message. When the live sbx-settings maximum keeps the idle above what the bundles hold (for example 216 h bundles under a live 30 d maximum, on a run that lowers it), the run used to say the idle "would drop" just before the raise refusal said it changes from 216 h to 768 h. The log now says the live sbx-settings sets the idle, so the two lines agree. A new test covers that case. The two "no bundles" tests now expect the new wording.

  • setup.sh header. It no longer reads as if SBX_LOWER_WORKSPACE_IDLE could be off.

  • Tests. The "first" checks now match only the reinstall-first advice, not any log line that happens to contain the word.

  • Deploy README caveat. After lowering the maximum, keep deploy/sbx/.generated/workers/ until the old maximum has passed. The kept idle lives only in those bundles, and the live sbx-settings already holds the lower maximum.

These close the review leftovers from #843's last round.

Test evidence

  • All nine deploy/sbx/tests/*.test.sh pass under macOS /bin/bash 3.2.57. setup.test.sh passes 69 tests, including the new case.
  • shellcheck -x -S warning is clean, and prettier is clean.

Refs #770

Assisted-By: Claude Code

…s the idle (rossoctl#770)

When the live sbx-settings maximum floors SH_WORKSPACE_IDLE above what the
bundles hold (216h bundles under a live 30 d maximum, with a lowered run),
the kept line said the idle "would drop" just before the raise refusal said it
changes from 216h to 768h. It now says the live sbx-settings sets the idle, so
the two lines agree. The setup.sh header no longer reads as if
SBX_LOWER_WORKSPACE_IDLE could be "off", and the tests' "first" checks match
only the reinstall-first advice, not any log line with the word.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
… caveat (rossoctl#770)

The idle-lifetime spec moves to v0.2, implemented in rossoctl#837, rossoctl#842 and rossoctl#843 and
shipping in v0.11.0, and records what the build decided (sliding only once the
maximum is configured, doctor and sbx env, SBX_MAX_LIFETIME_DAYS=off, a
lowered maximum keeping the workers' idle). The registry row reads
implemented. The deploy README says to keep deploy/sbx/.generated/workers
until a lowered maximum's old value has passed: the kept idle lives only in
those bundles.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
@pdettori
pdettori requested a review from cwiklik as a code owner November 17, 2026 03:35
@pdettori pdettori added the ready-for-ai-review Request automated AI code review from clawgenti label Nov 17, 2026

@ingpaolodettori-dev ingpaolodettori-dev 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.

Summary

These are follow-ups to #843 and they look good. check_host_idle now tells "the live sbx-settings sets the floor" apart from "the bundles set it". That removes the "would drop" message that contradicted the raise refusal right after it. I traced the 216 h bundles / live 30 d / new 20 d case through the new branch and the change loop, and it ends in the 216h→768h raise refusal, as the new test expects. The two no-bundles cases take the same branch and their tests were updated to match. I have two doc nits in the spec, inline.

Author: pdettori (MEMBER — maintainer)
Areas reviewed: Shell, Docs
Agent/IDE config (.claude/.vscode): none
Commits: 2 commits, all signed-off: yes
CI status: passing (deploy-scripts / deploy-scripts-bash32 pending at drafting)

- `setup.sh`: `SBX_MAX_LIFETIME_DAYS` is 1–30, default 30, and must be at least `SBX_LIFETIME_DAYS`.
- `setup.sh`: `SBX_MAX_LIFETIME_DAYS` is 1–30, default 30, and must be at least `SBX_LIFETIME_DAYS`;
or `off`: no `SH_SANDBOX_MAX_LIFETIME_SECONDS` (no sliding) and the idle of before (`SBX_LIFETIME_DAYS`
- 48 h), which lets an existing deployment take this `setup.sh` before its hosts can be reinstalled.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: (SBX_LIFETIME_DAYS - 48 h) has the wrong operator. The pre-sliding idle is SBX_LIFETIME_DAYS × 24 + 48 h (216 h at 7 days). This line also starts with - 48 h) after the wrap, which Markdown renders as a nested list item. Suggested fix: (`SBX_LIFETIME_DAYS` × 24 + 48 h), reflowed so no continuation line starts with - .

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in b418afa. The line now reads "the idle of before, that is SBX_LIFETIME_DAYS × 24 + 48 h (216 h at 7 days)", reflowed so no continuation line starts with an operator. Prettier had turned the wrapped + 48 h) into a - list item.

v0.11.0, where it is tested; not yet deployed on SBX0.
v0.2 records what the build decided: the control plane slides deadlines only once
`SH_SANDBOX_MAX_LIFETIME_SECONDS` is set (§6.1); `doctor`'s check command counts as use (§3.1);
`sbx env` mints without activity, `sbx token` and `--renew-every` with it (§3.1);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nit: These points cite §3.1, but §3.1 itself only covers doctor. It doesn't mention sbx env, sbx token or --renew-every. The lowered-maximum rule is cited as §6.3 but is added only to §6.1. Either add a sentence to each section or drop the extra section references.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in b418afa. §3.1 now says sbx env mints with activity: false (it runs no command and prints no token), and that sbx token and --renew-every count because a direct client's Execs run on those tokens. The lowered-maximum point now cites only §6.1, where the rule is.

The off idle reads SBX_LIFETIME_DAYS × 24 + 48 h, reflowed so no line starts
with an operator (Markdown rendered "- 48 h" as a list item). §3.1 now says
sbx env mints without activity and sbx token / --renew-every with it, as the
v0.2 line cites; the lowered-maximum rule is cited as §6.1, where it is.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>

@ingpaolodettori-dev ingpaolodettori-dev 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.

Follow-up at b418afa: both items from the 986ffef review are fixed. The §6.1 off idle now reads SBX_LIFETIME_DAYS × 24 + 48 h (216 h at 7 days) with no stray list item. §3.1 now covers sbx env (activity: false, matching cmdEnv in commands.ts) and sbx token / --renew-every (activity mints), and the header cites only §6.1 for the lowered-maximum rule. No new findings; CI is green.

@pdettori
pdettori merged commit 1aa8dd6 into rossoctl:main Nov 17, 2026
16 checks passed
@pdettori
pdettori deleted the docs/sbx-idle-lifetime-followups branch November 17, 2026 12:51
webchang added a commit to webchang/moca that referenced this pull request Nov 17, 2026
Brings rossoctl#847 (idle lifetime follow-ups: setup.sh names the live maximum
when it, not the bundles, keeps the workspace idle; the spec and README
notes). No conflicts.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Rong Chang <[email protected]>
@pdettori pdettori added this to the v0.11.0 milestone Nov 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-ai-review Request automated AI code review from clawgenti

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants