← Back to Pull requests

[MP2-031] Sandbox external adapter execution #184

Closed
unknown closed this pull request without merging on Sep 28, 2026 06:19 UTC
View on GitHub
unknown unknown commented on Sep 27, 2026 20:51 UTC
Author

Outcome

Problem

MP2-031 / MET-98 requires external adapters to acquire only approved inputs and normalize them without credentials, network access, privilege, or unbounded resource use. The existing execution path did not yet provide that complete fail-closed boundary.

User-visible behavior

The external-source CLI can now run an allowlisted adapter against exact-SHA/size-bound source and artifact inputs. Successful execution publishes validated canonical output atomically; policy, quota, archive, isolation, or validation failures leave no partial destination.

Changes

Scope

Adds the MP2-031 adapter sandbox, CLI/execution integration, acquisition and output policies, strict USTAR validation, atomic staged publication, adversarial tests, security documentation, and generated inventory/traceability updates. Release, publication, repository settings, workflows, credentials, and unrelated adapters remain out of scope.

Compatibility

The new behavior is additive. Existing reports and bundles remain readable. Supported Python/platform claims are unchanged. Host execution requires the documented Linux bubblewrap/seccomp primitives and fails closed when they are unavailable.

Evidence and research impact

Acquired bytes are copied into a sealed exact-byte snapshot before execution. The credential-empty, network-disabled, capability-dropped child emits bounded plain USTAR only; the parent prevalidates archive structure and quotas before descriptor-relative extraction and atomic no-replace publication. Existing evidence and research claims are unchanged.

Validation

Tests

  • Focused tests run: 221 non-host external-source tests PASS with 7 intentionally deselected host cases; the 7 real Linux host escape/fork/output/network tests PASS on the governed bubblewrap/seccomp host; 47 discovery/currentness tests PASS; 19 traceability-graph tests PASS; strict-parser, collection-contract, source-census, and required-terminal regressions PASS. The final frozen correction passes 138 focused tests; its broader focused/currentness suite passes 212 tests in 383.48 seconds.

  • Static/currentness checks: Ruff lint and format PASS; mypy PASS across 151 source files; functional/public/UI/traceability generators PASS; git diff --check PASS. Generated functional inventory has 123 rows and public-surface inventory has 11,343 rows, with no test-identity additions or removals.

  • Complete hosted qualification (exact candidate, run/attempt, or pending): pending for corrected exact head b1e3a365bdb2f33aab0703572535a66bee7a2e7a; failed predecessor runs 36349572687, 36351043621, 36351914001, 36354014915, 36355691584, 36356538306, 36358478754, and 36361134609 are retained. Run 36351914001 exposed strict-parser-consumer and collection-count defects. Run 36354014915 exposed the missing exact seven bubblewrap-unavailable hosted setup skips. Run 36355691584, job 108723092884, then ran 1,553 tests successfully with 4 governed skips before exposing the stale 150-file mypy source census; retained artifact 10943532681 has provider SHA-256 9ecbe748448fc399aaa0849ec62a4f9ea51f469f183c338db68c2959bb750b71. Run 36356538306, macOS job 108725581176, exposed four Linux-specific test-fixture assumptions while leaving production behavior unchanged; retained artifact 10944254053 has provider SHA-256 f5eb0cd43b3fc00632bb5023eeac7e6b4f082e27c6eb43220da3c49f86ef6304. Run 36358478754, attempt 1, proved all Linux shards successful and exposed the remaining descriptor-path and memfd_create assumptions in all eight macOS shards. Its original macOS artifacts remain provider-bound as 10945980541 (ee4883a79be3292b1b0e8b789c9581eb0e36675729ef033723d4db20654030a0), 10945552857 (9239b31ac696a0ea930a1c7794f262e4269fca958777540b73b0dc899e98dea2), 10945541218 (2e59fde6b0bfd1b15922be91046e4f39918019fcecc69b9407235b18f584e26c), 10945361740 (6e5221af1911ba5c22fdb8dd0eed3e903f0263734f539c0e16dfc057d3306e65), 10945242190 (ee6e16e06b30aa476f8a41406f56dd315626c5d3ed3265db1fb2232c530f3137), 10945009486 (23616bade397ec2492f55e4acd39b5cc19d30717505bc2e4f8e78672786576ee), 10944932596 (63e463467daddb626d7faa8051a4bf944651a276955ef8bff8a2540790e330bc), and 10944813792 (69aa0aa71f8cbcc770e69f5de3ac6dfa41750f22a7f6abe953d7ae2195791cfa). Run 36361134609, attempt 1, exact head cc187d678c9be20325a13c4cb5ad63c6df7cd389, completed with 11 successful jobs, six causal macOS shard failures, and two derivative aggregate failures; every Linux shard succeeded and two macOS shards also succeeded. The six causal artifacts are 10945114816 (0f3e2a80476dbf6ee99f71543cde474a6683da5b6d1314957a6930efd725938c, macOS 3.12 shard 0), 10946213542 (324879df0d98ec178e8006e12897343dd67d122f594d28f48c0617e4610f41c1, macOS 3.12 shard 2), 10946137191 (9a89ab4509dbe5f7c345759d0b44590692a3f317ea9fd3e7d602141d50a36f19, macOS 3.12 shard 3), 10945534141 (54d87b115a18021510266257f0607f76bfd16499993c4ed9c32cc0e9cf12c881, macOS 3.13 shard 0), 10945739849 (889622d6013e797462dd810904c6bd825eae00a3e1c3a3ee1f6d561d8edf9365, macOS 3.13 shard 2), and 10946268173 (713cdf23e917b0469e87ff193132b149ade46a44e6d7655d5ac0e63b9b440b8b, macOS 3.13 shard 3). They exposed one remaining test-harness assumption: production Linux atomic no-replace publication correctly fails closed on Darwin, while the non-Linux unit-test fixture lacked Darwin's atomic no-replace primitive. The correction adds renameatx_np(..., RENAME_EXCL) only to that non-Linux fixture; production and Linux behavior are unchanged, and check-then-rename is not used. Earlier portability corrections still recognize only exact governed skip node IDs, phase, and reason; use descriptor-backed platform-neutral anonymous unit-test files and Darwin descriptor-path lookup; preserve exact Linux descriptor-executable assertions; update measured source/collection counts; and retain mandatory PASS on the separately governed bubblewrap/seccomp host. No failed run is relabelled or retried into PASS.

  • Manual checks, if any: independent final staged-diff review APPROVE with no findings; no manual product substitution.
  • Documentation

    Updates the threat model and adds docs/security/adapter-execution.md; synchronizes support, security-control, capability-ledger, requirements, functional-inventory, and public-surface records.

    Boundaries

    Privacy and security

    Credentials are removed from the child environment, logs sanitize host paths, and inputs are exact-digest/size-bound. Network, process creation, namespace creation, capabilities, mutable input replacement, unsafe archive forms, output/stderr growth, timeout, and destination races are denied or bounded. No credentials, private recordings, personal data, or identifying workcell data are included.

    Checklist

  • The pull request is focused and its diff has been reviewed.

  • New or changed behavior has tests, including a relevant failure path.

  • Focused checks pass locally; required complete qualification must be green for the exact candidate before merge.

  • User-facing commands, support boundaries, and documentation remain truthful.

  • Third-party material has compatible licensing and required attribution.

  • No credentials, private recordings, personal data, or identifying workcell data were added.

  • Frozen v0.2.0 evidence, checksums, measurements, tag, and DOI metadata were not rewritten.

  • Current package capabilities are not attributed to the v0.2.0 SoftwareX evidence or the TIM v0.1.3 measurements.
  • Diff: 650 lines (+487 / -163) across 8 files Reviewer: Miko997 Review duration: 568m
    All Vouch review confidence checks passed
    Residual risk 0.21 = Change Risk (0.52) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.52 · 650 lines diff across 8 files
    0.52
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.388
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #184"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 52% (MEDIUM) · Higher = larger blast radius
    52%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 20.5% · Safe to merge
    20.5%