mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-05 08:23:59 +01:00
Merge remote-tracking branch 'origin/main' into capy/census-red-triage-oct19
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # CHANGELOG.md
This commit is contained in:
commit
6eeeea492e
39 files changed
+452
-151
No files matched your search
+1
-1
@@ -584,7 +584,7 @@ SITE=app.example.com
|
||||
DOMAIN=example.com
|
||||
$B goto "https://$SITE"
|
||||
$B cookie-import-browser opera-gx --domain "$DOMAIN" --profile Default # or: opera
|
||||
$B reload # confirm the intended account
|
||||
$B reload # view the page; only --verify-auth proves sign-in
|
||||
```
|
||||
|
||||
Run `$B cookie-import-browser` with no flags to see which browsers were detected. `--profile` can be omitted when only one profile has cookies for the domain. If the receipt reports App-Bound Encryption, run `$B handoff`, sign in to the intended account in the window that opens, then `$B resume` (needs a display).
|
||||
|
||||
@@ -9,6 +9,29 @@
|
||||
- **Office-hours marathon fixture:** `test/helpers/office-hours-formatter-fixture.ts` copies the formatter together with every local module it imports, so a new import can no longer be left out. A free test in `test/office-hours-review.test.ts` loads the copied formatter and fails on a missing module; the old three-file list reproduces the exact `Cannot find module '../lib/spec-review-cap.ts'` error. The case's touchfiles now include `lib/spec-review-cap.ts` and the new helper.
|
||||
- **Gate integrity:** no threshold, trial count, case kind or judge changed. The marathon assertions are unchanged; only the fixture's file copy changed.
|
||||
|
||||
## [1.91.151.0] - 2026-10-19
|
||||
|
||||
**Three contributor fixes: a saved "never ask" now sticks for /plan-eng-review's structure question, /context-save and /context-restore close three checkpoint gaps, and a new how-to covers the first production deploy.** Ported from fork PRs so they can run the paid gate; each commit keeps its author.
|
||||
|
||||
### Fixed
|
||||
- **/plan-eng-review's complexity-gate structure question has a registered id (`plan-eng-review-structure`).** Each run used to invent its own slug, so a `never-ask` saved through /plan-tune never matched the next run and the question came back every time. On `AUTO_DECIDE` the recommended arrangement is taken; feature cuts are still asked one by one. `gstack-question-preference --check` now also falls back to `$GSTACK_HOME/global-question-preferences.json` (the file the question-preference hook already reads) when the project file has no entry; a project entry still wins and the one-way-door and split-chain guards run first. From #3249 by @bezdekt.
|
||||
- **/context-save keeps provenance markers as English literals and backs file claims in Decisions Made; /context-restore treats a translated or unknown marker as `(path assumed)` and asks when no branch can pick between recent checkpoints with different titles.** Fixes #3217. From #3244 by @surlymochan.
|
||||
|
||||
### Added
|
||||
- **`docs/howto-bring-up-a-first-deploy.md`:** a vendor-neutral walkthrough for when /setup-deploy stops at "Nothing is deployed yet" (host, services, env and secrets, DNS, verification, and what to have ready when you rerun /setup-deploy). Linked from the README and docs/skills.md. Fixes #3150. From #3264 by @szsunyuan.
|
||||
## [1.91.150.0] - 2026-10-19
|
||||
|
||||
**The paid evals that still pinned older models now run on the current generation, and two cases that went red on the move are repaired at their cause.** Garry's direction (2026-10-18) is to stop testing older frontier models, so these files are re-baselined as a fresh measured reference rather than held to a threshold change.
|
||||
|
||||
### Changed
|
||||
- **Old-model pins:** the `claude-opus-4-7` pins in `skill-e2e-plan`, `skill-e2e-plan-prosons`, `skill-e2e-design`, `skill-e2e-office-hours-phase4` and `skill-e2e-qa-bugs` now follow `resolveEvalModel('capture')` (Opus 5.5). The overlay benchmark fixtures pin `claude-opus-5-5` and `claude-sonnet-5-5`, the cookie workflow judge pins `claude-sonnet-5-5`, and `codex-sol-scope-termination` runs on `gpt-6.1-sol` while still rendering the `gpt-5.6-sol` overlay.
|
||||
- **/setup-browser-cookies:** the workflow is now five ordered steps. It checks for Aside first and ends there on `READY`, since no import is needed. It then asks every decision (source and profile, domains and target, verification, storage reset, all cookies) before any `$B` command, prepares gstack's browser (verification variables before the daemon starts, the fallback, the `Mode: cdp` stop), imports, and reports on three lines: Imported, Storage reset, Sign-in. The `{{BROWSE_SETUP}}` block, which contradicted the Aside probe, is gone from this skill.
|
||||
- **Gate integrity:** no threshold, trial count, case kind or assertion changed. Free-test edits follow the new cookie template: two phrase and order assertions, the approval fixture's reverse edits, and the positional-literals checksum list, which no longer includes this skill.
|
||||
|
||||
### Fixed
|
||||
- **plan-review-prosons-hardstop-neg:** on Opus 5.5 one trial in three stopped with a provider refusal (`stop_reason: refusal`, category `reasoning_extraction`) on the turn that writes the captured question. Replays of the refused request were stopped 7 of 16 times with the capture prompt's "verbatim" and "Do NOT paraphrase. This is a format-capture test." wording and 0 of 24 without it. The shared prosons capture prompt now asks for "the text of the single AskUserQuestion you would have made", with the same required parts. The decision content and every assertion are unchanged; all four prosons cases pass 3/3.
|
||||
- **Cookie workflow judge:** on `claude-sonnet-5-5` it scored clarity 3, completeness 4, actionability 3 against the old template. The rewritten template scores 4/4/4 with unchanged thresholds.
|
||||
|
||||
## [1.91.149.0] - 2026-10-19
|
||||
|
||||
**Paid eval cases can now run on the Codex host, and the Monday census runs two arms: Claude Opus 5.5 and Codex gpt-6.1-sol.** `EVALS_HOST=codex` runs the 52 adapter-only gate cases through a full Codex runtime per case. On its first pilot gpt-6.1-sol passed 48 of 52 with no retries, at $4.63 for the 52 cases, against $28.93 for the same cases on Fable (0.16×). Claude-only cases are skipped on Codex with a recorded reason and never count as failed. GSTA-49 TM2.
|
||||
|
||||
@@ -656,6 +656,7 @@ Other references: [docs/gbrain-sync.md](docs/gbrain-sync.md) (sync-specific guid
|
||||
|-----|---------------|
|
||||
| [Skill Deep Dives](docs/skills.md) | Philosophy, examples, and workflow for every skill (includes Greptile integration) |
|
||||
| [Diagrams & Document Formats](docs/howto-diagrams-and-formats.md) | Mermaid/excalidraw fences in PDFs, image sizing and safety defaults, `--to html\|docx`, `/diagram` triplets |
|
||||
| [First Production Deploy](docs/howto-bring-up-a-first-deploy.md) | What to do when `/setup-deploy` says nothing is deployed yet: hosting, env and secrets, DNS, checking it works, then back to `/setup-deploy` |
|
||||
| [Builder Ethos](ETHOS.md) | Builder philosophy: Boil the Ocean, Search Before Building, three layers of knowledge |
|
||||
| [Using GBrain with GStack](USING_GBRAIN_WITH_GSTACK.md) | Every path, flag, bin helper, and troubleshooting step for `/setup-gbrain` |
|
||||
| [GBrain Sync](docs/gbrain-sync.md) | Cross-machine memory setup, privacy modes, troubleshooting |
|
||||
|
||||
@@ -1645,19 +1645,24 @@ and `test/dx-selected-navigation-ap.test.ts`. One shared table run once against
|
||||
only after `engFirstReviewAUQ` checks native completion once at entry; today each branch gates it
|
||||
separately, so the change alters a paid verdict and needs its own paid run.
|
||||
|
||||
### P3: Re-pin the five remaining claude-opus-4-7 paid files
|
||||
### P3: Follow-ups from re-baselining the old-model paid pins on the current generation
|
||||
|
||||
**What:** The 2026-09 audit moved seven paid evals to the default capture model (`resolveEvalModel('capture')`).
|
||||
`skill-e2e-design`, `skill-e2e-office-hours-phase4`, `skill-e2e-plan-prosons` and `skill-e2e-plan` keep
|
||||
`claude-opus-4-7` because six cases failed on the default model in one run (plan-design-review-plan-mode timeout,
|
||||
office-hours-phase4-fork format, plan-review-prosons-neutral-neg missing output, plan-ceo-review-selective and
|
||||
plan-eng-review 600 s timeouts, plan-ceo-review-expansion-energy posture score 3). plan-review-report, the one PR-gate
|
||||
case in `skill-e2e-plan`, left the pin on 2026-10-18 and follows the capture default. `skill-e2e-qa-bugs` returned
|
||||
to `claude-opus-4-7` after `qa-b6-static` timed out on the default model in two of three runs (census 36597762183
|
||||
and a targeted local rerun): each time the stream stopped mid-message, with no pending tool, right after the model
|
||||
found the disabled submit button, and emitted nothing until the 300 s case deadline. They measure an old model.
|
||||
**What:** GSTA-49 TM3 (2026-10-18) moved every remaining old-model paid pin to the current generation: the
|
||||
`claude-opus-4-7` pins in `skill-e2e-{plan,plan-prosons,design,office-hours-phase4,qa-bugs}` follow
|
||||
`resolveEvalModel('capture')`, the overlay fixtures pin `claude-opus-5-5` and `claude-sonnet-5-5`, the cookie workflow
|
||||
judge pins `claude-sonnet-5-5`, and `codex-sol-scope-termination` runs on `gpt-6.1-sol` (still rendering the
|
||||
`gpt-5.6-sol` overlay). Three things remain:
|
||||
|
||||
**Re-entry:** fix the prompt, budget or rubric so each case passes on the default model in one run, then drop the pin.
|
||||
- The base `claude-dedicated-tools-vs-bash` fixture now duplicates `claude-dedicated-tools-vs-bash-opus-5-5`.
|
||||
- The `opus-4-7-*` fixtures measure `model-overlays/opus-4-7.md` on Opus 5.5, which gets the generic `claude`
|
||||
overlay in product.
|
||||
- Opus 5.5 refuses (stop category `reasoning_extraction`) capture prompts that ask for the "verbatim text" of a
|
||||
question "you would have made" with "Do NOT paraphrase"; that wording stopped 7 of 16 replays of a prosons
|
||||
request and 0 of 24 without it. `skill-e2e-plan-prosons` dropped it; `skill-e2e-plan-format` and
|
||||
`skill-e2e-office-hours-phase4` still use it.
|
||||
|
||||
**Re-entry:** retire one dedicated-tools fixture, decide the opus-4-7 overlay's future, and drop the extraction
|
||||
wording from the remaining capture prompts with a paid run each.
|
||||
|
||||
### P3: Retire the unused CEO payment seeder
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# gstack digest v1.91.149.0 — regenerate/re-copy after upgrading gstack
|
||||
# gstack digest v1.91.151.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,
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
# gstack-question-preference — read/write/check explicit per-question preferences.
|
||||
#
|
||||
# Preference file: ~/.gstack/projects/{SLUG}/question-preferences.json
|
||||
# Global fallback: ~/.gstack/global-question-preferences.json, the file the
|
||||
# question-preference hook reads (--check only; a project entry for the same
|
||||
# id wins). Hand-edited; --write stays per-project.
|
||||
# Schema: { "<question_id>": "always-ask" | "never-ask" | "ask-only-for-one-way" }
|
||||
#
|
||||
# Subcommands:
|
||||
@@ -42,6 +45,7 @@ GSTACK_HOME="$_gstack_sr_root"
|
||||
eval "$("$SCRIPT_DIR/gstack-slug" 2>/dev/null || true)"
|
||||
SLUG="${SLUG:-unknown}"
|
||||
PREF_FILE="$GSTACK_HOME/projects/$SLUG/question-preferences.json"
|
||||
GLOBAL_PREF_FILE="$GSTACK_HOME/global-question-preferences.json"
|
||||
EVENT_FILE="$GSTACK_HOME/projects/$SLUG/question-events.jsonl"
|
||||
mkdir -p "$GSTACK_HOME/projects/$SLUG"
|
||||
|
||||
@@ -101,13 +105,23 @@ do_check() {
|
||||
fi
|
||||
ensure_file
|
||||
cd "$ROOT_DIR"
|
||||
PREF_FILE_PATH="$PREF_FILE" QID="$QID" QSUMMARY="$QSUMMARY" bun -e "
|
||||
PREF_FILE_PATH="$PREF_FILE" GLOBAL_PREF_FILE_PATH="$GLOBAL_PREF_FILE" QID="$QID" QSUMMARY="$QSUMMARY" bun -e "
|
||||
import('./scripts/one-way-doors.ts').then((oneway) => {
|
||||
const fs = require('fs');
|
||||
const qid = process.env.QID;
|
||||
const summary = process.env.QSUMMARY || undefined;
|
||||
const prefs = JSON.parse(fs.readFileSync(process.env.PREF_FILE_PATH, 'utf-8'));
|
||||
const pref = prefs[qid];
|
||||
let globalPrefs = {};
|
||||
try {
|
||||
if (fs.existsSync(process.env.GLOBAL_PREF_FILE_PATH)) {
|
||||
const parsed = JSON.parse(fs.readFileSync(process.env.GLOBAL_PREF_FILE_PATH, 'utf-8'));
|
||||
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) throw new Error('not an object');
|
||||
globalPrefs = parsed;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('NOTE: global-question-preferences.json is unreadable; ignoring it.');
|
||||
}
|
||||
const pref = qid in prefs ? prefs[qid] : globalPrefs[qid];
|
||||
|
||||
// Always check one-way status first — safety overrides preferences.
|
||||
// summary (when piped) lets the keyword net catch ad-hoc destructive
|
||||
|
||||
@@ -509,6 +509,12 @@ has written to). Prefixed lines are never candidates for "latest":
|
||||
- Otherwise: load the **first plain path line returned by Step 1 above**, which
|
||||
is the newest `YYYYMMDD-HHMMSS` checkpoint of this project for the current
|
||||
branch, or, if the current branch has none, the newest across all branches.
|
||||
- **No useful branch discriminator.** When `CURRENT_BRANCH` is empty, `HEAD`, or
|
||||
otherwise cannot discriminate (cwd is not a git repo, or branch is unknown), do
|
||||
not silently load newest if the recent candidates (e.g. last 24 hours, or the
|
||||
three newest) carry **different titles**. Show those titles with timestamps via
|
||||
AskUserQuestion, mark newest as the recommended option, and wait. Only auto-load
|
||||
newest when every recent candidate shares one title (same topic).
|
||||
- **Do not silently take an older checkpoint.** If Step 1 printed `NEWER_TASK`,
|
||||
or a `BELOW_CWD`/`POINTER` file is newer than the first plain path line (or
|
||||
there is none), show both (title, branch, saved time, and `project_root` for a
|
||||
@@ -534,6 +540,10 @@ checkpoint(s) from another project; only this project's are listed." If it print
|
||||
order, and drop nothing. Put an item under **Verify first** when it:
|
||||
- ends in `(path assumed)` or `(code read)`;
|
||||
- ends in `(path run)` but its text reports a failure;
|
||||
- ends in a parenthesised trailing marker that is **not** one of the five English
|
||||
literals `(path run)`, `(path read)`, `(path assumed)`, `(target state checked)`,
|
||||
`(code read)` — treat a translated or unknown marker as `(path assumed)` (→ Verify
|
||||
first), never as unmarked Next steps;
|
||||
- has no marker and is a writing step (migration, sync, insert, import, a dialog that
|
||||
writes) or names a concrete path (a runnable command, CLI flag or switch, config key
|
||||
or value, or file or directory path).
|
||||
|
||||
@@ -176,6 +176,12 @@ has written to). Prefixed lines are never candidates for "latest":
|
||||
- Otherwise: load the **first plain path line returned by Step 1 above**, which
|
||||
is the newest `YYYYMMDD-HHMMSS` checkpoint of this project for the current
|
||||
branch, or, if the current branch has none, the newest across all branches.
|
||||
- **No useful branch discriminator.** When `CURRENT_BRANCH` is empty, `HEAD`, or
|
||||
otherwise cannot discriminate (cwd is not a git repo, or branch is unknown), do
|
||||
not silently load newest if the recent candidates (e.g. last 24 hours, or the
|
||||
three newest) carry **different titles**. Show those titles with timestamps via
|
||||
AskUserQuestion, mark newest as the recommended option, and wait. Only auto-load
|
||||
newest when every recent candidate shares one title (same topic).
|
||||
- **Do not silently take an older checkpoint.** If Step 1 printed `NEWER_TASK`,
|
||||
or a `BELOW_CWD`/`POINTER` file is newer than the first plain path line (or
|
||||
there is none), show both (title, branch, saved time, and `project_root` for a
|
||||
@@ -201,6 +207,10 @@ checkpoint(s) from another project; only this project's are listed." If it print
|
||||
order, and drop nothing. Put an item under **Verify first** when it:
|
||||
- ends in `(path assumed)` or `(code read)`;
|
||||
- ends in `(path run)` but its text reports a failure;
|
||||
- ends in a parenthesised trailing marker that is **not** one of the five English
|
||||
literals `(path run)`, `(path read)`, `(path assumed)`, `(target state checked)`,
|
||||
`(code read)` — treat a translated or unknown marker as `(path assumed)` (→ Verify
|
||||
first), never as unmarked Next steps;
|
||||
- has no marker and is a writing step (migration, sync, insert, import, a dialog that
|
||||
writes) or names a concrete path (a runnable command, CLI flag or switch, config key
|
||||
or value, or file or directory path).
|
||||
|
||||
@@ -435,6 +435,21 @@ depends on the target's state, not on the code that writes. Examples:
|
||||
`Open. Run the suite with CONFIG=staging. (path run) exit 0` and
|
||||
`Open. Switch B reads config Y. (path assumed)`.
|
||||
|
||||
**Markers stay English literals.** `/context-restore` sorts on the exact strings
|
||||
`(path run)`, `(path read)`, `(path assumed)`, `(target state checked)`, and
|
||||
`(code read)`. Never translate them, even when the rest of the checkpoint is in
|
||||
another language. After drafting Remaining Work, scan each item that should have
|
||||
a marker: if it ends in a parenthesised token that is not one of those five, or
|
||||
has no marker when the table requires one, rewrite that item before writing the
|
||||
file (preferred), or add a Remaining Work item that names the bad line so restore
|
||||
puts it under Verify first.
|
||||
|
||||
**Decisions Made and file claims.** Provenance above covers Remaining Work only.
|
||||
Any statement in Decisions Made about the *contents* of a concrete file (item
|
||||
counts, line counts, section names) must be backed by a `grep`/`wc`/`Read` in this
|
||||
turn, or rewritten with an honest `(path assumed)` note in Remaining Work that
|
||||
restore will verify first. Do not record an unchecked file claim as fact.
|
||||
|
||||
If the user provided a title, use it. Otherwise, infer a concise title (3-6 words)
|
||||
from the work being done.
|
||||
|
||||
|
||||
@@ -103,6 +103,21 @@ depends on the target's state, not on the code that writes. Examples:
|
||||
`Open. Run the suite with CONFIG=staging. (path run) exit 0` and
|
||||
`Open. Switch B reads config Y. (path assumed)`.
|
||||
|
||||
**Markers stay English literals.** `/context-restore` sorts on the exact strings
|
||||
`(path run)`, `(path read)`, `(path assumed)`, `(target state checked)`, and
|
||||
`(code read)`. Never translate them, even when the rest of the checkpoint is in
|
||||
another language. After drafting Remaining Work, scan each item that should have
|
||||
a marker: if it ends in a parenthesised token that is not one of those five, or
|
||||
has no marker when the table requires one, rewrite that item before writing the
|
||||
file (preferred), or add a Remaining Work item that names the bad line so restore
|
||||
puts it under Verify first.
|
||||
|
||||
**Decisions Made and file claims.** Provenance above covers Remaining Work only.
|
||||
Any statement in Decisions Made about the *contents* of a concrete file (item
|
||||
counts, line counts, section names) must be backed by a `grep`/`wc`/`Read` in this
|
||||
turn, or rewritten with an honest `(path assumed)` note in Remaining Work that
|
||||
restore will verify first. Do not record an unchecked file claim as fact.
|
||||
|
||||
If the user provided a title, use it. Otherwise, infer a concise title (3-6 words)
|
||||
from the work being done.
|
||||
|
||||
|
||||
@@ -14,8 +14,10 @@ Selection IDs for the six retained paid cases stay unchanged.
|
||||
## Blocking checks
|
||||
|
||||
Both arms use the real Claude Code preset; ON appends the resolved overlay and
|
||||
OFF does not. Each retained fixture runs ten samples per arm, separately for
|
||||
`claude-opus-4-7` and `claude-sonnet-4-6`. Each model keeps its own results.
|
||||
OFF does not. Each retained fixture runs ten samples per arm on its pinned
|
||||
model: `claude-opus-5-5`, plus `claude-sonnet-5-5` for the dedicated-tools `-sonnet` case.
|
||||
Each model keeps its own results. The `opus-4-7-*` cases keep their overlay
|
||||
(`model-overlays/opus-4-7.md`) but run on Opus 5.5 since GSTA-49.
|
||||
|
||||
Every planned sample in both arms must execute successfully, produce exactly
|
||||
one successful native terminal result without an error flag, preserve workspace
|
||||
@@ -38,7 +40,7 @@ are not reinterpreted.
|
||||
| `opus-4-7-effort-match-trivial` | Read-only workspace; native final JSON contains the exact version string | Correct answer in every ON sample | Native `usage.output_tokens_details.thinking_tokens` |
|
||||
| `opus-4-7-literal-interpretation` | Only `src/auth.ts`, `src/billing.ts`, and `src/notifications.ts` may change; public tests stay frozen; independent behavior checks run outside the writable fixture | All three target behaviors pass in every ON sample | Correct target behaviors, 0..3 |
|
||||
|
||||
Each family also has a `-sonnet` case. Output validation checks the native final
|
||||
The dedicated-tools family also has `-sonnet` and `-opus-5-5` cases. Output validation checks the native final
|
||||
answer, so a correct word mentioned earlier cannot conceal a wrong final answer.
|
||||
The read-only prompts explicitly request the JSON shape. These exact-answer
|
||||
prompts are new in v2: compare ON/OFF within the same contract and fixture, not
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
# How to bring up your first production deploy
|
||||
|
||||
Use this when `/setup-deploy` stops with "Nothing is deployed yet". It walks through a first production deploy, so you finish with a live URL that `/setup-deploy` can record and `/land-and-deploy` can verify. It names no hosting provider or deploy tool; use whichever fits your project.
|
||||
|
||||
`/setup-deploy` writes nothing at that stop. It configures how `/land-and-deploy` checks a deploy, so it needs a production deploy that already exists.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- The app builds and starts locally with the commands production will run.
|
||||
- The code is in its GitHub repository. `/setup-deploy` and `/land-and-deploy` read it through the GitHub CLI, so `gh auth status` should pass.
|
||||
- An account with the hosting provider you choose, with billing set up if it needs it.
|
||||
- Optional: a domain you control, if users won't use the host's default address.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Choose where the app runs
|
||||
|
||||
Pick a host for the kind of app you have: static files, a long-running server or container, or functions. List what the app needs at runtime: the language runtime and its version, a database or other services, background jobs, and any disk that has to survive a restart.
|
||||
|
||||
Then choose how production deploys start. `/land-and-deploy` only watches a trigger that already exists; it never creates one. When `/setup-deploy` asks how deploys are triggered, the choices are:
|
||||
|
||||
- automatically on push to the default branch
|
||||
- a CI workflow in the repository
|
||||
- a deploy script or CLI command
|
||||
- manually
|
||||
|
||||
A trigger that runs on merge to the default branch keeps `/land-and-deploy` hands-off. With a command trigger, nothing deploys until the command runs: `/land-and-deploy` asks you to run it after the merge, or runs it only with your explicit approval.
|
||||
|
||||
### 2. Create the services the app depends on
|
||||
|
||||
Create production instances of every service the app uses, such as its database, cache, file storage, email or payments, separate from your development ones. Run the database schema setup or migrations against production before the app serves traffic.
|
||||
|
||||
### 3. Set environment variables and secrets
|
||||
|
||||
1. List every variable the app reads, at build time and at runtime.
|
||||
2. Set each one in the host's environment or secrets settings.
|
||||
3. Keep secret values out of the repository. Commit only an example file with placeholder values, such as `.env.example`.
|
||||
4. Enter secret values yourself. Don't paste them into a chat with your agent.
|
||||
|
||||
Some hosts inject variables only at runtime. A value the build needs, such as a public client-side key, has to be available when the build runs.
|
||||
|
||||
### 4. Run the first deploy
|
||||
|
||||
Start a deploy with the trigger you chose: push to the default branch, run the workflow, or run the command. Watch the build and release logs until they finish, and note the address the host assigns. If the build fails, fix it and deploy again before you go on.
|
||||
|
||||
### 5. Point your domain at it (optional)
|
||||
|
||||
1. At your DNS provider, add the records the host asks for: usually a CNAME record for a subdomain, or A and AAAA records for the root domain.
|
||||
2. Wait until the name resolves:
|
||||
|
||||
```bash
|
||||
dig +short app.example.com
|
||||
```
|
||||
|
||||
3. Check that HTTPS works for the domain with a valid certificate:
|
||||
|
||||
```bash
|
||||
curl -sI https://app.example.com | head -1
|
||||
```
|
||||
|
||||
Decide which address is the production URL, your domain or the host's default address. That is the URL you give `/setup-deploy`.
|
||||
|
||||
### 6. Check that it works
|
||||
|
||||
1. Open the production URL in a browser and walk through one real flow, such as signing in or loading data.
|
||||
2. If the app has a health endpoint, check that it returns a 2xx status:
|
||||
|
||||
```bash
|
||||
curl -s -o /dev/null -w "%{http_code}\n" https://app.example.com/health
|
||||
```
|
||||
|
||||
A useful health endpoint exercises the app, for example by reaching its database, instead of returning a fixed page.
|
||||
3. Make sure you can tell which revision is live: a status command that prints the deployed commit, or a page or endpoint that shows it. `/land-and-deploy` treats a page that loads as site health, not as proof that the merged commit is live.
|
||||
4. Check the host's logs for errors after your first requests.
|
||||
|
||||
### 7. Hand the deploy back to gstack
|
||||
|
||||
Run `/setup-deploy` again. If the project now has a config file for a platform it recognizes, it starts from that platform's settings; otherwise it asks. Either way, have these answers ready:
|
||||
|
||||
- how deploys are triggered (step 1)
|
||||
- the production URL (step 5)
|
||||
- how to check that a deploy succeeded: a health check URL, a status command, the CI workflow's status, or just checking that the URL loads
|
||||
- the merge method your repository allows (squash, merge or rebase), and any command to run before merging
|
||||
|
||||
It writes the answers to the `## Deploy Configuration` section of the project's CLAUDE.md, then tries the health check and the status command once. From then on, `/land-and-deploy` uses that section to merge your PR, watch the deploy and check production. Its first run walks you through a dry run of the pipeline before anything irreversible happens.
|
||||
|
||||
## Verification
|
||||
|
||||
- `/setup-deploy` ends with `DEPLOY CONFIGURATION — COMPLETE`.
|
||||
- The project's CLAUDE.md has the section, with your production URL:
|
||||
|
||||
```bash
|
||||
grep -A 20 "## Deploy Configuration" CLAUDE.md
|
||||
```
|
||||
|
||||
- Its health check did not print `UNREACHABLE`, and its status command did not print `COMMAND_FAILED`.
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**`/setup-deploy` stops at "Nothing is deployed yet" again.**
|
||||
That answer means there is no production deploy to record. Once the app is live, pick the answer that says how it deploys: on push, through a CI workflow, with a script or command, or by hand.
|
||||
|
||||
**The health check fails or prints `UNREACHABLE`.**
|
||||
Open the URL yourself. A 404 means the health path doesn't exist, so give `/setup-deploy` a path that returns 2xx, or the plain production URL. `/setup-deploy` keeps the configuration even when this check fails, so you can fix the URL later by running it again or by editing the section in CLAUDE.md.
|
||||
|
||||
**The app works on the host's address but not on your domain.**
|
||||
Check the DNS records (`dig +short <domain>`) and the certificate (`curl -sI https://<domain>`). New records can take a while to resolve everywhere.
|
||||
|
||||
**The build works locally but fails on the host.**
|
||||
Compare the host's build environment with yours. A missing build-time variable or a different runtime version is the usual cause.
|
||||
|
||||
**You deploy by running a command by hand.**
|
||||
Record it as the deploy trigger. After each merge, `/land-and-deploy` tells you production hasn't moved yet and asks you to run it.
|
||||
|
||||
## Related
|
||||
|
||||
- [`/setup-deploy`](./skills.md#setup-deploy) and [`/land-and-deploy`](./skills.md#land-and-deploy): what each skill does
|
||||
- [`/canary`](./skills.md#canary): post-deploy monitoring once production is live
|
||||
- Reference: [`setup-deploy/SKILL.md`](../setup-deploy/SKILL.md), [`land-and-deploy/SKILL.md`](../land-and-deploy/SKILL.md)
|
||||
@@ -1162,6 +1162,8 @@ Claude: Detected: Fly.io (fly.toml found)
|
||||
Written to CLAUDE.md. Run /land-and-deploy when ready.
|
||||
```
|
||||
|
||||
If you answer "Nothing is deployed yet", `/setup-deploy` stops and writes nothing, because there is no production deploy to record. [How to bring up your first production deploy](./howto-bring-up-a-first-deploy.md) covers that first step; run `/setup-deploy` again once the app is live.
|
||||
|
||||
---
|
||||
|
||||
## `/codex`
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "gstack",
|
||||
"version": "1.91.149",
|
||||
"version": "1.91.151",
|
||||
"description": "Garry's Stack — Claude Code skills + fast headless browser. One repo, one install, entire AI engineering workflow.",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
|
||||
@@ -441,18 +441,19 @@ Initial scope selectors need no grid or **pre-answer** ledger write. Ask and
|
||||
wait before changes.
|
||||
|
||||
1. Explain the complexity. Ask each proposed feature cut/deferral separately;
|
||||
wait before changing scope. With no proposed cuts, keep the feature list and
|
||||
go directly to the structure question.
|
||||
2. Always ask the structure question when this gate trips, even with no cuts.
|
||||
Compare only the file/class arrangement. Use labels `Original arrangement`
|
||||
and `Smaller arrangement`; put files/classes in each description. Both retain
|
||||
wait before changing scope.
|
||||
2. Always resolve the structure question when this gate trips, even with no cuts,
|
||||
as question_id `plan-eng-review-structure` (no per-plan slug); `AUTO_DECIDE`
|
||||
picks the recommendation. Compare only the file/class arrangement, labeled
|
||||
`Original arrangement` and `Smaller arrangement`, with files/classes per
|
||||
option. Both retain
|
||||
the same approved feature list, contracts and approved
|
||||
security/error/test/performance fixes. Include `Pending remedies not decided here: <ids>` in the
|
||||
question; unapproved fixes stay pending. If no smaller arrangement preserves
|
||||
these commitments, explain that and offer confirmation of the original
|
||||
arrangement or a pause to investigate a smaller one. Wait for the answer.
|
||||
A pause leaves the arrangement undecided: investigate only the agreed question,
|
||||
then return to this structure selector. Do not continue to C until it is settled.
|
||||
then return to the selector. Do not continue to C until it is settled.
|
||||
3. Save the actual feature and structure answers as one scope record: `feature
|
||||
answers: <refs>; structure: <A/B + ref>; accepted scope: <exact scope>;
|
||||
pending remedies: <ids or none>`.
|
||||
|
||||
@@ -339,18 +339,19 @@ Initial scope selectors need no grid or **pre-answer** ledger write. Ask and
|
||||
wait before changes.
|
||||
|
||||
1. Explain the complexity. Ask each proposed feature cut/deferral separately;
|
||||
wait before changing scope. With no proposed cuts, keep the feature list and
|
||||
go directly to the structure question.
|
||||
2. Always ask the structure question when this gate trips, even with no cuts.
|
||||
Compare only the file/class arrangement. Use labels `Original arrangement`
|
||||
and `Smaller arrangement`; put files/classes in each description. Both retain
|
||||
wait before changing scope.
|
||||
2. Always resolve the structure question when this gate trips, even with no cuts,
|
||||
as question_id `plan-eng-review-structure` (no per-plan slug); `AUTO_DECIDE`
|
||||
picks the recommendation. Compare only the file/class arrangement, labeled
|
||||
`Original arrangement` and `Smaller arrangement`, with files/classes per
|
||||
option. Both retain
|
||||
the same approved feature list, contracts and approved
|
||||
security/error/test/performance fixes. Include `Pending remedies not decided here: <ids>` in the
|
||||
question; unapproved fixes stay pending. If no smaller arrangement preserves
|
||||
these commitments, explain that and offer confirmation of the original
|
||||
arrangement or a pause to investigate a smaller one. Wait for the answer.
|
||||
A pause leaves the arrangement undecided: investigate only the agreed question,
|
||||
then return to this structure selector. Do not continue to C until it is settled.
|
||||
then return to the selector. Do not continue to C until it is settled.
|
||||
3. Save the actual feature and structure answers as one scope record: `feature
|
||||
answers: <refs>; structure: <A/B + ref>; accepted scope: <exact scope>;
|
||||
pending remedies: <ids or none>`.
|
||||
|
||||
@@ -336,6 +336,14 @@ export const QUESTIONS = {
|
||||
signal_key: 'scope-appetite',
|
||||
description: "Plan touches 8+ files — reduce scope or hold?",
|
||||
},
|
||||
'plan-eng-review-structure': {
|
||||
id: 'plan-eng-review-structure',
|
||||
skill: 'plan-eng-review',
|
||||
category: 'routing',
|
||||
door_type: 'two-way',
|
||||
options: ['original-arrangement', 'smaller-arrangement'],
|
||||
description: "Complexity gate — Original arrangement or Smaller arrangement (file/class layout only)?",
|
||||
},
|
||||
'plan-eng-review-test-gap': {
|
||||
id: 'plan-eng-review-test-gap',
|
||||
skill: 'plan-eng-review',
|
||||
|
||||
@@ -152,83 +152,59 @@ Skills that run plan reviews (`/plan-*-review`, `/codex review`) include the EXI
|
||||
|
||||
# Setup Browser Cookies
|
||||
|
||||
## 1. Choose the browser
|
||||
## 1. Check for Aside
|
||||
|
||||
Use this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`; otherwise use the installed root containing `bin/gstack-skill-start`, never a generated host stub. Read that root's `browse/SKILL.md` **BROWSER SETUP** section and run its probe first. On `READY`, stop importing: use Aside's sessions or ask the user to sign in there. Otherwise follow the probe's fallback handling, then continue below.
|
||||
Use this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`; otherwise use the installed root containing `bin/gstack-skill-start`, never a generated host stub. Read that root's `browse/SKILL.md` **BROWSER SETUP** section and run its Aside probe.
|
||||
|
||||
## SETUP (run this check BEFORE any browse command)
|
||||
- **Aside probe prints `READY`:** no import is needed, because Aside already has the user's signed-in sessions. Tell the user to use Aside, or to sign in there, and end this skill.
|
||||
- **Any other result:** continue with gstack's own headless browser (`$B`).
|
||||
|
||||
## 2. Get every decision from the user first
|
||||
|
||||
Ask these together, before running any `$B` command. Never guess an answer or treat the default Comet browser as consent.
|
||||
|
||||
1. **Source browser and profile.** `--profile` takes the profile's directory (`Default`, `Profile 2`), not its display name. A profile that cannot be read is unknown, not empty.
|
||||
2. **Domains to import,** and the **target**: one page on a chosen domain that the session should open, by URL.
|
||||
3. **Sign-in verification (`--verify-auth`)?** Default no. It reloads the target and reports **verified** only after a successful same-origin response with exactly one visible element, found by a CSS selector, whose whitespace-normalized text equals the expected identity. If yes, the user supplies the selector and the expected identity privately.
|
||||
4. **Clear stale storage (`--clear-storage`)?** Default no; needs explicit approval. Chromium only. It clears localStorage for the target's origin (shared by that origin's tabs) and sessionStorage for the target tab, and nothing else; other browser engines reject the reset but still import. A failed reset may already have cleared some storage and is not rolled back.
|
||||
5. **Every cookie in the profile (`--all`)?** Default no; needs explicit consent. It cannot be combined with a domain or with clearing storage.
|
||||
|
||||
Use the picker when any of answers 1-2 is still open; it asks for them. Use direct import when the user has named the browser, the profile directory and the domains.
|
||||
|
||||
## 3. Prepare gstack's browser
|
||||
|
||||
1. If the user wants verification, have them set `GSTACK_COOKIE_AUTH_SELECTOR` and `GSTACK_COOKIE_AUTH_EXPECTED_IDENTITY` privately in the shell that runs `$B`. The browser daemon reads them only when it starts, so if a gstack daemon is already running, run `$B stop` first. Never invent the values.
|
||||
2. Follow `browse/SKILL.md`'s **Browser fallback** section to find `$B`, building it if the check prints `NEEDS_SETUP`.
|
||||
3. Run `$B status`. If it reports `Mode: cdp`, `$B` is attached to the user's real browser and already has its sessions: tell the user no import is needed and end this skill.
|
||||
4. Open the target URL from answer 2 and leave that tab alone until the import finishes:
|
||||
|
||||
```bash
|
||||
_ROOT=$(git rev-parse --show-toplevel 2>/dev/null)
|
||||
B=""
|
||||
[ -n "$_ROOT" ] && [ -x "$_ROOT/.claude/skills/gstack/browse/dist/browse" ] && B="$_ROOT/.claude/skills/gstack/browse/dist/browse"
|
||||
[ -z "$B" ] && B="$HOME/.claude/skills/gstack/browse/dist/browse"
|
||||
if [ -x "$B" ] && "${B%/browse/*}/bin/gstack-browser-ensure"; then
|
||||
echo "READY: $B"
|
||||
else
|
||||
echo "NEEDS_SETUP"
|
||||
fi
|
||||
$B goto "<url>"
|
||||
```
|
||||
|
||||
`gstack-browser-ensure` installs Chromium on first use when the install skipped it (lazy browser); it prints `BROWSER_OK` or `BROWSER_UNAVAILABLE <reason>` first.
|
||||
## 4. Import
|
||||
|
||||
If `NEEDS_SETUP`:
|
||||
1. Tell the user: "gstack browse needs a one-time build (~10 seconds). OK to proceed?" Then STOP and wait.
|
||||
2. Run: `cd <SKILL_DIR> && ./setup`
|
||||
3. If `bun` is not installed:
|
||||
```bash
|
||||
if ! command -v bun >/dev/null 2>&1; then
|
||||
BUN_VERSION="1.4.2"
|
||||
BUN_INSTALL_SHA="bab8acfb046aac8c72407bdcce903957665d655d7acaa3e11c7c4616beae68dd"
|
||||
tmpfile=$(mktemp "${TMPDIR:-/tmp}/bun-install.XXXXXX")
|
||||
curl -fsSL "https://bun.sh/install" -o "$tmpfile"
|
||||
# shasum is macOS/perl; coreutils-only Linux ships sha256sum instead —
|
||||
# resolve whichever exists so the verify never fails on a missing tool.
|
||||
if command -v sha256sum >/dev/null 2>&1; then
|
||||
actual_sha=$(sha256sum < "$tmpfile" | awk '{print $(1)}')
|
||||
else
|
||||
actual_sha=$(shasum -a 256 < "$tmpfile" | awk '{print $(1)}')
|
||||
fi
|
||||
if [ "$actual_sha" != "$BUN_INSTALL_SHA" ]; then
|
||||
echo "ERROR: bun install script checksum mismatch" >&2
|
||||
echo " expected: $BUN_INSTALL_SHA" >&2
|
||||
echo " got: $actual_sha" >&2
|
||||
rm "$tmpfile"; exit 1
|
||||
fi
|
||||
bash "$tmpfile" "bun-v$BUN_VERSION"
|
||||
rm "$tmpfile"
|
||||
fi
|
||||
```
|
||||
|
||||
```bash
|
||||
$B status
|
||||
```
|
||||
If status says `Mode: cdp`, stop: the real browser already has sessions.
|
||||
|
||||
## 2. Confirm options before import
|
||||
|
||||
Open the known target and keep its tab unchanged. Both options default off and require explicit request:
|
||||
|
||||
- **`--verify-auth` / picker checkbox:** reloads the target. Have the user privately configure daemon `GSTACK_COOKIE_AUTH_SELECTOR` and `GSTACK_COOKIE_AUTH_EXPECTED_IDENTITY` **before startup**. Never invent values or assume CLI env reconfigures an existing daemon. Missing config rejects before mutation. Require a successful same-origin response and exactly one visible element whose whitespace-normalized text exactly matches the expected identity.
|
||||
- **`--clear-storage`:** for suspected stale storage, obtain explicit approval. Chromium only: clears captured-origin localStorage (shared across same-origin context tabs) and target-tab sessionStorage. Other origins, other tabs' sessionStorage, IndexedDB, and service workers stay intact. It uses an isolated world/native deadline; other engines reject reset, not imports/auth checks. Never auto-approve or claim rollback after partial failure.
|
||||
|
||||
## 3. Select source and scope
|
||||
Picker (the user confirms the browser, profile and domains there, ticks verification if they asked for it, then tells you when done; the link works once, for five minutes, so rerun the command if it expires):
|
||||
|
||||
```bash
|
||||
$B cookie-import-browser
|
||||
```
|
||||
|
||||
Ask the user to choose browser, account/profile, and domains, then say when done. Never guess accounts or treat default Comet as consent. Unreadable profiles are unknown, not empty. Rerun for an expired five-minute one-use link.
|
||||
Direct import: run `$B cookie-import-browser` with the chosen browser name, one `--domain` per run and `--profile` set to the profile directory (not its display name); add `--verify-auth` or `--clear-storage` only if the user said yes in step 2.
|
||||
|
||||
Direct import: pass the chosen browser and `--domain` after navigating to a matching target. `--profile` takes a directory, not a display name; omit only for an unambiguous relevant profile, otherwise use the picker. `--all` requires consent for all non-expired profile cookies; it cannot accompany `--domain` or `--clear-storage`.
|
||||
If the import rejects because verification settings are missing, nothing changed: tell the user which variable is missing and return to step 3. Read that same root's `BROWSER.md`, **Choosing a source and checking sign-in**, for other errors and receipt failure reasons; it has the error tables, examples, profile labels, supported sources and platform setup.
|
||||
|
||||
Read that same root's `BROWSER.md`, **Choosing a source and checking sign-in**, for examples, profile labels, supported sources and platform setup.
|
||||
## 5. Report honestly
|
||||
|
||||
## 4. Report honestly
|
||||
Report from the import receipt, not from raw `$B cookies`, as three lines:
|
||||
|
||||
Report receipt/picker counts, partial/zero/error and reset outcomes, not raw `$B cookies`. Imports affect the context, not one tab. **Not checked** means no requested check; **not verified** means it failed; **verified** requires positive target evidence. Zero imports, counts, or HTTP 200 never prove login.
|
||||
- `Imported: <count> (<imported|partial|empty|failed>, as the receipt says) from <browser> for <domains>`
|
||||
- `Storage reset: <done|failed|not requested>`
|
||||
- `Sign-in: <verified|not verified|not checked>`
|
||||
|
||||
Never request/publish cookie values, passwords, identity/profile text, session details, or raw errors in public logs.
|
||||
**Not checked** means verification was not requested; **not verified** means it ran and failed; **verified** needs the identity match. Cookie counts, zero imports and HTTP 200 never prove sign-in. Imported cookies apply to the whole browser context, not one tab.
|
||||
|
||||
Never request or publish cookie values, passwords, identity or profile text, session details, or raw errors in public logs.
|
||||
|
||||
## Platform boundaries
|
||||
|
||||
|
||||
@@ -21,41 +21,59 @@ allowed-tools:
|
||||
|
||||
# Setup Browser Cookies
|
||||
|
||||
## 1. Choose the browser
|
||||
## 1. Check for Aside
|
||||
|
||||
Use this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`; otherwise use the installed root containing `bin/gstack-skill-start`, never a generated host stub. Read that root's `browse/SKILL.md` **BROWSER SETUP** section and run its probe first. On `READY`, stop importing: use Aside's sessions or ask the user to sign in there. Otherwise follow the probe's fallback handling, then continue below.
|
||||
Use this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`; otherwise use the installed root containing `bin/gstack-skill-start`, never a generated host stub. Read that root's `browse/SKILL.md` **BROWSER SETUP** section and run its Aside probe.
|
||||
|
||||
{{BROWSE_SETUP}}
|
||||
- **Aside probe prints `READY`:** no import is needed, because Aside already has the user's signed-in sessions. Tell the user to use Aside, or to sign in there, and end this skill.
|
||||
- **Any other result:** continue with gstack's own headless browser (`$B`).
|
||||
|
||||
## 2. Get every decision from the user first
|
||||
|
||||
Ask these together, before running any `$B` command. Never guess an answer or treat the default Comet browser as consent.
|
||||
|
||||
1. **Source browser and profile.** `--profile` takes the profile's directory (`Default`, `Profile 2`), not its display name. A profile that cannot be read is unknown, not empty.
|
||||
2. **Domains to import,** and the **target**: one page on a chosen domain that the session should open, by URL.
|
||||
3. **Sign-in verification (`--verify-auth`)?** Default no. It reloads the target and reports **verified** only after a successful same-origin response with exactly one visible element, found by a CSS selector, whose whitespace-normalized text equals the expected identity. If yes, the user supplies the selector and the expected identity privately.
|
||||
4. **Clear stale storage (`--clear-storage`)?** Default no; needs explicit approval. Chromium only. It clears localStorage for the target's origin (shared by that origin's tabs) and sessionStorage for the target tab, and nothing else; other browser engines reject the reset but still import. A failed reset may already have cleared some storage and is not rolled back.
|
||||
5. **Every cookie in the profile (`--all`)?** Default no; needs explicit consent. It cannot be combined with a domain or with clearing storage.
|
||||
|
||||
Use the picker when any of answers 1-2 is still open; it asks for them. Use direct import when the user has named the browser, the profile directory and the domains.
|
||||
|
||||
## 3. Prepare gstack's browser
|
||||
|
||||
1. If the user wants verification, have them set `GSTACK_COOKIE_AUTH_SELECTOR` and `GSTACK_COOKIE_AUTH_EXPECTED_IDENTITY` privately in the shell that runs `$B`. The browser daemon reads them only when it starts, so if a gstack daemon is already running, run `$B stop` first. Never invent the values.
|
||||
2. Follow `browse/SKILL.md`'s **Browser fallback** section to find `$B`, building it if the check prints `NEEDS_SETUP`.
|
||||
3. Run `$B status`. If it reports `Mode: cdp`, `$B` is attached to the user's real browser and already has its sessions: tell the user no import is needed and end this skill.
|
||||
4. Open the target URL from answer 2 and leave that tab alone until the import finishes:
|
||||
|
||||
```bash
|
||||
$B status
|
||||
$B goto "<url>"
|
||||
```
|
||||
If status says `Mode: cdp`, stop: the real browser already has sessions.
|
||||
|
||||
## 2. Confirm options before import
|
||||
## 4. Import
|
||||
|
||||
Open the known target and keep its tab unchanged. Both options default off and require explicit request:
|
||||
|
||||
- **`--verify-auth` / picker checkbox:** reloads the target. Have the user privately configure daemon `GSTACK_COOKIE_AUTH_SELECTOR` and `GSTACK_COOKIE_AUTH_EXPECTED_IDENTITY` **before startup**. Never invent values or assume CLI env reconfigures an existing daemon. Missing config rejects before mutation. Require a successful same-origin response and exactly one visible element whose whitespace-normalized text exactly matches the expected identity.
|
||||
- **`--clear-storage`:** for suspected stale storage, obtain explicit approval. Chromium only: clears captured-origin localStorage (shared across same-origin context tabs) and target-tab sessionStorage. Other origins, other tabs' sessionStorage, IndexedDB, and service workers stay intact. It uses an isolated world/native deadline; other engines reject reset, not imports/auth checks. Never auto-approve or claim rollback after partial failure.
|
||||
|
||||
## 3. Select source and scope
|
||||
Picker (the user confirms the browser, profile and domains there, ticks verification if they asked for it, then tells you when done; the link works once, for five minutes, so rerun the command if it expires):
|
||||
|
||||
```bash
|
||||
$B cookie-import-browser
|
||||
```
|
||||
|
||||
Ask the user to choose browser, account/profile, and domains, then say when done. Never guess accounts or treat default Comet as consent. Unreadable profiles are unknown, not empty. Rerun for an expired five-minute one-use link.
|
||||
Direct import: run `$B cookie-import-browser` with the chosen browser name, one `--domain` per run and `--profile` set to the profile directory (not its display name); add `--verify-auth` or `--clear-storage` only if the user said yes in step 2.
|
||||
|
||||
Direct import: pass the chosen browser and `--domain` after navigating to a matching target. `--profile` takes a directory, not a display name; omit only for an unambiguous relevant profile, otherwise use the picker. `--all` requires consent for all non-expired profile cookies; it cannot accompany `--domain` or `--clear-storage`.
|
||||
If the import rejects because verification settings are missing, nothing changed: tell the user which variable is missing and return to step 3. Read that same root's `BROWSER.md`, **Choosing a source and checking sign-in**, for other errors and receipt failure reasons; it has the error tables, examples, profile labels, supported sources and platform setup.
|
||||
|
||||
Read that same root's `BROWSER.md`, **Choosing a source and checking sign-in**, for examples, profile labels, supported sources and platform setup.
|
||||
## 5. Report honestly
|
||||
|
||||
## 4. Report honestly
|
||||
Report from the import receipt, not from raw `$B cookies`, as three lines:
|
||||
|
||||
Report receipt/picker counts, partial/zero/error and reset outcomes, not raw `$B cookies`. Imports affect the context, not one tab. **Not checked** means no requested check; **not verified** means it failed; **verified** requires positive target evidence. Zero imports, counts, or HTTP 200 never prove login.
|
||||
- `Imported: <count> (<imported|partial|empty|failed>, as the receipt says) from <browser> for <domains>`
|
||||
- `Storage reset: <done|failed|not requested>`
|
||||
- `Sign-in: <verified|not verified|not checked>`
|
||||
|
||||
Never request/publish cookie values, passwords, identity/profile text, session details, or raw errors in public logs.
|
||||
**Not checked** means verification was not requested; **not verified** means it ran and failed; **verified** needs the identity match. Cookie counts, zero imports and HTTP 200 never prove sign-in. Imported cookies apply to the whole browser context, not one tab.
|
||||
|
||||
Never request or publish cookie values, passwords, identity or profile text, session details, or raw errors in public logs.
|
||||
|
||||
## Platform boundaries
|
||||
|
||||
|
||||
@@ -180,14 +180,14 @@ TODO: consider migrating this example to a larger configuration framework.
|
||||
name: 'codex-sol-scope-termination',
|
||||
suite: 'codex-e2e-sol-scope',
|
||||
budgetMs: CAPTURE_MS,
|
||||
model: 'gpt-5.6-sol',
|
||||
model: 'gpt-6.1-sol',
|
||||
outputLimit: Infinity,
|
||||
run: (signal) => runCodexSkill({
|
||||
skillDir,
|
||||
skillName: 'gstack-investigate',
|
||||
cwd: scratch,
|
||||
sandbox: 'workspace-write',
|
||||
model: 'gpt-5.6-sol',
|
||||
model: 'gpt-6.1-sol',
|
||||
configOverrides: ['model_reasoning_effort="high"'],
|
||||
ignoreUserConfig: true,
|
||||
timeoutMs: CODEX_TIMEOUT_MS,
|
||||
|
||||
@@ -37,6 +37,8 @@ describe('Remaining Work provenance contract', () => {
|
||||
expect(table).toContain('`Open.`');
|
||||
expect(table).toContain('`[done]`');
|
||||
expect(table.indexOf('a writing step')).toBeLessThan(table.indexOf('names a concrete path'));
|
||||
expect(table).toContain('**Markers stay English literals.**');
|
||||
expect(table).toContain('**Decisions Made and file claims.**');
|
||||
const format = between(save, '### Remaining Work', '### Notes');
|
||||
expect(format).toContain('`Open.`');
|
||||
});
|
||||
@@ -49,6 +51,8 @@ describe('Remaining Work provenance contract', () => {
|
||||
for (const marker of ['(path assumed)', '(code read)']) expect(verifyFirst).toContain(`\`${marker}\``);
|
||||
expect(verifyFirst).toContain('reports a failure');
|
||||
expect(verifyFirst).toContain('has no marker');
|
||||
expect(verifyFirst).toContain('translated or unknown marker');
|
||||
expect(restore).toContain('**No useful branch discriminator.**');
|
||||
const nextSteps = between(rules, 'Every other item goes under **Next steps**', 'Verifying means');
|
||||
for (const marker of ['(path run)', '(path read)', '(target state checked)']) expect(nextSteps).toContain(`\`${marker}\``);
|
||||
expect(rules).toContain(
|
||||
|
||||
@@ -244,8 +244,8 @@ describe('cookie workflow judge input', () => {
|
||||
expect(body).toContain('Use this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`');
|
||||
expect(body).toContain('the installed root containing `bin/gstack-skill-start`, never a generated host stub');
|
||||
expect(body).toContain("Read that root's `browse/SKILL.md`");
|
||||
expect(body).toContain('On `READY`, stop importing');
|
||||
expect(body.indexOf('**BROWSER SETUP**')).toBeLessThan(body.indexOf('## SETUP'));
|
||||
expect(body).toContain('**Aside probe prints `READY`:** no import is needed');
|
||||
expect(body.indexOf('**BROWSER SETUP**')).toBeLessThan(body.indexOf('**Browser fallback**'));
|
||||
expect(body).toContain("Read that same root's `BROWSER.md`, **Choosing a source and checking sign-in**");
|
||||
expect(body).not.toContain('../BROWSER.md');
|
||||
}
|
||||
|
||||
@@ -76,10 +76,16 @@ describe('engineering review routing contracts', () => {
|
||||
test('high complexity stops before Section 1 and asks cuts and structure separately', () => {
|
||||
expectMentions(compact(complexity), [['stop', 'classes/services', 'section']], 'compact(complexity)');
|
||||
ordered(compact(complexity), ['1. Explain the complexity', 'Ask each proposed feature cut/deferral separately',
|
||||
'2. Always ask the structure question', '3. Save the actual feature and structure answers']);
|
||||
'2. Always resolve the structure question', '3. Save the actual feature and structure answers']);
|
||||
expect(compact(complexity)).toContain('Pending remedies not decided here: <ids>');
|
||||
});
|
||||
|
||||
test('the structure question uses its registered id and honors a stored preference', () => {
|
||||
ordered(compact(complexity), ['2. Always resolve the structure question',
|
||||
'as question_id `plan-eng-review-structure` (no per-plan slug)', '`AUTO_DECIDE` picks the recommendation',
|
||||
'Compare only the file/class arrangement']);
|
||||
});
|
||||
|
||||
test('no safe smaller arrangement does not authorize scope cuts or bypass the pause', () => {
|
||||
ordered(compact(complexity), ['If no smaller arrangement preserves these commitments',
|
||||
'A pause leaves the arrangement undecided', 'Do not continue to C until it is settled']);
|
||||
|
||||
Vendored
+6
-6
@@ -202,7 +202,7 @@ export const OVERLAY_FIXTURES: OverlayFixture[] = [
|
||||
{
|
||||
id: 'claude-dedicated-tools-vs-bash',
|
||||
overlayPath: 'model-overlays/claude.md',
|
||||
model: 'claude-opus-4-7',
|
||||
model: 'claude-opus-5-5',
|
||||
trials: 10,
|
||||
concurrency: 3,
|
||||
direction: 'lower_is_better',
|
||||
@@ -241,7 +241,7 @@ export const OVERLAY_FIXTURES: OverlayFixture[] = [
|
||||
{
|
||||
id: 'opus-4-7-effort-match-trivial',
|
||||
overlayPath: 'model-overlays/opus-4-7.md',
|
||||
model: 'claude-opus-4-7',
|
||||
model: 'claude-opus-5-5',
|
||||
trials: 10,
|
||||
concurrency: 3,
|
||||
direction: 'lower_is_better',
|
||||
@@ -269,7 +269,7 @@ export const OVERLAY_FIXTURES: OverlayFixture[] = [
|
||||
{
|
||||
id: 'opus-4-7-literal-interpretation',
|
||||
overlayPath: 'model-overlays/opus-4-7.md',
|
||||
model: 'claude-opus-4-7',
|
||||
model: 'claude-opus-5-5',
|
||||
trials: 10,
|
||||
concurrency: 3,
|
||||
direction: 'higher_is_better',
|
||||
@@ -290,16 +290,16 @@ export const OVERLAY_FIXTURES: OverlayFixture[] = [
|
||||
},
|
||||
|
||||
// =========================================================================
|
||||
// Sonnet 4.6 variants of the Opus-4.7 fixtures.
|
||||
// Sonnet 5.5 variant of the Opus 5.5 dedicated-tools fixture.
|
||||
//
|
||||
// Same overlays, prompts, metrics and trial counts; different pinned model.
|
||||
// Same overlay, prompt, metric and trial count; different pinned model.
|
||||
// Model effects remain separate instead of pooling their observations.
|
||||
// =========================================================================
|
||||
|
||||
{
|
||||
id: 'claude-dedicated-tools-vs-bash-sonnet',
|
||||
overlayPath: 'model-overlays/claude.md',
|
||||
model: 'claude-sonnet-4-6',
|
||||
model: 'claude-sonnet-5-5',
|
||||
trials: 10,
|
||||
concurrency: 3,
|
||||
direction: 'lower_is_better',
|
||||
|
||||
@@ -132,6 +132,57 @@ describe('--check with preferences set', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// The global file ($GSTACK_HOME/global-question-preferences.json, the same file
|
||||
// the question-preference hook reads) is a hand-edited fallback for --check
|
||||
// only: one setting covers every project, a project entry for the same id
|
||||
// wins, and the one-way / split-chain guards still run.
|
||||
describe('--check global preference fallback', () => {
|
||||
function plantGlobal(contents: string) {
|
||||
fs.writeFileSync(path.join(tmpHome, 'global-question-preferences.json'), contents);
|
||||
}
|
||||
|
||||
test('global never-ask with no project entry → AUTO_DECIDE', () => {
|
||||
plantGlobal(JSON.stringify({ 'plan-eng-review-structure': 'never-ask' }));
|
||||
const r = run('--check', 'plan-eng-review-structure');
|
||||
expect(r.status).toBe(0);
|
||||
expect(r.stdout.trim()).toBe('AUTO_DECIDE');
|
||||
});
|
||||
|
||||
test('project entry wins over the global entry', () => {
|
||||
plantGlobal(JSON.stringify({ 'plan-eng-review-structure': 'never-ask' }));
|
||||
run('--write', JSON.stringify({ question_id: 'plan-eng-review-structure', preference: 'always-ask', source: 'plan-tune' }));
|
||||
const r = run('--check', 'plan-eng-review-structure');
|
||||
expect(r.stdout.trim()).toBe('ASK_NORMALLY');
|
||||
});
|
||||
|
||||
test('global never-ask on a one-way id → ASK_NORMALLY with safety note', () => {
|
||||
plantGlobal(JSON.stringify({ 'ship-test-failure-triage': 'never-ask' }));
|
||||
const r = run('--check', 'ship-test-failure-triage');
|
||||
expect(r.stdout).toContain('ASK_NORMALLY');
|
||||
expect(r.stdout).toContain('one-way door overrides');
|
||||
});
|
||||
|
||||
test('global never-ask on a split-chain id → ASK_NORMALLY', () => {
|
||||
plantGlobal(JSON.stringify({ 'plan-eng-review-split-option-a': 'never-ask' }));
|
||||
const r = run('--check', 'plan-eng-review-split-option-a');
|
||||
expect(r.stdout.split('\n')[0]).toBe('ASK_NORMALLY');
|
||||
});
|
||||
|
||||
test.each(['{not json', 'null', '["never-ask"]'])('unusable global file %p is ignored with a note', (contents) => {
|
||||
plantGlobal(contents);
|
||||
const r = run('--check', 'plan-eng-review-structure');
|
||||
expect(r.status).toBe(0);
|
||||
expect(r.stdout.trim()).toBe('ASK_NORMALLY');
|
||||
expect(r.stderr).toContain('global-question-preferences.json is unreadable');
|
||||
});
|
||||
|
||||
test('--write stays per-project and never touches the global file', () => {
|
||||
plantGlobal('{}');
|
||||
run('--write', JSON.stringify({ question_id: 'plan-eng-review-structure', preference: 'never-ask', source: 'plan-tune' }));
|
||||
expect(fs.readFileSync(path.join(tmpHome, 'global-question-preferences.json'), 'utf-8')).toBe('{}');
|
||||
});
|
||||
});
|
||||
|
||||
// #2024: the keyword net only fires when the question TEXT reaches the
|
||||
// classifier. --summary-stdin pipes it (stdin, not argv — summaries carry
|
||||
// quotes/newlines/shell metacharacters). Without the summary, an unregistered
|
||||
|
||||
@@ -4,7 +4,7 @@ import { join } from 'node:path';
|
||||
import { buildWorkflowJudgePrompt, type WorkflowJudgeFile, type WorkflowJudgeInput } from './workflow-judge-input';
|
||||
|
||||
export const COOKIE_WORKFLOW_JUDGE = {
|
||||
model: 'claude-sonnet-4-6',
|
||||
model: 'claude-sonnet-5-5',
|
||||
judgeContext: 'a fallback-browser cookie import workflow',
|
||||
judgeGoal: 'how to select an authorized source browser, profile, and domain without guessing an account; configure optional authentication verification before mutation; obtain explicit consent for precisely scoped storage reset; distinguish copied cookies from positive sign-in evidence; and recover within the documented platform and privacy boundaries',
|
||||
thresholds: { clarity: 4, completeness: 3, actionability: 4 },
|
||||
|
||||
@@ -46,14 +46,31 @@ const LATER_ENTRYPOINT_EDITS: Array<[string, string]> = [
|
||||
['bash "$tmpfile" "bun-v$BUN_VERSION"', 'BUN_VERSION="$BUN_VERSION" bash "$tmpfile"'],
|
||||
];
|
||||
|
||||
// The GSTA-49 cookie-workflow repair rewrote the entrypoint's steps 1-5 (split
|
||||
// the two probe READY outcomes, dropped the duplicate SETUP block for the browse
|
||||
// fallback, moved source selection before the target, asked about verification
|
||||
// before the daemon starts, added a report shape) and one BROWSER.md comment.
|
||||
// Reversing it first restores the pre-repair text, which the edits below then
|
||||
// take back further.
|
||||
const LATER_COOKIE_ORDER_EDITS: Array<[string, string]> = [
|
||||
["## 1. Check for Aside\n\nUse this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`; otherwise use the installed root containing `bin/gstack-skill-start`, never a generated host stub. Read that root's `browse/SKILL.md` **BROWSER SETUP** section and run its Aside probe.\n\n- **Aside probe prints `READY`:** no import is needed, because Aside already has the user's signed-in sessions. Tell the user to use Aside, or to sign in there, and end this skill.\n- **Any other result:** continue with gstack's own headless browser (`$B`).\n\n## 2. Get every decision from the user first\n\nAsk these together, before running any `$B` command. Never guess an answer or treat the default Comet browser as consent.\n\n1. **Source browser and profile.** `--profile` takes the profile's directory (`Default`, `Profile 2`), not its display name. A profile that cannot be read is unknown, not empty.\n2. **Domains to import,** and the **target**: one page on a chosen domain that the session should open, by URL.\n3. **Sign-in verification (`--verify-auth`)?** Default no. It reloads the target and reports **verified** only after a successful same-origin response with exactly one visible element, found by a CSS selector, whose whitespace-normalized text equals the expected identity. If yes, the user supplies the selector and the expected identity privately.\n4. **Clear stale storage (`--clear-storage`)?** Default no; needs explicit approval. Chromium only. It clears localStorage for the target's origin (shared by that origin's tabs) and sessionStorage for the target tab, and nothing else; other browser engines reject the reset but still import. A failed reset may already have cleared some storage and is not rolled back.\n5. **Every cookie in the profile (`--all`)?** Default no; needs explicit consent. It cannot be combined with a domain or with clearing storage.\n\nUse the picker when any of answers 1-2 is still open; it asks for them. Use direct import when the user has named the browser, the profile directory and the domains.\n\n## 3. Prepare gstack's browser\n\n1. If the user wants verification, have them set `GSTACK_COOKIE_AUTH_SELECTOR` and `GSTACK_COOKIE_AUTH_EXPECTED_IDENTITY` privately in the shell that runs `$B`. The browser daemon reads them only when it starts, so if a gstack daemon is already running, run `$B stop` first. Never invent the values.\n2. Follow `browse/SKILL.md`'s **Browser fallback** section to find `$B`, building it if the check prints `NEEDS_SETUP`.\n3. Run `$B status`. If it reports `Mode: cdp`, `$B` is attached to the user's real browser and already has its sessions: tell the user no import is needed and end this skill.\n4. Open the target URL from answer 2 and leave that tab alone until the import finishes:\n\n```bash\n$B goto \"<url>\"\n```\n\n## 4. Import\n\nPicker (the user confirms the browser, profile and domains there, ticks verification if they asked for it, then tells you when done; the link works once, for five minutes, so rerun the command if it expires):\n\n```bash\n$B cookie-import-browser\n```\n\nDirect import: run `$B cookie-import-browser` with the chosen browser name, one `--domain` per run and `--profile` set to the profile directory (not its display name); add `--verify-auth` or `--clear-storage` only if the user said yes in step 2.\n\nIf the import rejects because verification settings are missing, nothing changed: tell the user which variable is missing and return to step 3. Read that same root's `BROWSER.md`, **Choosing a source and checking sign-in**, for other errors and receipt failure reasons; it has the error tables, examples, profile labels, supported sources and platform setup.\n\n## 5. Report honestly\n\nReport from the import receipt, not from raw `$B cookies`, as three lines:\n\n- `Imported: <count> (<imported|partial|empty|failed>, as the receipt says) from <browser> for <domains>`\n- `Storage reset: <done|failed|not requested>`\n- `Sign-in: <verified|not verified|not checked>`\n\n**Not checked** means verification was not requested; **not verified** means it ran and failed; **verified** needs the identity match. Cookie counts, zero imports and HTTP 200 never prove sign-in. Imported cookies apply to the whole browser context, not one tab.\n\nNever request or publish cookie values, passwords, identity or profile text, session details, or raw errors in public logs.\n\n## Platform boundaries", "## 1. Choose the browser\n\nUse this checkout as the gstack root if it contains `BROWSER.md` and `browse/SKILL.md`; otherwise use the installed root containing `bin/gstack-skill-start`, never a generated host stub. Read that root's `browse/SKILL.md` **BROWSER SETUP** section and run its probe first. On `READY`, stop importing: use Aside's sessions or ask the user to sign in there. Otherwise follow the probe's fallback handling, then continue below.\n\n## SETUP (run this check BEFORE any browse command)\n\n```bash\n_ROOT=$(git rev-parse --show-toplevel 2>/de
Line truncated
|
||||
["# view the page; only --verify-auth proves sign-in", "# confirm the intended account"],
|
||||
];
|
||||
|
||||
export function approvedCookieWorkflowSource(source: string): string {
|
||||
let removedLines = 0;
|
||||
let removedEntrypointLines = 0;
|
||||
let historical = source
|
||||
let reordered = source;
|
||||
for (const [later, earlier] of LATER_COOKIE_ORDER_EDITS) {
|
||||
if (!reordered.includes(later)) continue;
|
||||
removedEntrypointLines += later.split('\n').length - earlier.split('\n').length;
|
||||
reordered = reordered.replace(later, earlier);
|
||||
}
|
||||
let historical = reordered
|
||||
.replace('sha256sum < "$tmpfile" | awk \'{print $(1)}\'', 'sha256sum "$tmpfile" | awk \'{print $1}\'')
|
||||
.replace('shasum -a 256 < "$tmpfile" | awk \'{print $(1)}\'', 'shasum -a 256 "$tmpfile" | awk \'{print $1}\'')
|
||||
.replace(LATER_BROWSER_BLOCK, block => { removedLines = block.split('\n').length - 1; return ''; })
|
||||
.replace(LATER_ENTRYPOINT_BLOCK, block => { removedEntrypointLines = block.split('\n').length - 1; return ''; });
|
||||
.replace(LATER_ENTRYPOINT_BLOCK, block => { removedEntrypointLines += block.split('\n').length - 1; return ''; });
|
||||
for (const [later, earlier] of [...LATER_BROWSER_EDITS, ...LATER_PREAMBLE_EDITS, ...LATER_WAVE_EDITS, ...LATER_ENTRYPOINT_EDITS]) historical = historical.replace(later, earlier);
|
||||
return historical
|
||||
.replace(/(--- BEGIN FILE "BROWSER\.md" \(lines \d+-)(\d+)(; section\) ---)/, (_, head, end, tail) => `${head}${Number(end) - removedLines}${tail}`)
|
||||
|
||||
@@ -654,7 +654,7 @@ describe('Plan format actual capture and judge lifecycle', () => {
|
||||
const starts = events.filter(event => event.kind === 'start');
|
||||
expect(starts.map(({ timeout, maxTurns, model }) => ({ timeout, maxTurns, model })))
|
||||
.toEqual([1, 2].map(() => ({ timeout: 300, maxTurns: 10,
|
||||
model: file.includes('plan-prosons') ? 'claude-opus-4-7' : resolveEvalModel('capture') })));
|
||||
model: resolveEvalModel('capture') })));
|
||||
expect(events.filter(event => event.kind === 'ready').map(event => event.fixtureExists)).toEqual([true, true]);
|
||||
expect(entries).toHaveLength(2);
|
||||
expect(entries.map(entry => entry.attempt)).toEqual([1, 2]);
|
||||
|
||||
@@ -2,6 +2,7 @@ import { expect, test } from 'bun:test';
|
||||
import * as fs from 'node:fs';
|
||||
import * as path from 'node:path';
|
||||
import { CAPTURE_MS, CAPTURE_LONG_MS } from './helpers/eval-budgets';
|
||||
import { resolveEvalModel } from '../lib/eval-model';
|
||||
const source = fs.readFileSync(path.join(import.meta.dir, 'skill-e2e-office-hours-phase4.test.ts'), 'utf8');
|
||||
const question = (word = 'architectural', options = 'A) Put retrieval on the server\nB) Put retrieval on the client') =>
|
||||
`Where should retrieval live?\nThis ${word} choice decides which component owns the retrieval algorithm and the cross-host API contract.\n${options}\nRecommendation: A because all hosts need a consistent algorithm with one owner.\n`;
|
||||
@@ -19,7 +20,7 @@ async function runCaller(captured: string | undefined, scenario: 'success' | 'ti
|
||||
const result = { exitReason: scenario === 'timeout' ? 'timeout' : 'success', browseErrors: [], durationMs: 123, costUsd: 0.1, output: 'public completion' };
|
||||
const args: Record<string,any> = {
|
||||
expect, beforeAll: (fn: () => void) => setups.push(fn), afterAll: (fn: () => Promise<void>) => finalizers.push(fn),
|
||||
CAPTURE_MS, CAPTURE_LONG_MS, ROOT: sourceRoot, runId: 'synthetic-run',
|
||||
CAPTURE_MS, CAPTURE_LONG_MS, resolveEvalModel, ROOT: sourceRoot, runId: 'synthetic-run',
|
||||
describeIfSelected: (_title: string, _names: string[], fn: () => void) => fn(),
|
||||
testConcurrentIfSelected: (name: string, fn: () => Promise<void>, timeout: number) => { expect(name).toBe('office-hours-phase4-fork'); expect(timeout).toBe(CAPTURE_LONG_MS); callbacks.push(fn); },
|
||||
createEvalCollector: () => collector, finalizeEvalCollector: async () => {}, logCost: () => {},
|
||||
@@ -35,7 +36,7 @@ async function runCaller(captured: string | undefined, scenario: 'success' | 'ti
|
||||
fs: { mkdtempSync:(prefix:string)=>prefix+'owned', mkdirSync:()=>{}, rmSync:()=>{}, existsSync:(name:string)=>files.has(name),
|
||||
writeFileSync:(name:string,body:string)=>files.set(name,body), readFileSync:(name:string)=>name===fixturePath.join(sourceRoot,'office-hours','SKILL.md') ? '## AskUserQuestion Format\nformat\n## Phase 4: Alternatives Generation\nworkflow\n## Phase 4.5\nnext' : files.get(name) },
|
||||
runSkillTest: async (opts: any) => {
|
||||
calls.push(opts); expect(opts.timeout).toBe(CAPTURE_MS); expect(opts.maxTurns).toBe(12); expect(opts.model).toBe('claude-opus-4-7');
|
||||
calls.push(opts); expect(opts.timeout).toBe(CAPTURE_MS); expect(opts.maxTurns).toBe(12); expect(opts.model).toBe(resolveEvalModel('capture'));
|
||||
expect(opts.prompt).toContain('Do NOT call any tool to ask the user.');
|
||||
if (captured !== undefined) files.set(fixturePath.join(opts.workingDirectory, 'phase4-capture.md'), captured);
|
||||
return result;
|
||||
|
||||
@@ -28,7 +28,7 @@ test('every fixture owns one paid wrapper; public models/trials/concurrency/turn
|
||||
expect(isPaidTestFile('test/overlay-lifecycle.test.ts')).toBe(false);
|
||||
expect(OVERLAY_FIXTURES.every(f => f.trials === 10 && f.concurrency === 3)).toBe(true);
|
||||
expect(OVERLAY_FIXTURES.map(f => f.maxTurns ?? 5)).toEqual([15,8,15,15,15]);
|
||||
expect(OVERLAY_FIXTURES.map(f => f.model)).toEqual([...Array(3).fill('claude-opus-4-7'), 'claude-sonnet-4-6', 'claude-opus-5-5']);
|
||||
expect(OVERLAY_FIXTURES.map(f => f.model)).toEqual([...Array(3).fill('claude-opus-5-5'), 'claude-sonnet-5-5', 'claude-opus-5-5']);
|
||||
expect([OVERLAY_CASE_WORK_MS, OVERLAY_RECORD_GRACE_MS, OVERLAY_CASE_OUTER_MS, OVERLAY_MIN_FILE_WALL_MS]).toEqual([1_800_000, 5_000, 1_810_000, 1_830_000]);
|
||||
});
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ describe('SDK overlay measurements', () => {
|
||||
});
|
||||
|
||||
describe('correctness versus efficacy', () => {
|
||||
describe.each(['claude-opus-4-7', 'claude-sonnet-4-6'])('dedicated-tool gate for %s', (model) => {
|
||||
describe.each(['claude-opus-5-5', 'claude-sonnet-5-5'])('dedicated-tool gate for %s', (model) => {
|
||||
const f = { ...OVERLAY_FIXTURES.find(f => f.metricName === 'bash_tool_calls' && f.model === model)!, trials: 3 };
|
||||
// Contract v4: a trial whose final JSON fails the fixture's verify is a valid
|
||||
// measurement with a wrong answer, not an invalid measurement.
|
||||
@@ -276,9 +276,8 @@ describe('literal fixture task correctness', () => {
|
||||
expect(OVERLAY_FIXTURES).toHaveLength(5);
|
||||
expect(OVERLAY_FIXTURES.some((f) => f.id.includes('fanout') || f.comparison?.unsupportedHypothesis)).toBe(false);
|
||||
expect(OVERLAY_FIXTURES.every((f) => f.trials === 10 && f.comparison)).toBe(true);
|
||||
expect(OVERLAY_FIXTURES.filter((f) => f.model === 'claude-opus-4-7')).toHaveLength(3);
|
||||
expect(OVERLAY_FIXTURES.filter((f) => f.model === 'claude-sonnet-4-6')).toHaveLength(1);
|
||||
expect(OVERLAY_FIXTURES.filter((f) => f.model === 'claude-opus-5-5')).toHaveLength(1);
|
||||
expect(OVERLAY_FIXTURES.filter((f) => f.model === 'claude-opus-5-5')).toHaveLength(4);
|
||||
expect(OVERLAY_FIXTURES.filter((f) => f.model === 'claude-sonnet-5-5')).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ test('Eng loads its one remedy procedure before Scope Challenge findings and ret
|
||||
const scope = compactProse(sections.slice(sections.indexOf('## Scope Challenge'), sections.indexOf('## Review Sections')));
|
||||
expectAll(scope, [/decision-brief format for this complexity gate/i,
|
||||
/ask each proposed feature cut\/deferral separately; wait before changing scope/i,
|
||||
/unapproved fixes stay pending/i, /always ask the structure question when this gate trips/i,
|
||||
/unapproved fixes stay pending/i, /always resolve the structure question when this gate trips/i,
|
||||
/offer confirmation of the original arrangement or a pause to investigate a smaller one\. wait for the answer/i,
|
||||
/apply only accepted scope changes/i, /"No issues found" for an empty list/i, /findings and scope answers approve no remedies/i]);
|
||||
const complexityRule = at(scope, /initial scope selectors need no grid or \*\*pre-answer\*\* ledger write/i);
|
||||
|
||||
@@ -124,7 +124,7 @@ Write DESIGN.md and CLAUDE.md (or update it) in the working directory.`,
|
||||
timeout: CAPTURE_LONG_MS,
|
||||
testName: 'design-consultation-core',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/design-consultation core', result);
|
||||
@@ -298,7 +298,7 @@ Run Phase 0's DESIGN.md format check exactly as written (the gstack bin director
|
||||
timeout: CAPTURE_LONG_MS,
|
||||
testName: 'design-consultation-existing',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/design-consultation existing', result);
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
import { expect, beforeAll, afterAll } from 'bun:test';
|
||||
import { CAPTURE_MS, CAPTURE_LONG_MS } from './helpers/eval-budgets';
|
||||
import { runSkillTest } from './helpers/session-runner';
|
||||
import { resolveEvalModel } from '../lib/eval-model';
|
||||
import type { EvalTestEntry } from './helpers/eval-store';
|
||||
import {
|
||||
ROOT, runId,
|
||||
@@ -166,7 +167,7 @@ After writing the file with that ONE Phase 4 question, stop. Do not continue to
|
||||
timeout: CAPTURE_MS,
|
||||
testName: 'office-hours-phase4-fork',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/office-hours Phase 4 fork', result);
|
||||
|
||||
@@ -30,6 +30,7 @@ import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
|
||||
import { CAPTURE_MS } from './helpers/eval-budgets';
|
||||
import { NEUTRAL_POSTURE_RE } from './helpers/prosons-posture';
|
||||
import { runSkillTest } from './helpers/session-runner';
|
||||
import { resolveEvalModel } from '../lib/eval-model';
|
||||
import { runRecordedOfficeHoursAttempt, OFFICE_HOURS_BUN_GRACE_MS } from './helpers/office-hours-attempt';
|
||||
import {
|
||||
ROOT, runId,
|
||||
@@ -134,7 +135,7 @@ function setupPlanDir(tmpPrefix: string, planContent: string, skillName: string)
|
||||
}
|
||||
|
||||
function captureInstruction(outFile: string): string {
|
||||
return `Write the verbatim text of the single AskUserQuestion you would have made to ${outFile} (full text including D<N> header, ELI10, Stakes, Recommendation, Pros/cons, and Net line — the complete rich markdown body). Do NOT call any tool to ask the user. Do NOT paraphrase. This is a format-capture test.`;
|
||||
return `Write the text of the single AskUserQuestion you would have made to ${outFile} (full text including D<N> header, ELI10, Stakes, Recommendation, Pros/cons, and Net line — the complete rich markdown body). Do NOT call any tool to ask the user.`;
|
||||
}
|
||||
|
||||
// --- Case 1: Format positive — all v1.7.0.0 tokens present ---
|
||||
@@ -155,7 +156,7 @@ describeIfSelected('Plan Prosons — Format Positive', ['plan-review-prosons-for
|
||||
testConcurrentIfSelected('plan-review-prosons-format', async () => {
|
||||
await runRecordedOfficeHoursAttempt({
|
||||
collector: evalCollector, name: '/plan-review-prosons-format', suite: 'Plan Prosons — Format Positive',
|
||||
model: 'claude-opus-4-7', budgetMs: CAPTURE_MS,
|
||||
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
||||
run: signal => runSkillTest({
|
||||
signal,
|
||||
prompt: `Read plan-ceo-review/SKILL.md for the review workflow.
|
||||
@@ -170,7 +171,7 @@ After writing the file, stop.`,
|
||||
timeout: CAPTURE_MS,
|
||||
testName: 'plan-review-prosons-format',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
}),
|
||||
validate: async (result, signal) => {
|
||||
logCost('/plan-review prosons format positive', result);
|
||||
@@ -217,7 +218,7 @@ describeIfSelected('Plan Prosons — Hard-stop Negative', ['plan-review-prosons-
|
||||
testConcurrentIfSelected('plan-review-prosons-hardstop-neg', async () => {
|
||||
await runRecordedOfficeHoursAttempt({
|
||||
collector: evalCollector, name: '/plan-review-prosons-hardstop-neg', suite: 'Plan Prosons — Hard-stop Negative',
|
||||
model: 'claude-opus-4-7', budgetMs: CAPTURE_MS,
|
||||
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
||||
run: signal => runSkillTest({
|
||||
signal,
|
||||
prompt: `Read plan-ceo-review/SKILL.md.
|
||||
@@ -232,7 +233,7 @@ After writing the file, stop.`,
|
||||
timeout: CAPTURE_MS,
|
||||
testName: 'plan-review-prosons-hardstop-neg',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
}),
|
||||
validate: async (result, signal) => {
|
||||
logCost('/plan-review prosons hard-stop negative', result);
|
||||
@@ -270,7 +271,7 @@ describeIfSelected('Plan Prosons — Neutral-posture Negative', ['plan-review-pr
|
||||
testConcurrentIfSelected('plan-review-prosons-neutral-neg', async () => {
|
||||
await runRecordedOfficeHoursAttempt({
|
||||
collector: evalCollector, name: '/plan-review-prosons-neutral-neg', suite: 'Plan Prosons — Neutral Negative',
|
||||
model: 'claude-opus-4-7', budgetMs: CAPTURE_MS,
|
||||
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
||||
run: signal => runSkillTest({
|
||||
signal,
|
||||
prompt: `Read plan-ceo-review/SKILL.md.
|
||||
@@ -285,7 +286,7 @@ After writing the file, stop.`,
|
||||
timeout: CAPTURE_MS,
|
||||
testName: 'plan-review-prosons-neutral-neg',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
}),
|
||||
validate: async (result, signal) => {
|
||||
logCost('/plan-review prosons neutral negative', result);
|
||||
@@ -324,7 +325,7 @@ describeIfSelected('Plan Prosons — Hard-stop Positive', ['plan-ceo-review-pros
|
||||
testConcurrentIfSelected('plan-ceo-review-prosons-cadence', async () => {
|
||||
await runRecordedOfficeHoursAttempt({
|
||||
collector: evalCollector, name: '/plan-ceo-review-prosons-cadence', suite: 'Plan Prosons — Hard-stop Positive',
|
||||
model: 'claude-opus-4-7', budgetMs: CAPTURE_MS,
|
||||
model: resolveEvalModel('capture'), budgetMs: CAPTURE_MS,
|
||||
run: signal => runSkillTest({
|
||||
signal,
|
||||
prompt: `Read plan-ceo-review/SKILL.md.
|
||||
@@ -339,7 +340,7 @@ After writing the file, stop.`,
|
||||
timeout: CAPTURE_MS,
|
||||
testName: 'plan-ceo-review-prosons-cadence',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
}),
|
||||
validate: async (result, signal) => {
|
||||
logCost('/plan-review prosons hard-stop positive', result);
|
||||
|
||||
@@ -91,7 +91,7 @@ Focus on reviewing the plan content: architecture, error handling, security, and
|
||||
timeout: 540_000,
|
||||
testName: 'plan-ceo-review',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/plan-ceo-review', result);
|
||||
@@ -178,7 +178,7 @@ Focus on reviewing the plan content: architecture, error handling, security, and
|
||||
timeout: CAPTURE_LONG_MS,
|
||||
testName: 'plan-ceo-review-selective',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/plan-ceo-review (SELECTIVE)', result);
|
||||
@@ -246,7 +246,7 @@ Write your expansion proposals to ${planDir}/proposals.md with ONLY the proposal
|
||||
timeout: CAPTURE_LONG_MS,
|
||||
testName: 'plan-ceo-review-expansion-energy',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/plan-ceo-review (EXPANSION ENERGY)', result);
|
||||
@@ -355,7 +355,7 @@ Focus on architecture, code quality, tests, and performance sections.`,
|
||||
timeout: CAPTURE_LONG_MS,
|
||||
testName: 'plan-eng-review',
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost('/plan-eng-review', result);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
|
||||
import { CAPTURE_MS, CAPTURE_LONG_MS } from './helpers/eval-budgets';
|
||||
import { runSkillTest } from './helpers/session-runner';
|
||||
import { resolveEvalModel } from '../lib/eval-model';
|
||||
import { outcomeJudge } from './helpers/llm-judge';
|
||||
import { judgePassed } from './helpers/eval-store';
|
||||
import {
|
||||
@@ -108,7 +109,7 @@ CRITICAL RULES:
|
||||
timeout: CAPTURE_MS,
|
||||
testName: `qa-${label}`,
|
||||
runId,
|
||||
model: 'claude-opus-4-7',
|
||||
model: resolveEvalModel('capture'),
|
||||
});
|
||||
|
||||
logCost(`/qa ${label}`, result);
|
||||
|
||||
@@ -75,7 +75,7 @@ for (const host of ['claude', 'codex'] as const) for (const args of [[], tenArgu
|
||||
const file = backslashPath ? join(root, 'checksum\\path', 'install-script') : join(root, 'install-script');
|
||||
mkdirSync(dirname(file), { recursive: true });
|
||||
writeFileSync(file, 'synthetic installer bytes\n');
|
||||
for (const name of ['open-gstack-browser', 'pair-agent', 'setup-browser-cookies']) {
|
||||
for (const name of ['open-gstack-browser', 'pair-agent']) {
|
||||
const lines = apply(skill(host, name)).split('\n').filter(line => line.includes('actual_sha=$('));
|
||||
expect(lines.map(line => line.trim())).toEqual([
|
||||
literals.checksum,
|
||||
|
||||
Reference in new issue
Block a user