Skip to content

v1.91.354.0 land-and-deploy: move the canary step into an on-demand section (skill diet, GSTA-161) - #3663

Merged
capy-ai[bot] merged 8 commits into
mainfrom
gsta161/land-and-deploy-diet
Oct 31, 2026
Merged

capy-ai[bot] merged 8 commits into
mainfrom
gsta161/land-and-deploy-diet

Conversation

@garrytan

@garrytan garrytan commented Oct 31, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3663,
  "head": "4974fe49479952ee6daa9739d6872952fe6bb88a",
  "version": "1.91.345.0",
  "base": "main",
  "gate": {
    "test": {
      "pass": 17806,
      "fail": 0
    }
  },
  "session_kind": "unattended",
  "head_tree": "fad7f1e46e855591b33db7494359b3a6f8bcbc40",
  "product_patch_id": "110f6b36b3ca077b5e459838e7ced9075764f5e2",
  "gstack_version": "1.91.347.0",
  "review_depth": {
    "depth": "standard",
    "class": "code",
    "runtime_lines": 160,
    "rules": "55726fab80631072",
    "base": "4eae3ef27d0e7a3f6a10366f16cd985508df9133",
    "registry": "4eae3ef27d0e7a3f6a10366f16cd985508df9133",
    "gate_scan": {
      "tagged": 0,
      "head": "4974fe49479952ee6daa9739d6872952fe6bb88a"
    },
    "reasons": [
      "runtime=160>50"
    ]
  },
  "pregate": "requires-remote cleared @fad7f1e46e85 (1 checks, current for 4974fe494799)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41161728478",
    "windows-free-tests.yml/windows-free-shard: https://github.com/garrytan/gstack/actions/runs/41161728607",
    "pregate.json/remote_gate: remote-gate tree=fad7f1e46e85 tests=17806"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "README.md, docs/, land-and-deploy/ (SKILL.md, sections), changelog.d fragment"
  },
  "review_loop": {
    "passes": 1,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 4,
    "fixed": 0,
    "scope": "frozen",
    "dispatches": {
      "specialist": 6
    }
  }
}

What changed

Step 7 now routes to the on-demand canary section instead of carrying the canary script, browser setup and third-party rules inline

Step 7 now routes to the on-demand canary section instead of carrying the canary script, browser setup and third-party rules inline.

Before/after as text: Step 7 now routes to the on-demand canary section instead of carrying the canary script, browser setup and third-party rules inline
--- Before · land-and-deploy/SKILL.md.tmpl § Step 7: Canary verification (conditional depth) at 2127729 · source text
+++ After · land-and-deploy/SKILL.md.tmpl § Step 7: Canary verification (conditional depth) on this branch · source text
@@ ⋯ 3 unchanged ⋯ @@
 Staging choice A returns to its production route; C goes to Step 9 without claiming
 STAGING VERIFIED. Production goes to Step 9 with incomplete health evidence.
 
+{{SECTION:canary}}
-Use the saved pre-merge scope and Step 5's precedence rule; URL/triggered-deploy paths
-still verify docs-only. Set `TARGET=production` unless entering from staging choice A/C.
-
-| Diff Scope | Canary Depth |
-|------------|-------------|
-| SCOPE_DOCS only | Smoke when Step 5 routes here; otherwise skipped there |
-| SCOPE_CONFIG only | Smoke: the Aside script below; `responseStatus` in `NAV=` must be 200 |
-| SCOPE_BACKEND only | Console errors + perf check |
-| SCOPE_FRONTEND (any) | Full: console + perf + screenshot |
-| Mixed scopes | Full canary |
-
-**Full canary sequence** — one `aside repl` script does the whole check (console hook first, then load, then evidence):
-
-```bash
-aside repl '
-const HOOK = `(() => { window.__gstackErrs = window.__gstackErrs || []; const oe = console.error; console.error = (...a) => { window.__gstackErrs.push(a.map(String).join(" ")); oe.apply(console, a); }; window.addEventListener("error", e => window.__gstackErrs.push("uncaught: " + e.message)); window.addEventListener("unhandledrejection", e => window.__gstackErrs.push("unhandledrejection: " + (e.reason && e.reason.message || e.reason))); })()`;
-const pg = await openTab("about:blank");
-await pg._sendToTarget("Page.addScriptToEvaluateOnNewDocument", { source: HOOK });
-await pg.goto("<url>");
-console.log("URL=" + pg.url());
-console.log("CONSOLE_ERRORS=" + JSON.stringify(await pg.evaluate(() => window.__gstackErrs)));
-console.log("NAV=" + await pg.evaluate(() => JSON.stringify(performance.getEntriesByType("navigation")[0])));
-console.log("TEXT_START"); console.log((await pg.evaluate(() => document.body.innerText)).slice(0, 20000)); console.log("TEXT_END");
-await pg.screenshot({ path: "post-deploy.jpg", type: "jpeg", quality: 60, fullPage: true });
-const a = await annotatedScreenshot(pg);
-await fs.writeFile(path.join(pwd, "post-deploy-annotated.png"), Buffer.from(a.base64Image, "base64"));
-console.log("ASIDE_DIR=" + pwd);
-await closeTab(pg);
-console.log("GSTACK_STEP_OK");
-'
-```
-
-Then copy the evidence out of the printed session directory:
-
-```bash
-mkdir -p .gstack/deploy-reports && cp "<ASIDE_DIR>/post-deploy.jpg" "<ASIDE_DIR>/post-deploy-annotated.png" .gstack/deploy-reports/
-```
-
-Read the output line by line:
-
-- `URL=` — the page loaded and stayed on the site (not a redirect to an error page). A line starting with `[error` or a missing `GSTACK_STEP_OK` means the load failed.
-- `CONSOLE_ERRORS=` — check for critical errors: entries containing `Error`, `Uncaught`, `Failed to load`, `TypeError`, `ReferenceError`. Ignore warnings.
-- `NAV=` — `responseStatus` is the HTTP status of the document (Chromium PerformanceNavigationTiming) — must be 200. `loadEventEnd` is the page load time. Check that it is under 10 seconds.
-- `TEXT_START` / `TEXT_END` — verify the page has real content (not blank, not a generic error page).
-- `post-deploy.jpg` and the annotated `post-deploy-annotated.png` are the evidence. Read the copied screenshot so the user sees it.
-
-**Health assessment:**
-- Page loads successfully with 200 status (`responseStatus` in `NAV=`) → PASS
-- No critical console errors → PASS
-- Page has real content (not blank or error screen) → PASS
-- Loads in under 10 seconds → PASS
-
-Assess only checks required by the selected depth; mark unperformed checks N/A.
-All required checks pass: record HEALTHY for this target. Staging returns through
-Step 5a's chosen A/C route; production goes to Step 9. Preserve deployment uncertainty.
-
-If any fail: show the evidence (screenshot path, console errors, perf numbers). Use AskUserQuestion:
-- **Re-ground:** "I found some issues on the live site after the deploy. Here's what I see: {specific issues}. This might be temporary (caches clearing, CDN propagating) or it might be a real problem."
-- **RECOMMENDATION:** Choose based on severity — B for critical (site down), A for minor (console errors).
-- A) Accept these observed issues for now — report DEGRADED, not healthy
-- B) That's broken — revert the merge and roll back to the previous version
-- C) Let me investigate more — open the site and look at logs before deciding
-
-**A:** Record DEGRADED and the user's acknowledgment, then Step 9 (do not silently
-continue from failed staging to production verification). **B:** Step 8, only with
-explicit rollback approval. **C:** Inspect the page/evidence and read-only logs;
-summarize findings, then ask for one recheck (repeat Step 7), rollback (Step 8), or
-finish DEGRADED (Step 9). These investigations never modify or redeploy code.
-When `ROLLBACK=true`, failures remain ROLLBACK PENDING; offer investigation or report,
-not another revert. Keep staging/production screenshots distinct when checking both.
 
 ---

Why

Garry asked for "95% of the outcome but with 50% of the token use", and land-and-deploy was one of the largest skills every session loads. The canary step only matters after a deploy, so its 15 KB of script and browser rules now load when the run reaches it (or a browser or third-party site action), not at the start of every run.

Blast radius

Only land-and-deploy's Claude Code render changes shape: Codex and Factory renders inline every section, and the shared resolvers ({{THIRD_PARTY_ACTIONS}}, {{ASIDE_SETUP}}, {{BROWSE_FALLBACK}}) are untouched, so other skills render byte-identical. Evidence rung: script ran (gen:skill-docs and --host all leave no diff; 17,806 free tests pass on Ubicloud at this tree) plus a paid before/after run where every after-arm canary and render-hook trial read sections/canary.md before acting.

Approvals

No approvals recorded for branch gsta161/land-and-deploy-diet.

Summary

Step 7's canary script, the Third-Party Web Actions contract, the Aside setup and the browser fallback move from land-and-deploy/SKILL.md into sections/canary.md (registered in the manifest; the routing row and a STOP pointer stay in the skeleton). SKILL.md drops from 51,992 to 32,216 bytes. A new 10-task eval suite under test/fixtures/skill-evals/land-and-deploy/ measured it: in a paid Opus 5.5 run (3 trials per arm), loaded skill bytes fell from 109,334 to 93,828 (-14%), the transcript-graded pass rate was 97% after, 80% before and 87% on a second before panel, and cost per session stayed flat ($0.601 to $0.603). The first run failed on deploy-ok because the fixture's "private": true made its Deploy workflow unpublishable and the dieted skill correctly refused to merge; the fixture was fixed for the two deploy tasks and those tasks reran in every arm. Size, carve and Aside guards are re-pinned to the smaller skeleton.

Test Coverage

Coverage: deterministic (each of 4 changed runtime files has a changed test naming it; no audit reader).
Tests ran: test 17806

Pre-Landing Review

No blocking issues. Four informational findings, noted and not fixed under the crew's rule that informational findings never start another review pass:

  • test/fixtures/skill-evals/land-and-deploy/check.sh:12 (testing): STATE is hardcoded to $W/.gstack-home while seed.sh honors GSTACK_STATE_ROOT; latent if a runner exports it.
  • test/fixtures/skill-evals/land-and-deploy/gh-stub.sh:28 (maintainability): auto is set on --auto but never read.
  • test/fixtures/skill-evals/land-and-deploy/check.sh:44 (maintainability): the ci-red check id is unused.
  • land-and-deploy/SKILL.md.tmpl:329 (red team): Step 7's "if browser access is unavailable, record SKIPPED" sentence comes before the STOP pointer to sections/canary.md, which now holds the readiness probe and the $B fallback. Worst case is a lost verification (DEPLOYED (UNVERIFIED)), never a false healthy; all three paid after-arm canary trials read the section and probed first.

REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=4 fixed=0 scope=frozen dispatches=6
Gate edits: 10 listed, 4 read, 0 findings (all four read hunks tighten a guard: two allowlist pins removed because the renders are now under the default cap, canary.md added to expectedSections, maxSkeletonBytes lowered 52,682 to 32,216)

Outside review (openai/gpt-6.1-sol, cross-family) and native adversarial review: nothing at the blocking floor. Their notes, for follow-up:

  • The canary section is entered for any third-party site action, but its Step 7 run has no "return to the calling step" line for an earlier setup-only entry.
  • check.sh's head-pin assertion only searches the merge line for the head SHA, so a SHA in --body would pass; a stricter argv check belongs with the suite's negative controls.
  • The Third-Party Web Actions contract now loads only when the agent routes to the section; a STOP pointer at Steps 1.5 and 6 would cover earlier dashboard detours.
  • Codex's land-and-deploy render is 99,769 characters, 231 under the 100,000 cap, so later prose additions there will hit the size guard.

Exploratory QA

Not run as a separate probe; behavior was exercised by the paid before/after suite above (10 tasks, 120 cells across two runs).

Design Review

No frontend files changed — design review skipped.

Eval Results

The project's eval selector fell back to the full gate because changelog.d/ fragments are an unknown dependency to it, and this machine could not run it (claude CLI absent; workflow dispatch not permitted), so no gate cases ran at the PR stage; the train gate covers them. The PR's own paid before/after: verdict PASS, after minus before +16.7 pp [0, +40], before2 minus before +6.7 pp [-13.3, +33.3], ledger gsta161-land-and-deploy $70.62.

Plan Completion

Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Fix: add "Plan: " to the PR body, or run /autoplan.

Verification Results

No Step 8.1 obligations (no plan bound).

TODOS

No TODO items completed in this PR.

Documentation

Status: current. Audited the base 2127729..head 4974fe4 diff plus the clean working tree. No documentation changes are needed.

Scope: /land-and-deploy Step 7's canary procedure (canary script, third-party actions, Aside setup, browser fallback) moved from land-and-deploy/SKILL.md.tmpl into an on-demand land-and-deploy/sections/canary.md.tmpl. The diff also adds a 10-task eval fixture suite and re-pins the size and carve guards.

Documentation health:

  • README.md: Current (the skill table describes behavior, which is unchanged)
  • docs/skills.md: Current (the /land-and-deploy and /canary sections are still accurate)
  • docs/PROJECT_STRUCTURE.md: Current
  • docs/howto-bring-up-a-first-deploy.md: Current
  • docs/evals/detector-inventory.md: Current (it cites first-run-validation.md, which did not move)
  • gstack/llms.txt: Current

Coverage debt: None new. The section-loading layout has reference coverage only through the manifest and tests; that gap predates this change.

Diagram drift: None.

Test plan

  • UBI_OWNER=gsta161 gstack-pregate --stage tests --remote --spend-cap 2 --timeout 2700 --allow-repo-commands: 17,806 tests, 0 failed on tree fad7f1e46e85 ($0.07)
  • land-and-deploy and guard set (73 entries, run locally before /ship): green, 1,532 tests with no failures and 19 skipped
  • bun run typecheck clean; bun run gen:skill-docs and --host all leave no diff
  • GitHub free-tests, windows-free-tests and macos-named-regressions green at 0c245b6

garrytan and others added 6 commits October 31, 2026 01:39
Ten tasks written before any cut: happy path, a red required check with an
--admin push (wrong-behavior control), a conflicting PR, an already-merged
PR, a dirty checkout, the first-run dry run, deploy success, deploy failure
(no revert), a canary URL with no browser, and a Render deploy hook that
needs a dashboard step. seed.sh builds a tiny Bun library with a local bare
remote; gh-stub.sh fakes PR #1, its checks, a real squash merge and the
deploy run; check.sh asserts the end state from the remote and the gh log.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… on demand (GSTA-161)

Step 7's canary script and health assessment, the Aside browser contract,
the gstack-browser fallback and the Third-Party Web Actions contract move
from the always-loaded SKILL.md into sections/canary.md, read at Step 7 when
a URL is checked or before any browser step or third-party site action. The
routing rules (SKIPPED without a browser, staging and production routes) stay
in the skeleton. Shared resolvers are untouched.

Skill-Diet: land-and-deploy
Skill-Size: 107318→87590 bytes (loaded per session, confirmed run without a canary URL; SKILL.md 51992→32264)
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…TA-161)

The canary section drops its duplicated health checklist and long labels so
the parity union stays under its 1.126 cap with the new pointer and index
row. Carve guard: canary.md joins expectedSections and maxSkeletonBytes
drops 52,682 -> 32,216. The codex and factory size pins go away: both hosts
are now under 100,000 chars. The browser tripwire reads land-and-deploy's
Aside contract from sections/canary.md, as it already does for qa.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…e the paid verdict (GSTA-161)

The priced pilot (after arm) behaved correctly: it reported MERGED
(UNVERIFIED) and 'URL check skipped' with no browser, but the pattern only
accepted canary/health/browser before 'skipped'. Detector fix, the same for
every arm, made before any before/after cell ran.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…fixtures (GSTA-161)

The Deploy workflow runs bun publish, which refuses a private package, so
deploy-ok's 'deploy works' scenario was not actually deployable and a careful
run correctly held the merge. Variant-scoped: other tasks seed identical repos.

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 31, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 2 commits October 31, 2026 04:18
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@github-actions github-actions Bot changed the title land-and-deploy: move the canary step into an on-demand section (skill diet, GSTA-161) v1.91.354.0 land-and-deploy: move the canary step into an on-demand section (skill diet, GSTA-161) Oct 31, 2026
@capy-ai
capy-ai Bot merged commit a77fae2 into main Oct 31, 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