Skip to content

fix(review): /ship planner misreads: chart SVG as code, session data as auth, stale local base (GST-911, GST-884) - #3838

Closed
garrytan wants to merge 9 commits into
mainfrom
gst-911-planner-misreads
Closed

garrytan wants to merge 9 commits into
mainfrom
gst-911-planner-misreads

Conversation

@garrytan

@garrytan garrytan commented Nov 2, 2026 •

Copy link
Copy Markdown
Owner
{
  "schema_version": 1,
  "pr": 3838,
  "head": "26d71ad689dbf9d9e740919f81cb7d2826b99fe9",
  "version": "1.92.56.0",
  "base": "main",
  "session_kind": "unattended",
  "head_tree": "46d369af5a3c4f47b9dbe64bf16c879f345df513",
  "product_patch_id": "b2b791ce28c8f1a6b00c7c4ca2b6039efc1113b4",
  "gstack_version": "1.92.52.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 229,
    "rules": "97c1e5fe49607f73",
    "base": "924ac4d406b09cda5ee98550bb15adf13a86545a",
    "registry": "924ac4d406b09cda5ee98550bb15adf13a86545a",
    "gate_scan": {
      "tagged": 0,
      "head": "26d71ad689dbf9d9e740919f81cb7d2826b99fe9"
    },
    "reasons": [
      "gate-class",
      "runtime=229"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @46d369af5a3c (1 checks, current for 26d71ad689db)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41395175654",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41395179649",
    "pregate.json/remote_gate: remote-gate tree=46d369af5a3c tests=8404"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, changelog.d/, README.md (read-only audit gst911-docs-b, the one re-audit)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 8,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 3,
    "rounds": 5,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder",
    "date": "2026-11-02",
    "via": "GSTA-36 decision on #3838",
    "reason": "after the last granted fix, further floor findings ship as open notes in the PR body",
    "fix_check": {
      "head": "26d71ad689dbf9d9e740919f81cb7d2826b99fe9",
      "findings": 3,
      "files": [
        "lib/review-depth.ts"
      ]
    }
  }
}
{
  "schema_version": 1,
  "pr": 3838,
  "head": "26d71ad689dbf9d9e740919f81cb7d2826b99fe9",
  "version": "1.92.56.0",
  "base": "main",
  "session_kind": "unattended",
  "head_tree": "46d369af5a3c4f47b9dbe64bf16c879f345df513",
  "product_patch_id": "b2b791ce28c8f1a6b00c7c4ca2b6039efc1113b4",
  "gstack_version": "1.92.52.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 229,
    "rules": "97c1e5fe49607f73",
    "base": "924ac4d406b09cda5ee98550bb15adf13a86545a",
    "registry": "924ac4d406b09cda5ee98550bb15adf13a86545a",
    "gate_scan": {
      "tagged": 0,
      "head": "26d71ad689dbf9d9e740919f81cb7d2826b99fe9"
    },
    "reasons": [
      "gate-class",
      "runtime=229"
    ],
    "risk": []
  },
  "pregate": "requires-remote cleared @46d369af5a3c (1 checks, current for 26d71ad689db)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41395175654",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41395179649",
    "pregate.json/remote_gate: remote-gate tree=46d369af5a3c tests=8404"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, changelog.d/, README.md (read-only audit gst911-docs-b, the one re-audit)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 8,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 3,
    "rounds": 5,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "review_loop_exception": {
    "accepted_by": "GStack Minder",
    "date": "2026-11-02",
    "via": "GSTA-36 decision on #3838",
    "reason": "after the last granted fix, further floor findings ship as open notes in the PR body",
    "fix_check": {
      "head": "26d71ad689dbf9d9e740919f81cb7d2826b99fe9",
      "findings": 3,
      "files": [
        "lib/review-depth.ts"
      ]
    }
  }
}

What changed

Before and after: the gstack-evals#132 write-up planned as gate/full with 5 readers before, and as docs/light with 0 runtime lines after

/ship's review planner misread three things in a results write-up (gstack-evals#132), and the combination sent a docs PR to the full five-reader panel:

  1. A chart SVG was read as runtime code. A matplotlib chart was 621 runtime lines. Now an SVG counts as data only when its whole file is a drawing: drawing elements and RDF metadata, CSS made of declarations only (no @ rule and no function except a same-file url(#id); a style element is read to its real closing tag, with comments dropped and CDATA read as CSS, in linear time), every href a same-file # reference or an inline raster image, and no event handler or entity declaration. The file is read after character references are decoded. An SVG that can run script (a script or foreignObject element, an event handler, or a javascript: URL) stays code and now gets the security class.
  2. A session-named data file was read as auth. recovered-sessions.jsonl no longer sets SCOPE_AUTH. Session code and session config still do.
  3. The gate scan and diff scope read a stale local main (GST-884). gstack-diff-scope and the receipt depth now resolve origin/<base> by its full ref name, so a stale local branch or a tag named main or origin/main can't stand in for it. The review-plan/gate-diff half of this is in fix: a stale local main no longer makes /ship review a change at full gate depth #3826 (GST-883), which already rewrites that resolution.

Before: gate/full, 621 runtime lines, 5 dispatches, auth targeted. After: docs/light, runtime 0. Repro: ~/.capy/work/gst911/repro.sh on this branch and on main f5cb6ec.

Why

A results PR that adds a chart and a JSONL file should get one light review, not the full panel. Each misread raised the depth on its own, and together they cost a five-reader review on a docs change.

Blast radius

Review planning only (lib/review-depth.ts, lib/review-risk.ts, lib/review-collect.ts, bin/gstack-diff-scope, bin/gstack-review-plan, lib/ship-preflight.ts, lib/ship-receipt-depth.ts). No network calls, secrets, permissions, workflows or dependencies. The no-loss replay over the last 100 first-parent main commits (to f5cb6ec) changed 0 commits in depth, class, risk classes, targeted classes or SCOPE_AUTH (7 true before, 7 after). None of those commits touches an SVG, so the SVG rule is proven on fixtures: test/review-planner-misreads.test.ts holds 44 tests, including verdicts at 1 MB and 8 MB (the collector's read cap), and every SVG that can load or run something stays code. The rule fails closed, so a chart that uses rgb() in CSS now plans as code (more review, never less).

Approvals

Date Asked Exact words Outcome Covers Still pending
2026-11-02 One scoped fix-check after the round-2 CRITICAL (red-team#1, stray-quote href bypass) “granted this under rule 23 (CREW): one scoped fix-check on the lookahead-attribute fix (4b3abea) and its four failing-first rows (10af2e1). There is no third round.” (GStack Minder) approved GST-911 review loop none
2026-11-02 One more scoped fix for the Step 11 image-set() bypass “granted one more scoped fix, its last for GST-911. Make it fail-closed, not another denylist entry.” (GStack Minder) approved GST-911 CSS in drawing SVGs; further floor findings ship as open notes none
2026-11-02 Accept the CSS allowlist deviation and one last fix for both row-13 notes (hidden </style>, quadratic SVG_STYLE) “Deviation accepted. The fail-closed CSS allowlist stays. One last grant: a single fix covering both row-13 notes. Anything new at the blocking floor ships as an open note listed in the PR body. Don't fix it.” (GStack Minder) approved GST-911 style walker; later floor findings ship as open notes none

Pre-Landing Review

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=8 fixed=4 scope=frozen fix_checks=3 dispatches=4

2 CRITICALs were found and fixed, so blocking_found=0 undercounts.

Review-loop exception: accepted by GStack Minder 2026-11-02 via GSTA-36 decision on #3838: after the last granted fix, further floor findings ship as open notes in the PR body (fix-check at 26d71ad, 3 findings)

Gate edits: none detected (GATE_SCAN tagged=0 at d8227c1 against origin/main).

  • Pass 1 (gate/full): 3 INFORMATIONAL findings (a CSS escape, a zero-padded character reference, a split handler line), all fixed in d8227c1 with 7 failing-first rows.
  • Pass 2 (full on the fix range): red-team#1 CRITICAL. A stray quote hid an external href. Fixed in 4b3abea (failing first: 10af2e1). A fix-check under GStack Minder's grant was clean (2 INFORMATIONAL notes).
  • Step 11: the outside voice (gpt-6.1-sol) had no findings. Native adversarial found CSS image-set() loading an outside image. That's fixed in 0f61362 (failing first: 25563a8) with a CSS allowlist: declarations only, plus url(#id).
  • Last grant: the style element's CSS is now walked with indexOf, so a </style> hidden in a comment or CDATA can't end it early, and a run of unclosed <style tags is refused in linear time (480 KB: 5.7 ms, was 15.9 s). Fixed in 26d71ad (failing first: 6ad88b7). Every verdict was checked at 1, 2, 4 and 8 million characters. The fix-check and the Step 11 rebind on 46d369af raised the notes below; none was fixed.

Deferred findings

Review notes (open, shipped under the round cap)

These came from the last fix-check and the Step 11 rebind on the final tree (46d369af). The last grant allowed no further fix.

  • Fails open: a numeric character reference can fake a comment or a closing tag. The walker reads text after &#60; is decoded, so <style>&#60;!-- … --></style> drops real CSS as a comment, and /* &#60;/style> */ ends the element early. Walking the raw text and decoding only the collected CSS would close both.
  • Fails open for SVG inlined into HTML: HTML comment shapes. <!-->, --!> and a comment in <title><style> end or skip differently under an HTML parser, so CSS the walker drops can still load there. Checking each comment body with the CSS rule too would close it.
  • The closing tag isn't matched to the opening tag's prefix, so </a:style> ends a <style>. This was already true before the walker.
  • A self-closing <style/> now refuses the drawing. This fails closed.
  • CSS presentation attributes (cursor, mask) aren't checked against the CSS allowlist. It's unverified whether a browser fetches through them.
  • rgb(), hsl() and transform functions in CSS now send a chart to code. This fails closed.
  • A split javascript: with part of it on an unchanged line loses the security class, but the file still stays code.
  • A backslash anywhere refuses the drawing (matplotlib writes `$\alpha```gstack-ship-receipt
    {
    "schema_version": 1,
    "pr": 3838,
    "head": "0f61362c1e4603062e0c5db3c8f1625001b622f8",
    "version": "1.92.56.0",
    "base": "main",
    "session_kind": "unattended",
    "head_tree": "aee847a68d0a75c68cd71cee42a47392d21c183d",
    "product_patch_id": "c89ab954d63fa3e75071397c10fbae8023fc8163",
    "gstack_version": "1.92.52.0",
    "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 201,
    "rules": "97c1e5fe49607f73",
    "base": "f5cb6ec1eb3ea25b579e022dfd735d7b452f6bb5",
    "registry": "f5cb6ec1eb3ea25b579e022dfd735d7b452f6bb5",
    "gate_scan": {
    "tagged": 0,
    "head": "0f61362c1e4603062e0c5db3c8f1625001b622f8"
    },
    "reasons": [
    "gate-class",
    "runtime=201"
    ],
    "risk": []
    },
    "pregate": "requires-remote cleared @aee847a68d0a (1 checks, current for 0f61362)",
    "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/41392537248",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/41392541686",
    "pregate.json/remote_gate: remote-gate tree=aee847a68d0a tests=8399"
    ],
    "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
    },
    "docs": {
    "status": "current",
    "scope": "docs/, changelog.d/, README.md (read-only audit gst911-docs-a)"
    },
    "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 5,
    "fixed": 4,
    "scope": "frozen",
    "fix_checks": 2,
    "rounds": 4,
    "dispatches": {
    "specialist": 2,
    "red-team": 2
    }
    },
    "review_loop_exception": {
    "accepted_by": "GStack Minder",
    "date": "2026-11-02",
    "via": "GSTA-249 thread",
    "reason": "after the last granted fix, further floor findings ship as open notes in the PR body",
    "fix_check": {
    "head": "0f61362c1e4603062e0c5db3c8f1625001b622f8",
    "findings": 1,
    "files": [
    "lib/review-depth.ts"
    ]
    }
    }
    }

<!-- SHIP_RECEIPT_BLOCK -->

## What changed

![Before and after: the gstack-evals#132 write-up planned as gate/full with 5 readers before, and as docs/light with 0 runtime lines after](https://api.capy.ai/pr-assets/AiATeIMtflEtBiYnMcIjD-rPmssFRlU5iuIykMsZum0.png)

/ship's review planner misread three things in a results write-up (gstack-evals#132), and the combination sent a docs PR to the full five-reader panel:

1. **A chart SVG was read as runtime code.** A matplotlib chart was 621 runtime lines. Now an SVG counts as data only when its whole file is a drawing: drawing elements and RDF metadata, CSS made of declarations only (no `@` rule and no function except a same-file `url(#id)`; a style element is read to its real closing tag, with comments dropped and CDATA read as CSS, in linear time), every `href` a same-file `#` reference or an inline raster image, and no event handler or entity declaration. The file is read after character references are decoded. An SVG that can run script (a `script` or `foreignObject` element, an event handler, or a `javascript:` URL) stays code and now gets the security class.
2. **A session-named data file was read as auth.** `recovered-sessions.jsonl` no longer sets `SCOPE_AUTH`. Session code and session config still do.
3. **The gate scan and diff scope read a stale local `main` (GST-884).** `gstack-diff-scope` and the receipt depth now resolve `origin/<base>` by its full ref name, so a stale local branch or a tag named `main` or `origin/main` can't stand in for it. The review-plan/gate-diff half of this is in #3826 (GST-883), which already rewrites that resolution.

Before: gate/full, 621 runtime lines, 5 dispatches, auth targeted. After: docs/light, runtime 0. Repro: `~/.capy/work/gst911/repro.sh` on this branch and on main f5cb6ec1e.

## Why

A results PR that adds a chart and a JSONL file should get one light review, not the full panel. Each misread raised the depth on its own, and together they cost a five-reader review on a docs change.

## Blast radius

Review planning only (`lib/review-depth.ts`, `lib/review-risk.ts`, `lib/review-collect.ts`, `bin/gstack-diff-scope`, `bin/gstack-review-plan`, `lib/ship-preflight.ts`, `lib/ship-receipt-depth.ts`). No network calls, secrets, permissions, workflows or dependencies. The no-loss replay over the last 100 first-parent main commits (to f5cb6ec1e) changed 0 commits in depth, class, risk classes, targeted classes or `SCOPE_AUTH` (7 true before, 7 after). None of those commits touches an SVG, so the SVG rule is proven on fixtures: `test/review-planner-misreads.test.ts` holds 44 tests, including verdicts at 1 MB and 8 MB (the collector's read cap), and every SVG that can load or run something stays code. The rule fails closed, so a chart that uses `rgb()` in CSS now plans as code (more review, never less).

## Approvals

| Date | Asked | Exact words | Outcome | Covers | Still pending |
|---|---|---|---|---|---|
| 2026-11-02 | One scoped fix-check after the round-2 CRITICAL (red-team#1, stray-quote href bypass) | “granted this under rule 23 (CREW): one scoped fix-check on the lookahead-attribute fix (4b3abead1) and its four failing-first rows (10af2e1ed). There is no third round.” (GStack Minder) | approved | GST-911 review loop | none |
| 2026-11-02 | One more scoped fix for the Step 11 image-set() bypass | “granted one more scoped fix, its last for GST-911. Make it fail-closed, not another denylist entry.” (GStack Minder) | approved | GST-911 CSS in drawing SVGs; further floor findings ship as open notes | none |
| 2026-11-02 | Accept the CSS allowlist deviation and one last fix for both row-13 notes (hidden &lt;/style&gt;, quadratic SVG_STYLE) | “Deviation accepted. The fail-closed CSS allowlist stays. One last grant: a single fix covering both row-13 notes. Anything new at the blocking floor ships as an open note listed in the PR body. Don't fix it.” (GStack Minder) | approved | GST-911 style walker; later floor findings ship as open notes | none |

## Pre-Landing Review

REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=8 fixed=4 scope=frozen fix_checks=3 dispatches=4

2 CRITICALs were found and fixed, so `blocking_found=0` undercounts.

Review-loop exception: accepted by GStack Minder 2026-11-02 via GSTA-36 decision on #3838: after the last granted fix, further floor findings ship as open notes in the PR body (fix-check at 26d71ad689db, 3 findings)

Gate edits: none detected (GATE_SCAN tagged=0 at d8227c100 against origin/main).

- Pass 1 (gate/full): 3 INFORMATIONAL findings (a CSS escape, a zero-padded character reference, a split handler line), all fixed in d8227c100 with 7 failing-first rows.
- Pass 2 (full on the fix range): red-team#1 CRITICAL. A stray quote hid an external `href`. Fixed in 4b3abead1 (failing first: 10af2e1ed). A fix-check under GStack Minder's grant was clean (2 INFORMATIONAL notes).
- Step 11: the outside voice (gpt-6.1-sol) had no findings. Native adversarial found CSS `image-set()` loading an outside image. That's fixed in 0f61362c1 (failing first: 25563a8e5) with a CSS allowlist: declarations only, plus `url(#id)`.
- Last grant: the style element's CSS is now walked with indexOf, so a `</style>` hidden in a comment or CDATA can't end it early, and a run of unclosed `<style` tags is refused in linear time (480 KB: 5.7 ms, was 15.9 s). Fixed in 26d71ad68 (failing first: 6ad88b7fe). Every verdict was checked at 1, 2, 4 and 8 million characters. The fix-check and the Step 11 rebind on 46d369af raised the notes below; none was fixed.

## Deferred findings

- #3836: the `rules=` hashes don't cover inline regexes in `svgDrawing`, `decodeCharRefs` and `matchRisk`'s line join (Step 11, adversarial-native#4).

 labels into comments). This fails closed.
- The attribute value scan stops at `=` and `<`. A malformed `href==//x` goes unchecked, but it can only load from the same origin.

## CI

One flaky rerun: `macos-named-regressions` in run 41395150076 timed out in the browse/ #915 proxy test (30 s, macOS runner). This PR touches no browse file. The same job passed in the dispatched run 41395175654 at this head and on attempt 2.

## Documentation

Scope: re-audit after 6ad88b7fe and 26d71ad68 (style element CSS walked with indexOf; comments dropped; CDATA read as CSS; unclosed or malformed style elements refuse the drawing plan). Checked the drawing rule in docs/review-policy.md (near line 185) and changelog.d/gst-911-planner-misreads.md against lib/review-depth.ts svgDrawing. Result: both still accurate, since an unclosed or malformed style element falls under 'anything else keeps it code'. Debt: the policy does not name the comment/CDATA handling or the unclosed-style refusal; this is optional detail and not an inaccuracy.

garrytan and others added 7 commits November 2, 2026 03:52
… auth, bare base in diff-scope and receipt depth (GST-911, GST-884, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…y; session data files are not auth; diff-scope and the receipt depth read origin/<base> by full ref name (GST-911, GST-884)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-padded character references; the security class reads a file's changed SVG lines joined (GST-911 review pass 1)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… SVG (GST-911 review pass 2, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…g its value, so a stray quote cannot hide an external href (GST-911 review pass 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…d): image-set(), image(), element() keep it code (GST-911 Step 11, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nd no function but url(#id), which closes image-set(), image(), element() and every other CSS load (GST-911 Step 11)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@trunk-io

trunk-io Bot commented Nov 2, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

garrytan and others added 2 commits November 2, 2026 05:26
…unclosed style tags are refused in linear time, and every drawing verdict holds at 1 MB and 8 MB (GST-911, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…ts and reading CDATA, so no hidden </style> ends it early and unclosed style tags refuse in linear time (GST-911)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Frozen in wave review-e7b551ebd865 (branch wave/review-e7b551ebd865) at 26d71ad. Push nothing here: a moved head drops this PR from the wave. Fixes go on the wave branch through its integrator.

garrytan added a commit that referenced this pull request Nov 2, 2026
… red-team CRITICAL)

SVG_REFUSED's url() entry backtracked quadratically on url( followed by a
long whitespace run (80k spaces: 820 ms; 1 MB: over 230 s), and
svgDrawing runs in collectLive and in collectCommit, which ship-queue
ready, train build and land call with no timeout. The rewritten entry
refuses exactly what #3838's pattern refused.

Repin lib/review-depth.ts under no-loss replay GST-911-redos
(verdict identity: 60,000 seeded strings, the edges and every SVG blob
in history, zero differences).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
capy-ai Bot added a commit that referenced this pull request Nov 2, 2026
* fix(retro): keep retro history in the state root, shared across worktrees (#3749)

/retro saved snapshots under .context/retros inside the working tree, so a run
in a linked worktree saw none of the main checkout's history, reported "First
retro recorded", and wrote a snapshot that git worktree remove deletes.

gstack-retro-metrics --history [--next <date>] now resolves the history
directory as <state root>/projects/<slug>/retros (the slug is keyed on the git
common dir, so every worktree shares it), moves any legacy .context/retros from
this worktree and the main checkout into it, lists prior snapshots and prints
the next snapshot path. Step 12/13 and the gbrain prior-retros query use it.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(gate-diff): read a bare base as origin/<base> in gate-diff and diff-scope (#3650)

gstack-gate-diff and gstack-diff-scope resolved a bare base such as main to
the local branch whenever it shared history with HEAD. A local main that is
behind origin/main (a linked worktree, or a Capy clone, where local main
never moves) then set the merge base, so /ship's gate scan and specialist
scope also read commits already upstream. Both now prefer origin/<base>
when it resolves, the base /ship fetches and merges against.

Fixes #3650

Co-authored-by: exGeni <[email protected]>
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(retro): make history migration safe against symlinks and concurrent runs (#3749 review)

Review pass 1 findings: a .context/retros that resolves outside its worktree
(or to the shared history itself) is left alone, so migration can no longer
delete the history it points at; moves are no-clobber with retry; a copy
identical to any same-date snapshot collapses; RETRO_FILE is reserved as {}
so overlapping runs in two worktrees never share a path; --next must be a
YYYY-MM-DD date; a missing option value no longer loops forever. Step 12
names RETRO_HISTORY_ERROR instead of reading it as a stale helper.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(changelog): fragment for the #3749 retro history fix

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: pre-landing review fixes (diff-scope reads slash-named bases through origin too)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(retro): trim Step 12/13 prose back under the parity skeleton cap

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: Step 11 review fixes (a fork branch, a colliding tag or another remote never replaces the base)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(retro): keep today="<today>" in Step 12 so the judge excerpt keeps both date inputs

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(changelog): describe the fork, tag and remote guards (#3650)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(retro): compare #3749 history paths with forward slashes so the Windows shard passes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review): review-plan and gate-diff plan the same with a stale local main or a shadowing tag (GST-883, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review): gate-diff and review-plan resolve a branch base to origin/<base> by full ref name; review-plan scans the merge base its own diff used (GST-883)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(changelog): GST-883 fragment

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review-risk): hostile-input time bounds for every risk pattern; the R51 rm and rmSync rules fail (GST-898)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-risk): the R51 rm and rmSync rules run in linear time (GST-898)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review-packets-removed): repin lib/review-risk.ts on the GST-898 verdict-identity replay

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-risk): padding cannot push recursive: true out of the rmSync window; repin on the GST-898 no-loss replay

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(changelog): GST-898 fragment wording

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review): planner misreads: SVG chart as runtime, session data as auth, bare base in diff-scope and receipt depth (GST-911, GST-884, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review): a drawing-only SVG is data and a scripted one is security; session data files are not auth; diff-scope and the receipt depth read origin/<base> by full ref name (GST-911, GST-884)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review): the SVG drawing check refuses CSS escapes and reads zero-padded character references; the security class reads a file's changed SVG lines joined (GST-911 review pass 1)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review): a stray quote cannot hide an external href in a drawing SVG (GST-911 review pass 2, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review): the SVG drawing check reads every name= without consuming its value, so a stray quote cannot hide an external href (GST-911 review pass 2)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review): CSS in a drawing SVG holds only declarations and url(#id): image-set(), image(), element() keep it code (GST-911 Step 11, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review): a drawing SVG's CSS holds declarations only, no @ rule and no function but url(#id), which closes image-set(), image(), element() and every other CSS load (GST-911 Step 11)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* test(review): a style element's CSS is read past comments and CDATA, unclosed style tags are refused in linear time, and every drawing verdict holds at 1 MB and 8 MB (GST-911, failing first)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review): walk a style element's CSS with indexOf, dropping comments and reading CDATA, so no hidden </style> ends it early and unclosed style tags refuse in linear time (GST-911)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(review-policy): the linear-time claim covers R51's rm and rmSync rules (GST-898)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(review-policy): state the rmSync padding rule exactly (GST-898)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix(review-depth): linear url() refusal in svgDrawing (wave review-2, red-team CRITICAL)

SVG_REFUSED's url() entry backtracked quadratically on url( followed by a
long whitespace run (80k spaces: 820 ms; 1 MB: over 230 s), and
svgDrawing runs in collectLive and in collectCommit, which ship-queue
ready, train build and land call with no timeout. The rewritten entry
refuses exactly what #3838's pattern refused.

Repin lib/review-depth.ts under no-loss replay GST-911-redos
(verdict identity: 60,000 seeded strings, the edges and every SVG blob
in history, zero differences).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: pre-landing review fixes (wave review-2, pass 1)

- bin/gstack-diff-scope: _resolve_base takes a related local <base> before
  another remote's twin, the order resolveBase uses, so the two tools pick
  the same base for a bare name when origin/<base> is unrelated.
- lib/review-depth.ts: a drawing's DOCTYPE names no document but W3C's SVG
  DTD; SYSTEM and other PUBLIC identifiers keep the SVG code.

Repin lib/review-depth.ts under no-loss replay GST-911-redos (the DOCTYPE
change only keeps more SVGs code, so it drops no reviewer).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* fix: freeze the exported SVG_REFUSED list (wave review-2, Step 11)

Exported only so test/review-risk-redos.test.ts can reach the url() entry;
a frozen readonly copy keeps any importer from changing verdicts while
DEPTH_RULES still reports the original rules.

Repin lib/review-depth.ts under no-loss replay GST-911-redos (no pattern
changed).

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* Revert "fix: freeze the exported SVG_REFUSED list (wave review-2, Step 11)"

The fix-check (wave review-2) showed Object.freeze is shallow: each RegExp
can still be changed in place, so the freeze did not close
adversarial-native#1, and it moved the tree past the one the Step 11
voices reviewed. The finding ships as an open note (its reviewer rated it
Low, not blocking; no production caller mutates the list).

Restores the lib/review-depth.ts pin under no-loss replay GST-911-redos.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(changelog): wave review-2 entry for the integrator fixes

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

* docs(review-policy): a drawing's DOCTYPE names no outside document (wave review-2 docs audit)

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>

---------

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Co-authored-by: exGeni <[email protected]>
@capy-ai

capy-ai Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Landed in wave #3848 as v1.92.76.0 (3d99c22), merged from this PR's pin 26d71ad. Integrator changes touching this PR's files: 61cd215 (merge of #3838, resolved by hand: docs/review-policy.md, lib/review-depth.ts, lib/review-risk.ts, test/review-packets-removed.test.ts), b3d0eb8, 86d0414, 170b32a, 0d5f01b, b306a49.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant