Skip to content

fix: address audit correctness and resource bounds - #4231

Merged
ScriptedAlchemy merged 9 commits into
masterfrom
fix/audit-correctness-and-resource-bounds
Oct 18, 2026
Merged

ScriptedAlchemy merged 9 commits into
masterfrom
fix/audit-correctness-and-resource-bounds

Conversation

@ScriptedAlchemy

@ScriptedAlchemy ScriptedAlchemy commented Oct 17, 2026 •

Copy link
Copy Markdown
Owner

Whole-line symbol edits could remove neighboring syntax, cancellation could delete payloads after an admitted SQL commit, and privacy rescans missed canonical inline bodies and external-row metadata. This change refuses unsafe line splices, makes the SQL writer own payload completion, and remediates metadata independently of body availability.

It also matches complete insertion anchors, respects Python bindings when resolving imported calls, fixes TypeScript multi-sequence gap continuity, bypasses proxies for local Rust SDK connections, bounds job output and MCP/HTTP admission, and confines file deliveries through no-follow directory handles. Eval grading now distinguishes forbidden attempts, completed abstention and missing agent runs; repetition denominators and per-child benchmark memory measurements are corrected. The security policy and optional mockup data loading reflect current behavior.

Validation:

  • bazel test //evals/hermetic:score_test //evals/hermetic:scorecard_test --test_output=errors passed both targets after correcting an initial test import-path failure.
  • All changed Rust files formatted successfully through Bazel's pinned nightly rustfmt. git diff --check and conventional commit lint passed.
  • bazel test //sdks/typescript:unit_test --test_output=errors passed. The new target brings the SDK suite into bazel test //....
  • The initial Rust suite invocation remained in dependency analysis for 18 minutes without executing tests and was canceled. The wider follow-up invocation was canceled while waiting. Rust compilation, race regressions, HTTP admission behavior and cross-platform verification remain for CI; no Rust test pass is claimed.
  • Added deterministic regressions for canceled/rejected commit ownership, canonical inline and external metadata rescans, shadowed imports, exact anchors, bounded command output, confined file destinations, local proxy routing, SDK gaps and grading.

This is a broad fix set; CI and review remain necessary before merge. Existing staged mockup dependency changes are excluded. No feature removal, generated contract edits, credentials or operator profile exports are included.

@changeset-bot

changeset-bot Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 0613f9c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

devin-ai-integration[bot]

This comment was marked as resolved.

ScriptedAlchemy and others added 8 commits October 17, 2026 12:11
…build

- Re-externalized privacy remediation now retains sanitized provider
  metadata beneath the new payload envelope instead of discarding it.
- Compute the resume_gap frontier from the validated integer so the
  TypeScript SDK declaration build type-checks.
- Cover decorated local shadowing in the Python call-binding test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pending bound equalled the per-connection execution cap, so a client
pipelining a ninth request got an internal error instead of queueing for
a permit. Stop reading at 64 pending requests instead; frames past the
bound wait in the socket, so retained payloads stay bounded.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

3 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

/// execution permit. At the bound the session stops reading, so further
/// frames wait in the peer's socket instead of being refused or retained;
/// a cancellation sent at the bound is read once one request settles.
pub const MAX_PENDING_REQUESTS: usize = 64;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 Pending requests exhaust session memory

Pipelining 64 large MCP requests lets MAX_PENDING_REQUESTS retain roughly a gigabyte of frames per session. The production execution limit is eight, so 56 decoded requests can wait in memory without running.

Learn more

Each received request becomes a future held by the session until it finishes or its response is written. MCP framing accepts frames up to 16 MiB, while the production execution limit permits only eight active requests per client. Raising the retained-future ceiling to 64 lets a single connection keep 56 large decoded payloads waiting for those eight permits. The per-connection worst-case input alone approaches 1 GiB, before decoded JSON and handler allocations.

Example: A client pipelines 64 valid tools/call frames with nearly 16 MiB of arguments each while the first eight calls are busy. The server retains all 64 requests rather than bounding memory near eight frames, so concurrent clients can exhaust daemon memory.

Recommended fix: Decouple queueing from retaining decoded payloads. Bound the bytes and count of admitted pending requests against available memory, or leave excess frames in the socket until execution capacity exists while preserving cancellation processing. Measure the retained payload cost before selecting a higher bound.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@ScriptedAlchemy
ScriptedAlchemy merged commit 35e5ae4 into master Oct 18, 2026
16 of 18 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