Repository navigation
fix(processes): bound system I/O and speed saved-item matching - #10
Merged
Merged
Conversation
Dispatch synchronous scanner work outside Swift cooperative workers and stop oversized command output promptly. Guard numeric boundaries, retain persisted identity hashes with faster encoding, and remove misleading per-process GPU attribution. Keep large sidebar counts readable and use the default release build backend.
Keep the initial and refreshed Access assessment pending until a scan completes. Withhold requirement guidance and diagnostic copying while the result is unknown so an empty initial assessment cannot flash a false Blocked state.
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.
Summary
docs/verification/2026-10-07-audit.md.Motivation
Native inspection with over 1,300 processes exposed saved-key matching on the main thread, a process count wrapping in its fixed-width rail, and misleading per-process GPU values. Numeric boundary inputs could trap, while unlimited command output remained active until its timeout. Synchronous scans also occupied cooperative workers.
Scope
Process acquisition/presentation, scanner scheduling, command output cleanup, release backend selection, regressions and verification documentation. No changes to process-action policy, automation ownership/transaction policy, user definitions, credentials, public signing/notarization, or AI authority.
Implementation
BlockingSystemWorkbridges synchronous scanner calls through a utility dispatch queue, propagating errors and checking task cancellation before and after work. A pipe's first output overflow starts existing TERM/KILL process-group cleanup while both streams continue draining. Numeric parsing rejects unsafe values before arithmetic. Saved keys retain SHA-256 inputs and thev2:lowercase format; no-CWD aliases avoid duplicate hashing. Process histories leave GPU unavailable, with system GPU retained in the dashboard. Counts use intrinsic single-line width. Access assessment stays Checking before its first result and during refresh, withholding requirement guidance and diagnostic copying until success/error is assigned. Build and binary lookup retain matching architecture/scratch arguments under the default backend.Behavioral changes
Oversized writers fail promptly instead of waiting for their deadline; malformed metric/elapsed input is rejected. Favorites/watch retain persisted membership. Process charts report CPU and memory without unsupported GPU attribution. Counts above 999 remain readable. Access no longer briefly labels an in-progress scan Blocked. Swift 6.4 release builds no longer emit the forced-native backend deprecation. No schema migration is needed.
Validation
swift test --jobs 4 -Xswiftc -warnings-as-errors, 685 XCTest cases (100 app, 585 core), zero failures on the final implementation.swift build --jobs 4 -c release -Xswiftc -warnings-as-errors.swift test --jobs 4 --filter ReleaseScriptTests -Xswiftc -warnings-as-errors, 63 tests after removing the obsolete flag.git diff --check,bash -n script/*.sh,./script/check_open_source_readiness.sh.linkd.autoShortcutCocoa 4097 errors), Apple Intelligence generation, notification delivery, and all permissions/appearance combinations. Host definition/administrator-approval warnings remain explicitly displayed.68e77f3has exactly the reviewed candidate tree. Rebuilt and installed local full-access arm64 version0.1.0 (20261007). Installed bundle byte comparison, signature/entitlement/architecture validation and binary hash match passed.Tests added or changed
Cover dispatch execution outside Swift tasks/main thread and error propagation; prompt cleanup of an endless TERM-ignoring oversized writer; invalid/non-finite/negative metric and unsafe RSS inputs; multicore CPU acceptance; exact maximum elapsed time and overflow; stable hash output and lexical executable basenames; unavailable per-process GPU samples.
CI status
All three required checks PASSED on final head
5ca654f: Full-history Gitleaks scan, macOS arm64, and macOS x86_64. Both architecture jobs passed constrained-executor checks, warnings-as-errors tests/release builds, universal sandbox/full-access bundle validation, and tracked-file cleanliness. No non-successful required checks remain; no bypass was used. Pre-existing host integration limitations are documented above.Post-merge checks also PASSED on main
68e77f3: Secret Scan and Release Gates, including both macOS architectures.Risk assessment
MEDIUM: subprocess cleanup and scanner scheduling touch runtime infrastructure. Existing timeout/cancellation/PID-group tests plus the added writer regression cover the changed cleanup path. Dispatch work cannot abort a synchronous scanner already in progress, whose existing tool bounds remain active. A deliberately escaping descendant retaining a pipe is not isolated by general process-group cleanup; no concrete production trigger was found in fixed system-tool callers. Numeric checks and saved-key compatibility are covered. The local ad-hoc bundle does not establish notarized distribution.
Rollback
Revert this commit to restore prior scanning, cleanup and presentation. Existing saved hashes remain compatible. The prior installed bundle was moved to Trash before replacement; no user automation or process data migration occurs.
Review focus
Inspect the first-overflow callback and existing group lifecycle, scanner bridge cancellation/error flow, numeric guards before arithmetic, persisted key format, accurate GPU attribution, matching build/path lookup arguments, and Access initial/pending/result transitions.
Follow-ups
Separately qualify permission-dependent Shortcuts, Foundation Models generation and notification delivery on supported host configurations. No required implementation or test work is deferred.