Skip to content

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
capy-ai[bot] merged 16 commits into
mainfrom
gsta-114-ubicloud
Oct 26, 2026
Merged

capy-ai[bot] merged 16 commits into
mainfrom
gsta-114-ubicloud

Conversation

@garrytan

@garrytan garrytan commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3482,
  "head": "c66329a77c3012add444536954c48ad9ba98bf30",
  "version": "1.91.253.0",
  "base": "main",
  "gate": {
    "pregate.json/remote_gate": {
      "pass": 18996,
      "fail": 0,
      "skip": 0
    },
    "free-tests.yml/macos-named-regressions": {
      "pass": 5,
      "fail": 0,
      "skip": 0
    },
    "windows-free-tests.yml/windows-free-shard": {
      "pass": 664,
      "fail": 0,
      "skip": 0
    }
  },
  "session_kind": "unattended",
  "pregate": "requires-remote cleared @24dc87213fbf (7 checks, current for c66329a77c30)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/40394307116",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/40394307120",
    "pregate.json/remote_gate: remote-gate tree=24dc87213fbf tests=18996 receipt=/home/user/.capy/work/ship-3482/remote-attempt6-gate.log sha256=1ff8910daace"
  ],
  "issues": {
    "fixes": [],
    "refs": [
      3479
    ],
    "flakes": []
  }
}

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.json could 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 .git is a pointer).

After: /ubicloud is a gstack skill (ubicloud/SKILL.md, entry point bin/gstack-ubi) over the repo's own scripts/ubicloud/ubi-runner.sh, which now has the discipline built in:

  • TTL names and a reaper. Generated VM names end in -t<hours> (UBI_TTL_HOURS, 0–999, default 4; 0 omits it). reap destroys any VM in the project whose TTL ended more than ten minutes ago, whichever owner made it, and every up runs it first (UBI_REAP=0 skips it); it returns 1 when the list or a destroy fails. Names without a TTL (including the ones pregate-remote.sh builds) are never reaped.
  • Quota preflight. up adds 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 the vCPU quota exhausted marker pregate-remote.sh retries on; both refusals print the per-owner usage table.
  • Watchdog and heartbeat. run, verify and ssh NAME COMMAND stream the remote output (both streams kept in the VM's state dir) through a watchdog: a heartbeat every UBI_HEARTBEAT seconds (300); a command silent for UBI_IDLE_TIMEOUT seconds (1800) or older than UBI_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.
  • One committed verify, confined to the checkout. verify runs the repository's .gstack/ubicloud.json (setup, command, size, location, storage, image, env, pass, pull; flags and a trailing -- COMMAND override) and refuses without the file. The file is repository content: setup and every pull destination must be relative paths inside --src (absolute, ~, .. refused before any API call; each destination re-resolved, symlinks followed, right before its pull), and a pass name 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). --pass never forwards UBICLOUD_*.
  • pack/sync from 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.
  • The skill teaches set/unset-only prerequisite checks, UBI_OWNER on 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 $U so hosts that run fences in fresh shells work.

bun run test:ubicloud and gstack-pregate --remote behave as before.

gstack-ubi verify: a committed .gstack/ubicloud.json no longer reaches past the checkout — before, the file's pass/setup/pull went straight to run (secret forwarding, arbitrary upload, pull into ~/.ssh); after, each is refused before any API call unless granted on the command line

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.ts resolves 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.sh is regenerated, CHANGELOG is additive.

lib/doctor-components.ts (ubicloud: CLAUDE_ONLY, regenerated bin/gstack-doctor-components.sh), root SKILL.md.tmpl routing line, README, AGENTS.md, docs/skills.md, docs/PROJECT_STRUCTURE.md, docs/TESTING_INTERNALS.md, CHANGELOG ## [Unreleased]. test/catalog-budget.test.ts ratchets 1,197 → 1,235 token-equivalents and CLAUDE.md names the new ceiling; test/fixtures/context-budget.json gains only the ubicloud row. 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, and test/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 fake ssh, no network): the original offline checks plus a fixture whose fake API can create, so run and verify execute end to end: a hung setup exits 124 and destroys the VM, UBI_RUN_TIMEOUT kills a chatty command, --pass writes only the named variable (never UBICLOUD_* or a non-name) without printing it, stdin passes through ssh NAME COMMAND, verify refuses ungranted pass names, 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_WAIT waits before refusing, reap reports a failed list or destroy, pack ships a worktree with a working .git, and bin/gstack-ubi execs the runner.
  • Focused at c66329a: ubicloud-runner, catalog-budget, context-budget, env-host-fence-conformance, context-budget-ratchet, skill-size-budget, parity-suite, ubicloud-pregate-remote, heredoc-pipe-deadlock, spawnsync-timeout-tripwire, bun-entry-isolation, host-conformance: 182 pass / 0 fail (doctor-components, gstack-doctor and changelog-style added after the main merge); typecheck, typecheck:test (819 known, none new), format:cso:check, gen:skill-docs clean.
  • Remote free tier on Ubicloud (us-east-a2, standard-16): see the ship receipt below.

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 -p before the containment check (fixed). Post-cap verification fixes (test lane for bin/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 and remote_cancel on 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; only git diff --cached on 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:328 describes UBI_OWNER as 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, verify confinement, --pass), test/ubicloud-runner.test.ts and bin/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 of UBI_GC_HOURS.
  • docs/skills.md: Updated — the sample transcript used a thread-code owner (gsta114); replaced with lane7.
  • ubicloud/SKILL.md.tmpl (and generated ubicloud/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.md says UBI_OWNER takes the full jam_… 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-owner usage table is printed "either way"; the runner prints it on a refusal, not when UBI_QUOTA_WAIT finds room. The runner's header comment still shows the name as ubirun-<owner>-<epoch>-<suffix> without -t<hours>.

Test plan

  • bun test focused (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 all clean
  • Remote free tier on Ubicloud (us-east-a2, standard-16, gstack-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)
  • CI at c66329a (pull_request runs; the head is mergeable again): Free Tests 40394307116, Windows Free Tests 40394307120, Quality gate 40394306975, Version Gate 40394306957, all green

Issues

Refs #3479 (main's host-conformance C3 fix taken as a test-only commit; the fix itself landed in #3471)

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-10-26 Codify the Captains' harness practices into gstack and fix the issues every Captain hit on Capy (GSTA-108 plan sections C and E; lane F: install, runtime, Ubicloud, autoplan) "Do it and also improve it: fix the issues all the captains have seen in this Capy project" (Garry (via GStack Minder)) approved phases 1-3 and lanes D, E, F at full scope; this lane's three PRs none
2026-10-15 Paid eval spend for focused cases and screens "it's fine run as many $93 paid gates as you want who cares" (Garry) standing approval train gates, bisects, the backstop, ready --screen screens, focused paid case runs (CREW rule 5); this lane capped at $10 by GStack Minder none

Source: gstack-approvals record for gsta-114-install-runtime (display only; not an approval citation).

garrytan and others added 2 commits October 26, 2026 15:02
…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>
@trunk-io

trunk-io Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 14 commits October 26, 2026 15:43
…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>
@github-actions github-actions Bot changed the title feat(ubicloud): /ubicloud skill with TTL-named VMs and a reaper, quota preflight, hang watchdog and one committed verify entry point 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 Oct 26, 2026
@capy-ai
capy-ai Bot merged commit 737ba3a into main Oct 26, 2026
62 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.

1 participant