mirror of
https://github.com/garrytan/gstack.git
synced 2026-11-29 19:34:29 +01:00
The paid shared-code review test counts a caller file printed with cat -A (GST-4120) (#4878)
The release gate's shared-code review test no longer fails a correct review that printed a caller file with `cat -A` in a batched read that ended in an error. Why: release gate run 46089594210 failed this case once on main (its rerun passed); the review was right, and only the test's evidence check missed the read. Nothing to do: this changes a test helper and adds one captured fixture; no shipped skill or binary changes. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> Review-Finding: p1/specialist-batched#1 reader=testing Review-Finding: p1v/outside-voice#1 reader=outside-voice
This commit is contained in:
1 parent
dfbdccf4c1
commit
5bf787370c
5 files changed
+647
-3
No files matched your search
@@ -0,0 +1 @@
|
||||
The paid shared-code review test no longer fails a correct review that printed a caller file with `cat -A`. In a batched read whose result is an error, the test's evidence check now also accepts GNU cat's visible rendering (`-A`, `-e`, `-t`, `-v`, `-E`, `-T`) of the exact file, so the release gate stops reporting this case as a flaky failure (run 46089594210). A truncated, edited or differently rendered file still fails.
|
||||
+543
@@ -0,0 +1,543 @@
|
||||
{
|
||||
"source": "Release gate 46088945889 / E2E Evals run 46089594210 slice 5 (paid-slice-5-a1), shared-libs-review-revalidation, filtered scenario at main 778934c0: one Bash call printed src/retry-route.ts through cat -A, so every line ended in a visible $, then cmp exited 1 because the raw bytes differ from the index blob, so the result carried is_error. Native tool blocks only; sources are the evidence files as that call printed them, each matching the sha256sum line the same call printed.",
|
||||
"expected": {
|
||||
"helper": "/__w/gstack/gstack/bin/gstack-review-log",
|
||||
"repo": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/repo",
|
||||
"state": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/state",
|
||||
"slug": "fixture-shared-libs",
|
||||
"directory": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/state/projects/fixture-shared-libs/.review-starts",
|
||||
"branch": "feature/a",
|
||||
"wtree": "288a3521b692882b9936606504a4b7999286702f",
|
||||
"startedAt": "2026-11-28T00:48:51.434Z",
|
||||
"finding": {
|
||||
"severity": "INFORMATIONAL",
|
||||
"confidence": 9,
|
||||
"path": "src/retry-worker.ts",
|
||||
"line": 2,
|
||||
"category": "shared-libs",
|
||||
"summary": "Reuse the tested parser",
|
||||
"advisory": true,
|
||||
"evidence_paths": [
|
||||
"src/retry-worker.ts",
|
||||
"src/retry-route.ts",
|
||||
"lib/retry-after.ts"
|
||||
],
|
||||
"helper_target": {
|
||||
"path": "lib/retry-after.ts",
|
||||
"symbol": "retrySeconds"
|
||||
},
|
||||
"fingerprint": "shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33",
|
||||
"snapshot_covered_paths": [
|
||||
"src/retry-worker.ts",
|
||||
"lib/retry-after.ts"
|
||||
]
|
||||
},
|
||||
"reusable": false,
|
||||
"coveredPaths": [
|
||||
"src/retry-worker.ts",
|
||||
"lib/retry-after.ts"
|
||||
],
|
||||
"sources": {
|
||||
"src/retry-worker.ts": "// Both callers require Retry-After seconds/date parsing, 3600-second ceiling and caller fallback.\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {\n if (value == null || value.trim() === '') return fallback;\n const normalized = value.trim();\n if (/^\\d+$/.test(normalized)) {\n const seconds = Number(normalized);\n if (!Number.isSafeInteger(seconds)) return fallback;\n return Math.min(seconds, 3600);\n }\n const deadline = Date.parse(normalized);\n if (!Number.isFinite(deadline)) return fallback;\n const remaining = Math.ceil((deadline - now) / 1000);\n if (remaining < 0) return 0;\n return Math.min(remaining, 3600);\n}\n",
|
||||
"lib/retry-after.ts": "// Proven shared parser already used by the scheduler.\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {\n if (value == null || value.trim() === '') return fallback;\n const normalized = value.trim();\n if (/^\\d+$/.test(normalized)) {\n const seconds = Number(normalized);\n if (!Number.isSafeInteger(seconds)) return fallback;\n return Math.min(seconds, 3600);\n }\n const deadline = Date.parse(normalized);\n if (!Number.isFinite(deadline)) return fallback;\n const remaining = Math.ceil((deadline - now) / 1000);\n if (remaining < 0) return 0;\n return Math.min(remaining, 3600);\n}\n",
|
||||
"src/retry-route.ts": "// Both callers require Retry-After seconds/date parsing, 3600-second ceiling and caller fallback.\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {\n if (value == null || value.trim() === '') return fallback;\n const normalized = value.trim();\n if (/^\\d+$/.test(normalized)) {\n const seconds = Number(normalized);\n if (!Number.isSafeInteger(seconds)) return fallback;\n return Math.min(seconds, 3600);\n }\n const deadline = Date.parse(normalized);\n if (!Number.isFinite(deadline)) return fallback;\n const remaining = Math.ceil((deadline - now) / 1000);\n if (remaining < 0) return 0;\n return Math.min(remaining, 3600);\n}\n// RAW-ONLY changed caller bytes after the skipped review\n"
|
||||
}
|
||||
},
|
||||
"events": [
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01TExSxPMMPuux1Qb3gqy3MK",
|
||||
"name": "Read",
|
||||
"input": {
|
||||
"file_path": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/review-lifecycle.md"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01TExSxPMMPuux1Qb3gqy3MK",
|
||||
"content": "1\t---\n2\tname: review\n3\tpreamble-tier: 4\n4\tversion: 1.0.0\n5\tdescription: \"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)\"\n6\tallowed-tools:\n7\t - Bash\n8\t - Read\n9\t - Edit\n10\t - Write\n11\t - Grep\n12\t - Glob\n13\t - Agent\n14\t - AskUserQuestion\n15\t - WebSearch\n16\t - Bash(/__w/gstack/gstack/bin/gstack-skill-load:*)\n17\ttriggers:\n18\t - review my changes\n19\t - look over my diff\n20\t - review this pr\n21\t - code review\n22\t - check my diff\n23\t - pre-landing review\n24\tcontract:\n25\t version: 1\n26\t items:\n27\t - { id: specialists-dispatched, kind: selected_specialists_dispatched, marker: \"Dispatching N specialists:\" }\n28\t - { id: adversarial-pass, kind: agent_dispatch, match: Think like an attacker and a chaos engineer, task_name: adversarial }\n29\t - { id: review-report, kind: report_labels, heading: Pre-Landing Review, labels: [Gate edits] }\n30\t---\n31\t\n32\t## Step 3: Get the diff\n33\t\n34\tAn invocation is this /review run; a pass reviews one candidate before any fixes.\n35\tOn first entry, initialize one invocation action list and CYCLES=0. Keep both through re-reviews.\n36\t\n37\tEach pass has one direction: collect findings in Steps 3–4.8, approve and apply\n38\tfixes in Step 5, then choose repeat or final persistence in Step 5.8.\n39\tDo not edit reviewed source until Step 5. All readers examine the same candidate.\n40\t\n41\tDiff the working tree against the merge base:\n42\t\n43\t```bash\n44\tDIFF_BASE=$(git merge-base origin/main HEAD)\n45\t/__w/gstack/gstack/bin/gstack-review-log --start review\n46\tgit diff \"$DIFF_BASE\"\n47\t```\n48\t\n49\t1. Save the printed REVIEW_START for this core candidate before reading its diff.\n50\t2. Each re-review captures a new token before reading, never at log time. After an\n51\t edited pass, start the next with `--start review --fix-range`: it prints\n52\t REVIEW_START, then `FIX_BASE=<sha>`. Wherever this pass sets DIFF_BASE outside\n53\t Step 4.8, use FIX_BASE instead; Step 4.8 and every other `<base>` use stay full.\n54\t On refusal, start a full pass.\n55\t3. Native/outside reviewer attempts own separate PASS_START tokens, not REVIEW_START.\n56\t4. Read non-ignored untracked source too (`git ls-files --others --exclude-standard`);\n57\t the captured candidate includes it.\n58\t5. First pass only: emit Step 1.5's final Scope Check; `Diff read` records this read.\n59\t\n60\tKeep the review-record terms separate:\n61\t\n62\t| Value | Purpose and owner |\n63\t|---|---|\n64\t| REVIEW_START / PASS_START | Opaque start receipts from the logger: one for the core pass, one for each other reviewer attempt. |\n65\t| Finding fingerprint | Groups duplicate findings. The installed helper computes shared-code fingerprints; a matching key alone never proves a prior Skip is reusable. |\n66\t| `review_binding` | The logger's proof tying a finished review to its captured candidate, not a finding identifier. |\n67\t| `snapshot_covered_paths` | Supporting advice files the logger proved byte-identical to that candidate. Used by the prior-Skip checker, never supplied by the reviewer. |\n68\t\n69\t## Step 4: Critical pass (core review)\n70\t\n71\t> **STOP.** Before any probe, including plan checks, complete the ordered scope/method Reads in earlier responses. Never batch a probe (capture, guard start, plan check) with a Read.\n72\tStep 4 is read-only: defer charters, setup and probes to Step 4.7.\n73\t\n74\t1. From the installed /review SKILL.md's directory, choose one path:\n75\t- If the caller directory is `review`, Read `../qa/sections/exploratory.md` in full.\n76\t- If the caller directory is prefixed `gstack-review`, use `../gstack-qa/sections/exploratory.md` instead and read it in full.\n77\t- If neither layout applies, report an unresolved QA installation as a setup blocker; do not guess another path.\n78\tUse this host's installation, never the product tree. If missing or unreadable, report a QA setup blocker and its affected probes as blocked; continue other safe probes (independent functional/static checks). Missing/unreadable assets block required QA.\n79\t2. Then Read QA's `sections/scope.md` in full; pick surfaces.\n80\t3. Then Read each listed method in full; the entrypoint alone completes nothing.\n81\t\n82\tQA's `sections/...` and `templates/...` paths resolve from installed QA SKILL.md, not caller/product.\n83\t\n84\tApply both checklist passes in order: CRITICAL, then INFORMATIONAL. Respect its suppressions.\n85\tCRITICAL is the blocking floor (docs/review-policy.md): a finding that would fail a\n86\ttest, break production, or lose data or secrets. Everything else is INFORMATIONAL and\n87\tnever earns another pass. `NO FINDINGS` is a complete result from any reviewer.\n88\t\n89\t**Sideways sweep (every finding; reads code OUTSIDE the diff).** Grep the findLine truncated
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01KCJwFgLyebRJPaAi1NDzHD",
|
||||
"name": "Read",
|
||||
"input": {
|
||||
"file_path": "/__w/gstack/gstack/review/checklist.md"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01KCJwFgLyebRJPaAi1NDzHD",
|
||||
"content": "1\t# Pre-Landing Review Checklist\n2\t\n3\t## Instructions\n4\t\n5\tReview the merge-base diff from the caller, including its selected uncommitted and new source. Use the caller's detected base, not a hardcoded branch. Cite `file:line` and suggest fixes. Only flag real problems.\n6\t\n7\t**PR type (decide first, from the changed paths; write it as the first line of your review, `PR type: <type>`):**\n8\t- **docs-only:** every path is Markdown or plain text under `docs/` or a README/CHANGELOG, and none is a prompt, template or skill file.\n9\t- **CI/infra:** `.github/**`, other CI config (`.gitlab-ci.yml`, `.circleci/**`, `Jenkinsfile`, Buildkite), `Dockerfile*`, compose files, Terraform, Kubernetes or Helm manifests.\n10\t- **scripts/tooling:** shell, batch and PowerShell files (`*.sh`, `*.bash`, `*.bat`, `*.cmd`, `*.ps1`), `Makefile`, lint and format config.\n11\t- **application:** everything else. Code in other languages under `bin/`, `scripts/` or `tools/` (an extensionless file there included), package manifests and lockfiles, prompt templates (`*.tmpl`) and skill Markdown are application, as is any path you cannot place. When in doubt, application.\n12\t- **mixed:** paths of more than one type above.\n13\t\n14\tOn application and mixed diffs, run every category below exactly as written; nothing is skipped. On a CI/infra, scripts/tooling or docs-only diff, always run Gate Integrity, Shell Injection, Completeness Gaps, Distribution & CI/CD Pipeline and Repo Conventions & Platform Fit, and report every other category whose subject is absent from the diff once, in one line: `Not applicable (PR type: <type>): <categories>`. A not-applicable category never counts as passed.\n15\t\n16\t**Two-pass review:**\n17\t- **Pass 1 (CRITICAL):** Run SQL & Data Safety, Race Conditions, LLM Output Trust Boundary, Shell Injection, Enum Completeness, and Gate Integrity first. Highest severity.\n18\t- **Pass 2 (INFORMATIONAL):** Run remaining categories below. Lower severity but still actioned.\n19\t- **Specialist categories (handled by parallel subagents, NOT this checklist):** Test Gaps, Dead Code, Magic Numbers, Conditional Side Effects, Performance & Bundle Impact, Crypto & Entropy, Simplification (unrequested structure). See `review/specialists/` for these.\n20\t\n21\tCompleteness Gaps and Simplification are orthogonal, not contradictory: Completeness pushes coverage UP (tests, edge cases, error paths), Simplification pushes unrequested structure DOWN (one-implementation abstractions, hand-rolled stdlib, dead flexibility). The same diff can legitimately receive both.\n22\t\n23\tAll findings get action via Fix-First Review: obvious mechanical fixes are applied automatically,\n24\tgenuinely ambiguous issues are batched into a single user question.\n25\t\n26\t**Output format:**\n27\t\n28\t```\n29\tPre-Landing Review: N issues (X critical, Y informational)\n30\t\n31\t**AUTO-FIXED:**\n32\t- [file:line] Problem → fix applied\n33\t\n34\t**NEEDS INPUT:**\n35\t- [file:line] Problem description\n36\t Recommended fix: suggested fix\n37\t```\n38\t\n39\tIf no issues found: `Pre-Landing Review: No issues found.`\n40\t\n41\tBe terse. For each issue: one line describing the problem, one line with the fix. No preamble, no summaries, no \"looks good overall.\"\n42\t\n43\t---\n44\t\n45\t## Review Categories\n46\t\n47\t### Pass 1 — CRITICAL\n48\t\n49\t#### SQL & Data Safety\n50\t- String interpolation in SQL (even if values are `.to_i`/`.to_f` — use parameterized queries (Rails: sanitize_sql_array/Arel; Node: prepared statements; Python: parameterized queries))\n51\t- TOCTOU races: check-then-set patterns that should be atomic `WHERE` + `update_all`\n52\t- Bypassing model validations for direct DB writes (Rails: update_column; Django: QuerySet.update(); Prisma: raw queries)\n53\t- N+1 queries: Missing eager loading (Rails: .includes(); SQLAlchemy: joinedload(); Prisma: include) for associations used in loops/views\n54\t\n55\t#### Race Conditions & Concurrency\n56\t- Read-check-write without uniqueness constraint or catch duplicate key error and retry (e.g., `where(hash:).first` then `save!` without handling concurrent insert)\n57\t- find-or-create without unique DB index — concurrent calls can create duplicates\n58\t- Status transitions that don't use atomic `WHERE old_status = ? UPDATE SET new_status` — concurrent updates can skip or double-apply transitions\n59\t- Unsafe HTML rendering (Rails: .html_safe/raw(); React: dangerouslySetInnerHTML; Vue: v-html; Django: |safe/mark_safe) on user-controlled data (XSS)\n60\t\n61\t#### LLM Output Trust Boundary\n62\t- LLM-generated values (emails, URLs, names) written to DB or passed to mailers without format validation. Add lightweight guards (`EMAIL_REGEXP`, `URI.parse`, `.strip`) before persisting.\n63\t- Structured tool output (arrays, hashes) accepted without type/shape checks before database writes.\n64\t- LLM-generated URLs fetched without allowlist — SLine truncated
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_015KGFYKymBsFFsDgt846b48",
|
||||
"name": "Read",
|
||||
"input": {
|
||||
"file_path": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/current-advisory.jsonl"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_015KGFYKymBsFFsDgt846b48",
|
||||
"content": "1\t{\"severity\":\"INFORMATIONAL\",\"confidence\":9,\"path\":\"src/retry-worker.ts\",\"line\":2,\"category\":\"shared-libs\",\"summary\":\"Reuse the tested parser\",\"advisory\":true,\"evidence_paths\":[\"src/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"},\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\",\"snapshot_covered_paths\":[\"src/retry-worker.ts\",\"lib/retry-after.ts\"],\"specialist\":\"maintainability\"}\n2\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01JrGKtXw2juJVDBupAt9C8Z",
|
||||
"name": "Read",
|
||||
"input": {
|
||||
"file_path": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/resumed-review-prerequisites.json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01JrGKtXw2juJVDBupAt9C8Z",
|
||||
"content": "1\t{\n2\t \"kind\": \"synthetic-path-review-prerequisites\",\n3\t \"synthetic\": true,\n4\t \"native_coverage\": false,\n5\t \"binding\": {\n6\t \"root\": \"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as\",\n7\t \"repo\": \"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/repo\",\n8\t \"state\": \"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/state\",\n9\t \"branch\": \"feature/a\",\n10\t \"head\": \"180b0f7072053763790f5f497bd14e2641d14bca\",\n11\t \"base\": \"180b0f7072053763790f5f497bd14e2641d14bca\",\n12\t \"wtree\": \"288a3521b692882b9936606504a4b7999286702f\",\n13\t \"index\": \"H 100644 bb5af942f63559a016674999cc537a73cd78c6a5 0\\t.gitignore\\nH 100644 bd2d0ac4930be6c76142f6a6c8d10e920413fc46 0\\tREADME.md\\nH 100644 00dfe6a156bae81aefc94ff1e9db54e32d774c75 0\\tlib/retry-after.ts\\nH 100644 8f6dd51314e9960b7bc3add9d95b8f530b85087d 0\\tsrc/retry-route.ts\\nH 100644 8ab4b18d9a2bd337433526c96343d251aaee8539 0\\tsrc/retry-worker.ts\\nH 100644 c362fe9878839740d82db85053758be5b95834cd 0\\tsrc/scheduler.ts\\nH 100644 a470f2c203c43e66c47991c64654dd524f9c5c29 0\\ttest/retry-after.test.ts\",\n14\t \"raw\": {\n15\t \".\": \"dir:16877\",\n16\t \".git/config\": \"33188:dd1cf6e79b2bb286373328b427b063182953114d5a6983ba87fa670da851fdd1\",\n17\t \".git/info/attributes\": \"33188:ffebdbd0e32ed7078fa00533beb7a17bfc12ba5d2d419f7425582d4670faab7f\",\n18\t \".git/info/exclude\": \"33188:6671fe83b7a07c8932ee89164d1f2793b2318058eb8b98dc5c06ee0a5a3b0ec1\",\n19\t \".gitignore\": \"33188:1578ba3393bbaae78dbda7cc170832528d3bfa4f61690cd07ba8b7075d47540b\",\n20\t \"README.md\": \"33188:df29e8fdc8895e1fe9d824b1697e4ef77ac6686a40dda22cf513074b37c490bc\",\n21\t \"lib\": \"dir:16877\",\n22\t \"lib/retry-after.ts\": \"33188:67d7124d11830e41baa5fca93bd0d45ce64fe58d92799c7d14635b912c5e5942\",\n23\t \"src\": \"dir:16877\",\n24\t \"src/retry-route.ts\": \"33188:c036d7506ae5b7fa666392d96e9265cbe53fbd093e0f16c7df09e46ffb567d11\",\n25\t \"src/retry-worker.ts\": \"33188:a17d12e37ae2b07d38dae292156aef6ec83d11b4ec2e295bb14d01f0e8fc9b2e\",\n26\t \"src/scheduler.ts\": \"33188:8a07bfe628ea4f9e679bcab3cfb68482678eebc1e4031887e996d799a6d1198e\",\n27\t \"test\": \"dir:16877\",\n28\t \"test/retry-after.test.ts\": \"33188:653e4090ae4e0d856f4dbf04fb05449d04c44fef599c24ce146d94969a1040a1\"\n29\t }\n30\t },\n31\t \"qa\": {\n32\t \"settled\": true,\n33\t \"required_probes\": [\n34\t {\n35\t \"id\": \"retry-contract\",\n36\t \"status\": \"passed\",\n37\t \"result\": \"Synthetic fixture input: Retry-After seconds/date parsing, ceiling and fallback probes passed.\"\n38\t }\n39\t ],\n40\t \"findings\": []\n41\t },\n42\t \"native_adversarial\": {\n43\t \"settled\": true,\n44\t \"status\": \"completed\",\n45\t \"findings\": [],\n46\t \"result\": \"Synthetic fixture input: native adversarial review returned no findings.\"\n47\t },\n48\t \"structured_review\": {\n49\t \"required\": false,\n50\t \"reason\": \"Tiny diff; no full-review, structured-review or P1 override requested.\"\n51\t }\n52\t}\n53\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01QNcWFkFX9wt7V24EeVCQWS",
|
||||
"name": "Read",
|
||||
"input": {
|
||||
"file_path": "/__w/gstack/gstack/review/sections/shared-code-reuse.md"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01QNcWFkFX9wt7V24EeVCQWS",
|
||||
"content": "1\t<!-- AUTO-GENERATED from shared-code-reuse.md.tmpl — do not edit directly -->\n2\t<!-- Regenerate: bun run gen:skill-docs -->\n3\t**Reuse a skipped shared-code advisory only with complete structural evidence:**\n4\t\n5\t1. **Read the evidence.** Read all supporting callers and the helper target\n6\t read-only: `git update-index`, even `--really-refresh`, clears the index flags\n7\t the checker reads. Establish first-party authored provenance and whether this\n8\t extraction is worthwhile; the checker cannot. Retain `evidence_paths`/`helper_target`.\n9\t2. **Run the checker.** From the repository root, pass the current finding as\n10\t literal JSON on stdin. Replace REVIEW_START with this pass's token\n11\t and the example paths/symbol with actual evidence. Keep the quoted delimiter.\n12\t\n13\t```bash\n14\t\"$HOME/.claude/skills/gstack/bin/gstack-review-log\" --check-shared-libs REVIEW_START <<'GSTACK_SHARED_LIBS_REUSE_JSON'\n15\t{\"advisory\":true,\"severity\":\"INFORMATIONAL\",\"evidence_paths\":[\"src/caller-a.ts\",\"src/caller-b.ts\"],\"helper_target\":{\"path\":\"src/shared.ts\",\"symbol\":\"sharedHelper\"}}\n16\tGSTACK_SHARED_LIBS_REUSE_JSON\n17\t```\n18\t\n19\t3. **Act on its result.** Only `reusable: true` permits suppression.\n20\t False, command failure or unreadable output requires fresh source review and a\n21\t new decision, never suppression. Do not supply your own snapshot, prior record or coverage.\n22\t4. **Persist through the logger.** The logger recomputes coverage; never supply\n23\t proof. Real defects retain normal Fix-First handling.\n24\t\n25\t**What a reusable result proves (never reconstruct these checks):**\n26\t- Identity: `sharedLibsFingerprint` plus the repo, raw branch and current snapshot.\n27\t The checker reads REVIEW_START without consuming/replacing it. Sanitized branch names are not identity.\n28\t- Prior decision: completed/converged review, verified binding, explicit Skip and\n29\t logger-versioned `snapshot_covered_paths`; unversioned coverage needs a fresh decision.\n30\t- Source: `canReuseSharedLibsAdvisory` requires every supporting path's raw file\n31\t byte-for-byte with its blob. Exclude assume-unchanged, skip-worktree and sparse index\n32\t entries; symlinks/ancestors, submodules, ignored/outside or unreadable files;\n33\t active/unknown Git filters, encodings and line conversion.\n34\t- Safe inspection: disables fsmonitor and optional locks; never uses external diff/textconv.\n35\t Unknown evidence fails closed.\n36\t"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01QZdU6xawqofCkj2FdDVHKj",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "git fetch origin 2>&1; echo \"--- merge-base\"; git merge-base origin/main HEAD; echo \"--- HEAD\"; git rev-parse HEAD; git rev-parse origin/main; echo \"--- branch\"; git branch --show-current; echo \"--- index\"; git ls-files -s -v; echo \"--- debug flags\"; git ls-files --debug | head -80; echo \"--- config\"; git config --local --list; echo \"--- attributes\"; cat .gitattributes 2>/dev/null; cat .git/info/attributes 2>/dev/null; git check-attr -a -- $(git ls-files); echo \"--- status\"; git status --porcelain=v2",
|
||||
"description": "Gather base metadata, index, config, attributes"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01QZdU6xawqofCkj2FdDVHKj",
|
||||
"content": "--- merge-base\n180b0f7072053763790f5f497bd14e2641d14bca\n--- HEAD\n180b0f7072053763790f5f497bd14e2641d14bca\n180b0f7072053763790f5f497bd14e2641d14bca\n--- branch\nfeature/a\n--- index\nH 100644 bb5af942f63559a016674999cc537a73cd78c6a5 0\t.gitignore\nH 100644 bd2d0ac4930be6c76142f6a6c8d10e920413fc46 0\tREADME.md\nH 100644 00dfe6a156bae81aefc94ff1e9db54e32d774c75 0\tlib/retry-after.ts\nH 100644 8f6dd51314e9960b7bc3add9d95b8f530b85087d 0\tsrc/retry-route.ts\nH 100644 8ab4b18d9a2bd337433526c96343d251aaee8539 0\tsrc/retry-worker.ts\nH 100644 c362fe9878839740d82db85053758be5b95834cd 0\tsrc/scheduler.ts\nH 100644 a470f2c203c43e66c47991c64654dd524f9c5c29 0\ttest/retry-after.test.ts\n--- debug flags\n.gitignore\n ctime: 1795826861:529483655\n mtime: 1795826861:529483655\n dev: 45\tino: 10488036\n uid: 1001\tgid: 1001\n size: 10\tflags: 0\nREADME.md\n ctime: 1795826861:529733931\n mtime: 1795826861:529733931\n dev: 45\tino: 10488037\n uid: 1001\tgid: 1001\n size: 22\tflags: 0\nlib/retry-after.ts\n ctime: 1795826861:539127851\n mtime: 1795826861:539127851\n dev: 45\tino: 10488066\n uid: 1001\tgid: 1001\n size: 629\tflags: 0\nsrc/retry-route.ts\n ctime: 1795826861:539127851\n mtime: 1795826861:539127851\n dev: 45\tino: 10488064\n uid: 1001\tgid: 1001\n size: 673\tflags: 0\nsrc/retry-worker.ts\n ctime: 1795826861:552001525\n mtime: 1795826861:552001525\n dev: 45\tino: 10488063\n uid: 1001\tgid: 1001\n size: 51\tflags: 0\nsrc/scheduler.ts\n ctime: 1795826861:539231098\n mtime: 1795826861:539231098\n dev: 45\tino: 10488067\n uid: 1001\tgid: 1001\n size: 126\tflags: 0\ntest/retry-after.test.ts\n ctime: 1795826861:539231098\n mtime: 1795826861:539231098\n dev: 45\tino: 10488069\n uid: 1001\tgid: 1001\n size: 384\tflags: 0\n--- config\ncore.repositoryformatversion=0\ncore.filemode=true\ncore.bare=false\ncore.logallrefupdates=true\nuser.name=Shared Libs Fixture\nuser.email=shared-libs@example.invalid\nremote.origin.url=https://github.com/fixture/shared-libs.git\nremote.origin.fetch=+refs/heads/*:refs/remotes/origin/*\nfilter.normalize.clean='/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/normalize-filter'\n--- attributes\nsrc/retry-route.ts filter=normalize\nsrc/retry-route.ts: filter: normalize\n--- status\n1 .M N... 100644 100644 100644 8f6dd51314e9960b7bc3add9d95b8f530b85087d 8f6dd51314e9960b7bc3add9d95b8f530b85087d src/retry-route.ts\n1 .M N... 100644 100644 100644 8ab4b18d9a2bd337433526c96343d251aaee8539 8ab4b18d9a2bd337433526c96343d251aaee8539 src/retry-worker.ts",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01YQwCFugkSv7Rxao9mmSUUZ",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "'/__w/gstack/gstack/bin/gstack-review-log' --start review",
|
||||
"description": "Capture review start token"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01YQwCFugkSv7Rxao9mmSUUZ",
|
||||
"content": "82687ac8-83ec-4c53-b7a8-3f2922fce190",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01XJZMQhUhxkBGavRBZXjw9A",
|
||||
"name": "Read",
|
||||
"input": {
|
||||
"file_path": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/state/projects/fixture-shared-libs/.review-starts/82687ac8-83ec-4c53-b7a8-3f2922fce190.json"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01XJZMQhUhxkBGavRBZXjw9A",
|
||||
"content": "1\t{\"skill\":\"review\",\"repo\":\"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/repo\",\"branch\":\"feature/a\",\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"started_at\":\"2026-11-28T00:48:51.434Z\",\"owner\":{\"machine\":\"ed5b5d59f3cb/\",\"boot\":\"f0abb729-ea55-4e14-8047-4740b0e56428\",\"pid\":8289,\"start\":13049,\"comm\":\"claude\"}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01XLjNkWT7DxQLza3wieVQiM",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "git diff --no-ext-diff --no-textconv 180b0f7072053763790f5f497bd14e2641d14bca; echo \"--- untracked\"; git ls-files --others --exclude-standard",
|
||||
"description": "Show working tree diff against merge base"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01XLjNkWT7DxQLza3wieVQiM",
|
||||
"content": "diff --git a/src/retry-worker.ts b/src/retry-worker.ts\nindex 8ab4b18..8f6dd51 100644\n--- a/src/retry-worker.ts\n+++ b/src/retry-worker.ts\n@@ -1 +1,15 @@\n-export { retrySeconds } from '../lib/retry-after';\n+// Both callers require Retry-After seconds/date parsing, 3600-second ceiling and caller fallback.\n+export function retrySeconds(value: string | null, now: number, fallback = 5): number {\n+ if (value == null || value.trim() === '') return fallback;\n+ const normalized = value.trim();\n+ if (/^\\d+$/.test(normalized)) {\n+ const seconds = Number(normalized);\n+ if (!Number.isSafeInteger(seconds)) return fallback;\n+ return Math.min(seconds, 3600);\n+ }\n+ const deadline = Date.parse(normalized);\n+ if (!Number.isFinite(deadline)) return fallback;\n+ const remaining = Math.ceil((deadline - now) / 1000);\n+ if (remaining < 0) return 0;\n+ return Math.min(remaining, 3600);\n+}\n--- untracked",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_0115rUCLFr348pVbJqr5p6e9",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "echo \"=== src/retry-worker.ts\"; cat src/retry-worker.ts; echo \"=== src/retry-route.ts\"; cat -A src/retry-route.ts; echo \"=== lib/retry-after.ts\"; cat lib/retry-after.ts; echo \"=== src/scheduler.ts\"; cat src/scheduler.ts; echo \"=== test/retry-after.test.ts\"; cat test/retry-after.test.ts; echo \"=== blob route (index)\"; git cat-file -p 8f6dd51314e9960b7bc3add9d95b8f530b85087d | cat -A; echo \"=== raw hashes\"; sha256sum src/retry-route.ts src/retry-worker.ts lib/retry-after.ts; git hash-object --no-filters src/retry-route.ts src/retry-worker.ts lib/retry-after.ts; echo \"=== cmp route raw vs index blob\"; git cat-file -p 8f6dd51314e9960b7bc3add9d95b8f530b85087d | cmp - src/retry-route.ts && echo identical",
|
||||
"description": "Read evidence files and compare raw bytes with blobs"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_0115rUCLFr348pVbJqr5p6e9",
|
||||
"content": "Exit code 1\n=== src/retry-worker.ts\n// Both callers require Retry-After seconds/date parsing, 3600-second ceiling and caller fallback.\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {\n if (value == null || value.trim() === '') return fallback;\n const normalized = value.trim();\n if (/^\\d+$/.test(normalized)) {\n const seconds = Number(normalized);\n if (!Number.isSafeInteger(seconds)) return fallback;\n return Math.min(seconds, 3600);\n }\n const deadline = Date.parse(normalized);\n if (!Number.isFinite(deadline)) return fallback;\n const remaining = Math.ceil((deadline - now) / 1000);\n if (remaining < 0) return 0;\n return Math.min(remaining, 3600);\n}\n=== src/retry-route.ts\n// Both callers require Retry-After seconds/date parsing, 3600-second ceiling and caller fallback.$\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {$\n if (value == null || value.trim() === '') return fallback;$\n const normalized = value.trim();$\n if (/^\\d+$/.test(normalized)) {$\n const seconds = Number(normalized);$\n if (!Number.isSafeInteger(seconds)) return fallback;$\n return Math.min(seconds, 3600);$\n }$\n const deadline = Date.parse(normalized);$\n if (!Number.isFinite(deadline)) return fallback;$\n const remaining = Math.ceil((deadline - now) / 1000);$\n if (remaining < 0) return 0;$\n return Math.min(remaining, 3600);$\n}$\n// RAW-ONLY changed caller bytes after the skipped review$\n=== lib/retry-after.ts\n// Proven shared parser already used by the scheduler.\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {\n if (value == null || value.trim() === '') return fallback;\n const normalized = value.trim();\n if (/^\\d+$/.test(normalized)) {\n const seconds = Number(normalized);\n if (!Number.isSafeInteger(seconds)) return fallback;\n return Math.min(seconds, 3600);\n }\n const deadline = Date.parse(normalized);\n if (!Number.isFinite(deadline)) return fallback;\n const remaining = Math.ceil((deadline - now) / 1000);\n if (remaining < 0) return 0;\n return Math.min(remaining, 3600);\n}\n=== src/scheduler.ts\nimport { retrySeconds } from '../lib/retry-after';\nexport const nextRun = (value: string) => retrySeconds(value, Date.now());\n=== test/retry-after.test.ts\nimport { expect, test } from 'bun:test';\nimport { retrySeconds } from '../lib/retry-after';\ntest('retry parser contract', () => {\n expect(retrySeconds(null, 0)).toBe(5);\n expect(retrySeconds('invalid', 0, 7)).toBe(7);\n expect(retrySeconds(' 42 ', 0)).toBe(42);\n expect(retrySeconds('999999', 0)).toBe(3600);\n expect(retrySeconds('Thu, 01 Jan 1970 00:00:01 GMT', 0)).toBe(1);\n});\n=== blob route (index)\n// Both callers require Retry-After seconds/date parsing, 3600-second ceiling and caller fallback.$\nexport function retrySeconds(value: string | null, now: number, fallback = 5): number {$\n if (value == null || value.trim() === '') return fallback;$\n const normalized = value.trim();$\n if (/^\\d+$/.test(normalized)) {$\n const seconds = Number(normalized);$\n if (!Number.isSafeInteger(seconds)) return fallback;$\n return Math.min(seconds, 3600);$\n }$\n const deadline = Date.parse(normalized);$\n if (!Number.isFinite(deadline)) return fallback;$\n const remaining = Math.ceil((deadline - now) / 1000);$\n if (remaining < 0) return 0;$\n return Math.min(remaining, 3600);$\n}$\n=== raw hashes\nc036d7506ae5b7fa666392d96e9265cbe53fbd093e0f16c7df09e46ffb567d11 src/retry-route.ts\na17d12e37ae2b07d38dae292156aef6ec83d11b4ec2e295bb14d01f0e8fc9b2e src/retry-worker.ts\n67d7124d11830e41baa5fca93bd0d45ce64fe58d92799c7d14635b912c5e5942 lib/retry-after.ts\n17b3d7ef6893832cc9ae3cdae509b1cb97336df2\n8f6dd51314e9960b7bc3add9d95b8f530b85087d\n00dfe6a156bae81aefc94ff1e9db54e32d774c75\n=== cmp route raw vs index blob\ncmp: EOF on - after byte 673, line 15",
|
||||
"is_error": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01Snzmc79JVvZRBMxEKZ2DiX",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "'/__w/gstack/gstack/bin/gstack-review-log' --check-shared-libs 82687ac8-83ec-4c53-b7a8-3f2922fce190 <<'GSTACK_REVALIDATION_FINDING'\n{\"severity\":\"INFORMATIONAL\",\"confidence\":9,\"path\":\"src/retry-worker.ts\",\"line\":2,\"category\":\"shared-libs\",\"summary\":\"Reuse the tested parser\",\"advisory\":true,\"evidence_paths\":[\"src/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"},\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\",\"snapshot_covered_paths\":[\"src/retry-worker.ts\",\"lib/retry-after.ts\"],\"specialist\":\"maintainability\"}\nGSTACK_REVALIDATION_FINDING",
|
||||
"description": "Check whether prior shared-libs Skip is reusable"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01Snzmc79JVvZRBMxEKZ2DiX",
|
||||
"content": "{\"reusable\":false,\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\",\"review_start\":{\"skill\":\"review\",\"repo\":\"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/repo\",\"branch\":\"feature/a\",\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"started_at\":\"2026-11-28T00:48:51.434Z\",\"owner\":{\"machine\":\"ed5b5d59f3cb/\",\"boot\":\"f0abb729-ea55-4e14-8047-4740b0e56428\",\"pid\":8289,\"start\":13049,\"comm\":\"claude\"}},\"snapshot\":{\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"branch_id\":\"951d42dc02dc743167ac3dd9d8decc5eee71860498c4b1707e1d38816df1ed1d\",\"covered_paths\":[\"src/retry-worker.ts\",\"lib/retry-after.ts\"]}}",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01KRAJymUHVUphKLs2peywEd",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "'/__w/gstack/gstack/bin/gstack-review-read'; echo \"=== fingerprint\"; GSTACK_SHARED_LIB=/__w/gstack/gstack/lib/review-evidence.ts; bun --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/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"}}\nGSTACK_SHARED_LIBS_JSON\necho \"=== importers\"; grep -rn \"retry-worker\\|retry-route\\|retry-after\\|retrySeconds\" --include=*.ts . | grep -v node_modules; git rev-parse --short HEAD",
|
||||
"description": "Read prior reviews, compute fingerprint, find importers"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01KRAJymUHVUphKLs2peywEd",
|
||||
"content": "{\"skill\":\"review\",\"timestamp\":\"2026-11-28T00:47:41.718Z\",\"status\":\"clean\",\"issues_found\":0,\"critical\":0,\"informational\":0,\"quality_score\":10,\"findings\":[{\"severity\":\"INFORMATIONAL\",\"confidence\":9,\"path\":\"src/retry-worker.ts\",\"line\":2,\"category\":\"shared-libs\",\"summary\":\"Reuse the tested parser\",\"advisory\":true,\"action\":\"skipped\",\"evidence_paths\":[\"src/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"},\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\",\"snapshot_covered_paths\":[\"src/retry-worker.ts\",\"lib/retry-after.ts\"]}],\"completed\":true,\"converged\":true,\"cycles\":0,\"status_source\":\"claimed\",\"commit_full\":\"180b0f7072053763790f5f497bd14e2641d14bca\",\"tree\":\"0d6f7d79e489259c97311903f75fe9570a21645d\",\"dirty\":true,\"review_binding\":{\"state\":\"verified\",\"start_wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"end_wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"started_at\":\"2026-11-28T00:47:41.712Z\",\"branch_id\":\"951d42dc02dc743167ac3dd9d8decc5eee71860498c4b1707e1d38816df1ed1d\"},\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"shared_libs_coverage_version\":1,\"review_freshness\":{\"status\":\"CURRENT\",\"reason\":\"completed clean pass on unchanged content\"}}\n---CONFIG---\nfalse---HEAD---\n180b0f7\n---WTREE---\n288a3521b692882b9936606504a4b7999286702f\n---TREE---\n0d6f7d79e489259c97311903f75fe9570a21645d\n---DIRTY---\ntrue\n=== fingerprint\nshared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\n=== importers\n(eval):4: no matches found: --include=*.ts\n180b0f7",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01QSPY4itjdmpqYEa2DmxcDz",
|
||||
"name": "Grep",
|
||||
"input": {
|
||||
"pattern": "retry-worker|retry-route|retry-after|retrySeconds",
|
||||
"path": "/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/repo",
|
||||
"output_mode": "content"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01QSPY4itjdmpqYEa2DmxcDz",
|
||||
"content": "lib/retry-after.ts:2:export function retrySeconds(value: string | null, now: number, fallback = 5): number {\ntest/retry-after.test.ts:2:import { retrySeconds } from '../lib/retry-after';\ntest/retry-after.test.ts:4: expect(retrySeconds(null, 0)).toBe(5);\ntest/retry-after.test.ts:5: expect(retrySeconds('invalid', 0, 7)).toBe(7);\ntest/retry-after.test.ts:6: expect(retrySeconds(' 42 ', 0)).toBe(42);\ntest/retry-after.test.ts:7: expect(retrySeconds('999999', 0)).toBe(3600);\ntest/retry-after.test.ts:8: expect(retrySeconds('Thu, 01 Jan 1970 00:00:01 GMT', 0)).toBe(1);\nsrc/retry-route.ts:2:export function retrySeconds(value: string | null, now: number, fallback = 5): number {\nsrc/retry-worker.ts:2:export function retrySeconds(value: string | null, now: number, fallback = 5): number {\nsrc/scheduler.ts:1:import { retrySeconds } from '../lib/retry-after';\nsrc/scheduler.ts:2:export const nextRun = (value: string) => retrySeconds(value, Date.now());"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01MxhYHUy3YMgCk44qbmPUPs",
|
||||
"name": "AskUserQuestion",
|
||||
"input": {
|
||||
"questions": [
|
||||
{
|
||||
"question": "[ADVISORY] shared-libs (fingerprint shared-libs:af037ba2…ee6d33). This diff replaces the worker's one-line re-export with a 14-line copy of retrySeconds (src/retry-worker.ts:2-15). An identical copy is already in src/retry-route.ts:2-15. Both match the existing, tested lib/retry-after.ts:2 retrySeconds (used by src/scheduler.ts:1, covered by test/retry-after.test.ts) byte for byte in contract: same signature, fallback 5, 3600s ceiling. The earlier Skip can't be reused: the checker returned reusable:false because src/retry-route.ts has a raw-only change hidden by its active 'normalize' Git filter. Fix: change both files to `export { retrySeconds } from '../lib/retry-after';`, about 28 lines saved (implementation: −30/+2). The existing contract test covers it, and the blast radius is limited to retry delay parsing. Note: this replay is no-edit, so choosing Fix blocks completion; it does not apply the edit. RECOMMENDATION: A.",
|
||||
"header": "Shared-libs",
|
||||
"multiSelect": false,
|
||||
"options": [
|
||||
{
|
||||
"label": "A) Fix as recommended (Recommended)",
|
||||
"description": "Re-export lib/retry-after retrySeconds from the worker and route. The edit is blocked in this no-edit replay; the review is reported as not completed."
|
||||
},
|
||||
{
|
||||
"label": "B) Skip",
|
||||
"description": "No code/index change; Skip recorded."
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01MxhYHUy3YMgCk44qbmPUPs",
|
||||
"content": "Your questions have been answered: \"[ADVISORY] shared-libs (fingerprint shared-libs:af037ba2…ee6d33). This diff replaces the worker's one-line re-export with a 14-line copy of retrySeconds (src/retry-worker.ts:2-15). An identical copy is already in src/retry-route.ts:2-15. Both match the existing, tested lib/retry-after.ts:2 retrySeconds (used by src/scheduler.ts:1, covered by test/retry-after.test.ts) byte for byte in contract: same signature, fallback 5, 3600s ceiling. The earlier Skip can't be reused: the checker returned reusable:false because src/retry-route.ts has a raw-only change hidden by its active 'normalize' Git filter. Fix: change both files to `export { retrySeconds } from '../lib/retry-after';`, about 28 lines saved (implementation: −30/+2). The existing contract test covers it, and the blast radius is limited to retry delay parsing. Note: this replay is no-edit, so choosing Fix blocks completion; it does not apply the edit. RECOMMENDATION: A.\"=\"B) Skip\". You can now continue with these answers in mind."
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01P6Fw3fGJzigbe7rhEvEE7u",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "sha256sum .git/config .git/info/attributes .git/info/exclude .gitignore README.md lib/retry-after.ts src/retry-route.ts src/retry-worker.ts src/scheduler.ts test/retry-after.test.ts; git ls-files -s -v; git rev-parse HEAD origin/main; git branch --show-current; git ls-files --others --exclude-standard; date -u +%Y-%m-%dT%H:%M:%SZ",
|
||||
"description": "Re-verify source hashes, index, refs and branch"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01P6Fw3fGJzigbe7rhEvEE7u",
|
||||
"content": "dd1cf6e79b2bb286373328b427b063182953114d5a6983ba87fa670da851fdd1 .git/config\nffebdbd0e32ed7078fa00533beb7a17bfc12ba5d2d419f7425582d4670faab7f .git/info/attributes\n6671fe83b7a07c8932ee89164d1f2793b2318058eb8b98dc5c06ee0a5a3b0ec1 .git/info/exclude\n1578ba3393bbaae78dbda7cc170832528d3bfa4f61690cd07ba8b7075d47540b .gitignore\ndf29e8fdc8895e1fe9d824b1697e4ef77ac6686a40dda22cf513074b37c490bc README.md\n67d7124d11830e41baa5fca93bd0d45ce64fe58d92799c7d14635b912c5e5942 lib/retry-after.ts\nc036d7506ae5b7fa666392d96e9265cbe53fbd093e0f16c7df09e46ffb567d11 src/retry-route.ts\na17d12e37ae2b07d38dae292156aef6ec83d11b4ec2e295bb14d01f0e8fc9b2e src/retry-worker.ts\n8a07bfe628ea4f9e679bcab3cfb68482678eebc1e4031887e996d799a6d1198e src/scheduler.ts\n653e4090ae4e0d856f4dbf04fb05449d04c44fef599c24ce146d94969a1040a1 test/retry-after.test.ts\nH 100644 bb5af942f63559a016674999cc537a73cd78c6a5 0\t.gitignore\nH 100644 bd2d0ac4930be6c76142f6a6c8d10e920413fc46 0\tREADME.md\nH 100644 00dfe6a156bae81aefc94ff1e9db54e32d774c75 0\tlib/retry-after.ts\nH 100644 8f6dd51314e9960b7bc3add9d95b8f530b85087d 0\tsrc/retry-route.ts\nH 100644 8ab4b18d9a2bd337433526c96343d251aaee8539 0\tsrc/retry-worker.ts\nH 100644 c362fe9878839740d82db85053758be5b95834cd 0\tsrc/scheduler.ts\nH 100644 a470f2c203c43e66c47991c64654dd524f9c5c29 0\ttest/retry-after.test.ts\n180b0f7072053763790f5f497bd14e2641d14bca\n180b0f7072053763790f5f497bd14e2641d14bca\nfeature/a\n2026-11-28T00:49:38Z",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_01Xivq7UufM9jngVcUqvhzqy",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "bun '/__w/gstack/gstack/test/helpers/shared-libs-path-fixture.ts' --check-review-prerequisites '/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/resumed-review-prerequisites.json'",
|
||||
"description": "Validate synthetic QA and adversarial prerequisites"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_01Xivq7UufM9jngVcUqvhzqy",
|
||||
"content": "{\"synthetic\":true,\"native_coverage\":false,\"settled\":true,\"current\":true,\"input_sha256\":\"68724b21a556b4ab2143fb9e4fea569269b35d978ab338e56a5d56aa158f266d\",\"context\":{\"kind\":\"synthetic-path-review-prerequisites\",\"synthetic\":true,\"native_coverage\":false,\"binding\":{\"root\":\"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as\",\"repo\":\"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/repo\",\"state\":\"/home/runner/.cache/gstack-paid-shard-ORf4W9/tmp/gstack-shared-revalidate-filtered-dUN5as/state\",\"branch\":\"feature/a\",\"head\":\"180b0f7072053763790f5f497bd14e2641d14bca\",\"base\":\"180b0f7072053763790f5f497bd14e2641d14bca\",\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"index\":\"H 100644 bb5af942f63559a016674999cc537a73cd78c6a5 0\\t.gitignore\\nH 100644 bd2d0ac4930be6c76142f6a6c8d10e920413fc46 0\\tREADME.md\\nH 100644 00dfe6a156bae81aefc94ff1e9db54e32d774c75 0\\tlib/retry-after.ts\\nH 100644 8f6dd51314e9960b7bc3add9d95b8f530b85087d 0\\tsrc/retry-route.ts\\nH 100644 8ab4b18d9a2bd337433526c96343d251aaee8539 0\\tsrc/retry-worker.ts\\nH 100644 c362fe9878839740d82db85053758be5b95834cd 0\\tsrc/scheduler.ts\\nH 100644 a470f2c203c43e66c47991c64654dd524f9c5c29 0\\ttest/retry-after.test.ts\",\"raw\":{\".\":\"dir:16877\",\".git/config\":\"33188:dd1cf6e79b2bb286373328b427b063182953114d5a6983ba87fa670da851fdd1\",\".git/info/attributes\":\"33188:ffebdbd0e32ed7078fa00533beb7a17bfc12ba5d2d419f7425582d4670faab7f\",\".git/info/exclude\":\"33188:6671fe83b7a07c8932ee89164d1f2793b2318058eb8b98dc5c06ee0a5a3b0ec1\",\".gitignore\":\"33188:1578ba3393bbaae78dbda7cc170832528d3bfa4f61690cd07ba8b7075d47540b\",\"README.md\":\"33188:df29e8fdc8895e1fe9d824b1697e4ef77ac6686a40dda22cf513074b37c490bc\",\"lib\":\"dir:16877\",\"lib/retry-after.ts\":\"33188:67d7124d11830e41baa5fca93bd0d45ce64fe58d92799c7d14635b912c5e5942\",\"src\":\"dir:16877\",\"src/retry-route.ts\":\"33188:c036d7506ae5b7fa666392d96e9265cbe53fbd093e0f16c7df09e46ffb567d11\",\"src/retry-worker.ts\":\"33188:a17d12e37ae2b07d38dae292156aef6ec83d11b4ec2e295bb14d01f0e8fc9b2e\",\"src/scheduler.ts\":\"33188:8a07bfe628ea4f9e679bcab3cfb68482678eebc1e4031887e996d799a6d1198e\",\"test\":\"dir:16877\",\"test/retry-after.test.ts\":\"33188:653e4090ae4e0d856f4dbf04fb05449d04c44fef599c24ce146d94969a1040a1\"}},\"qa\":{\"settled\":true,\"required_probes\":[{\"id\":\"retry-contract\",\"status\":\"passed\",\"result\":\"Synthetic fixture input: Retry-After seconds/date parsing, ceiling and fallback probes passed.\"}],\"findings\":[]},\"native_adversarial\":{\"settled\":true,\"status\":\"completed\",\"findings\":[],\"result\":\"Synthetic fixture input: native adversarial review returned no findings.\"},\"structured_review\":{\"required\":false,\"reason\":\"Tiny diff; no full-review, structured-review or P1 override requested.\"}}}",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "assistant",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_use",
|
||||
"id": "toolu_018SqEM3C6io1X5qNbXsf6yw",
|
||||
"name": "Bash",
|
||||
"input": {
|
||||
"command": "'/__w/gstack/gstack/bin/gstack-review-log' '{\"skill\":\"review\",\"timestamp\":\"2026-11-28T00:49:38Z\",\"status\":\"clean\",\"issues_found\":0,\"critical\":0,\"informational\":0,\"quality_score\":10.0,\"specialists\":{},\"findings\":[{\"severity\":\"INFORMATIONAL\",\"confidence\":9,\"path\":\"src/retry-worker.ts\",\"line\":2,\"category\":\"shared-libs\",\"summary\":\"Reuse the tested parser\",\"advisory\":true,\"action\":\"skipped\",\"evidence_paths\":[\"src/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"},\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\"}],\"commit\":\"180b0f7\",\"completed\":true,\"converged\":true,\"cycles\":0}' --finish 82687ac8-83ec-4c53-b7a8-3f2922fce190 && '/__w/gstack/gstack/bin/gstack-review-read'",
|
||||
"description": "Persist final review record and read it back"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "user",
|
||||
"message": {
|
||||
"content": [
|
||||
{
|
||||
"type": "tool_result",
|
||||
"tool_use_id": "toolu_018SqEM3C6io1X5qNbXsf6yw",
|
||||
"content": "{\"skill\":\"review\",\"timestamp\":\"2026-11-28T00:47:41.718Z\",\"status\":\"clean\",\"issues_found\":0,\"critical\":0,\"informational\":0,\"quality_score\":10,\"findings\":[{\"severity\":\"INFORMATIONAL\",\"confidence\":9,\"path\":\"src/retry-worker.ts\",\"line\":2,\"category\":\"shared-libs\",\"summary\":\"Reuse the tested parser\",\"advisory\":true,\"action\":\"skipped\",\"evidence_paths\":[\"src/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"},\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\",\"snapshot_covered_paths\":[\"src/retry-worker.ts\",\"lib/retry-after.ts\"]}],\"completed\":true,\"converged\":true,\"cycles\":0,\"status_source\":\"claimed\",\"commit_full\":\"180b0f7072053763790f5f497bd14e2641d14bca\",\"tree\":\"0d6f7d79e489259c97311903f75fe9570a21645d\",\"dirty\":true,\"review_binding\":{\"state\":\"verified\",\"start_wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"end_wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"started_at\":\"2026-11-28T00:47:41.712Z\",\"branch_id\":\"951d42dc02dc743167ac3dd9d8decc5eee71860498c4b1707e1d38816df1ed1d\"},\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"shared_libs_coverage_version\":1,\"review_freshness\":{\"status\":\"CURRENT\",\"reason\":\"completed clean pass on unchanged content\"}}\n{\"skill\":\"review\",\"timestamp\":\"2026-11-28T00:49:38Z\",\"status\":\"clean\",\"issues_found\":0,\"critical\":0,\"informational\":0,\"quality_score\":10,\"specialists\":{},\"findings\":[{\"severity\":\"INFORMATIONAL\",\"confidence\":9,\"path\":\"src/retry-worker.ts\",\"line\":2,\"category\":\"shared-libs\",\"summary\":\"Reuse the tested parser\",\"advisory\":true,\"action\":\"skipped\",\"evidence_paths\":[\"src/retry-worker.ts\",\"src/retry-route.ts\",\"lib/retry-after.ts\"],\"helper_target\":{\"path\":\"lib/retry-after.ts\",\"symbol\":\"retrySeconds\"},\"fingerprint\":\"shared-libs:af037ba20b8a3674855fb65b04f1855c7f0cb5581d3b31f1c4cf5ab648ee6d33\",\"snapshot_covered_paths\":[\"src/retry-worker.ts\",\"lib/retry-after.ts\"]}],\"commit\":\"180b0f7\",\"completed\":true,\"converged\":true,\"cycles\":0,\"status_source\":\"claimed\",\"commit_full\":\"180b0f7072053763790f5f497bd14e2641d14bca\",\"tree\":\"0d6f7d79e489259c97311903f75fe9570a21645d\",\"dirty\":true,\"review_binding\":{\"state\":\"verified\",\"start_wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"end_wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"started_at\":\"2026-11-28T00:48:51.434Z\",\"branch_id\":\"951d42dc02dc743167ac3dd9d8decc5eee71860498c4b1707e1d38816df1ed1d\"},\"wtree\":\"288a3521b692882b9936606504a4b7999286702f\",\"shared_libs_coverage_version\":1,\"review_freshness\":{\"status\":\"CURRENT\",\"reason\":\"completed clean pass on unchanged content\"}}\n---CONFIG---\nfalse---HEAD---\n180b0f7\n---WTREE---\n288a3521b692882b9936606504a4b7999286702f\n---TREE---\n0d6f7d79e489259c97311903f75fe9570a21645d\n---DIRTY---\ntrue",
|
||||
"is_error": false
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -245,6 +245,7 @@ export const FREE_FIXTURES: Readonly<Record<string, readonly string[]>> = {
|
||||
'test/fixtures/shared-libs-plan-callers-passing-censuses.json': ['test/shared-libs-plan-actor.test.ts'],
|
||||
'test/fixtures/shared-libs-plan-callers-slash-scope-37174266054.json': ['test/shared-libs-plan-actor.test.ts'],
|
||||
'test/fixtures/shared-libs-plan-callers-verbless-scope-37186854666.json': ['test/shared-libs-plan-actor.test.ts'],
|
||||
'test/fixtures/shared-libs-revalidation-filtered-show-all-read-46089594210.json': ['test/shared-libs-checker-interface-evidence-replays.test.ts'],
|
||||
'test/fixtures/shared-libs-unsupported-git-opus-reports.json': ['test/shared-libs-fixture.test.ts'],
|
||||
'test/fixtures/shared-libs-unsupported-git-requests.json': ['test/shared-libs-fixture.test.ts'],
|
||||
'test/fixtures/shared-libs/**': ['test/shared-libs-checker-interface-evidence.test.ts', 'test/shared-libs-fixture.test.ts', 'test/shared-libs-plan-actor.test.ts', 'test/shared-libs-revalidation-prompt.test.ts', 'test/shared-libs-review-start-evidence.test.ts', 'test/shared-libs-source-reads.test.ts', 'test/shared-libs-stage-actor.test.ts'],
|
||||
|
||||
@@ -309,6 +309,40 @@ function reader(words: string[], target: string | ((operand: string) => boolean)
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* What a read of `file` in `command` can print for `whole`: its bytes, or GNU cat's rendering
|
||||
* under the -A/-e/-t/-v/-E/-T options of a cat call that reads it (run 46089594210 read a
|
||||
* filtered caller through cat -A, so each line ended in a visible $).
|
||||
*/
|
||||
function shownSources(command: string, file: string, whole: string, expected: StartContext): string[] {
|
||||
const paths = sourcePaths(file);
|
||||
const environment = new Map([['GSTACK_HOME', expected.state], ['SLUG', expected.slug]]);
|
||||
const shown = [whole.replace(/\n$/, '')];
|
||||
for (const call of withDirectories(commands(command), paths.normalize(expected.repo), paths, environment)) {
|
||||
if (basename(call.words[0]) !== 'cat' || !reader(call.words, operand => {
|
||||
const expanded = expandVariables(operand, call.variables);
|
||||
return expanded !== undefined && literalPath(expanded, call.cwd, paths) === file;
|
||||
})) continue;
|
||||
const flags = call.words.slice(1, call.words.includes('--') ? call.words.indexOf('--') : undefined)
|
||||
.filter(word => word.startsWith('-') && word !== '-').map(word => word.slice(1)).join('');
|
||||
if (!flags || !/^[AetvETu]+$/.test(flags)) continue;
|
||||
const ends = /[AeE]/.test(flags), tabs = /[AtT]/.test(flags), nonprinting = /[Aetv]/.test(flags);
|
||||
const bytes: number[] = [];
|
||||
const text = (value: string) => { for (const char of value) bytes.push(char.charCodeAt(0)); };
|
||||
for (let byte of Buffer.from(whole, 'utf8')) {
|
||||
if (byte === 10) { if (ends) text('$'); bytes.push(10); continue; }
|
||||
if (byte === 9) { if (tabs) text('^I'); else bytes.push(9); continue; }
|
||||
if (!nonprinting) { bytes.push(byte); continue; }
|
||||
if (byte >= 128) { text('M-'); byte -= 128; }
|
||||
if (byte < 32) text(`^${String.fromCharCode(byte + 64)}`);
|
||||
else if (byte === 127) text('^?');
|
||||
else bytes.push(byte);
|
||||
}
|
||||
shown.push(Buffer.from(bytes).toString('utf8').replace(/\n$/, ''));
|
||||
}
|
||||
return shown;
|
||||
}
|
||||
|
||||
const rebinds = (words: string[], variable: string) => words[0]?.startsWith(`${variable}=`)
|
||||
|| ['export', 'local', 'declare', 'readonly', 'unset'].includes(words[0])
|
||||
&& words.slice(1).some(word => word === variable || word.startsWith(`${variable}=`));
|
||||
@@ -551,13 +585,14 @@ export function hasTrustedSharedLibsCheck(events: unknown[], expected: CheckerCo
|
||||
const reads = pairs.filter(pair => pair.at > start.returnedAt && pair.returnedAt < check.at && pair.text.trim());
|
||||
if (!expected.finding.evidence_paths.every((relative: string) => {
|
||||
const file = paths.join(expected.repo, relative);
|
||||
const source = expected.sources?.[relative]?.replace(/\n$/, '');
|
||||
const source = expected.sources?.[relative];
|
||||
return reads.some(read => read.tool === 'Read' && !read.error && typeof read.input?.file_path === 'string'
|
||||
&& literalPath(read.input.file_path, expected.repo, paths) === file
|
||||
|| read.tool === 'Bash' && typeof read.input?.command === 'string'
|
||||
&& inspectsFile(read.input.command, file, read.text, expected)
|
||||
&& (!read.error || !!source && commands(read.input.command).length > 1
|
||||
&& read.text.replace(/^ *\d+\t/gm, '').includes(source)));
|
||||
&& (!read.error || !!source?.replace(/\n$/, '') && commands(read.input.command).length > 1
|
||||
&& shownSources(read.input.command, file, source, expected)
|
||||
.some(shown => read.text.replace(/^ *\d+\t/gm, '').includes(shown))));
|
||||
})) continue;
|
||||
if (bash.some(finish => finish.at > check.returnedAt && invocations(finish.input.command).some(call =>
|
||||
call.words.length === 4 && call.words[2] === '--finish' && call.words[3] === token))) return true;
|
||||
|
||||
@@ -9,6 +9,7 @@ import { preparePathEligibilityFixture, checkPathReviewPrerequisites } from './h
|
||||
import { pathCallback, capturedPathRun } from './helpers/shared-libs-checker-evidence';
|
||||
import loopRead from './fixtures/shared-libs-index-flags-loop-read-39173752116.json';
|
||||
import erroredRead from './fixtures/shared-libs-path-ignored-errored-read-40617200857.json';
|
||||
import showAllRead from './fixtures/shared-libs-revalidation-filtered-show-all-read-46089594210.json';
|
||||
|
||||
describe('native executable shared-code checker evidence', () => {
|
||||
test.each([0, 1])('the complete R59 public attempt %i satisfies the actual callback without a manual fingerprint call', async index => {
|
||||
@@ -154,3 +155,66 @@ describe('errored Bash reads from the captured ignored-path review', () => {
|
||||
expect(hasTrustedSharedLibsCheck(events, expected)).toBe(false);
|
||||
});
|
||||
});
|
||||
|
||||
// Gate 46089594210 slice 5: the filtered revalidation printed src/retry-route.ts through cat -A
|
||||
// (a visible $ ends each line) beside a cmp that exited 1, so the result carried is_error.
|
||||
describe('errored cat -A read from the captured filtered revalidation', () => {
|
||||
const blocks = (events: any[]) => events.flatMap(event => event.message.content);
|
||||
const read = (events: any[]) => blocks(events).find((block: any) => block.type === 'tool_use'
|
||||
&& block.input?.command?.includes('cat -A src/retry-route.ts;'));
|
||||
const output = (events: any[], id: string) => blocks(events).find((block: any) => block.type === 'tool_result' && block.tool_use_id === id);
|
||||
|
||||
test('a whole evidence source shown by cat -A before a later failure counts as reading it', () => {
|
||||
const events = structuredClone(showAllRead.events);
|
||||
const result = output(events, read(events).id);
|
||||
expect(result.is_error).toBe(true);
|
||||
expect(result.content).toContain('// RAW-ONLY changed caller bytes after the skipped review$\n');
|
||||
expect(hasTrustedSharedLibsCheck(events, showAllRead.expected)).toBe(true);
|
||||
});
|
||||
|
||||
// Recorded from GNU coreutils 9.4 cat for a source with a tab, a control byte, DEL and a
|
||||
// non-ASCII character (stock macOS cat rejects -A, -E and -T).
|
||||
const sample = 'export const retry = (value: string) =>\tvalue.trim(); // \u0001\u007f café\nend\n';
|
||||
const head = 'export const retry = (value: string) =>';
|
||||
const gnu: Record<string, string> = {
|
||||
'-A': `${head}^Ivalue.trim(); // ^A^? cafM-CM-)$\nend$\n`,
|
||||
'-e': `${head}\tvalue.trim(); // ^A^? cafM-CM-)$\nend$\n`,
|
||||
'-t': `${head}^Ivalue.trim(); // ^A^? cafM-CM-)\nend\n`,
|
||||
'-v': `${head}\tvalue.trim(); // ^A^? cafM-CM-)\nend\n`,
|
||||
'-E': `${head}\tvalue.trim(); // \u0001\u007f café$\nend$\n`,
|
||||
'-T': `${head}^Ivalue.trim(); // \u0001\u007f café\nend\n`,
|
||||
'-vET': `${head}^Ivalue.trim(); // ^A^? cafM-CM-)$\nend$\n`,
|
||||
};
|
||||
const shownBy = (flag: string) => gnu[flag];
|
||||
const withShown = (flag: string, shown: string) => {
|
||||
const events = structuredClone(showAllRead.events), call = read(events), result = output(events, call.id);
|
||||
const expected: any = structuredClone(showAllRead.expected);
|
||||
expected.sources['src/retry-route.ts'] = sample;
|
||||
call.input.command = call.input.command.replace('cat -A src/retry-route.ts', `cat ${flag} src/retry-route.ts`);
|
||||
const start = result.content.indexOf('=== src/retry-route.ts\n') + '=== src/retry-route.ts\n'.length;
|
||||
result.content = result.content.slice(0, start) + shown + result.content.slice(result.content.indexOf('=== lib/retry-after.ts', start));
|
||||
return { events, expected };
|
||||
};
|
||||
|
||||
test.each(['-A', '-e', '-t', '-v', '-E', '-T', '-vET'])('GNU cat %s output of the exact source counts', flag => {
|
||||
const { events, expected } = withShown(flag, shownBy(flag));
|
||||
expect(hasTrustedSharedLibsCheck(events, expected)).toBe(true);
|
||||
});
|
||||
|
||||
test.each([['-T', '-A'], ['-A', '-v'], ['-e', '-A'], ['-E', '-e']])('cat %s with the output of cat %s is still rejected', (flag, printed) => {
|
||||
const { events, expected } = withShown(flag, shownBy(printed));
|
||||
expect(hasTrustedSharedLibsCheck(events, expected)).toBe(false);
|
||||
});
|
||||
|
||||
test.each(['no expected sources', 'tampered expected source', 'last source line missing', 'plain cat', 'cat -v without line ends', 'errored single read'])('%s is still rejected', shape => {
|
||||
const events = structuredClone(showAllRead.events), call = read(events), result = output(events, call.id);
|
||||
const expected: any = structuredClone(showAllRead.expected);
|
||||
if (shape === 'no expected sources') delete expected.sources;
|
||||
if (shape === 'tampered expected source') expected.sources['src/retry-route.ts'] = expected.sources['src/retry-route.ts'].replace('3600)', '3601)');
|
||||
if (shape === 'last source line missing') result.content = result.content.replace('// RAW-ONLY changed caller bytes after the skipped review$\n', '');
|
||||
if (shape === 'plain cat') call.input.command = call.input.command.replace('cat -A src/retry-route.ts', 'cat src/retry-route.ts');
|
||||
if (shape === 'cat -v without line ends') call.input.command = call.input.command.replace('cat -A src/retry-route.ts', 'cat -v src/retry-route.ts');
|
||||
if (shape === 'errored single read') call.input.command = 'cat -A src/retry-route.ts';
|
||||
expect(hasTrustedSharedLibsCheck(events, expected)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user