Skip to content

fix: remediate CLI, provider, and metrics audit findings#16

Merged
cluic merged 2 commits into
mainfrom
codex/fix-audit-findings
Jul 19, 2026
Merged

fix: remediate CLI, provider, and metrics audit findings#16
cluic merged 2 commits into
mainfrom
codex/fix-audit-findings

Conversation

@cluic

@cluic cluic commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Restore CLI execution through npm-style POSIX bin symlinks while preserving side-effect-free imports.
  • Let an ordinary Providers-page compatibility test select the first Provider through the existing no-start compare-and-set path, without calling readiness-gated activation.
  • Make Overview success rates and Provider/model distributions truthful under semantic failures, dropped observations, saturation, overflow, and fixed UTC windows.
  • Propagate Provider model policy through Worker snapshots and harden the proxy data plane, Capture, debug output, and anonymous Metrics against streaming, compression, integrity-header, and protected-value failures found by the audit.

Audit findings resolved

Reported defects

  1. npm global/POSIX symlinks could make isDirectExecution() compare a real module path with an unresolved symlink path, suppressing runCli().
  2. A fresh Providers-page test omitted activateIfNone, so the following explicit activation hit CODEX_NOT_READY while Codex was unconfigured.
  3. Overview counted HTTP-level outcomes as successful Responses completions and could lose/conflate model distribution remainder.

Additional findings

  • Provider modelMode/modelOverride did not survive every registry -> service -> Worker snapshot boundary.
  • Pass-through requests/responses could be fully buffered, cancellation and partial-response settlement were incomplete, and response-start latency began too early.
  • JSON/SSE semantic inspection, compressed-body limits, zstd fallback framing, and SSE line/event accounting had correctness and memory-bound gaps.
  • Lexical model override could damage unrelated JSON number/duplicate-key/whitespace bytes and retained invalid integrity/signature headers.
  • Dynamic Connection tokens could reintroduce hop-by-hop headers.
  • Capture truncation/byte totals and debug/Capture redaction did not cover all protected-value placements and reversible percent/JSON/Base64/base64url/hex forms, MIME whitespace, header names, metadata, Metrics model IDs, or undeclared compressed bodies.
  • Metrics saturation/dimension eviction could violate persisted and projected conservation invariants; incomplete data could still appear as a precise rate.
  • Browser fixtures, legacy model-policy validation, generated UI copy, package-lock root metadata, README release facts, and Changeset coverage had drifted from production contracts.

Verification

  • npm test: 519/519 (458 unit-core + 9 isolated Capture + 51 integration + 1 serial core chain)
  • Chromium Playwright: 46/46
  • Proxy/Capture focus: 43/43
  • npm run lint: 33 source files
  • npm run typecheck:ui: pass
  • npm run verify:ui-build: exact three-file output pass
  • npm audit --omit=dev: 0 vulnerabilities
  • Package/native/workflow checks: 21/21
  • npm pack --dry-run --json --ignore-scripts: exact reviewed 34-file package
  • Changesets status against origin/main: minor
  • git diff --check, production/staged sensitive-pattern scans, fixed-port cleanup, desktop/mobile visual QA: pass
  • Independent final review: no remaining P0-P2
  • GitHub Actions: Linux, macOS, Windows, and release preflight pass

Risk and boundaries

Merge risk is L3 because this changes the proxy data plane, Worker runtime snapshots, and Provider lifecycle-adjacent behavior. The PR intentionally remains draft for human review and the repository's external release gates.

Node versions without native zstd conservatively skip semantic inspection for unsupported checksummed or multi-frame fallback cases while preserving byte-exact forwarding. Local tests use temporary roots, synthetic credentials, and loopback upstreams; they do not replace copied-real-history or external-upstream evidence.

@cluic
cluic marked this pull request as ready for review July 19, 2026 01:09
@cluic
cluic merged commit b61249f into main Jul 19, 2026
4 checks passed
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