Skip to content

Harden error handling, dependencies, and MCP boundaries - #28

Merged
mikim merged 3 commits into
mainfrom
codex/harden-reliability-pipeline
Jul 28, 2026
Merged

Harden error handling, dependencies, and MCP boundaries#28
mikim merged 3 commits into
mainfrom
codex/harden-reliability-pipeline

Conversation

@mikim

@mikim mikim commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Keep explicit phase: "error" events actionable even when normalized error details are absent, including recent-window burst detection.
  • Patch vulnerable transitive lockfile entries (fast-uri 3.1.4 and @hono/node-server 2.0.12) without changing parent SDK versions.
  • Add opt-in sanitizer input/output budgets for messages, blocks, and UTF-16 text, with deterministic traversal, hook reapplication, bounded impact accounting, and merge amplification protection.
  • Replace MCP handler casts with fail-fast Ajv 2020 validation against strict tool schemas and the canonical runtime-event v2 schema.
  • Add secure MCP defaults (256 messages / 2,048 blocks / 1,000,000 text code units), a 1,024-character merge-separator ceiling, and real Client + InMemoryTransport integration coverage.
  • Include the MCP example build/tests in the root and CI command path.

Why

This closes three reliability gaps found during repository triage: silent no-op recovery for underspecified error events, known vulnerable transitive dependencies, and unvalidated/unbounded MCP tool inputs.

Affected packages

  • @ark/sanitize
  • @ark/classify
  • tooling / docs / MCP example

Validation

  • pnpm install --frozen-lockfile
  • pnpm check (97/97 tests; typecheck, lint, schema validation, package/MCP builds)
  • MCP integration tests (5/5)
  • pnpm audit --prod --json (0 vulnerabilities)
  • pnpm audit --json (0 vulnerabilities)
  • Changesets added for both public package changes
  • Independent adversarial review completed with no remaining P1/P2 blockers

Residual boundary

The sanitizer budgets gate known content/messages before transforms and cap normalized output, but they are not a raw JSON-RPC byte limit and do not recursively budget opaque provider-specific fields. That transport/deep-object boundary remains explicitly documented.

@mikim
mikim marked this pull request as ready for review July 28, 2026 04:12
@mikim
mikim merged commit b1c78e2 into main Jul 28, 2026
4 checks passed
@mikim
mikim deleted the codex/harden-reliability-pipeline branch July 28, 2026 04:14
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