Skip to content

refactor: prepare containment handoff for Linux native policy - #186

Merged
kevin-orellana merged 4 commits into
mainfrom
feature/linux-native-launch-prep
Oct 28, 2026
Merged

kevin-orellana merged 4 commits into
mainfrom
feature/linux-native-launch-prep

Conversation

@kevin-orellana

@kevin-orellana kevin-orellana commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Human readable section

Problem: Linux filesystem checks need a way for a workload to register before it starts. The current containment call cannot carry that connection.

Solution: Add an optional registration connection to the containment function. Update the Linux, macOS, and test callers together.

Example: An existing Rust caller changes Containment::apply(&config, None, None) to Containment::apply(&config, None, None, None). The final None means no native filesystem registration.

Trade-off: Rust callers must add the fourth argument. This preparation does not enable Linux native filesystem policy. Supplying a registration connection still returns an unsupported-capability error.

Description

This is PR 1 of 4: #186 → #191 → #193 → #188. Merge this PR into main first.

  • Extend Containment::apply and the internal backend interface with native_filesystem_handoff. Existing callers pass None, so their launch behavior stays the same.
  • Reject a supplied connection before backend selection. an_unavailable_native_handoff_refuses_before_backend_selection tests that order.
  • Correct the API documentation to describe all four arguments. The third argument, confirm_fd, already exists. Only the fourth argument is new.
  • Extend the existing box_library test to verify that the readiness callback can create the configuration before Box reads it. This tests existing behavior.
  • Add the preparation branch to the continuous integration pull-request filter so feat: add Linux native kernel mechanisms #191 receives checks. Job permissions and push triggers do not change.

The other PRs use temporary review bases. After each prerequisite merges, update and retarget the next PR to main. Do not merge into a staging branch.

Related Issues

#127 tracks the Linux adapter. #191 adds kernel mechanisms, #193 connects policy operations, and #188 activates the feature.
#181 contains the original feature discussion. A new commit reversed its accidental merge into this preparation branch and restored the reviewed preparation tree.

Type of Change

Breaking change

Testing

Current head: 53b0f604178d1fdc3d3ea578bbe9a37ffd055714. This review changed no source in this PR.

Check Result
Fresh launch-preparation checks The containment refusal test and complete custom box_library executable passed on Rust 1.98.1.
Three regression controls Each changed implementation compiled, then failed its intended assertion: missing handoff refusal, late opt-in refusal, and callback after configuration parsing. Restored code passed.
Prior current-head checks All-target macOS compilation, owned-crate lint, and 1,003 library/catalog tests passed. The custom callback executable also passed.
Test preservation No existing test or assertion was removed, and no ignore was added.

The repository interface review treats the fourth Containment::apply argument as a deliberate breaking Rust interface change. Existing CLI and strands_box::run callers do not migrate. The migration example appears above.

Fresh independent review followed the repository's feature-critic checklist. The bounded docs-sync review found no missing documentation for this preparation.

Hosted checks, formal human approval, and merge approval remain separate. Authorization and identity-policy investigation was excluded; this is not full security sign-off. Cloud native qualification and performance testing remain separate work.

Checklist

  • I have read the CONTRIBUTING document
  • I have reviewed and understand every line of code in this PR, including any generated by AI tools, and I can explain why it works
  • My change is focused and reasonably small; I have split unrelated work into separate PRs
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • My changes generate no new warnings

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

keorel and others added 2 commits October 27, 2026 19:04
## Problem

The Linux native adapter needs a containment handoff argument. Mixing its interface migration with the adapter obscures review of existing launch behavior.

## Solution

Add the approved fourth optional argument to Containment::apply and migrate every backend and caller. Callers pass None. A supplied handoff returns UnsupportedCapability before backend selection. Update the public documentation. Include the dependent review branch in the existing CI pull-request filter.

## Tests

Box and containment all-feature suites passed 1,513 tests with six existing ignores. The library callback executable passed, including its callback-created configuration case. an_unavailable_native_handoff_refuses_before_backend_selection checks the refusal and selection order. Build, formatting, diff checks, and strict owned-crate Clippy passed. Independent review found no remaining issues. No baseline test or assertion was removed. Full workspace and native macOS checks were not rerun on this standalone branch. Hosted checks and cloud qualification remain separate.
Comment thread crates/box/tests/box_library.rs Resolved
@github-actions

Copy link
Copy Markdown

Assessment: Request Changes

The signature extension is clean and the mechanical caller updates look correct and consistent. The one substantive concern is a new test whose negative assertion guards against a string the codebase never emits, so it passes vacuously and does not actually verify the behavior the PR claims (see inline comment on box_library.rs). That guard is the whole point of the new --callback-config case, so it's worth fixing before merge.

Review Categories
  • Interface change: Adding a fourth native_filesystem_handoff argument to the single Containment::apply verb is consistent with the crate's "one verb, no second entry point" tenet, and containment/AGENTS.md + README are updated to match. The crate is publish = false (internal), so this is an internal breaking change only. Early fail-closed rejection before backend selection is pinned by an_unavailable_native_handoff_refuses_before_backend_selection — good.
  • Testing: The new refusal test is well-targeted. The --callback-config test has a vacuous negative assertion (inline comment) that undermines its stated purpose.
  • Minor (non-blocking): backend.apply(..., native_filesystem_handoff) always receives None after the early return; threading it is harmless forward-looking scaffolding. The UnsupportedCapability { backend: "this containment build" } value is a slight stretch of a field documented as "the backend that rejected it", since rejection happens before any backend is selected — the rendered message still reads fine.

Nicely scoped preparation PR — the behavior-preserving None threading and the documentation corrections are easy to follow.

@kevin-orellana
kevin-orellana merged commit 1ad7e98 into main Oct 28, 2026
27 checks passed
@kevin-orellana
kevin-orellana deleted the feature/linux-native-launch-prep branch October 28, 2026 16:23
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.

3 participants