Skip to content

fix(audit): resolve HIGH + MEDIUM + perf/correctness findings from multi-agent repo audit#185

Merged
Lykhoyda merged 2 commits into
mainfrom
fix/audit-findings-2026-05-29
May 30, 2026
Merged

fix(audit): resolve HIGH + MEDIUM + perf/correctness findings from multi-agent repo audit#185
Lykhoyda merged 2 commits into
mainfrom
fix/audit-findings-2026-05-29

Conversation

@Lykhoyda

Copy link
Copy Markdown
Owner

Summary

A 13-subsystem multi-agent audit of the repo surfaced 86 confirmed findings (adversarially verified; 18 plausible-but-wrong findings refuted). This PR resolves the 1 HIGH, all 16 MEDIUM, and the high-value perf/low/doc items — ~42 findings, each with regression tests where unit-testable.

  • Full unit suite: 1558 pass (added ~40 new regression tests)
  • tsc clean, Swift runner xcodebuild build-for-testing SUCCEEDED
  • Live-verified on device: the multi-renderer getTree() fix confirmed over CDP against the booted Bridgeless + Reanimated test app (returned the real AppContainer tree, not a LogBox shell)

🔴 HIGH

  • collect-feedback.sh redact() failed open on macOS — an invalid sed bracket range made the secret stage error on every run, leaking ghp_/AKIA/JWT/Bearer/sk_ tokens into the public feedback issue. Now a single sed program that fails closed ([REDACTED_FAILED]). Added a bash regression test that proves the leak, then proves it closed.

🟠 MEDIUM (16)

Correctness: device_batch swipe→real swipe; iOS/Android HTTP request timeouts; ref-map @ref age gate → STALE_REF; iOS screenshot png format; NaN tap-coord guard; repair-engine grammar realigned to the failure parser (quoted/commented testIDs); experience candidate/import-id collisions, ghost-recovery idempotency allow-list, redaction quoted-JSON/object-auth gaps, PII over-redaction; cross_platform_verify FAIL → ok:false; runMaestroInline B59 tiered fallback; unfiltered getTree() multi-renderer walk; per-project nav-graph strike namespacing; swift textInputAt query restriction; EAS portable stat.

⚡ Performance

meta.timings_ms helper + scrollintoview instrumentation (closes a CLAUDE.md mandate that had zero implementations); object_inspect concurrent child fetch; nav_graph go single graph read (was up to 4 disk re-parses/call); connect candidate loop O(n²)→indexed; auto_login poll-until-ready instead of a blind 3s wait.

🟡 LOW / docs

Guarded JSON.parse ×2; navigateTo loop depth cap; sidecar lastSeenMtimeMs re-seed; proof_step no-session verify; device_record path-traversal guard; device_find recoveredTier surfaced on all outcomes; detectPrerequisites whole-word match; learned-actions --max NaN fallback; collect-feedback grep -c double-zero; IPv4/6 loopback alignment; tool-count drift (51/74 → 75); REACT_READY renderer range 1-5 → 1-20; repair-budget windowed count.

Swift (compile-verified)

  • rn-fast-runner now answers GET /health directly (was unparseable → liveness always read stale)
  • snapshotHasFocus uses as? not as! (a force-cast trap is uncatchable by the Obj-C exception catcher)

Deferred

~20 lower-value / moderate-risk items (e.g. logger async, maestro_test_all parallelism, maestro pass/fail string detection, CAS/cache reuse, lockfile/connectWs lifecycle; plus genuinely cosmetic/working-as-intended ones like the fingerprint "hermes" default) were deliberately deferred to avoid rushing regressions into a shipping plugin — tracked for a focused, well-tested follow-up.

Testing

  • npm test → 1558 pass
  • npx tsc --noEmit → clean
  • xcodebuild build-for-testing (rn-fast-runner) → TEST BUILD SUCCEEDED
  • Live CDP verification of multi-renderer getTree() on the booted simulator

🤖 Generated with Claude Code

Lykhoyda and others added 2 commits May 30, 2026 12:18
…lti-agent repo audit

A 13-subsystem multi-agent audit (adversarially verified, 18 findings refuted)
surfaced 86 confirmed issues. This resolves the 1 HIGH, all 16 MEDIUM, and the
high-value perf/low/doc items — ~42 findings — each with regression tests.
Full suite: 1558 pass. Swift runner build-for-testing SUCCEEDED. The multi-renderer
getTree fix was live-verified on the booted Bridgeless+Reanimated test app over CDP.

HIGH
- collect-feedback.sh redact() failed OPEN on macOS (invalid sed bracket range)
  leaking ghp_/AKIA/JWT/Bearer/sk_ secrets into public feedback issues — now one
  sed program that fails CLOSED ([REDACTION_FAILED]); + bash regression test.

MEDIUM (correctness/inconsistency)
- device_batch swipe was a scroll; now a real swipe gesture honoring duration
- runIOS/postCommand + android client: AbortController per-command HTTP timeout
- ref-map @ref coords gated on snapshot age (isRefMapFresh) -> STALE_REF when stale
- iOS raw screenshot honors png format via extension; NaN tap coords rejected
- repair-engine extract/replaceIdSelector match the maestro-error-parser quoted-id
  grammar (quoted/commented testIDs no longer skip auto-repair)
- experience: candidate-id regex matches real filenames; imported heuristic ids
  deduped; ghost recovery gated to idempotent tools; redaction catches quoted-JSON
  /object-auth secrets; PII regex no longer over-redacts bare numbers
- cross_platform_verify FAIL returns ok:false (was warnResult/ok:true)
- runMaestroInline routes through chooseMaestroDispatch (B59 iOS-only fallback)
- injected getTree() unfiltered branch walks ALL renderers (B143/B145)
- nav-graph strikes namespaced per project (no cross-project cooldown poisoning)
- swift textInputAt restricts query to input types; eas_resolve_artifact.sh portable stat

PERF
- meta.timings_ms helper + scrollintoview instrumentation (CLAUDE.md mandate)
- object_inspect concurrent child fetch; nav_graph go single graph read (was 4x)
- connect candidate loop O(n^2) indexOf -> indexed; auto-login polls instead of 3s wait

LOW / correctness + docs
- guarded JSON.parse (navigation-state, android client); navigateTo loop depth cap
- sidecar missing lastSeenMtimeMs re-seeded (re-enables human-edit guard)
- proof_step no-session verify -> verified:false; device_record path-traversal guard
- device_find surfaces recoveredTier on NOT_FOUND/AMBIGUOUS; detectPrerequisites
  whole-word permission match; learned-actions --max NaN fallback; collect-feedback
  grep double-zero fix; iOS /health probe 127.0.0.1 (was [::1])
- tool-count drift (banner 51, CLAUDE.md 74 -> 75); REACT_READY renderer range 1-5 -> 1-20
- repair budget refusal reports 24h-windowed count, not lifetime total

Swift (xcodebuild build-for-testing verified)
- rn-fast-runner answers GET /health directly (was unparseable -> liveness always stale)
- snapshotHasFocus uses `as?` not `as!` (force-cast trap is uncatchable)

Deferred (~20 moderate-risk perf + cosmetic items) tracked for a focused follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Follow-up to the audit fixes — addresses the remaining lower-severity items. Full suite still 1558 pass; tsc clean.

Perf/lifecycle: logger buffered WriteStream (no event-loop block); connectWs backstop terminates a wedged socket (no leak); cdp_network_log truncated/total accurate on the unfiltered path via buffer size.

Correctness/clarity: maestro_run pass/fail no longer false-flags benign 'Error:' (exit code authoritative); fingerprint engine = Hermes only with an RN signal else null; groupFailures unreachable passed++ removed; multiplexer debug-logs unrouted-id drops; RunIOSArgs dead x1/y1 removed; path-safety sidecar-path comment fixed; ensure-agent-device uses npm prefix -g (npm 9+); expo_ensure_running preserves temp logs on failure.

Not-actioned (correct as-is): lockfile release (signals route to exit->release; SIGKILL covered by mtime), dumpsys (action=all runs once), persistRun CAS re-read (required after conflict), test-recorder dedup edge / buildNavigationPlan scan / loadExperience forceReload (dev-only/negligible).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Lykhoyda Lykhoyda merged commit 056532b into main May 30, 2026
7 checks passed
@Lykhoyda Lykhoyda deleted the fix/audit-findings-2026-05-29 branch May 30, 2026 12:59
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