Skip to content

Review planner sorts Swift and Xcode files by risk instead of sending every iOS PR to the full panel (GST-3041) - #4469

Merged
capy-ai[bot] merged 4 commits into
mainfrom
review-plan-sorts-swift-paths
Nov 18, 2026
Merged

capy-ai[bot] merged 4 commits into
mainfrom
review-plan-sorts-swift-paths

Conversation

@garrytan

@garrytan garrytan commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

/ship's review planner now sorts Swift and Xcode files by risk, so a plain iOS UI change gets the light review instead of the full five-reader panel.
Why: gstack-diff-scope had no rule for .swift, so every all-Swift diff printed SCOPE_ERROR=unmatched and the planner failed closed. Reported from the GHome iOS app's PR review.
Nothing to do: unknown file types still fail closed exactly as before.

How each Apple path is classified, and why

Every rule mirrors what the classifier already does for the JS/TS or Dart equivalent. The depth policy, thresholds and round caps are untouched. The planner now gets real scope flags instead of an error, and the outbound-client line rule in lib/review-risk.ts adds the Swift networking APIs, so a Swift network client still gets the full panel the way a fetch client does. A replay of the planner on the last 200 main commits, before and after that addition, gave identical plans for all 200.

Paths Scope flags Mirrors Planned depth
*.swift (except Package.swift) FRONTEND + BACKEND .dart: the extension can't tell a SwiftUI view from a network client, so both reviewers' scopes apply light, unless a risk rule fires
Swift lines that open a network connection (URLSession, URLRequest(, NWConnection, Alamofire) risk class security fetch(, axios, requests.get(: the existing outbound-client line rule in lib/review-risk.ts full
*.storyboard, *.xib, *.strings, *.stringsdict, *.xcstrings, *.xcassets/* FRONTEND .tsx/.html/stylesheets: UI only light
Info.plist, *-Info.plist, *.entitlements, *.xcprivacy AUTH + CONFIG the existing *permission* auth arm: these hold URL schemes, App Transport Security exceptions, usage strings, keychain/push/HealthKit capabilities and declared data use gate class, full
Package.swift, Package.resolved, Podfile(.lock), Cartfile(.resolved) CONFIG, never FRONTEND package.json, Gemfile.lock, pubspec.lock same as a JS dependency change
*.pbxproj, *.xcconfig, *.xcscheme, *.xcworkspacedata, *.xctestplan, other *.plist CONFIG, never FRONTEND build and CI config same as JS build config
Swift under an auth path (App/Auth/…) or a keychain path (App/Keychain/…) AUTH / secret path, as today the extension-agnostic auth and secret-path rules already in place gate class, full

isFrontendPath (lib/frontend-scope.ts) mirrors the new UI arm, and gstack-design-detect skips Swift and Apple UI files the way it already skips Dart, since its engine only reads web sources.

Tests
  • test/review-plan-cli.test.ts: a ghome#32-like SwiftUI diff plans REVIEW_DEPTH: light with no DEPTH_ERROR (red on main: scope error: unmatched, 5 dispatches); adding an Info.plist plans gate class, full depth.
  • test/diff-scope.test.ts: the ghome#32 file list (red on main with SCOPE_ERROR=unmatched), one table row per Apple path class above, and a negative control: a Metal shader (.metal) still prints SCOPE_ERROR=unmatched and exits 2.
  • test/frontend-scope.test.ts: new samples, including the bash/TypeScript parity run.
  • test/gstack-design-detect.test.ts: a .swift file never reaches the web design scan.
  • test/review-risk-routing.test.ts and the review-pin replay GST-3041: a Swift URLSession client plans full with risk class security, and a SwiftUI view stays light.
Agent notes

Issue GST-3041 (from GHOM-1's report on garrytan/ghome#32).

Plan: exempt: bug fix (R40)

Open notes (below the blocking floor, not fixed here):

  • launchd and ExportOptions plists read as plain config, not auth.
  • Swift test files named *Tests.swift outside a test directory are not recognised as tests (over-reviews).
  • Package@swift-*.swift reads as UI and app code, not config (over-reviews).
  • An asset catalog's Contents.json may plan at docs depth through the data-file rule.
  • URLSessionWebSocketTask or URLSessionConfiguration alone still plan light.
  • .xcconfig key assignments and Swift Keychain calls (SecItemAdd and the like) carry no secret risk class; the pregate credential scan still runs.

Approvals: a-d62fbde31bce (Captain GStack Minder: one scoped fix-check after round 2), a-5f3f591b9783 (Captain GStack Minder: the review-policy.md security-list edit).

{
  "schema_version": 1,
  "pr": 4469,
  "head": "34fb6fe0c95a5d74f9918f3172c6e217b3c6cf42",
  "version": "1.100.0.0",
  "base": "main",
  "gate": {
    "targeted": {
      "pass": 485,
      "fail": 0,
      "skip": 0
    }
  },
  "calls": 35,
  "session_kind": "unattended",
  "run": "ship-20261118T001150-f2320f",
  "head_tree": "e356aee6d703832dbebb6e4599246f96ef4d81a3",
  "product_patch_id": "f23c3f3fc5a3ec27a238ff361a22032a1dce0ee5",
  "gstack_version": "1.100.0.0",
  "review_depth": {
    "depth": "full",
    "class": "gate",
    "runtime_lines": 40,
    "rules": "eea6cc4231b53b9e",
    "base": "cbd21f94243405223d87f64658c0deac009b7cda",
    "registry": "cbd21f94243405223d87f64658c0deac009b7cda",
    "gate_scan": {
      "tagged": 0,
      "head": "34fb6fe0c95a5d74f9918f3172c6e217b3c6cf42"
    },
    "reasons": [
      "gate-class",
      "risk:secret",
      "risk:security",
      "runtime=40"
    ],
    "risk": [
      "secret",
      "security"
    ],
    "mode": "panel"
  },
  "pregate": "requires-remote cleared @e356aee6d703 (8 checks, current for 34fb6fe0c95a)",
  "requires_remote": [
    "free-tests.yml/macos-named-regressions: https://github.com/garrytan/gstack/actions/runs/44212615614/attempts/1",
    "windows-smoke.yml/windows-smoke: https://github.com/garrytan/gstack/actions/runs/44212615538/attempts/1",
    "pregate.json/remote_gate: remote-gate tree=e356aee6d703 tests=37707 skipped=88 runs=44212615614/1 profiles=ci-reuse/free-tests heads=34fb6fe0c95a verified=2026-11-18T01:10:12.149Z"
  ],
  "issues": {
    "fixes": [],
    "refs": [],
    "flakes": []
  },
  "docs": {
    "status": "current",
    "scope": "docs/, README.md, AGENTS.md, CONTRIBUTING.md against cbd21f94..34fb6fe0 (re-audit ship-4469-docs-2)"
  },
  "review_loop": {
    "passes": 2,
    "blocking_found": 2,
    "deferred": 0,
    "noted": 1,
    "fixed": 2,
    "scope": "frozen",
    "fix_checks": 1,
    "rounds": 3,
    "ledgers_read": 6,
    "dispatches": {
      "specialist": 2,
      "red-team": 2
    }
  },
  "gate_dispositions": [],
  "review_targeted": {
    "classes": [
      "secret"
    ],
    "rules": "23eb808423669ba0",
    "brief_sha": "7f92a0d0a8319c3c0e076fb3b1a4689c45120b2be2c14dfc7d4cb03aafa9d6a5",
    "product_patch_id": "f23c3f3fc5a3ec27a238ff361a22032a1dce0ee5",
    "status": "done",
    "findings": 2,
    "raised_by": "targeted"
  }
}

Open in Capy

…ailing closed (GST-3041)

gstack-diff-scope had no arm for .swift or Xcode files, so an all-Swift diff printed SCOPE_ERROR=unmatched and review-depth forced the full panel. Swift and Apple UI files now read as frontend and backend like Dart; Info.plist, entitlements and the privacy manifest read as auth; SwiftPM, CocoaPods, project and build-setting files read as config. Unknown types still fail closed.

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

trunk-io Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

😎 This pull request was merged.

garrytan and others added 3 commits November 18, 2026 00:32
URLSession, URLRequest, NWConnection and Alamofire lines now read as outbound HTTP, like fetch, so a Swift client change still gets the security readers now that .swift no longer fails closed.

Review-Finding: p1/outside-voice#1 reader=outside-voice
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Replay GST-3041: planner depth from 2081e67 and a936221 on the last 200 first-parent main commits was identical for all 200 (0 raised, 0 lowered); a URLSession client fixture rises from light to full and a SwiftUI fixture stays light.

Review-Finding: p2/red-team#1 reader=red-team
Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
…n scan skips

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
@capy-ai
capy-ai Bot merged commit 29e9502 into main Nov 18, 2026
53 checks passed
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
…ode to full review (GST-3052) (#4472)

/ship's review planner now sends Swift code that asks for a privacy
permission, reads HealthKit or calendar data, or writes, deletes or
protects users' files on the device to the full review panel.

Why: since #4469, iOS changes that asked for microphone permission,
wrote and deleted meeting transcript files, or read calendars got the
light, one-reader review. Reported from the GHome iOS app's PR review.

Nothing to do: plain SwiftUI views, UserDefaults settings and file reads
still plan light.

Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
Review-Finding: p1/red-team#1 reader=red-team
Review-Finding: p1/red-team#2 reader=red-team
This was referenced Nov 18, 2026
capy-ai Bot added a commit that referenced this pull request Nov 18, 2026
- A test, or a scratch repository in the temp directory, can no longer write approval rows into your real Capy Drive (GST-3027). (#4466)
- An unattended /autoplan run on Claude Code no longer says the publication guard is off while it is on. (#4481)
- A phase report written only in reasoning now gets a denial that says so and names the fix. (#4481)
- `gstack-autoplan revise` no longer refuses a plan that the first `next` accepted. (#4470)
- `revise --plan` with a different file now says the run follows that file. (#4470)
- A second-model plan review in `/autoplan` is no longer reported as unavailable when it actually ran (GST-3051). (#4471)
- The /ship conductor trial plan now lets case reverts that conflict with later code be resolved by hand in docs, tests and the planted file, so large pull requests can be cases (GST-3003). (#4460)
- A locked plan for a trial of /ship without its separate conductor subagent (GST-3003). (#4456)
- A driven /ship now runs each phase as one command, counts its calls, and stops itself at 100 minutes. (#4451)
- /ship stops asking owners to clear two kinds of bookkeeping noise: base-side merge text and a reviewer's confirmation prose. (#4458)
- A base merge that only touched base-side text no longer stops `/ship` finish for an owner's grant. (#4458)
- A reviewer's confirmation prose no longer becomes a Critical finding that only an owner can clear. (#4458)
- A CI run that passed only after its failed jobs were re-run is now marked wherever gstack reuses it. (#4473)
- /ship reuses CI's passing test run when merging the base changed no file, and stops instead of quietly starting hour-long test runs or reviewing an empty diff (GST-3019). (#4461)
- /ship on Codex no longer stops at the test coverage audit. (#4489)
- A cold first-use check before an app build reaches its owner (GST-3025). (#4465)
- `skill_prefix=true` now survives updates when gbrain is installed. (#4454)
- The OpenClaw docs no longer send you to ClawHub, which held only April 2026 builds of office-hours, ceo-review and retro and no longer has gstack skills (the docs also said four skills while listing three). (#4454)
- `gstack-issue-links` no longer reads other repositories' issues as gstack's. (#4454)
- /ship's pre-gate finds the tests of a monorepo app that imports through its own `@/` alias. (#4464)
- /office-hours explains why it recommends a mode. (#4450)
- /office-hours keeps its 34 founder videos and essays out of the skill file. (#4463)
- Two `gstack-owner-answers add` runs for the same answer no longer collide. (#4490)
- A Captain can check an ask against the owner's earlier answers before sending it. (#4467)
- `gstack-post` stops reading /ship's own receipt identifiers as phone numbers, so posting a /ship PR body no longer needs a confirm. (#4488)
- GitHub release notes now list every change in plain words, with a link to its pull request. (#4390)
- gstack's router no longer gives bug reports a special rule, so the model fixes a bug the way it would without gstack. (#4442)
- /ship's review plan now sorts Swift and Xcode files by risk instead of sending every iOS PR to the full review panel (GST-3041). (#4469)
- /ship's review plan now sends Swift code that touches private user data to the full review panel (GST-3052). (#4472)
- A round grant at /ship's review round cap now buys the fix round it names, in the same run or the next (GST-2968). (#4479)
- The secrets check stops flagging three kinds of ordinary code as a secret, and catches two misses. (#4457)
- A security finding's location and reason no longer go into a PR body. (#4486)
- The token-capped /ship child on Claude Code now starts its prompt with the typed `/ship` command, so the skill actually loads. (#4487)
- A /ship receipt now counts the second-model review's blocking findings, and refuses to be written while one is still open. (#4485)
- A `/ship` with a token cap on Claude Code no longer stops at its first handoff. (#4452)
- /ship's push step now always ends with one line that says whether it pushed (GST-3053). (#4474)
- A PR's review-round count can no longer be overwritten by the body `/ship` posts. (#4440)
- One queued record with a malformed path no longer stops artifacts sync for every project. (#4455)
- A failed artifacts push stays reported until a push succeeds. (#4455)
- The /sync-gbrain memory row no longer says OK when pages failed to import. (#4455)
- ### Tests (#4495)
- A policy-floor test no longer fails once gstack's own version reaches the minor after the newest policy key; it now checks a floor above both, so the v1.101.0.0 release can pass CI. (#4495)
- CI now uploads free-suite test results to Trunk with analytics-uploader v2.1.8 and analytics-cli 0.17.0, up from v2.1.6 and 0.16.2. (#4453)
- Packing a checkout for a Ubicloud run no longer fails when git beside it is rewriting a ref. (#4447)
- The /plan-ceo-review HOLD SCOPE eval no longer fails a review because its follow-up question didn't repeat the mode name. (#4447)
- Unattended /autoplan now records the owner's relayed gate reply instead of refusing it. (#4484)
- Unattended /autoplan now runs the second-model review you turned on, and waits for it instead of ending the session. (#4459)
- Two /autoplan runs started in the same second no longer share a run id. (#4459)

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