Skip to content

/ship catches a file-mode change from main on files whose names start with a colon - #4774

Merged
capy-ai[bot] merged 3 commits into
mainfrom
ls-tree-mode-check-fails-closed
Nov 24, 2026
Merged

capy-ai[bot] merged 3 commits into
mainfrom
ls-tree-mode-check-fails-closed

Conversation

@garrytan

@garrytan garrytan commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

/ship's file-mode check now reads file names literally, so a name like :!tool.sh or :(top)tool.sh can no longer hide a mode change that a merge brought in from main.
Why: this was the one open finding on #4754 that could let a changed head count as reviewed. Nothing for readers to do.

What changed
  • comparePath (lib/ship-patch.ts) asks git --literal-pathspecs ls-tree for each head's file mode. A lookup that fails now counts as a change that needs review, instead of two failures comparing as equal.
  • baseHolds uses the same literal lookup, so :(top)tool.sh no longer reads the mode of the root tool.sh.
Blast radius

Only /ship's check of whether a merged head still matches what was reviewed. Normal file names behave exactly as before. A name starting with git pathspec magic now gets a full review whenever its mode moved.

Tests
  • test/ship-base-side-masks.test.ts: a base exec-bit flip on :!tool.sh, :(glob)tool.sh and :(top)tool.sh is changed, and the same merge without the flip is still context. baseHolds does not hold a reviewed mode change the base dropped on :(top)tool.sh, and does hold it when the base took the mode. Skipped on Windows, where those names are not legal.
  • With the flags removed, the new test fails (checked locally).
  • Focused: 9 pass, 0 fail. CI free-tests at this tree: run 45317295418, 39389 tests.
Agent notes

Agent notes

Review

Two rounds, light depth (batched specialist with the Red Team prompt, native adversarial Opus 5.5). Round 1 at 0764509: the specialist found nothing; the native adversarial reader found the same unflagged lookup in baseHolds (Medium), the changelog overclaiming because of it (Low), and no :(top) test (Low). All three were fixed in 959fd98. gstack's plan requires a full round 2 after any fix, so round 2 ran at 959fd98, and both readers were clean. The changelog fragment was then renamed to match the branch (6b42345).

Review notes

  • INFORMATIONAL (round 2 native adversarial) lib/ship-receipt-patch.ts:96 and lib/ship-receipt-depth.ts:427 still call ls-tree without literal pathspecs. Both fail toward more review, and both are outside this diff.

Documentation

Status: current. No documentation changes were needed for this branch.

Scope: base 6ef38613 to HEAD 6b423456 on ls-tree-mode-check-fails-closed: 3 commits and 3 committed files (lib/ship-patch.ts, test/ship-base-side-masks.test.ts, changelog.d/ls-tree-mode-check-fails-closed.md), with nothing staged, unstaged or untracked. The change makes /ship's file-mode check in comparePath and baseHolds read file names literally (--literal-pathspecs) and treats a failed mode lookup as a change that needs review. A file whose name starts with : can no longer hide a base-side mode change.

Documentation health:

  • docs/ship-policy.md: Current. The carry table already requires the branch's file modes to stay identical across a base merge, and the comparePath/baseHolds rules describe the behavior the fix restores.
  • docs/troubleshooting.md: Current. The RECEIPT_CARRY_SCOPED_REVIEW and product-changed guidance is still accurate.
  • docs/pregate.md, docs/TESTING_INTERNALS.md, docs/designs/GSTACK_ON_CAPY.md: Current. They mention modes or lib/ship-patch.ts, but this behavior doesn't affect them.
  • CHANGELOG.md: Current (not edited). The entry is the branch's fragment changelog.d/ls-tree-mode-check-fails-closed.md, which matches the diff.
  • README.md, AGENTS.md, CONTRIBUTING.md: Current. The diff touches no feature list, command or setup step.

Coverage: no new public surface (no command, flag, config key or exported API), so there's no documentation debt.

Diagram drift: none.

Validation notes

  • Local full suite not run. This PR touches lib/ship-patch.ts, where CREW rule 12 asks for one, but the last full local run (/ship counts a clean base merge as reviewed (GST-3562) #4754, same environment) failed only on environment files. CI free-tests ran the full suite green at this tree (run 45317295418).
  • Captain GStack Minder (GSTA-36) asked for one reviewer and one round. gstack's review plan prints two readers, and a fix after round 1 requires a full round 2. Both rounds ran under the $10 cap.

Approvals

Plan: exempt: bug fix follow-up to #4754 (no plan needed)

{
  "schema_version": 1,
  "pr": 4774,
  "head": "6b423456a9810675618c613b19b9a8da9a49a73a",
  "version": "1.103.0.0",
  "base": "main",
  "calls": 40,
  "session_kind": "unattended",
  "run": "lship",
  "head_tree": "e71f0d644b8c74e4c0999bfb025e2f9e601f40e2",
  "product_patch_id": "fd35030fad2b50e2511c2d08bd921bccc2199a55",
  "gstack_version": "1.103.0.0",
  "review_depth": {
    "depth": "light",
    "class": "code",
    "runtime_lines": 6,
    "rules": "33831f8248a814fd",
    "base": "6ef386130221673561b4b43792a72effba97f2d0",
    "registry": "6ef386130221673561b4b43792a72effba97f2d0",
    "gate_scan": {
      "tagged": 0,
      "head": "6b423456a9810675618c613b19b9a8da9a49a73a"
    },
    "reasons": [
      "runtime=6"
    ],
    "risk": [],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @e71f0d644b8c (8 checks, current for 6b423456a981)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/45317295418/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=e71f0d644b8c tests=39389 skipped=64 runs=45317295418/1 profiles=ci-reuse/free-tests heads=6b423456a981 verified=2026-11-24T03:52:26.803Z"
  ],
  "docs": {
    "status": "current",
    "scope": "README.md and docs/ (156 docs), base 6ef38613 to 6b423456"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 0,
    "deferred": 0,
    "noted": 0,
    "fixed": 3,
    "scope": "frozen",
    "rounds": 2,
    "dispatches": {
      "specialist": 2
    }
  },
  "gate_dispositions": []
}

garrytan and others added 3 commits November 24, 2026 02:44
…iled lookup as a change

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

Review-Finding: p1/adversarial-native#1,#2,#3
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>
@trunk-io

trunk-io Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

@capy-ai
capy-ai Bot merged commit 6b7714c into main Nov 24, 2026
53 checks passed
@garrytan garrytan mentioned this pull request Nov 24, 2026
capy-ai Bot added a commit that referenced this pull request Nov 24, 2026
- `/ship` now tells you what to change when GitHub refuses a push for email privacy. (#4748)
- The release gate's /cso check accepts the low-confidence hypotheses /cso now reports. (#4753)
- /cso reports every security finding the code supports instead of dropping most of them. (#4739)
- /cso can search the whole repository in one call, and a daily report now lists its low-confidence hypotheses. (#4742)
- A first version's plan and try-it message now open with the owner's own words, and the build is tried the same way he will try it before he is asked. (#4759)
- A first version's public export now keeps out the owner's short quotes and his reasons to leave something out, and a phone first-use check installs a build the cloud phone can actually run. (#4772)
- Three intermittent test failures are fixed. (#4745)
- Free Tests runs its shards on 8-core runners again. (#4749)
- A land that waits on an earlier CI run now decides on what that run actually did. (#4763)
- Landing a PR no longer starts a new CI run when one for the same merged code is already running or has passed. (#4760)
- /ship no longer misses a file-mode change from main on files whose names start with `:`. (#4774)
- make-pdf keeps quotes in alt text, link titles and raw HTML attributes inside the attribute, so a Markdown file can no longer add an `onerror`, `onload` or `javascript:` link that runs in the print browser. (#4761)
- Posting a PR body that lists earlier /ship runs no longer stops for a phone number that isn't there. (#4747)
- A first version's public export now catches a short owner quote whose padding or quote marks are encoded. (#4778)
- A first version's public export now also keeps out a short owner quote written with spaces just inside its quote marks. (#4776)
- Posting a PR body that lists earlier /ship runs no longer stops for a card number that isn't there. (#4751)
- /ship no longer asks for an extra reader when you merge the base branch next to code that was already reviewed. (#4754)
- /ship no longer plans narrow re-checks after a fix. (#4741)
- /ship can't quietly gain new refusals. (#4740)
- `gstack-upgrade` no longer refuses to run after you disable skills. (#4743)
- The free test suite splits its shards from this week's recorded test times. (#4744)
- gstack now writes up a failed or shelved attempt before closing it. (#4735)

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