mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-23 16:41:35 +01:00
Free-suite CI stops failing before any test runs when archive.ubuntu.com is slow, and four tests that failed and then passed in the last day are fixed at their cause. Why: 27 setup failures and 5 flaky reds on 2026-11-19 cost reruns and blocked READY checks across PRs and main. Nothing to do: the first run on each runner image fills the new package cache. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
39 lines
18 KiB
JSON
39 lines
18 KiB
JSON
{
|
|
"provenance": {
|
|
"source": "https://github.com/garrytan/gstack/actions/runs/44351657692 eval slice 15 (main 2767d229, full census), review-coverage-audit (claude-opus-5-5); the three parent Bash calls and their results, byte-exact (the three Read calls between the second and third, of review skill files, are omitted)",
|
|
"recordedPassed": false,
|
|
"recordedFailures": [
|
|
"missing successful source-file read",
|
|
"missing successful test-file read"
|
|
],
|
|
"note": "The first call cd-ed into <cwd>/review and failed at a zsh echo ====== separator; the second cd-ed there again and listed it. Claude Code keeps a call's final cwd, so the third call, cd .. && cat -n src/billing.ts && echo ---- && cat -n test/billing.test.ts, read the owned files from the recorded cwd. The checker only accepted a leading cd to the absolute recorded cwd, so it credited neither read."
|
|
},
|
|
"cwd": "/home/runner/.cache/gstack-paid-shard-dT3Otw/tmp/skill-e2e-review-coverage-v7u3iN",
|
|
"sessionId": "ed8701ac-c025-448b-a772-b867d220639e",
|
|
"calls": [
|
|
{
|
|
"toolUseId": "toolu_01Hzqn9sssjPsqahBCq2JxFM",
|
|
"command": "cd /home/runner/.cache/gstack-paid-shard-dT3Otw/tmp/skill-e2e-review-coverage-v7u3iN/review; cat SKILL.md; echo ======; cat sections/review-army.md; echo =====; cat specialists/testing.md",
|
|
"isError": true,
|
|
"output": "Exit code 1\n---\nname: review\npreamble-tier: 4\nversion: 1.0.0\ndescription: \"Use when you review a diff before it lands: local changes, a branch or a PR. Use for: review my changes, look over my diff, review this pr. (gstack)\"\nallowed-tools:\n - Bash\n - Read\n - Edit\n - Write\n - Grep\n - Glob\n - Agent\n - AskUserQuestion\n - WebSearch\ntriggers:\n - review my changes\n - look over my diff\n - review this pr\n - code review\n - check my diff\n - pre-landing review\ncontract:\n version: 1\n items:\n - id: specialists-dispatched\n kind: selected_specialists_dispatched\n marker: \"Dispatching N specialists:\"\n - id: adversarial-pass\n kind: agent_dispatch\n match: Think like an attacker and a chaos engineer\n - id: review-report\n kind: report_labels\n heading: Pre-Landing Review\n labels:\n - Gate edits\n---\n\n<!-- AUTO-GENERATED from SKILL.md.tmpl — do not edit directly -->\n<!-- Regenerate: bun run gen:skill-docs -->\n\n## Done means\n\nFinish only when each of these exists (contract v1):\n\n- `specialists-dispatched`: the specialist selection printed (`Dispatching N specialists:` ...), then one Agent dispatch per specialist it names (none when a small diff skips them).\n- `adversarial-pass`: an Agent dispatch for the adversarial pass, its prompt including \"Think like an attacker and a chaos engineer\".\n- `review-report`: a `Pre-Landing Review` with Gate edits filled in (`none: <why>` where the skill's own stop rule leaves one empty).\n\n`~/.claude/skills/gstack/bin/gstack-skill-contract check` reads them from the transcript (docs/skill-routing-and-contracts.md). For an item that truly does not apply, run `~/.claude/skills/gstack/bin/gstack-skill-contract waive <item> --reason \"<why>\"` (this session only; it counts as a miss).\n\n## Step 0: Detect platform and base branch\n\nFirst, detect the git hosting platform from the remote URL:\n\n```bash\ngit remote get-url origin 2>/dev/null\n```\n\n- If the URL contains \"github.com\" → platform is **GitHub**\n- If the URL contains \"gitlab\" → platform is **GitLab**\n- Otherwise, check CLI availability:\n - `gh auth status 2>/dev/null` succeeds → platform is **GitHub** (covers GitHub Enterprise)\n - `glab auth status 2>/dev/null` succeeds → platform is **GitLab** (covers self-hosted)\n - Neither → **unknown** (use git-native commands only)\n\nDetermine which branch this PR/MR targets, or the repo's default branch if no\nPR/MR exists. Use the result as \"the base branch\" in all subsequent steps.\n\n**If GitHub:**\n1. `gh pr view --json baseRefName -q .baseRefName` — if succeeds, use it\n2. `gh repo view --json defaultBranchRef -q .defaultBranchRef.name` — if succeeds, use it\n\n**If GitLab:**\n1. `glab mr view -F json 2>/dev/null` and extract the `target_branch` field — if succeeds, use it\n2. `glab repo view -F json 2>/dev/null` and extract the `default_branch` field — if succeeds, use it\n\n**Git-native fallback (if unknown platform, or CLI commands fail):**\n1. `git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's|refs/remotes/origin/||'`\n2. If that fails: `git rev-parse --verify origin/main 2>/dev/null` → use `main`\n3. If that fails: `git rev-parse --verify origin/master 2>/dev/null` → use `master`\n\nIf all fail, fall back to `main`.\n\nPrint the detected base branch name. In every subsequent `git diff`, `git log`,\n`git fetch`, `git merge`, and PR/MR creation command, substitute the detected\nbranch name wherever the instructions say \"the base branch\" or `<default>`.\n\n---\n\n# Pre-Landing PR Review\n\nReview the branch diff against the base for structural issues tests miss.\n\n---\n\n## Section index — Read each section when its situation applies\n\nThis skill is a decision-tree skeleton. The steps below point to on-demand\nsections. Read a section in full before doing its step; do not work from memory.\n\n| When | Read this section |\n|------|-------------------|\n| leaving Step 1.5 | `sections/plan-completion.md` |\n| Select surfaces and read QA methods | Inline in [Step 4](#step-4-critical-pass-core-review); setup and probes run in Step 4.7 |\n| dispatching the Review Army specialists and merging their findings after the critical pass (Step 4.5) | `sections/review-army.md` |\n| running the always-on native adversarial review before fixes (Step 4.8) | `sections/adversarial.md` |\n| reusing explicitly skipped shared-code advice (Step 5.0) | `sections/shared-code-reuse.md` |\n\n---\n\n## Step 1: Check branch\n\n1. Run `git branch --show-current`.\n2. If on the base branch, output: **\"Nothing to review — you're on the base branch or have no changes against it.\"** and stop.\n3. Run `git fetch origin <base> --quiet && echo \"BASE_REFRESH: fresh\" || echo \"BASE_REFRESH: stale $(git rev-parse --short origin/<base>)\"`, then `DIFF_BASE=$(git merge-base origin/<base> HEAD) && git diff \"$DIFF_BASE\" --stat`. If no diff, output the same message and stop. `stale` is not an empty diff: continue; report `Base coverage: stale at <revision>`.\n4. Run `~/.claude/skills/gstack/bin/gstack-contributor-mode det\n\n... [19960 characters truncated] ...\n\n`.\n\n**Identity before merge or suppression:** Use installed `sharedLibsFingerprint`, never model-generated hashes. Send literal JSON on stdin (actual paths/symbol; keep the quoted delimiter), not interpolated shell code:\n\n```bash\nGSTACK_SHARED_LIB=~/.claude/skills/gstack/lib/review-evidence.ts\nbun --no-env-file --config=/dev/null -e 'const { sharedLibsFingerprint } = await import(process.argv[1]); const value = sharedLibsFingerprint(JSON.parse(await Bun.stdin.text())); if (!value) process.exit(1); console.log(value);' \"$GSTACK_SHARED_LIB\" <<'GSTACK_SHARED_LIBS_JSON'\n{\"evidence_paths\":[\"src/caller-a.ts\",\"src/caller-b.ts\"],\"helper_target\":{\"path\":\"src/shared.ts\",\"symbol\":\"sharedHelper\"}}\nGSTACK_SHARED_LIBS_JSON\n```\n\nUse the returned fingerprint; malformed/missing metadata requires revalidation. Real defects follow Fix-First independently: advice or a prior Skip cannot suppress, downgrade or replace them, even with a shared supplied fingerprint.\n\nCore findings use the confidence gates below; Step 4.6 applies its specialist gates.\nUse CRITICAL/INFORMATIONAL labels in the finding format.\nStep 5.8 combines these finding lines with the checklist's action groups.\n\n## Confidence Calibration\n\nVerify evidence first, then score every finding (1-10) and apply its display rule.\n\n### Pre-emit verification gate\n\n1. **Quote the specific code line:** file:line and verbatim text. For a missing field,\n quote its class definition; for a nullable value, its initialization; for a race, both sides.\n2. For framework-generated symbols, read and quote their generating metaclass,\n descriptor, ORM Meta block, migration, decorator or schema. Missing literal\n names in the class body or grep results do not prove absence.\n3. **If you cannot quote the motivating line(s), the finding is unverified.**\n Force its confidence to 4-5: use 4 for appendix-only reporting, or 5 only when\n the finding belongs in the main report with the medium-confidence caveat below.\n Never invent speculative confidence 7+.\n\n| Score | Meaning | Display rule |\n|-------|---------|-------------|\n| 9-10 | Specific code verifies a concrete bug or exploit. | Show normally |\n| 7-8 | High-confidence pattern match; very likely correct. | Show normally |\n| 5-6 | Moderate; could be a false positive. | Show with caveat: \"Medium confidence, verify this is actually an issue\" |\n| 3-4 | Suspicious but may be fine. | Suppress from main report. Include in appendix only. |\n| 1-2 | Speculation. | Only report a suspected release-blocking catastrophe (widespread data loss, total outage or system-wide compromise); label it CRITICAL and explicitly speculative. |\n\n**Finding format:**\n\n`[CRITICAL|INFORMATIONAL] (confidence: N/10) file:line — description`\n\nExample:\n`[CRITICAL] (confidence: 9/10) user.rb:42 — SQL injection via string interpolation`\n\n**Calibration learning:** If the user confirms a reported finding scored < 7 is\nreal, log it per Operational Self-Improvement.\n\n### TODOS cross-reference\n\nIf root `TODOS.md` exists, report closed items as \"This PR addresses TODO: <title>\".\nFlag new TODOs as informational and cite related items; otherwise skip silently.\n\n### Documentation staleness check\n\nRead root `.md` files. When changed code affects a documented feature or workflow\nbut its doc was not updated, flag an INFORMATIONAL finding naming the file and\naffected behavior. Propose `/document-release` for the parent's decision, never a\ncritical finding or another writer during collection. Skip silently if no docs exist.\n\n---\n\n> **STOP.** Before dispatching the Review Army specialists and merging their findings after the critical pass (Step 4.5), Read `~/.claude/skills/gstack/review/sections/review-army.md` and execute it\n> in full. Do not work from memory — that section is the source of truth for this step.\n\n---\n\n### Step 4.7: Exploratory QA (before Fix-First)\n\nOnly the parent runs report-only discovery.\nNever overwrite another run's reports. Batch only independent Reads.\n\n**1. Set the charter and isolation.**\nReuse Step 4's surfaces and completed Reads. Finish any missing scope/method Reads before charters, setup or probes; do not repeat completed Reads.\nWrite the Charter and complete the shared isolation/permission preflight before setup.\n\n**2. Check readiness and list required checks.**\nFor browsers, Read QA's `sections/browser-setup.md` and follow its report-only rules.\nReuse setup only with verified tools/session/target/ownership; otherwise recheck.\nNever install, import cookies or bootstrap tests. Functional-only skips browser setup.\n- Smoke: 5 minutes/12 probes, one success and the riskiest changed failure/edge.\n Required even for small diffs or missing plans/servers.\n- Required: plan commands/assertions, listed separately. Other ideas are optional, untested.\n\n**3. Run smoke and plan checks.**\nFollow the shared Probe loop for smoke checks and replays until the smoke limit.\nThen run required plan checks and revalidation, even after smoke expires, using the same procedure bu"
|
|
},
|
|
{
|
|
"toolUseId": "toolu_011cpmVj5bo6i2W6jDpYHHU3",
|
|
"command": "cd /home/runner/.cache/gstack-paid-shard-dT3Otw/tmp/skill-e2e-review-coverage-v7u3iN/review; ls -R; wc -c SKILL.md sections/* specialists/* 2>&1",
|
|
"isError": false,
|
|
"output": ".:\nSKILL.md\nSKILL.md.tmpl\nTODOS-format.md\nchecklist.md\ndesign-checklist.md\ngate-integrity.md\ngreptile-triage.md\nsections\nspecialists\n\n./sections:\nadversarial.md\nadversarial.md.tmpl\nmanifest.json\nplan-completion.md\nplan-completion.md.tmpl\npreamble.md\nreview-army.md\nreview-army.md.tmpl\nshared-code-reuse.md\nshared-code-reuse.md.tmpl\n\n./specialists:\napi-contract.md\ndata-migration.md\nmaintainability.md\nperformance.md\nred-team.md\nsecurity.md\nsimplification.md\nstate-machines.md\ntargeted.md\ntesting.md\n 52633 SKILL.md\n 23929 sections/adversarial.md\n 21 sections/adversarial.md.tmpl\n 1373 sections/manifest.json\n 17186 sections/plan-completion.md\n 299 sections/plan-completion.md.tmpl\n 23282 sections/preamble.md\n 18261 sections/review-army.md\n 16 sections/review-army.md.tmpl\n 2342 sections/shared-code-reuse.md\n 22 sections/shared-code-reuse.md.tmpl\n 2357 specialists/api-contract.md\n 2306 specialists/data-migration.md\n 2616 specialists/maintainability.md\n 2618 specialists/performance.md\n 2258 specialists/red-team.md\n 4060 specialists/security.md\n 4421 specialists/simplification.md\n 3748 specialists/state-machines.md\n 3309 specialists/targeted.md\n 9163 specialists/testing.md\n176220 total"
|
|
},
|
|
{
|
|
"toolUseId": "toolu_015UemgddjS7qg4bZSbVVGvF",
|
|
"command": "cd .. && cat -n src/billing.ts && echo ---- && cat -n test/billing.test.ts",
|
|
"isError": false,
|
|
"output": " 1\t\n 2\texport function processPayment(amount: number, currency: string) {\n 3\t if (amount <= 0) throw new Error('Invalid amount');\n 4\t if (currency !== 'USD' && currency !== 'EUR') throw new Error('Unsupported currency');\n 5\t return { status: 'success', amount, currency };\n 6\t}\n 7\t\n 8\texport function refundPayment(paymentId: string, reason: string) {\n 9\t if (!paymentId) throw new Error('Payment ID required');\n 10\t if (!reason) throw new Error('Reason required');\n 11\t return { status: 'refunded', paymentId, reason };\n 12\t}\n 13\t\n 14\t// coverage-read-evidence: 1b7e293f-bb26-4289-9b75-958c7613d49b\n----\n 1\t\n 2\timport { describe, test, expect } from 'vitest';\n 3\timport { processPayment } from '../src/billing';\n 4\t\n 5\tdescribe('processPayment', () => {\n 6\t test('processes valid payment', () => {\n 7\t const result = processPayment(100, 'USD');\n 8\t expect(result.status).toBe('success');\n 9\t });\n 10\t // GAP: no test for invalid amount\n 11\t // GAP: no test for unsupported currency\n 12\t // GAP: refundPayment not tested at all\n 13\t});\n 14\t\n 15\t// coverage-read-evidence: 59099786-6c84-45d7-a782-2be271408a36"
|
|
}
|
|
],
|
|
"finalOutput": "I applied only the testing specialist checklist to the two files. I didn't dispatch other specialists, run the adversarial pass, or change any files.\n\n```text\nsrc/billing.ts\nprocessPayment(amount, currency)\n├── valid USD happy path, processPayment(100, 'USD') returns status 'success' [OK]\n├── valid EUR path, currency === 'EUR' returns success (billing.ts:4) [GAP]\n├── amount <= 0 guard throws 'Invalid amount' (billing.ts:3) [GAP]\n│ └── boundary values amount = 0 and negative amounts [GAP]\n└── unsupported currency guard throws 'Unsupported currency' (billing.ts:4) [GAP]\nrefundPayment(paymentId, reason)\n├── refund success path returns status 'refunded' (billing.ts:11) [GAP]\n├── empty paymentId guard throws 'Payment ID required' (billing.ts:9) [GAP]\n└── empty reason guard throws 'Reason required' (billing.ts:10) [GAP]\n (refundPayment is not imported in test/billing.test.ts:3)\nLegend: [OK] tested [GAP] no test\n```\n\n{\"severity\":\"INFORMATIONAL\",\"confidence\":10,\"path\":\"src/billing.ts\",\"line\":8,\"category\":\"testing\",\"summary\":\"refundPayment is a public function with no tests and is not imported in test/billing.test.ts; its success path and both guards are uncovered\",\"fix\":\"Import refundPayment and test the success return plus both throw paths\",\"fingerprint\":\"src/billing.ts:8:testing\",\"specialist\":\"testing\",\"test_stub\":\"describe('refundPayment', () => { test('refunds valid payment', () => { expect(refundPayment('pay_1','dup').status).toBe('refunded'); }); test('rejects missing paymentId', () => { expect(() => refundPayment('','dup')).toThrow('Payment ID required'); }); test('rejects missing reason', () => { expect(() => refundPayment('pay_1','')).toThrow('Reason required'); }); });\"}\n{\"severity\":\"INFORMATIONAL\",\"confidence\":10,\"path\":\"src/billing.ts\",\"line\":3,\"category\":\"testing\",\"summary\":\"The guard `if (amount <= 0) throw new Error('Invalid amount')` has no negative-path test, and the boundary values 0 and negative amounts are untested\",\"fix\":\"Add toThrow tests for amou",
|
|
"files": {
|
|
"source": "\nexport function processPayment(amount: number, currency: string) {\n if (amount <= 0) throw new Error('Invalid amount');\n if (currency !== 'USD' && currency !== 'EUR') throw new Error('Unsupported currency');\n return { status: 'success', amount, currency };\n}\n\nexport function refundPayment(paymentId: string, reason: string) {\n if (!paymentId) throw new Error('Payment ID required');\n if (!reason) throw new Error('Reason required');\n return { status: 'refunded', paymentId, reason };\n}\n\n// coverage-read-evidence: 1b7e293f-bb26-4289-9b75-958c7613d49b\n",
|
|
"tests": "\nimport { describe, test, expect } from 'vitest';\nimport { processPayment } from '../src/billing';\n\ndescribe('processPayment', () => {\n test('processes valid payment', () => {\n const result = processPayment(100, 'USD');\n expect(result.status).toBe('success');\n });\n // GAP: no test for invalid amount\n // GAP: no test for unsupported currency\n // GAP: refundPayment not tested at all\n});\n\n// coverage-read-evidence: 59099786-6c84-45d7-a782-2be271408a36\n"
|
|
}
|
|
}
|