fix: close packaging and static-audit gaps - #20
Merged
Conversation
Stage only git-tracked runtime files and a fresh GUI build into the macOS app, fail package:macos on a dirty tree, and scan the staged bundle. Bound request bodies while streaming, redact privacy-scan matches, fail closed on malformed percent-encoding, and honor the confirmed-launch gate on delegation Install/Update/Remove. Co-authored-by: pavelhov <pavelhov@users.noreply.github.com>
The packaging script lists tracked files with `git -C "$repo_root" ls-files -z --`, not `git ls-files -z --`. Co-authored-by: pavelhov <pavelhov@users.noreply.github.com>
The confirmed-launch notice added a locale key that every locale already ships; the parity list in subagents-classic must name it too. Co-authored-by: pavelhov <pavelhov@users.noreply.github.com>
pavelhov
marked this pull request as ready for review
August 27, 2026 18:39
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.
Audit/packaging fixes only. No Cursor OAuth/API-key changes. Proxy and GUI test runners were not reworked except where a test had to cover a fix.
1. macOS packaging copied the live working tree
Verified:
scripts/build-macos-app.shcopied livesrc/,bin/, and ignoredgui/dist. Untracked files under those trees could ship; a stale dashboard could ship.Changed:
git ls-filespaths undersrc/andbin/(fail-fast inspect, then copy).gui/dist.privacy-scan.ts --scan-root.node_modulessymlinks for absolute/escaping targets before archive.package:macosnow fails on a dirty/untracked working tree.build:macosstays permissive for local dev.2. Request limits after full
arrayBuffer()Verified:
readBoundedJsonRequestBodyrejected an honestContent-Lengthearly, then calledreq.arrayBuffer()for missing/dishonest declarations, so the cap ran after the whole body was buffered.Changed: Stream with
getReader(), abort as soon as the byte cap is exceeded, and never callarrayBuffer().3. Privacy scan leaked matches and skipped Swift/plist/
gui/distVerified: Failures printed
finding.valuein full. Extensions did not include.swift/.plist.gui/dist/was excluded (and is gitignored, sogit ls-filesnever saw it).Changed: Logs print
[redacted N chars]only. Scan Swift, plist, andgui/distwhen present.--scan-rootwalks a staged tree (used by the macOS packager). Fixture/Users/example/underapp/remains allowlisted.4. Uncaught
URIErrorfrom malformed percent-encodingVerified:
decodeURIComponenton artifact ids (src/server/index.ts) and live call ids (src/server/live.ts) could throw and crash the request/process.Changed: Fail closed: artifacts return 400
invalid artifact id encoding; live sideband parsing returnsnull.5. Delegation Install/Update/Remove ignored confirmed-launch
Verified: Server PUT/DELETE
/api/codex-delegationrequiresconfirmed-gui-session(403 otherwise). The card enabled those buttons from local status alone.Changed: Buttons stay disabled without a confirmed launch and show the launcher-required notice.
Also included (small and still real)
ApiKeys.tsxcatalog fetch moved from unauthenticated/v1/models(loopback bypass) to session-backed/api/models.node_modulessymlink containment check (see packaging above).Skipped (not trivial here)
RELEASE_OUTPUT_DIRpath containmentTesting
Local (Linux):
bun run typecheckbun run privacy:scanbun run test:parallel(606 files passed)cd gui && bun run test(868 tests / 139 files)cd gui && bun run lintcd gui && bun run lint:i18ncd gui && bun run buildFocused coverage for the fixes:
tests/request-decompress.test.tstests/privacy-scan.test.tstests/package-tree-safety.test.tstests/macos-build-script.test.ts(Darwin containment cases remain Darwin-gated)tests/server-live.test.tstests/server-images.test.tsgui/tests/codex-delegation-setup.test.tsxgui/tests/subagents-classic.test.ts(launcherRequired i18n contract)gui/tests/api-access-models.test.tsplus ApiKeys mocks on/api/modelsWaiting on GitHub
cifor this branch before merging intodevelopment(notmain).