Repository navigation
Conversation
…the R51 rm and rmSync rules fail (GST-898) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…-898) Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… verdict-identity replay Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…nc window; repin on the GST-898 no-loss replay 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>
|
Merging to
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 |
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> # Conflicts: # lib/review-risk.ts # test/review-packets-removed.test.ts
… rules (GST-898) 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>
Contributor
|
Frozen in wave |
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]>
Contributor
|
Landed in wave #3848 as v1.92.76.0 (3d99c22), merged from this PR's pin 9964657. 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
One hostile added line could hold /ship's review classification for seconds. R51's
rm -rfrule and itsrmSync(… recursive: true)rule inlib/review-risk.tsran in quadratic time, and both now run in linear time.rmrule. The old pattern\brm\s+-(?:[a-z]*r[a-z]*f|[a-z]*f[a-z]*r)\bbacktracked over every split of a long flag run. One line ofrm -and 100,000rcharacters heldmatchRiskfor 3.7 to 4.3 s, and the time grew with the square of the length. The new pattern\brm\s+-(?=[a-z]*r)(?=[a-z]*f)[a-z]*[rf]\bmatches the same set of lines: one lowercase run containing both r and f, ending in r or f, at a word boundary. The same line now takes about 1 ms.rmSyncrule.[^)]*rescanned the rest of a line from everyrmSync(start, so a line of repeatedrmSync(calls took 462 ms at 100k characters, also growing quadratically. The rule now looks forrecursive: truein the first 500 characters of the call, and a call with more than 500 characters before the first)after it counts as security on its own. It never misses a line the old rule caught, and plain padding can't push the flag out of view. Its[^)]scan still stops at the first), sormSync(path.join(...), { recursive: true })gets no security class, the same as under R51. That gap is GST-942.SECURITY_LINEandDATA_LINEare exported so the new test can time every pattern, asMONEY_LINEandSECRET_LINEalready were.docs/review-policy.md's risk-classes paragraph used to say the linear-time test covers only GST-850's rules. It now citestest/review-risk-redos.test.tsand states the 501-character rmSync rule exactly.test/review-packets-removed.test.tsrepinslib/review-risk.tson a newGST-898no-loss entry (the verdict-identity check below).Why
GST-898. GST-850's scoped fix-check found the repro, and its own linear-time test didn't cover R51's rules. The slow match fails closed, so this is S2:
gstack-review-dispatch passgivesgstack-review-plan180 s and returns a failure on timeout (bin/gstack-review-dispatch:176-177). The Capy pass program turns that intoSTOP:(lib/capy-review-pass.js:57), and /ship ends an attempt on a STOP with no repair route (ship/SKILL.md:170). The queue recomputes depth in-process (lib/ship-receipt-depth.ts:72,182), so a slow line can stall it but can't lower the depth it reports. The cost was availability, since one line in a pooled PR could stall /ship,readyand train build for minutes.Proof
test/review-risk-redos.test.tsfailed 2 of 8. Over two runs, sixrminputs took 3,711 to 5,816 ms against a 100 ms bound, repeatedrmSync(took 462 to 567 ms, and thematchRiskrepro took 3,692 to 4,261 ms against 250 ms. After the fix, 8 of 8 pass, and the slowest pattern list takes 25 ms in total.SECURITY_LINE,DATA_LINE,SECRET_LINE,MONEY_LINEandSECRET_PATH. The set includes the tar and redirect anchors from v1.92.61.0 fix(ship): risk classes cover outbound clients, archives, child_process and metering (GST-850) #3829, so it covers those rules once both PRs land. A wider sweep (50 anchors by 35 fills at 8k and 32k characters) flagged only these two rules on main and none after the fix.RISK_RULESmoves from 64e1b559f80f9f22 to f0909560d71a695f andDEPTH_RULESfrom 97c1e5fe49607f73 to 8f7e35bb1d31e64a. No pinned literal needed an update: the queue recomputes depth and never compares a receipt'srules.Blast radius
Only
lib/review-risk.ts's two R51 patterns and two exports change, which affects review depth for every /ship run. Thermrule is an exact rewrite. ThermSyncrule can only add the security class, on a call with more than 500 characters before the first)after it, and no line in the last 100 commits hits that branch. #3829 (GST-850) edits the sameSECURITY_LINElines and the same pin: see Sibling PR below.Base merge (#3829 landed, crew rule 19)
#3829 landed in main dd9834d (v1.92.61.0). With GStack Minder's rule 19 grant, I merged main once in 30a19f0 (no force-push), using the resolution below. The result is byte-identical to the trial merge, and its focused tests pass (326 pass, 0 fail). The receipt couldn't carry (
RECEIPT_CARRY_PRODUCT_CHANGED: the line this PR removes is now #3829's rule), so the granted scoped fix-check covered the resolution. After the merge, the rm and rmSync rules give the same verdict as #3829's on all 68,526 changed lines of the 100 first-parent main commits ending at dd9834d (rmSync 169 hits and rm 47, identical). The remote pregate on the final tree 3b2c1fbf ran 8,407 tests with 0 failed, for $0.07. The macOS and Windows lanes were cleared by runs 41398207750 and 41398207787 at 9964657.Before #3829 landed, I trial-merged this head (c803339) with #3829 at 1ec2f43. The conflicts were in
lib/review-risk.tsandtest/review-packets-removed.test.ts. To resolve them, take #3829'sSECURITY_LINEblock and swap in this PR'srmandrmSyncpatterns (itsrmSyncwas the bounded[^)]{0,500}form, which padding can bypass). Keep both no-loss replay entries, keeplib/review-depth.tson GST-850's pin, and repinlib/review-risk.tsto the merged bytes onGST-898. On the merged tree, 326 tests pass across the redos, linear, routing, depth, packets-removed and targeted suites.Pre-Landing Review
REVIEW_LOOP: passes=2 blocking_found=0 deferred=0 noted=3 fixed=0 scope=frozen fix_checks=2 dispatches=6
Full depth (gate class), 2 rounds. Round 1 ran a batched specialist (testing, security, state machines), the Red Team, QA, a native adversarial reader and a cross-family outside voice (openai/gpt-6.1-sol). The outside voice found one blocker: the first version bounded
rmSyncto[^)]{0,500}(as #3829 does), and 501 characters of padding dropped a recursive delete from full to light review. It's fixed with the conservative 501-character branch. An exact linear form with a lazy group was tried and rejected: JavaScriptCore returned no match on a 3.2-million-character line, which silently fails open. Round 2 on the fix range (batched specialist, Red Team, QA) came back clean. Step 11 then reran on the frozen tree to bind the records, and both voices came back clean.After the base merge, GStack Minder's grant allowed one scoped fix-check on the merge resolution. It found 0 CRITICAL and 1 INFORMATIONAL note, covered by the post-#3829 replay above. The docs fix then got one fix-check, because
docs/*-policy.mdis agent prose. That check found 0 CRITICAL and 2 INFORMATIONAL notes about my rmSync wording, and I applied its suggested wording in 9964657 without another review, as the transitions table allows for below-floor fixes after a fix-check.Review-loop exception: accepted by GStack Minder (GSTA-36) 2026-11-02 via GSTA-36 rule 19 grant for #3831 after train 84: one scoped fix-check on the main-merge resolution, no new review round; the docs/review-policy.md sentence it then asked for got one fix-check, and its below-floor wording note was applied (fix-check at 4250be9, 2 findings)
Gate edits: none detected (3 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none). The one read hunk is the pin repin in
test/review-packets-removed.test.ts, which names its new no-loss entry.Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/review-risk.ts:40securitylib/review-risk.ts:40securitylib/review-risk.ts:36maintainabilitytest/review-risk-redos.test.ts:30testing-Rf,-r -f,--recursive --force) andrmSync(path.join(…), …)predate this PR. Closing them changes verdicts, so it needs its own replay. The rmSync gap is GST-942, reproduced there, withfs.promises.rmand)padding.test/review-packets-removed.test.ts:61testing: the GST-898 no-loss text describes the replay against R51 (a563f47). The post-v1.92.61.0 fix(ship): risk classes cover outbound clients, archives, child_process and metering (GST-850) #3829 replay above covers the merged base.Documentation
Post-merge audits:
gst898-docs-3(read-only, base dd9834d) blocked on the stale risk-classes sentence indocs/review-policy.md, and the repair re-auditgst898-docs-4came back current at 4250be9. Its section follows.Scope: read-only repair re-audit of branch gst-898-rm-rule-redos against main, focused on the risk-classes paragraph in docs/review-policy.md (lines 200–226) that commit 4250be9 rewrote.
Result: current. The stale sentence about the claim covering only GST-850's rules is gone. The paragraph now names test/review-risk-redos.test.ts, which checks every risk pattern (R51's rm and rmSync included) on 100,000-character lines against a 100 ms limit, and documents the rmSync rule for calls with more than 500 characters before the closing parenthesis. Both statements match lib/review-risk.ts:57 and the test file.
Debt: the new sentence is one unwrapped long line (cosmetic only).
The one-clause accuracy fix at 9964657 was not re-audited.
Documentation exception: accepted by GStack Minder (GSTA-36) 2026-11-02 via GSTA-36 message to GSTA-249, 2026-11-02: GSTA-36 2026-11-02: docs record accepted for the one-clause accuracy fix to docs/review-policy.md (drops the padding claim); no further audit.
Approvals
None needed: a bug fix under the fix-lane exemption, with merges under standing rule 6.