Trafficbot follow-up audit — 2026-10-30
Scope: fresh source inspection, backend/frontend builds, frontend tests, linters, backend suite and loopback API tests. This is a code and validation audit; no fresh visual audit, installer execution, release installation, or live external traffic. Application code was not modified.
Verdict
The four release blockers documented on October 25 remain in the current working tree. No verified resolution was found for engine startup, onboarding hook ordering, settings validation, or platform packaging.
Priority findings
- P1 — Native startup schedules a batch and exits its controller.
apps/desktop/src-tauri/src/engine.rs:60-63 runs main with BOT_ROLE=producer; src/main.ts:230-251 submits work and shuts down. Use the dedicated long-running management entry point for both development and packaged builds.
- P1 — Onboarding can crash when dismissed.
apps/desktop/src/components/Onboarding.tsx:24 returns before the effect at line 41. Hook count changes after dismissal or automatic completion. Frontend lint confirms this error.
- P1 — Settings writes lack an allowlist and safe encoding.
src/application/api/ControlServer.ts:480-504 accepts arbitrary keys and writes raw values into .env. Newlines can introduce extra settings; returned process.env values can disagree with the already-parsed runtime Config. This route is authenticated, but still needs typed validation, bounded settings, atomic persistence and explicit restart semantics.
- P1 — Worker enrollment client cannot authenticate to its endpoint.
src/infrastructure/worker/EnrollmentClient.ts:13-16 sends only Content-Type and a body token; global middleware in ControlServer.ts:46 requires an installation Bearer token before enrollment validation. The wizard-generated command supplies no installation token. A worker on another host also receives a 127.0.0.1 address pointing to itself. Design a dedicated, narrowly authorized enrollment flow and secure transport rather than removing management authentication.
- P1 — Scheduler can restart after shutdown.
src/application/schedules/ScheduleRunner.ts:27-37 does not retain the initial timeout. Calling stop before the first tick cannot cancel it; the callback later runs and creates a recurring interval. The six API assertions pass, but Jest stays alive with an open-handles warning, consistent with this lifecycle defect. Add cancellation covering both initial timeout and interval and a stopped guard.
- P2 — Update reconciliation misses late Redis readiness. ControlServer.start calls reconciler.start before controller.ts connects Redis. UpdateReconciler.start returns immediately if no connection exists; controller.ts has no subsequent call to start it. Consequently update subscriptions and restart-timeout tracking can remain inactive throughout the normal dedicated-controller lifecycle.
- P2 — Proxy concurrency limit is cosmetic. The UI/DTO expose maxConcurrentLeases, but ProxyRecord does not store it and ProxyAllocator.acquire never enforces it. Leases are process-local; expiresAt is written but no expiry cleanup exists. The displayed limit does not provide a fleet-wide concurrency guarantee.
- P2 — Engine health can stay green after disconnect. EngineStatus derives health from a cached system object and uses live only for a small stream marker. TanStack Query retains the previous snapshot on fetch errors; App also labels the sidebar connected from connection-object presence. Mark stale/disconnected health explicitly and gate actions on actual readiness.
- P2 — Enrollment offers unsupported artifact combinations. Wizard allows Windows ARM64, but build-workers.cjs only produces Windows x64. Filter options from the available release manifest rather than constructing download URLs for every selectable pair.
Packaging and missing features carried forward
- prepare-desktop-engine.cjs hardcodes macOS ARM64; Tauri bundle targets remain app-only. Windows/Linux installer production and macOS x64 support need target-specific configuration and execution evidence.
- Sessions still lack stop/retry, related-log navigation, event timeline and richer filters.
- Campaign editor still lacks capability-driven platform/browser/device selection and persistent-profile binding guidance.
- Existing proxy editing/manual tests, native important-event notifications, safe restart and tray campaign pause remain incomplete.
Fresh validation
- Backend TypeScript build: pass.
- Desktop TypeScript/Vite build: pass, main JS approximately 739 kB minified.
- Backend lint: 14 errors.
- Frontend lint: conditional-hook error and warnings; exits with success despite diagnostic error.
- Frontend tests: 13 passed, 3 failed due to localStorage.getItem unavailable in the test environment.
- Loopback API tests: all 6 assertions pass; process remains running with open-handles warning.
- Backend suite with loopback access: 251 passed, 42 skipped across 27 passing suites; Jest remains alive with an open-handles warning. Initial sandbox-only ArtifactDownloader socket errors disappeared on rerun. Full output:
/tmp/trafficbot-audit-20261030-tests.log.
Recommended sequence: repair native startup and scheduler shutdown; fix onboarding; validate settings and enrollment authentication; enforce proxy limits and stale health; then complete compatibility controls and validate native installers.