Repository navigation
v1.91.259.0 feat(ubicloud): /ubicloud skill with TTL-named VMs and a reaper, quota preflight, hang watchdog and one committed verify entry point - #3482
Merged
Conversation
…a preflight, hang watchdog and one committed verify entry point Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
…holder (INV-3 fence lint) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n product prose) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n and end the remote session, quota and reap outcomes verify: .gstack/ubicloud.json is repository content, so its setup script and pull destinations must resolve inside --src (absolute, ~ and .. refused before any API call) and a name it lists under pass is forwarded only when the command line grants it (--pass NAME or --trust-config); --pass never forwards UBICLOUD_* and refuses non-names. watched: the caller's stdin reaches the remote command, a command that finished while the clock was read is not a timeout, a hung setup exits 124, INT/TERM take the ssh session down, and the watchdog ends the command's session on the VM (setsid + ~/.ubirun-<phase>.sid + pkill -s). Quota: a cached refusal maximum is trusted for a day, the refusal names its source and uses the 'vCPU quota exhausted' marker pregate-remote.sh retries on. reap: returns 1 on a failed list or destroy; TTL suffixes read in base 10 and UBI_TTL_HOURS takes 0-999. Tests: a fake API that creates plus a fake ssh run 'run' and 'verify' end to end. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… is optional on the image Two watched commands on one VM wrote the same ~/.ubirun-<phase>.sid, so a cancel could end the other's session; the file now carries the runner's pid and is removed when the command ends. An image without setsid runs the command through plain bash instead of failing with exit 127. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… options by arity, a finished command keeps its status, the remote sid outlives the wrapper; docs audit Pass-2 (Codex adversarial on the delta): an earlier pull could plant a symlink where a later config pull lands, so under verify every destination is resolved again (symlinks followed) right before its pull and a refused pull exits 1; '--dest --trust-config' made an option value act as the trust flag, so verify parses by arity; a command that finished in the instant before the watchdog's kill exited 0 and was still reported as 124; the wrapper removed the sid file while a background child kept the channel open, so the file now stays until remote_cancel reads it. Docs audit (document-release, edit mode): TTL suffix and owner rule in TESTING_INTERNALS, the reaper as the exception to 'no sweep', the docs/skills.md transcript uses a neutral owner; CHANGELOG and the runner header corrected on the two points it deferred. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…outside the checkout inside_dir checked containment after mkdir -p, so a destination under a planted symlink (escape/new/sub) created the outside directories before being refused. The nearest existing ancestor is checked first; only an accepted destination is created, and it is checked again after. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…s arguments) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
A worktree's .git is a gitdir pointer into the main repository; on the VM git could not run, so the remote pregate refused with PREGATE_VM_TREE_MISMATCH vm=unavailable. pack now replaces it with a bare --single-branch clone of the checked-out branch (core.bare false, the worktree's index copied in), ~45 MB for gstack; a detached worktree is refused with the fix named. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…can run on this tree Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…inal git dir) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ck (the merge resolution kept only the conflicted span) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
… base=origin/main@7dc2f23 policy=base origin/main@7dc2f23192b7:.gstack/ship-policy.json) ship, next in queue at 1.91.259.0 STAMP_VERSION: 1.91.259.0 claims: ignored (stamp-at-merge) stage version: done (wrote 1.91.259.0) stage release_tool: done (bun scripts/gen-agents-digest.ts) stage changelog: done (Unreleased -> 1.91.259.0) stage stamp_paths: skipped (no stamp_paths in policy) stage mirror: skipped (no mirror in policy) stage apply: done (4 file(s)) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3c91fda..e4f4d63 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## [Unreleased] +## [1.91.259.0] - 2026-10-26 **New `/ubicloud` skill: the Ubicloud runner moves into gstack with the discipline a shared vCPU quota needs.** Crews ran heavy suites on Ubicloud through a user-scope skill and per-lane wrappers, and paid for it in stray VMs after a machine slept, a project quota at 528 of 512 vCPUs when lanes verified in parallel, verifies that hung for an hour before anyone noticed, and a stale wrapper that skipped a service start. `scripts/ubicloud/ubi-runner.sh` now carries the fixes and `ubicloud/SKILL.md` (entry point `bin/gstack-ubi`) teaches the watched launch; `bun run test:ubicloud` and the remote pregate are unchanged. diff --git a/VERSION b/VERSION index c67e9e4..08528ff 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.91.258.0 +1.91.259.0 diff --git a/agents-digest/gstack-AGENTS.md b/agents-digest/gstack-AGENTS.md index 4bd43c9..203312c 100644 --- a/agents-digest/gstack-AGENTS.md +++ b/agents-digest/gstack-AGENTS.md @@ -1,4 +1,4 @@ -# gstack digest v1.91.258.0 — regenerate/re-copy after upgrading gstack +# gstack digest v1.91.259.0 — regenerate/re-copy after upgrading gstack Behavioral rules from gstack (https://github.com/garrytan/gstack), compressed for agent hosts without a full skill install. The full skills add workflows, diff --git a/node_modules b/node_modules new file mode 120000 index 000000000..c7990ad12 --- /dev/null +++ b/node_modules @@ -0,0 +1 @@ +/workspace/gstack-ubi/node_modules \ No newline at end of file diff --git a/package.json b/package.json index 5e6d568..0eca459 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gstack", - "version": "1.91.258", + "version": "1.91.259", "description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.", "license": "MIT", "type": "module", FILES: CHANGELOG.md VERSION agents-digest/gstack-AGENTS.md package.json MERGE_CONDITION: sha=76e86e08a851fb1a19bef9a947bdf0abeb87956d next: NEW_VERSION=1.91.259.0; commit and push only the stamp diff above (FILES), with no edit of your own: the train's verify accepts the CHANGELOG only as the base's plus this PR's entry re-headed; merge with the expected head 76e86e0 and recompute on a stale queue. GSTACK_RESULT: skill=restamp status=complete run=/workspace/gstack-ubi/.gstack/tmp/restamp-journal.json Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Before: heavy suites ran on Ubicloud through a user-scope Capy skill and a wrapper script per lane. A runner killed by a sleeping machine left its VM running until someone noticed; parallel verifies pushed the shared project quota to 528 of 512 vCPUs; a hung verify held a VM for an hour with no signal; a stale per-lane wrapper skipped a service start and failed a full verify for nothing; a repository's
.gstack/ubicloud.jsoncould forward any local env var, upload any local file as the setup script and pull into any local path; and a linked worktree could not be shipped to a VM at all (its.gitis a pointer).After:
/ubicloudis a gstack skill (ubicloud/SKILL.md, entry pointbin/gstack-ubi) over the repo's ownscripts/ubicloud/ubi-runner.sh, which now has the discipline built in:-t<hours>(UBI_TTL_HOURS, 0–999, default 4; 0 omits it).reapdestroys any VM in the project whose TTL ended more than ten minutes ago, whichever owner made it, and everyupruns it first (UBI_REAP=0skips it); it returns 1 when the list or a destroy fails. Names without a TTL (including the onespregate-remote.shbuilds) are never reaped.upadds the size's vCPUs to the project's running VMs and refuses before the create request when that exceeds the known ceiling (UBI_QUOTA_VCPUS, or the maximum the last API refusal printed, cached for a day).UBI_QUOTA_WAIT=<seconds>waits for room instead. The refusal names its source and uses thevCPU quota exhaustedmarkerpregate-remote.shretries on; both refusals print the per-ownerusagetable.run,verifyandssh NAME COMMANDstream the remote output (both streams kept in the VM's state dir) through a watchdog: a heartbeat everyUBI_HEARTBEATseconds (300); a command silent forUBI_IDLE_TIMEOUTseconds (1800) or older thanUBI_RUN_TIMEOUT(0 = unlimited) is killed with exit 124 and its last 40 lines, and its session on the VM is ended too (setsid+~/.ubirun-<phase>-<pid>.sid+pkill -s), since killing the client alone leaves a silent remote job running. The caller's stdin reaches the remote command, a command that finished before the kill keeps its own status, a hung setup exits 124, and Ctrl-C takes the ssh session down.verifyruns the repository's.gstack/ubicloud.json(setup, command, size, location, storage, image, env, pass, pull; flags and a trailing-- COMMANDoverride) and refuses without the file. The file is repository content:setupand everypulldestination must be relative paths inside--src(absolute,~,..refused before any API call; each destination re-resolved, symlinks followed, right before its pull), and apassname is forwarded only when the command line grants it (--pass NAME, or all with--trust-config; options are parsed by arity so a value never acts as the flag).--passnever forwardsUBICLOUD_*.pack/syncfrom a linked worktree. The tarball carries a self-contained single-branch clone with the worktree's index instead of the gitdir pointer (~45 MB for gstack); a split index is left out, a detached worktree is refused with the fix named.UBI_OWNERon every machine, a watched launch, quoting the recovery line, the verify grant model, how to read exit 124 and a quota refusal, and the resume checklist; every fence binds$Uso hosts that run fences in fresh shells work.bun run test:ubicloudandgstack-pregate --remotebehave as before.Why
Harness-codify plan row 27 / lane F item 6: the Captains' Ubicloud issues (stray VMs after machine sleep, quota exhaustion, hung verifies, per-lane wrappers, unwatched operations) move from crew rules into the tool. Everything is generic: no thread codes in product code or prose; repository verify definitions live in the consuming repo.
Registration and out-of-lane files
Main 4d48d39 (v1.91.253.0, with /captain) is merged in under GStack Minder's rule-19 grant:
test/catalog-budget.test.tsresolves to captain's 1,251 plus ubicloud's 38 = 1,289 (measured 5,150 bytes = 1,288), CLAUDE.md names 1,289,bin/gstack-doctor-components.shis regenerated, CHANGELOG is additive.lib/doctor-components.ts(ubicloud: CLAUDE_ONLY, regeneratedbin/gstack-doctor-components.sh), rootSKILL.md.tmplrouting line, README, AGENTS.md, docs/skills.md, docs/PROJECT_STRUCTURE.md, docs/TESTING_INTERNALS.md, CHANGELOG## [Unreleased].test/catalog-budget.test.tsratchets 1,197 → 1,235 token-equivalents and CLAUDE.md names the new ceiling;test/fixtures/context-budget.jsongains only theubicloudrow. Out of this lane's owned set and disclosed:scripts/ubicloud/ubi-runner.sh,lib/doctor-components.ts,bin/gstack-doctor-components.sh,test/catalog-budget.test.ts,test/fixtures/context-budget.json, the docs above, andtest/host-conformance.test.ts(main's C3 fix, #3479, taken as one test-only commit so the remote gate can run on this tree; identical to main).Tests
test/ubicloud-runner.test.ts(31 tests; fake API and fakessh, no network): the original offline checks plus a fixture whose fake API can create, sorunandverifyexecute end to end: a hung setup exits 124 and destroys the VM,UBI_RUN_TIMEOUTkills a chatty command,--passwrites only the named variable (neverUBICLOUD_*or a non-name) without printing it, stdin passes throughssh NAME COMMAND,verifyrefuses ungrantedpassnames, option values posing as--trust-config, and setup/pull paths outside--src(including a symlink planted by an earlier pull), a quota refusal caches its maximum which drives the preflight until a day old,UBI_QUOTA_WAITwaits before refusing,reapreports a failed list or destroy,packships a worktree with a working.git, andbin/gstack-ubiexecs the runner.Review (rule 23: 3 passes + binding)
Pass 1 (whole diff): five native reviewers (checklist+specialists, red team, adversarial, coverage 12/21 paths, exploratory QA) and Codex structured. Blocking: verify trusted the config's
pass/setup/pull; watchdog dropped stdin. Pass 2 (delta): Codex adversarial found the symlink pull redirect, the option-value-as-flag, success-reported-as-124, sid removed before children exit. Pass 3 (delta, cap):mkdir -pbefore the containment check (fixed). Post-cap verification fixes (test lane forbin/gstack-ubi, worktree pack, split index) reviewed by Codex structured and bound on the final tree.Deferred (advisory, named per rule 23): a local TOCTOU between the pull containment check and
tar -x -C(needs a concurrent local writer; the remote command has already exited when pulls run); a recycled remote session id between the watchdog andremote_cancelon a VM that is destroyed seconds later; staged-but-uncommitted blobs are not shipped with a worktree's index (working files are, so tests run on the right content; onlygit diff --cachedon the VM would fail); the Codex adversarial pass on the pass-1 scope timed out at 540 s (its pass-2 and pass-3 runs on the deltas completed);docs/capy-install.md:328describesUBI_OWNERas the full thread id while the runner keeps 12 lowercase letters and digits (file owned by #3475's tree).Documentation
Status: updated — 2 docs edited, no blockers.
Scope audited: the 19 committed files of PR #3482 (docaudit-1793041029, edit mode, 128 docs inventoried) against
scripts/ubicloud/ubi-runner.sh(usage text, TTL/reaper, quota preflight, watchdog,verifyconfinement,--pass),test/ubicloud-runner.test.tsandbin/gstack-ubi.Documentation health:
docs/TESTING_INTERNALS.md: Updated — VM name now shows the-t<hours>suffix and the 12-character owner rule; "nothing sweeps stale VMs" now says no age-based sweep, with the TTL reaper as the exception; the resume-checklist profiling note now names the TTL (reaped by any lane after TTL + 10 min) instead ofUBI_GC_HOURS.docs/skills.md: Updated — the sample transcript used a thread-code owner (gsta114); replaced withlane7.ubicloud/SKILL.md.tmpl(and generatedubicloud/SKILL.md): Current — every command, env default, log line and exit code checked against the runner; no regeneration needed.CHANGELOG.md[Unreleased]: Current for every runner claim checked; parent-owned, not edited.README.md,AGENTS.md,CLAUDE.md(1,235 ratchet),docs/PROJECT_STRUCTURE.md,gstack/llms.txt,docs/pregate.md,CONTRIBUTING.md: Current.Coverage map: /ubicloud has reference (README, AGENTS.md, llms.txt, docs/skills.md, TESTING_INTERNALS) and how-to (SKILL.md) coverage; no tutorial or explanation page (common gap, not filled).
Diagram drift: none; the PROJECT_STRUCTURE tree entry for
ubicloud/is correct.Deferred (not in this diff):
docs/capy-install.mdsaysUBI_OWNERtakes the fulljam_…thread id, but the runner lowercases, keeps letters and digits only, and truncates to 12 characters (unchanged by this PR). The CHANGELOG says the per-ownerusagetable is printed "either way"; the runner prints it on a refusal, not whenUBI_QUOTA_WAITfinds room. The runner's header comment still shows the name asubirun-<owner>-<epoch>-<suffix>without-t<hours>.Test plan
bun testfocused (15 files) at c66329a (main 4d48d39 merged in under a rule-19 grant; catalog ceiling 1,251 → 1,289): 182 pass / 0 fail;bun run typecheck,typecheck:test,format:cso:check,gen:skill-docs --host allcleangstack-pregate --stage tests --remote): tree 24dc8721, 18996 tests, 0 failed, $0.06, no flaky retry (the pre-merge run at tree 3ce20654 was 18951/0 with one FLAKY-PASS: test/plan-seed-submission.test.ts)Issues
Refs #3479 (main's host-conformance C3 fix taken as a test-only commit; the fix itself landed in #3471)
Approvals
Source: gstack-approvals record for gsta-114-install-runtime (display only; not an approval citation).