@runchr/gstack-antigravity 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.agents/rules/ETHOS.md +129 -0
- package/.agents/rules/global-gstack.md +117 -0
- package/.agents/rules/persona-gstack-autoplan.md +14 -0
- package/.agents/rules/persona-gstack-benchmark.md +14 -0
- package/.agents/rules/persona-gstack-browse.md +14 -0
- package/.agents/rules/persona-gstack-canary.md +14 -0
- package/.agents/rules/persona-gstack-careful.md +14 -0
- package/.agents/rules/persona-gstack-codex.md +14 -0
- package/.agents/rules/persona-gstack-cso.md +14 -0
- package/.agents/rules/persona-gstack-design-consultation.md +14 -0
- package/.agents/rules/persona-gstack-design-review.md +14 -0
- package/.agents/rules/persona-gstack-document-release.md +14 -0
- package/.agents/rules/persona-gstack-freeze.md +14 -0
- package/.agents/rules/persona-gstack-gstack-upgrade.md +14 -0
- package/.agents/rules/persona-gstack-guard.md +14 -0
- package/.agents/rules/persona-gstack-investigate.md +14 -0
- package/.agents/rules/persona-gstack-land-and-deploy.md +14 -0
- package/.agents/rules/persona-gstack-office-hours.md +14 -0
- package/.agents/rules/persona-gstack-plan-ceo-review.md +14 -0
- package/.agents/rules/persona-gstack-plan-design-review.md +14 -0
- package/.agents/rules/persona-gstack-plan-eng-review.md +14 -0
- package/.agents/rules/persona-gstack-qa-only.md +14 -0
- package/.agents/rules/persona-gstack-qa.md +14 -0
- package/.agents/rules/persona-gstack-retro.md +14 -0
- package/.agents/rules/persona-gstack-review.md +14 -0
- package/.agents/rules/persona-gstack-setup-browser-cookies.md +14 -0
- package/.agents/rules/persona-gstack-setup-deploy.md +14 -0
- package/.agents/rules/persona-gstack-ship.md +14 -0
- package/.agents/rules/persona-gstack-unfreeze.md +14 -0
- package/.agents/rules/persona-gstack.md +40 -0
- package/.agents/rules/recursive-identities.md +22 -0
- package/.agents/workflows/autoplan.md +30 -0
- package/.agents/workflows/benchmark.md +31 -0
- package/.agents/workflows/browse.md +26 -0
- package/.agents/workflows/canary.md +33 -0
- package/.agents/workflows/careful.md +22 -0
- package/.agents/workflows/codex.md +36 -0
- package/.agents/workflows/cso.md +29 -0
- package/.agents/workflows/design-consultation.md +28 -0
- package/.agents/workflows/design-review.md +28 -0
- package/.agents/workflows/document-release.md +32 -0
- package/.agents/workflows/freeze.md +17 -0
- package/.agents/workflows/gstack-upgrade.md +54 -0
- package/.agents/workflows/gstack.md +56 -0
- package/.agents/workflows/guard.md +18 -0
- package/.agents/workflows/investigate.md +37 -0
- package/.agents/workflows/land-and-deploy.md +35 -0
- package/.agents/workflows/office-hours.md +27 -0
- package/.agents/workflows/plan-ceo-review.md +34 -0
- package/.agents/workflows/plan-design-review.md +31 -0
- package/.agents/workflows/plan-eng-review.md +28 -0
- package/.agents/workflows/qa-only.md +28 -0
- package/.agents/workflows/qa.md +73 -0
- package/.agents/workflows/retro.md +34 -0
- package/.agents/workflows/review.md +30 -0
- package/.agents/workflows/setup-browser-cookies.md +15 -0
- package/.agents/workflows/setup-cookies.md +8 -0
- package/.agents/workflows/setup-deploy.md +21 -0
- package/.agents/workflows/ship.md +93 -0
- package/.agents/workflows/unfreeze.md +12 -0
- package/LICENSE +22 -0
- package/README.md +189 -0
- package/README_KO.md +191 -0
- package/bin/install.js +105 -0
- package/gstack-origin/.agents/skills/gstack/SKILL.md +651 -0
- package/gstack-origin/.agents/skills/gstack-autoplan/SKILL.md +678 -0
- package/gstack-origin/.agents/skills/gstack-benchmark/SKILL.md +482 -0
- package/gstack-origin/.agents/skills/gstack-browse/SKILL.md +511 -0
- package/gstack-origin/.agents/skills/gstack-canary/SKILL.md +486 -0
- package/gstack-origin/.agents/skills/gstack-careful/SKILL.md +50 -0
- package/gstack-origin/.agents/skills/gstack-cso/SKILL.md +607 -0
- package/gstack-origin/.agents/skills/gstack-design-consultation/SKILL.md +615 -0
- package/gstack-origin/.agents/skills/gstack-design-review/SKILL.md +988 -0
- package/gstack-origin/.agents/skills/gstack-document-release/SKILL.md +604 -0
- package/gstack-origin/.agents/skills/gstack-freeze/SKILL.md +67 -0
- package/gstack-origin/.agents/skills/gstack-guard/SKILL.md +62 -0
- package/gstack-origin/.agents/skills/gstack-investigate/SKILL.md +415 -0
- package/gstack-origin/.agents/skills/gstack-land-and-deploy/SKILL.md +873 -0
- package/gstack-origin/.agents/skills/gstack-office-hours/SKILL.md +986 -0
- package/gstack-origin/.agents/skills/gstack-plan-ceo-review/SKILL.md +1268 -0
- package/gstack-origin/.agents/skills/gstack-plan-design-review/SKILL.md +668 -0
- package/gstack-origin/.agents/skills/gstack-plan-eng-review/SKILL.md +826 -0
- package/gstack-origin/.agents/skills/gstack-qa/SKILL.md +1006 -0
- package/gstack-origin/.agents/skills/gstack-qa-only/SKILL.md +626 -0
- package/gstack-origin/.agents/skills/gstack-retro/SKILL.md +1065 -0
- package/gstack-origin/.agents/skills/gstack-review/SKILL.md +704 -0
- package/gstack-origin/.agents/skills/gstack-setup-browser-cookies/SKILL.md +325 -0
- package/gstack-origin/.agents/skills/gstack-setup-deploy/SKILL.md +450 -0
- package/gstack-origin/.agents/skills/gstack-ship/SKILL.md +1312 -0
- package/gstack-origin/.agents/skills/gstack-unfreeze/SKILL.md +36 -0
- package/gstack-origin/.agents/skills/gstack-upgrade/SKILL.md +220 -0
- package/gstack-origin/.env.example +5 -0
- package/gstack-origin/.github/workflows/skill-docs.yml +17 -0
- package/gstack-origin/AGENTS.md +49 -0
- package/gstack-origin/ARCHITECTURE.md +359 -0
- package/gstack-origin/BROWSER.md +271 -0
- package/gstack-origin/CHANGELOG.md +800 -0
- package/gstack-origin/CLAUDE.md +284 -0
- package/gstack-origin/CONTRIBUTING.md +370 -0
- package/gstack-origin/ETHOS.md +129 -0
- package/gstack-origin/LICENSE +21 -0
- package/gstack-origin/README.md +228 -0
- package/gstack-origin/SKILL.md +657 -0
- package/gstack-origin/SKILL.md.tmpl +281 -0
- package/gstack-origin/TODOS.md +564 -0
- package/gstack-origin/VERSION +1 -0
- package/gstack-origin/autoplan/SKILL.md +689 -0
- package/gstack-origin/autoplan/SKILL.md.tmpl +416 -0
- package/gstack-origin/benchmark/SKILL.md +489 -0
- package/gstack-origin/benchmark/SKILL.md.tmpl +233 -0
- package/gstack-origin/bin/dev-setup +68 -0
- package/gstack-origin/bin/dev-teardown +56 -0
- package/gstack-origin/bin/gstack-analytics +191 -0
- package/gstack-origin/bin/gstack-community-dashboard +113 -0
- package/gstack-origin/bin/gstack-config +38 -0
- package/gstack-origin/bin/gstack-diff-scope +71 -0
- package/gstack-origin/bin/gstack-global-discover.ts +591 -0
- package/gstack-origin/bin/gstack-repo-mode +93 -0
- package/gstack-origin/bin/gstack-review-log +9 -0
- package/gstack-origin/bin/gstack-review-read +12 -0
- package/gstack-origin/bin/gstack-slug +15 -0
- package/gstack-origin/bin/gstack-telemetry-log +158 -0
- package/gstack-origin/bin/gstack-telemetry-sync +127 -0
- package/gstack-origin/bin/gstack-update-check +196 -0
- package/gstack-origin/browse/SKILL.md +517 -0
- package/gstack-origin/browse/SKILL.md.tmpl +141 -0
- package/gstack-origin/browse/bin/find-browse +21 -0
- package/gstack-origin/browse/bin/remote-slug +14 -0
- package/gstack-origin/browse/scripts/build-node-server.sh +48 -0
- package/gstack-origin/browse/src/browser-manager.ts +634 -0
- package/gstack-origin/browse/src/buffers.ts +137 -0
- package/gstack-origin/browse/src/bun-polyfill.cjs +109 -0
- package/gstack-origin/browse/src/cli.ts +420 -0
- package/gstack-origin/browse/src/commands.ts +111 -0
- package/gstack-origin/browse/src/config.ts +150 -0
- package/gstack-origin/browse/src/cookie-import-browser.ts +417 -0
- package/gstack-origin/browse/src/cookie-picker-routes.ts +207 -0
- package/gstack-origin/browse/src/cookie-picker-ui.ts +541 -0
- package/gstack-origin/browse/src/find-browse.ts +61 -0
- package/gstack-origin/browse/src/meta-commands.ts +269 -0
- package/gstack-origin/browse/src/platform.ts +17 -0
- package/gstack-origin/browse/src/read-commands.ts +335 -0
- package/gstack-origin/browse/src/server.ts +369 -0
- package/gstack-origin/browse/src/snapshot.ts +398 -0
- package/gstack-origin/browse/src/url-validation.ts +91 -0
- package/gstack-origin/browse/src/write-commands.ts +352 -0
- package/gstack-origin/browse/test/bun-polyfill.test.ts +72 -0
- package/gstack-origin/browse/test/commands.test.ts +1836 -0
- package/gstack-origin/browse/test/config.test.ts +250 -0
- package/gstack-origin/browse/test/cookie-import-browser.test.ts +397 -0
- package/gstack-origin/browse/test/cookie-picker-routes.test.ts +205 -0
- package/gstack-origin/browse/test/find-browse.test.ts +50 -0
- package/gstack-origin/browse/test/fixtures/basic.html +33 -0
- package/gstack-origin/browse/test/fixtures/cursor-interactive.html +22 -0
- package/gstack-origin/browse/test/fixtures/dialog.html +15 -0
- package/gstack-origin/browse/test/fixtures/empty.html +2 -0
- package/gstack-origin/browse/test/fixtures/forms.html +55 -0
- package/gstack-origin/browse/test/fixtures/qa-eval-checkout.html +108 -0
- package/gstack-origin/browse/test/fixtures/qa-eval-spa.html +98 -0
- package/gstack-origin/browse/test/fixtures/qa-eval.html +51 -0
- package/gstack-origin/browse/test/fixtures/responsive.html +49 -0
- package/gstack-origin/browse/test/fixtures/snapshot.html +55 -0
- package/gstack-origin/browse/test/fixtures/spa.html +24 -0
- package/gstack-origin/browse/test/fixtures/states.html +17 -0
- package/gstack-origin/browse/test/fixtures/upload.html +25 -0
- package/gstack-origin/browse/test/gstack-config.test.ts +125 -0
- package/gstack-origin/browse/test/gstack-update-check.test.ts +467 -0
- package/gstack-origin/browse/test/handoff.test.ts +235 -0
- package/gstack-origin/browse/test/path-validation.test.ts +63 -0
- package/gstack-origin/browse/test/platform.test.ts +37 -0
- package/gstack-origin/browse/test/snapshot.test.ts +467 -0
- package/gstack-origin/browse/test/test-server.ts +57 -0
- package/gstack-origin/browse/test/url-validation.test.ts +72 -0
- package/gstack-origin/canary/SKILL.md +493 -0
- package/gstack-origin/canary/SKILL.md.tmpl +220 -0
- package/gstack-origin/careful/SKILL.md +59 -0
- package/gstack-origin/careful/SKILL.md.tmpl +57 -0
- package/gstack-origin/careful/bin/check-careful.sh +112 -0
- package/gstack-origin/codex/SKILL.md +677 -0
- package/gstack-origin/codex/SKILL.md.tmpl +356 -0
- package/gstack-origin/conductor.json +6 -0
- package/gstack-origin/cso/SKILL.md +615 -0
- package/gstack-origin/cso/SKILL.md.tmpl +376 -0
- package/gstack-origin/design-consultation/SKILL.md +625 -0
- package/gstack-origin/design-consultation/SKILL.md.tmpl +369 -0
- package/gstack-origin/design-review/SKILL.md +998 -0
- package/gstack-origin/design-review/SKILL.md.tmpl +262 -0
- package/gstack-origin/docs/images/github-2013.png +0 -0
- package/gstack-origin/docs/images/github-2026.png +0 -0
- package/gstack-origin/docs/skills.md +877 -0
- package/gstack-origin/document-release/SKILL.md +613 -0
- package/gstack-origin/document-release/SKILL.md.tmpl +357 -0
- package/gstack-origin/freeze/SKILL.md +82 -0
- package/gstack-origin/freeze/SKILL.md.tmpl +80 -0
- package/gstack-origin/freeze/bin/check-freeze.sh +68 -0
- package/gstack-origin/gstack-upgrade/SKILL.md +226 -0
- package/gstack-origin/gstack-upgrade/SKILL.md.tmpl +224 -0
- package/gstack-origin/guard/SKILL.md +82 -0
- package/gstack-origin/guard/SKILL.md.tmpl +80 -0
- package/gstack-origin/investigate/SKILL.md +435 -0
- package/gstack-origin/investigate/SKILL.md.tmpl +196 -0
- package/gstack-origin/land-and-deploy/SKILL.md +880 -0
- package/gstack-origin/land-and-deploy/SKILL.md.tmpl +575 -0
- package/gstack-origin/office-hours/SKILL.md +996 -0
- package/gstack-origin/office-hours/SKILL.md.tmpl +624 -0
- package/gstack-origin/package.json +55 -0
- package/gstack-origin/plan-ceo-review/SKILL.md +1277 -0
- package/gstack-origin/plan-ceo-review/SKILL.md.tmpl +838 -0
- package/gstack-origin/plan-design-review/SKILL.md +676 -0
- package/gstack-origin/plan-design-review/SKILL.md.tmpl +314 -0
- package/gstack-origin/plan-eng-review/SKILL.md +836 -0
- package/gstack-origin/plan-eng-review/SKILL.md.tmpl +279 -0
- package/gstack-origin/qa/SKILL.md +1016 -0
- package/gstack-origin/qa/SKILL.md.tmpl +316 -0
- package/gstack-origin/qa/references/issue-taxonomy.md +85 -0
- package/gstack-origin/qa/templates/qa-report-template.md +126 -0
- package/gstack-origin/qa-only/SKILL.md +633 -0
- package/gstack-origin/qa-only/SKILL.md.tmpl +101 -0
- package/gstack-origin/retro/SKILL.md +1072 -0
- package/gstack-origin/retro/SKILL.md.tmpl +833 -0
- package/gstack-origin/review/SKILL.md +849 -0
- package/gstack-origin/review/SKILL.md.tmpl +259 -0
- package/gstack-origin/review/TODOS-format.md +62 -0
- package/gstack-origin/review/checklist.md +190 -0
- package/gstack-origin/review/design-checklist.md +132 -0
- package/gstack-origin/review/greptile-triage.md +220 -0
- package/gstack-origin/scripts/analytics.ts +190 -0
- package/gstack-origin/scripts/dev-skill.ts +82 -0
- package/gstack-origin/scripts/eval-compare.ts +96 -0
- package/gstack-origin/scripts/eval-list.ts +116 -0
- package/gstack-origin/scripts/eval-select.ts +86 -0
- package/gstack-origin/scripts/eval-summary.ts +187 -0
- package/gstack-origin/scripts/eval-watch.ts +172 -0
- package/gstack-origin/scripts/gen-skill-docs.ts +2414 -0
- package/gstack-origin/scripts/skill-check.ts +167 -0
- package/gstack-origin/setup +269 -0
- package/gstack-origin/setup-browser-cookies/SKILL.md +330 -0
- package/gstack-origin/setup-browser-cookies/SKILL.md.tmpl +74 -0
- package/gstack-origin/setup-deploy/SKILL.md +459 -0
- package/gstack-origin/setup-deploy/SKILL.md.tmpl +220 -0
- package/gstack-origin/ship/SKILL.md +1457 -0
- package/gstack-origin/ship/SKILL.md.tmpl +528 -0
- package/gstack-origin/supabase/config.sh +10 -0
- package/gstack-origin/supabase/functions/community-pulse/index.ts +59 -0
- package/gstack-origin/supabase/functions/telemetry-ingest/index.ts +135 -0
- package/gstack-origin/supabase/functions/update-check/index.ts +37 -0
- package/gstack-origin/supabase/migrations/001_telemetry.sql +89 -0
- package/gstack-origin/test/analytics.test.ts +277 -0
- package/gstack-origin/test/codex-e2e.test.ts +197 -0
- package/gstack-origin/test/fixtures/coverage-audit-fixture.ts +76 -0
- package/gstack-origin/test/fixtures/eval-baselines.json +7 -0
- package/gstack-origin/test/fixtures/qa-eval-checkout-ground-truth.json +43 -0
- package/gstack-origin/test/fixtures/qa-eval-ground-truth.json +43 -0
- package/gstack-origin/test/fixtures/qa-eval-spa-ground-truth.json +43 -0
- package/gstack-origin/test/fixtures/review-eval-design-slop.css +86 -0
- package/gstack-origin/test/fixtures/review-eval-design-slop.html +41 -0
- package/gstack-origin/test/fixtures/review-eval-enum-diff.rb +30 -0
- package/gstack-origin/test/fixtures/review-eval-enum.rb +27 -0
- package/gstack-origin/test/fixtures/review-eval-vuln.rb +14 -0
- package/gstack-origin/test/gemini-e2e.test.ts +173 -0
- package/gstack-origin/test/gen-skill-docs.test.ts +1049 -0
- package/gstack-origin/test/global-discover.test.ts +187 -0
- package/gstack-origin/test/helpers/codex-session-runner.ts +282 -0
- package/gstack-origin/test/helpers/e2e-helpers.ts +239 -0
- package/gstack-origin/test/helpers/eval-store.test.ts +548 -0
- package/gstack-origin/test/helpers/eval-store.ts +689 -0
- package/gstack-origin/test/helpers/gemini-session-runner.test.ts +104 -0
- package/gstack-origin/test/helpers/gemini-session-runner.ts +201 -0
- package/gstack-origin/test/helpers/llm-judge.ts +130 -0
- package/gstack-origin/test/helpers/observability.test.ts +283 -0
- package/gstack-origin/test/helpers/session-runner.test.ts +96 -0
- package/gstack-origin/test/helpers/session-runner.ts +357 -0
- package/gstack-origin/test/helpers/skill-parser.ts +206 -0
- package/gstack-origin/test/helpers/touchfiles.ts +260 -0
- package/gstack-origin/test/hook-scripts.test.ts +373 -0
- package/gstack-origin/test/skill-e2e-browse.test.ts +293 -0
- package/gstack-origin/test/skill-e2e-deploy.test.ts +279 -0
- package/gstack-origin/test/skill-e2e-design.test.ts +614 -0
- package/gstack-origin/test/skill-e2e-plan.test.ts +538 -0
- package/gstack-origin/test/skill-e2e-qa-bugs.test.ts +194 -0
- package/gstack-origin/test/skill-e2e-qa-workflow.test.ts +412 -0
- package/gstack-origin/test/skill-e2e-review.test.ts +535 -0
- package/gstack-origin/test/skill-e2e-workflow.test.ts +586 -0
- package/gstack-origin/test/skill-e2e.test.ts +3325 -0
- package/gstack-origin/test/skill-llm-eval.test.ts +787 -0
- package/gstack-origin/test/skill-parser.test.ts +179 -0
- package/gstack-origin/test/skill-routing-e2e.test.ts +605 -0
- package/gstack-origin/test/skill-validation.test.ts +1520 -0
- package/gstack-origin/test/telemetry.test.ts +278 -0
- package/gstack-origin/test/touchfiles.test.ts +262 -0
- package/gstack-origin/unfreeze/SKILL.md +40 -0
- package/gstack-origin/unfreeze/SKILL.md.tmpl +38 -0
- package/package.json +38 -0
- package/scripts/install-antigravity-skill.ps1 +33 -0
- package/scripts/install-antigravity-skill.sh +41 -0
- package/scripts/sync-gstack-origin.ps1 +37 -0
- package/scripts/sync-gstack-origin.sh +35 -0
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
import { describe, test, expect, beforeAll, afterAll } from 'bun:test';
|
|
2
|
+
import { runSkillTest } from './helpers/session-runner';
|
|
3
|
+
import {
|
|
4
|
+
ROOT, browseBin, runId, evalsEnabled,
|
|
5
|
+
describeIfSelected, testConcurrentIfSelected,
|
|
6
|
+
copyDirSync, setupBrowseShims, logCost, recordE2E,
|
|
7
|
+
createEvalCollector, finalizeEvalCollector,
|
|
8
|
+
} from './helpers/e2e-helpers';
|
|
9
|
+
import { spawnSync } from 'child_process';
|
|
10
|
+
import * as fs from 'fs';
|
|
11
|
+
import * as path from 'path';
|
|
12
|
+
import * as os from 'os';
|
|
13
|
+
|
|
14
|
+
const evalCollector = createEvalCollector('e2e-workflow');
|
|
15
|
+
|
|
16
|
+
// --- Document-Release skill E2E ---
|
|
17
|
+
|
|
18
|
+
describeIfSelected('Document-Release skill E2E', ['document-release'], () => {
|
|
19
|
+
let docReleaseDir: string;
|
|
20
|
+
|
|
21
|
+
beforeAll(() => {
|
|
22
|
+
docReleaseDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-doc-release-'));
|
|
23
|
+
|
|
24
|
+
// Copy document-release skill files
|
|
25
|
+
copyDirSync(path.join(ROOT, 'document-release'), path.join(docReleaseDir, 'document-release'));
|
|
26
|
+
|
|
27
|
+
// Init git repo with initial docs
|
|
28
|
+
const run = (cmd: string, args: string[]) =>
|
|
29
|
+
spawnSync(cmd, args, { cwd: docReleaseDir, stdio: 'pipe', timeout: 5000 });
|
|
30
|
+
|
|
31
|
+
run('git', ['init', '-b', 'main']);
|
|
32
|
+
run('git', ['config', 'user.email', 'test@test.com']);
|
|
33
|
+
run('git', ['config', 'user.name', 'Test']);
|
|
34
|
+
|
|
35
|
+
// Create initial README with a features list
|
|
36
|
+
fs.writeFileSync(path.join(docReleaseDir, 'README.md'),
|
|
37
|
+
'# Test Project\n\n## Features\n\n- Feature A\n- Feature B\n\n## Install\n\n```bash\nnpm install\n```\n');
|
|
38
|
+
|
|
39
|
+
// Create initial CHANGELOG that must NOT be clobbered
|
|
40
|
+
fs.writeFileSync(path.join(docReleaseDir, 'CHANGELOG.md'),
|
|
41
|
+
'# Changelog\n\n## 1.0.0 — 2026-03-01\n\n- Initial release with Feature A and Feature B\n- Setup CI pipeline\n');
|
|
42
|
+
|
|
43
|
+
// Create VERSION file (already bumped)
|
|
44
|
+
fs.writeFileSync(path.join(docReleaseDir, 'VERSION'), '1.1.0\n');
|
|
45
|
+
|
|
46
|
+
run('git', ['add', '.']);
|
|
47
|
+
run('git', ['commit', '-m', 'initial']);
|
|
48
|
+
|
|
49
|
+
// Create feature branch with a code change
|
|
50
|
+
run('git', ['checkout', '-b', 'feat/add-feature-c']);
|
|
51
|
+
fs.writeFileSync(path.join(docReleaseDir, 'feature-c.ts'), 'export function featureC() { return "C"; }\n');
|
|
52
|
+
fs.writeFileSync(path.join(docReleaseDir, 'VERSION'), '1.1.1\n');
|
|
53
|
+
fs.writeFileSync(path.join(docReleaseDir, 'CHANGELOG.md'),
|
|
54
|
+
'# Changelog\n\n## 1.1.1 — 2026-03-16\n\n- Added Feature C\n\n## 1.0.0 — 2026-03-01\n\n- Initial release with Feature A and Feature B\n- Setup CI pipeline\n');
|
|
55
|
+
run('git', ['add', '.']);
|
|
56
|
+
run('git', ['commit', '-m', 'feat: add feature C']);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
afterAll(() => {
|
|
60
|
+
try { fs.rmSync(docReleaseDir, { recursive: true, force: true }); } catch {}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
test('/document-release updates docs without clobbering CHANGELOG', async () => {
|
|
64
|
+
const result = await runSkillTest({
|
|
65
|
+
prompt: `Read the file document-release/SKILL.md for the document-release workflow instructions.
|
|
66
|
+
|
|
67
|
+
Run the /document-release workflow on this repo. The base branch is "main".
|
|
68
|
+
|
|
69
|
+
IMPORTANT:
|
|
70
|
+
- Do NOT use AskUserQuestion — auto-approve everything or skip if unsure.
|
|
71
|
+
- Do NOT push or create PRs (there is no remote).
|
|
72
|
+
- Do NOT run gh commands (no remote).
|
|
73
|
+
- Focus on updating README.md to reflect the new Feature C.
|
|
74
|
+
- Do NOT overwrite or regenerate CHANGELOG entries.
|
|
75
|
+
- Skip VERSION bump (it's already bumped).
|
|
76
|
+
- After editing, just commit the changes locally.`,
|
|
77
|
+
workingDirectory: docReleaseDir,
|
|
78
|
+
maxTurns: 30,
|
|
79
|
+
allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Grep', 'Glob'],
|
|
80
|
+
timeout: 180_000,
|
|
81
|
+
testName: 'document-release',
|
|
82
|
+
runId,
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
logCost('/document-release', result);
|
|
86
|
+
|
|
87
|
+
// Read CHANGELOG to verify it was NOT clobbered
|
|
88
|
+
const changelog = fs.readFileSync(path.join(docReleaseDir, 'CHANGELOG.md'), 'utf-8');
|
|
89
|
+
const hasOriginalEntries = changelog.includes('Initial release with Feature A and Feature B')
|
|
90
|
+
&& changelog.includes('Setup CI pipeline')
|
|
91
|
+
&& changelog.includes('1.0.0');
|
|
92
|
+
if (!hasOriginalEntries) {
|
|
93
|
+
console.warn('CHANGELOG CLOBBERED — original entries missing!');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// Check if README was updated
|
|
97
|
+
const readme = fs.readFileSync(path.join(docReleaseDir, 'README.md'), 'utf-8');
|
|
98
|
+
const readmeUpdated = readme.includes('Feature C') || readme.includes('feature-c') || readme.includes('feature C');
|
|
99
|
+
|
|
100
|
+
const exitOk = ['success', 'error_max_turns'].includes(result.exitReason);
|
|
101
|
+
recordE2E(evalCollector, '/document-release', 'Document-Release skill E2E', result, {
|
|
102
|
+
passed: exitOk && hasOriginalEntries,
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
// Critical guardrail: CHANGELOG must not be clobbered
|
|
106
|
+
expect(hasOriginalEntries).toBe(true);
|
|
107
|
+
|
|
108
|
+
// Accept error_max_turns — thorough doc review is not a failure
|
|
109
|
+
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
110
|
+
|
|
111
|
+
// Informational: did it update README?
|
|
112
|
+
if (readmeUpdated) {
|
|
113
|
+
console.log('README updated to include Feature C');
|
|
114
|
+
} else {
|
|
115
|
+
console.warn('README was NOT updated — agent may not have found the feature');
|
|
116
|
+
}
|
|
117
|
+
}, 240_000);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
// --- Ship workflow with local bare remote ---
|
|
121
|
+
|
|
122
|
+
describeIfSelected('Ship workflow E2E', ['ship-local-workflow'], () => {
|
|
123
|
+
let shipWorkDir: string;
|
|
124
|
+
let shipRemoteDir: string;
|
|
125
|
+
|
|
126
|
+
beforeAll(() => {
|
|
127
|
+
shipRemoteDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-ship-remote-'));
|
|
128
|
+
shipWorkDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-ship-work-'));
|
|
129
|
+
|
|
130
|
+
// Create bare remote
|
|
131
|
+
spawnSync('git', ['init', '--bare'], { cwd: shipRemoteDir, stdio: 'pipe' });
|
|
132
|
+
|
|
133
|
+
// Clone it as working repo
|
|
134
|
+
spawnSync('git', ['clone', shipRemoteDir, shipWorkDir], { stdio: 'pipe' });
|
|
135
|
+
|
|
136
|
+
const run = (cmd: string, args: string[]) =>
|
|
137
|
+
spawnSync(cmd, args, { cwd: shipWorkDir, stdio: 'pipe', timeout: 5000 });
|
|
138
|
+
run('git', ['config', 'user.email', 'test@test.com']);
|
|
139
|
+
run('git', ['config', 'user.name', 'Test']);
|
|
140
|
+
|
|
141
|
+
// Initial commit on main
|
|
142
|
+
fs.writeFileSync(path.join(shipWorkDir, 'app.ts'), 'console.log("v1");\n');
|
|
143
|
+
fs.writeFileSync(path.join(shipWorkDir, 'VERSION'), '0.1.0.0\n');
|
|
144
|
+
fs.writeFileSync(path.join(shipWorkDir, 'CHANGELOG.md'), '# Changelog\n');
|
|
145
|
+
run('git', ['add', '.']);
|
|
146
|
+
run('git', ['commit', '-m', 'initial']);
|
|
147
|
+
run('git', ['push', '-u', 'origin', 'main']);
|
|
148
|
+
|
|
149
|
+
// Feature branch
|
|
150
|
+
run('git', ['checkout', '-b', 'feature/ship-test']);
|
|
151
|
+
fs.writeFileSync(path.join(shipWorkDir, 'app.ts'), 'console.log("v2");\n');
|
|
152
|
+
run('git', ['add', 'app.ts']);
|
|
153
|
+
run('git', ['commit', '-m', 'feat: update to v2']);
|
|
154
|
+
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
afterAll(() => {
|
|
158
|
+
try { fs.rmSync(shipWorkDir, { recursive: true, force: true }); } catch {}
|
|
159
|
+
try { fs.rmSync(shipRemoteDir, { recursive: true, force: true }); } catch {}
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
testConcurrentIfSelected('ship-local-workflow', async () => {
|
|
163
|
+
const result = await runSkillTest({
|
|
164
|
+
prompt: `You are running a ship workflow. This is fully automated — do NOT ask for confirmation at any step. Run straight through.
|
|
165
|
+
|
|
166
|
+
Step 0 — Detect base branch:
|
|
167
|
+
Try: gh pr view --json baseRefName -q .baseRefName
|
|
168
|
+
If that fails, try: gh repo view --json defaultBranchRef -q .defaultBranchRef.name
|
|
169
|
+
If both fail, fall back to "main". Use the detected branch as <base> in all subsequent steps.
|
|
170
|
+
|
|
171
|
+
Step 2 — Merge base branch:
|
|
172
|
+
git fetch origin <base> && git merge origin/<base> --no-edit
|
|
173
|
+
If already up to date, continue silently.
|
|
174
|
+
|
|
175
|
+
Step 4 — Version bump:
|
|
176
|
+
Read the VERSION file (4-digit format: MAJOR.MINOR.PATCH.MICRO).
|
|
177
|
+
Auto-pick MICRO bump (increment the 4th digit). Write the new version to VERSION.
|
|
178
|
+
|
|
179
|
+
Step 5 — CHANGELOG:
|
|
180
|
+
Read CHANGELOG.md. Auto-generate an entry from the branch commits:
|
|
181
|
+
- git log <base>..HEAD --oneline
|
|
182
|
+
- git diff <base>...HEAD
|
|
183
|
+
Format: ## [X.Y.Z.W] - YYYY-MM-DD with bullet points. Prepend after the header.
|
|
184
|
+
|
|
185
|
+
Step 6 — Commit:
|
|
186
|
+
Stage all changes. Commit with message: "chore: bump version and changelog (vX.Y.Z.W)"
|
|
187
|
+
|
|
188
|
+
Step 7 — Push:
|
|
189
|
+
git push -u origin <branch-name>
|
|
190
|
+
|
|
191
|
+
Finally, write ship-summary.md with the version and branch.`,
|
|
192
|
+
workingDirectory: shipWorkDir,
|
|
193
|
+
maxTurns: 15,
|
|
194
|
+
timeout: 120_000,
|
|
195
|
+
testName: 'ship-local-workflow',
|
|
196
|
+
runId,
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
logCost('/ship local workflow', result);
|
|
200
|
+
|
|
201
|
+
// Check push succeeded
|
|
202
|
+
const remoteLog = spawnSync('git', ['log', '--oneline'], { cwd: shipRemoteDir, stdio: 'pipe' });
|
|
203
|
+
const remoteCommits = remoteLog.stdout.toString().trim().split('\n').length;
|
|
204
|
+
|
|
205
|
+
// Check VERSION was bumped
|
|
206
|
+
const versionContent = fs.existsSync(path.join(shipWorkDir, 'VERSION'))
|
|
207
|
+
? fs.readFileSync(path.join(shipWorkDir, 'VERSION'), 'utf-8').trim() : '';
|
|
208
|
+
const versionBumped = versionContent !== '0.1.0.0';
|
|
209
|
+
|
|
210
|
+
recordE2E(evalCollector, '/ship local workflow', 'Ship workflow E2E', result, {
|
|
211
|
+
passed: remoteCommits > 1 && ['success', 'error_max_turns'].includes(result.exitReason),
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
215
|
+
expect(remoteCommits).toBeGreaterThan(1);
|
|
216
|
+
console.log(`Remote commits: ${remoteCommits}, VERSION: ${versionContent}, bumped: ${versionBumped}`);
|
|
217
|
+
}, 150_000);
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// --- Browser cookie detection smoke test ---
|
|
221
|
+
|
|
222
|
+
describeIfSelected('Setup Browser Cookies E2E', ['setup-cookies-detect'], () => {
|
|
223
|
+
let cookieDir: string;
|
|
224
|
+
|
|
225
|
+
beforeAll(() => {
|
|
226
|
+
cookieDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-cookies-'));
|
|
227
|
+
// Copy skill files
|
|
228
|
+
fs.mkdirSync(path.join(cookieDir, 'setup-browser-cookies'), { recursive: true });
|
|
229
|
+
fs.copyFileSync(
|
|
230
|
+
path.join(ROOT, 'setup-browser-cookies', 'SKILL.md'),
|
|
231
|
+
path.join(cookieDir, 'setup-browser-cookies', 'SKILL.md'),
|
|
232
|
+
);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
afterAll(() => {
|
|
236
|
+
try { fs.rmSync(cookieDir, { recursive: true, force: true }); } catch {}
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
testConcurrentIfSelected('setup-cookies-detect', async () => {
|
|
240
|
+
const result = await runSkillTest({
|
|
241
|
+
prompt: `Read setup-browser-cookies/SKILL.md for the cookie import workflow.
|
|
242
|
+
|
|
243
|
+
This is a test environment. List which browsers you can detect on this system by checking for their cookie database files.
|
|
244
|
+
Write the detected browsers to ${cookieDir}/detected-browsers.md.
|
|
245
|
+
Do NOT launch the cookie picker UI — just detect and report.`,
|
|
246
|
+
workingDirectory: cookieDir,
|
|
247
|
+
maxTurns: 5,
|
|
248
|
+
timeout: 45_000,
|
|
249
|
+
testName: 'setup-cookies-detect',
|
|
250
|
+
runId,
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
logCost('/setup-browser-cookies detect', result);
|
|
254
|
+
|
|
255
|
+
const detectPath = path.join(cookieDir, 'detected-browsers.md');
|
|
256
|
+
const detectExists = fs.existsSync(detectPath);
|
|
257
|
+
const detectContent = detectExists ? fs.readFileSync(detectPath, 'utf-8') : '';
|
|
258
|
+
const hasBrowserName = /chrome|arc|brave|edge|comet|safari|firefox/i.test(detectContent);
|
|
259
|
+
|
|
260
|
+
recordE2E(evalCollector, '/setup-browser-cookies detect', 'Setup Browser Cookies E2E', result, {
|
|
261
|
+
passed: detectExists && hasBrowserName && ['success', 'error_max_turns'].includes(result.exitReason),
|
|
262
|
+
});
|
|
263
|
+
|
|
264
|
+
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
265
|
+
expect(detectExists).toBe(true);
|
|
266
|
+
if (detectExists) {
|
|
267
|
+
expect(hasBrowserName).toBe(true);
|
|
268
|
+
}
|
|
269
|
+
}, 60_000);
|
|
270
|
+
});
|
|
271
|
+
|
|
272
|
+
// --- gstack-upgrade E2E ---
|
|
273
|
+
|
|
274
|
+
describeIfSelected('gstack-upgrade E2E', ['gstack-upgrade-happy-path'], () => {
|
|
275
|
+
let upgradeDir: string;
|
|
276
|
+
let remoteDir: string;
|
|
277
|
+
|
|
278
|
+
beforeAll(() => {
|
|
279
|
+
upgradeDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-upgrade-'));
|
|
280
|
+
remoteDir = fs.mkdtempSync(path.join(os.tmpdir(), 'gstack-remote-'));
|
|
281
|
+
|
|
282
|
+
const run = (cmd: string, args: string[], cwd: string) =>
|
|
283
|
+
spawnSync(cmd, args, { cwd, stdio: 'pipe', timeout: 5000 });
|
|
284
|
+
|
|
285
|
+
// Init the "project" repo
|
|
286
|
+
run('git', ['init'], upgradeDir);
|
|
287
|
+
run('git', ['config', 'user.email', 'test@test.com'], upgradeDir);
|
|
288
|
+
run('git', ['config', 'user.name', 'Test'], upgradeDir);
|
|
289
|
+
|
|
290
|
+
// Create mock gstack install directory (local-git type)
|
|
291
|
+
const mockGstack = path.join(upgradeDir, '.claude', 'skills', 'gstack');
|
|
292
|
+
fs.mkdirSync(mockGstack, { recursive: true });
|
|
293
|
+
|
|
294
|
+
// Init as a git repo
|
|
295
|
+
run('git', ['init'], mockGstack);
|
|
296
|
+
run('git', ['config', 'user.email', 'test@test.com'], mockGstack);
|
|
297
|
+
run('git', ['config', 'user.name', 'Test'], mockGstack);
|
|
298
|
+
|
|
299
|
+
// Create bare remote
|
|
300
|
+
run('git', ['init', '--bare'], remoteDir);
|
|
301
|
+
run('git', ['remote', 'add', 'origin', remoteDir], mockGstack);
|
|
302
|
+
|
|
303
|
+
// Write old version files
|
|
304
|
+
fs.writeFileSync(path.join(mockGstack, 'VERSION'), '0.5.0\n');
|
|
305
|
+
fs.writeFileSync(path.join(mockGstack, 'CHANGELOG.md'),
|
|
306
|
+
'# Changelog\n\n## 0.5.0 — 2026-03-01\n\n- Initial release\n');
|
|
307
|
+
fs.writeFileSync(path.join(mockGstack, 'setup'),
|
|
308
|
+
'#!/bin/bash\necho "Setup completed"\n', { mode: 0o755 });
|
|
309
|
+
|
|
310
|
+
// Initial commit + push
|
|
311
|
+
run('git', ['add', '.'], mockGstack);
|
|
312
|
+
run('git', ['commit', '-m', 'initial'], mockGstack);
|
|
313
|
+
run('git', ['push', '-u', 'origin', 'HEAD:main'], mockGstack);
|
|
314
|
+
|
|
315
|
+
// Create new version (simulate upstream release)
|
|
316
|
+
fs.writeFileSync(path.join(mockGstack, 'VERSION'), '0.6.0\n');
|
|
317
|
+
fs.writeFileSync(path.join(mockGstack, 'CHANGELOG.md'),
|
|
318
|
+
'# Changelog\n\n## 0.6.0 — 2026-03-15\n\n- New feature: interactive design review\n- Fix: snapshot flag validation\n\n## 0.5.0 — 2026-03-01\n\n- Initial release\n');
|
|
319
|
+
run('git', ['add', '.'], mockGstack);
|
|
320
|
+
run('git', ['commit', '-m', 'release 0.6.0'], mockGstack);
|
|
321
|
+
run('git', ['push', 'origin', 'HEAD:main'], mockGstack);
|
|
322
|
+
|
|
323
|
+
// Reset working copy back to old version
|
|
324
|
+
run('git', ['reset', '--hard', 'HEAD~1'], mockGstack);
|
|
325
|
+
|
|
326
|
+
// Copy gstack-upgrade skill
|
|
327
|
+
fs.mkdirSync(path.join(upgradeDir, 'gstack-upgrade'), { recursive: true });
|
|
328
|
+
fs.copyFileSync(
|
|
329
|
+
path.join(ROOT, 'gstack-upgrade', 'SKILL.md'),
|
|
330
|
+
path.join(upgradeDir, 'gstack-upgrade', 'SKILL.md'),
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
// Commit so git repo is clean
|
|
334
|
+
run('git', ['add', '.'], upgradeDir);
|
|
335
|
+
run('git', ['commit', '-m', 'initial project'], upgradeDir);
|
|
336
|
+
});
|
|
337
|
+
|
|
338
|
+
afterAll(() => {
|
|
339
|
+
try { fs.rmSync(upgradeDir, { recursive: true, force: true }); } catch {}
|
|
340
|
+
try { fs.rmSync(remoteDir, { recursive: true, force: true }); } catch {}
|
|
341
|
+
});
|
|
342
|
+
|
|
343
|
+
testConcurrentIfSelected('gstack-upgrade-happy-path', async () => {
|
|
344
|
+
const mockGstack = path.join(upgradeDir, '.claude', 'skills', 'gstack');
|
|
345
|
+
const result = await runSkillTest({
|
|
346
|
+
prompt: `Read gstack-upgrade/SKILL.md for the upgrade workflow.
|
|
347
|
+
|
|
348
|
+
You are running /gstack-upgrade standalone. The gstack installation is at ./.claude/skills/gstack (local-git type — it has a .git directory with an origin remote).
|
|
349
|
+
|
|
350
|
+
Current version: 0.5.0. A new version 0.6.0 is available on origin/main.
|
|
351
|
+
|
|
352
|
+
Follow the standalone upgrade flow:
|
|
353
|
+
1. Detect install type (local-git)
|
|
354
|
+
2. Run git fetch origin && git reset --hard origin/main in the install directory
|
|
355
|
+
3. Run the setup script
|
|
356
|
+
4. Show what's new from CHANGELOG
|
|
357
|
+
|
|
358
|
+
Skip any AskUserQuestion calls — auto-approve the upgrade. Write a summary of what you did to stdout.
|
|
359
|
+
|
|
360
|
+
IMPORTANT: The install directory is at ./.claude/skills/gstack — use that exact path.`,
|
|
361
|
+
workingDirectory: upgradeDir,
|
|
362
|
+
maxTurns: 20,
|
|
363
|
+
timeout: 180_000,
|
|
364
|
+
testName: 'gstack-upgrade-happy-path',
|
|
365
|
+
runId,
|
|
366
|
+
});
|
|
367
|
+
|
|
368
|
+
logCost('/gstack-upgrade happy path', result);
|
|
369
|
+
|
|
370
|
+
// Check that the version was updated
|
|
371
|
+
const versionAfter = fs.readFileSync(path.join(mockGstack, 'VERSION'), 'utf-8').trim();
|
|
372
|
+
const output = result.output || '';
|
|
373
|
+
const mentionsUpgrade = output.toLowerCase().includes('0.6.0') ||
|
|
374
|
+
output.toLowerCase().includes('upgrade') ||
|
|
375
|
+
output.toLowerCase().includes('updated');
|
|
376
|
+
|
|
377
|
+
recordE2E(evalCollector, '/gstack-upgrade happy path', 'gstack-upgrade E2E', result, {
|
|
378
|
+
passed: versionAfter === '0.6.0' && ['success', 'error_max_turns'].includes(result.exitReason),
|
|
379
|
+
});
|
|
380
|
+
|
|
381
|
+
expect(['success', 'error_max_turns']).toContain(result.exitReason);
|
|
382
|
+
expect(versionAfter).toBe('0.6.0');
|
|
383
|
+
}, 240_000);
|
|
384
|
+
});
|
|
385
|
+
|
|
386
|
+
// --- Test Coverage Audit E2E ---
|
|
387
|
+
|
|
388
|
+
describeIfSelected('Test Coverage Audit E2E', ['ship-coverage-audit'], () => {
|
|
389
|
+
let coverageDir: string;
|
|
390
|
+
|
|
391
|
+
beforeAll(() => {
|
|
392
|
+
coverageDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-coverage-'));
|
|
393
|
+
|
|
394
|
+
// Copy ship skill files
|
|
395
|
+
copyDirSync(path.join(ROOT, 'ship'), path.join(coverageDir, 'ship'));
|
|
396
|
+
copyDirSync(path.join(ROOT, 'review'), path.join(coverageDir, 'review'));
|
|
397
|
+
|
|
398
|
+
// Create a Node.js project WITH test framework but coverage gaps
|
|
399
|
+
fs.writeFileSync(path.join(coverageDir, 'package.json'), JSON.stringify({
|
|
400
|
+
name: 'test-coverage-app',
|
|
401
|
+
version: '1.0.0',
|
|
402
|
+
type: 'module',
|
|
403
|
+
scripts: { test: 'echo "no tests yet"' },
|
|
404
|
+
devDependencies: { vitest: '^1.0.0' },
|
|
405
|
+
}, null, 2));
|
|
406
|
+
|
|
407
|
+
// Create vitest config
|
|
408
|
+
fs.writeFileSync(path.join(coverageDir, 'vitest.config.ts'),
|
|
409
|
+
`import { defineConfig } from 'vitest/config';\nexport default defineConfig({ test: {} });\n`);
|
|
410
|
+
|
|
411
|
+
fs.writeFileSync(path.join(coverageDir, 'VERSION'), '0.1.0.0\n');
|
|
412
|
+
fs.writeFileSync(path.join(coverageDir, 'CHANGELOG.md'), '# Changelog\n');
|
|
413
|
+
|
|
414
|
+
// Create source file with multiple code paths
|
|
415
|
+
fs.mkdirSync(path.join(coverageDir, 'src'), { recursive: true });
|
|
416
|
+
fs.writeFileSync(path.join(coverageDir, 'src', 'billing.ts'), `
|
|
417
|
+
export function processPayment(amount: number, currency: string) {
|
|
418
|
+
if (amount <= 0) throw new Error('Invalid amount');
|
|
419
|
+
if (currency !== 'USD' && currency !== 'EUR') throw new Error('Unsupported currency');
|
|
420
|
+
return { status: 'success', amount, currency };
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
export function refundPayment(paymentId: string, reason: string) {
|
|
424
|
+
if (!paymentId) throw new Error('Payment ID required');
|
|
425
|
+
if (!reason) throw new Error('Reason required');
|
|
426
|
+
return { status: 'refunded', paymentId, reason };
|
|
427
|
+
}
|
|
428
|
+
`);
|
|
429
|
+
|
|
430
|
+
// Create a test directory with ONE test (partial coverage)
|
|
431
|
+
fs.mkdirSync(path.join(coverageDir, 'test'), { recursive: true });
|
|
432
|
+
fs.writeFileSync(path.join(coverageDir, 'test', 'billing.test.ts'), `
|
|
433
|
+
import { describe, test, expect } from 'vitest';
|
|
434
|
+
import { processPayment } from '../src/billing';
|
|
435
|
+
|
|
436
|
+
describe('processPayment', () => {
|
|
437
|
+
test('processes valid payment', () => {
|
|
438
|
+
const result = processPayment(100, 'USD');
|
|
439
|
+
expect(result.status).toBe('success');
|
|
440
|
+
});
|
|
441
|
+
// GAP: no test for invalid amount
|
|
442
|
+
// GAP: no test for unsupported currency
|
|
443
|
+
// GAP: refundPayment not tested at all
|
|
444
|
+
});
|
|
445
|
+
`);
|
|
446
|
+
|
|
447
|
+
// Init git repo with main branch
|
|
448
|
+
const run = (cmd: string, args: string[]) =>
|
|
449
|
+
spawnSync(cmd, args, { cwd: coverageDir, stdio: 'pipe', timeout: 5000 });
|
|
450
|
+
run('git', ['init', '-b', 'main']);
|
|
451
|
+
run('git', ['config', 'user.email', 'test@test.com']);
|
|
452
|
+
run('git', ['config', 'user.name', 'Test']);
|
|
453
|
+
run('git', ['add', '.']);
|
|
454
|
+
run('git', ['commit', '-m', 'initial commit']);
|
|
455
|
+
|
|
456
|
+
// Create feature branch
|
|
457
|
+
run('git', ['checkout', '-b', 'feature/billing']);
|
|
458
|
+
});
|
|
459
|
+
|
|
460
|
+
afterAll(() => {
|
|
461
|
+
try { fs.rmSync(coverageDir, { recursive: true, force: true }); } catch {}
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
test('/ship Step 3.4 produces coverage diagram', async () => {
|
|
465
|
+
const result = await runSkillTest({
|
|
466
|
+
prompt: `Read the file ship/SKILL.md for the ship workflow instructions.
|
|
467
|
+
|
|
468
|
+
You are on the feature/billing branch. The base branch is main.
|
|
469
|
+
This is a test project — there is no remote, no PR to create.
|
|
470
|
+
|
|
471
|
+
ONLY run Step 3.4 (Test Coverage Audit) from the ship workflow.
|
|
472
|
+
Skip all other steps (tests, evals, review, version, changelog, commit, push, PR).
|
|
473
|
+
|
|
474
|
+
The source code is in ${coverageDir}/src/billing.ts.
|
|
475
|
+
Existing tests are in ${coverageDir}/test/billing.test.ts.
|
|
476
|
+
The test command is: echo "tests pass" (mocked — just pretend tests pass).
|
|
477
|
+
|
|
478
|
+
Produce the ASCII coverage diagram showing which code paths are tested and which have gaps.
|
|
479
|
+
Do NOT generate new tests — just produce the diagram and coverage summary.
|
|
480
|
+
Output the diagram directly.`,
|
|
481
|
+
workingDirectory: coverageDir,
|
|
482
|
+
maxTurns: 15,
|
|
483
|
+
allowedTools: ['Bash', 'Read', 'Write', 'Edit', 'Glob', 'Grep'],
|
|
484
|
+
timeout: 120_000,
|
|
485
|
+
testName: 'ship-coverage-audit',
|
|
486
|
+
runId,
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
logCost('/ship coverage audit', result);
|
|
490
|
+
recordE2E(evalCollector, '/ship Step 3.4 coverage audit', 'Test Coverage Audit E2E', result, {
|
|
491
|
+
passed: result.exitReason === 'success',
|
|
492
|
+
});
|
|
493
|
+
|
|
494
|
+
expect(result.exitReason).toBe('success');
|
|
495
|
+
|
|
496
|
+
// Check output contains coverage diagram elements
|
|
497
|
+
const output = result.output || '';
|
|
498
|
+
const hasGap = output.includes('GAP') || output.includes('gap') || output.includes('NO TEST');
|
|
499
|
+
const hasTested = output.includes('TESTED') || output.includes('tested') || output.includes('✓');
|
|
500
|
+
const hasCoverage = output.includes('COVERAGE') || output.includes('coverage') || output.includes('paths tested');
|
|
501
|
+
|
|
502
|
+
console.log(`Output has GAP markers: ${hasGap}`);
|
|
503
|
+
console.log(`Output has TESTED markers: ${hasTested}`);
|
|
504
|
+
console.log(`Output has coverage summary: ${hasCoverage}`);
|
|
505
|
+
|
|
506
|
+
// At minimum, the agent should have read the source and test files
|
|
507
|
+
const readCalls = result.toolCalls.filter(tc => tc.tool === 'Read');
|
|
508
|
+
expect(readCalls.length).toBeGreaterThan(0);
|
|
509
|
+
}, 180_000);
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
// --- Codex skill E2E ---
|
|
513
|
+
|
|
514
|
+
describeIfSelected('Codex skill E2E', ['codex-review'], () => {
|
|
515
|
+
let codexDir: string;
|
|
516
|
+
|
|
517
|
+
beforeAll(() => {
|
|
518
|
+
codexDir = fs.mkdtempSync(path.join(os.tmpdir(), 'skill-e2e-codex-'));
|
|
519
|
+
|
|
520
|
+
const run = (cmd: string, args: string[]) =>
|
|
521
|
+
spawnSync(cmd, args, { cwd: codexDir, stdio: 'pipe', timeout: 5000 });
|
|
522
|
+
|
|
523
|
+
run('git', ['init', '-b', 'main']);
|
|
524
|
+
run('git', ['config', 'user.email', 'test@test.com']);
|
|
525
|
+
run('git', ['config', 'user.name', 'Test']);
|
|
526
|
+
|
|
527
|
+
// Commit a clean base on main
|
|
528
|
+
fs.writeFileSync(path.join(codexDir, 'app.rb'), '# clean base\nclass App\nend\n');
|
|
529
|
+
run('git', ['add', 'app.rb']);
|
|
530
|
+
run('git', ['commit', '-m', 'initial commit']);
|
|
531
|
+
|
|
532
|
+
// Create feature branch with vulnerable code (reuse review fixture)
|
|
533
|
+
run('git', ['checkout', '-b', 'feature/add-vuln']);
|
|
534
|
+
const vulnContent = fs.readFileSync(path.join(ROOT, 'test', 'fixtures', 'review-eval-vuln.rb'), 'utf-8');
|
|
535
|
+
fs.writeFileSync(path.join(codexDir, 'user_controller.rb'), vulnContent);
|
|
536
|
+
run('git', ['add', 'user_controller.rb']);
|
|
537
|
+
run('git', ['commit', '-m', 'add vulnerable controller']);
|
|
538
|
+
|
|
539
|
+
// Copy the codex skill file
|
|
540
|
+
fs.copyFileSync(path.join(ROOT, 'codex', 'SKILL.md'), path.join(codexDir, 'codex-SKILL.md'));
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
afterAll(() => {
|
|
544
|
+
try { fs.rmSync(codexDir, { recursive: true, force: true }); } catch {}
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
test('/codex review produces findings and GATE verdict', async () => {
|
|
548
|
+
// Check codex is available — skip if not installed
|
|
549
|
+
const codexCheck = spawnSync('which', ['codex'], { stdio: 'pipe', timeout: 3000 });
|
|
550
|
+
if (codexCheck.status !== 0) {
|
|
551
|
+
console.warn('codex CLI not installed — skipping E2E test');
|
|
552
|
+
return;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
const result = await runSkillTest({
|
|
556
|
+
prompt: `You are in a git repo on branch feature/add-vuln with changes against main.
|
|
557
|
+
Read codex-SKILL.md for the /codex skill instructions.
|
|
558
|
+
Run /codex review to review the current diff against main.
|
|
559
|
+
Write the full output (including the GATE verdict) to ${codexDir}/codex-output.md`,
|
|
560
|
+
workingDirectory: codexDir,
|
|
561
|
+
maxTurns: 15,
|
|
562
|
+
timeout: 300_000,
|
|
563
|
+
testName: 'codex-review',
|
|
564
|
+
runId,
|
|
565
|
+
model: 'claude-opus-4-6',
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
logCost('/codex review', result);
|
|
569
|
+
recordE2E(evalCollector, '/codex review', 'Codex skill E2E', result);
|
|
570
|
+
expect(result.exitReason).toBe('success');
|
|
571
|
+
|
|
572
|
+
// Check that output file was created with review content
|
|
573
|
+
const outputPath = path.join(codexDir, 'codex-output.md');
|
|
574
|
+
if (fs.existsSync(outputPath)) {
|
|
575
|
+
const output = fs.readFileSync(outputPath, 'utf-8');
|
|
576
|
+
// Should contain the CODEX SAYS header or GATE verdict
|
|
577
|
+
const hasCodexOutput = output.includes('CODEX') || output.includes('GATE') || output.includes('codex');
|
|
578
|
+
expect(hasCodexOutput).toBe(true);
|
|
579
|
+
}
|
|
580
|
+
}, 360_000);
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
// Module-level afterAll — finalize eval collector after all tests complete
|
|
584
|
+
afterAll(async () => {
|
|
585
|
+
await finalizeEvalCollector(evalCollector);
|
|
586
|
+
});
|