# jackin-isolation (https://jackin.tailrocks.com/reference/crates/jackin-isolation/)



{/* GENERATED from crates/jackin-isolation/README.md — edit the README, not this file */}

Mount isolation subsystem. Materializes per-workspace isolated git worktree mounts from the host repository into a container, inspects git state, and cleans up on teardown — the mechanism behind per-mount isolation.

## What this crate owns [#what-this-crate-owns]

* Mount materialization (`materialize`) from host repo into isolated worktrees, with branch/state tracking (`branch`, `state`).
* Git inspection (`git_inspect`) for dirty/worktree state.
* Finalization and cleanup (`finalize`, `cleanup`) on session teardown.

## Architecture tier and allowed dependencies [#architecture-tier-and-allowed-dependencies]

**Application/integration crate** sitting between orchestration and the Docker/git substrate. Allowed production dependencies (inward only): `jackin-core`, `jackin-config`, `jackin-diagnostics`, `jackin-protocol`, `jackin-docker`, `jackin-runtime`. Must NOT depend on `jackin-launch-tui` or `jackin-tui` (presentation).

## Structure [#structure]

| Module                                                                                                                                                                          | Owns                     | Tests                                                                                   |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------ | --------------------------------------------------------------------------------------- |
| <RepoFile path="crates/jackin-isolation/src/lib.rs">`lib.rs`</RepoFile>                                                                                                         | crate root, re-exports   | —                                                                                       |
| <RepoFile path="crates/jackin-isolation/src/materialize.rs">`materialize.rs`</RepoFile> · <RepoFile path="crates/jackin-isolation/src/materialize.rs">`materialize/`</RepoFile> | mount materialization    | <RepoFile path="crates/jackin-isolation/src/materialize/tests.rs">`tests.rs`</RepoFile> |
| <RepoFile path="crates/jackin-isolation/src/branch.rs">`branch.rs`</RepoFile> · <RepoFile path="crates/jackin-isolation/src/branch.rs">`branch/`</RepoFile>                     | branch tracking          | <RepoFile path="crates/jackin-isolation/src/branch/tests.rs">`tests.rs`</RepoFile>      |
| <RepoFile path="crates/jackin-isolation/src/state.rs">`state.rs`</RepoFile> · <RepoFile path="crates/jackin-isolation/src/state.rs">`state/`</RepoFile>                         | isolation-state tracking | <RepoFile path="crates/jackin-isolation/src/state/tests.rs">`tests.rs`</RepoFile>       |
| <RepoFile path="crates/jackin-isolation/src/git_inspect.rs">`git_inspect.rs`</RepoFile> · <RepoFile path="crates/jackin-isolation/src/git_inspect.rs">`git_inspect/`</RepoFile> | git/worktree inspection  | <RepoFile path="crates/jackin-isolation/src/git_inspect/tests.rs">`tests.rs`</RepoFile> |
| <RepoFile path="crates/jackin-isolation/src/finalize.rs">`finalize.rs`</RepoFile> · <RepoFile path="crates/jackin-isolation/src/finalize.rs">`finalize/`</RepoFile>             | finalize                 | <RepoFile path="crates/jackin-isolation/src/finalize/tests.rs">`tests.rs`</RepoFile>    |
| <RepoFile path="crates/jackin-isolation/src/cleanup.rs">`cleanup.rs`</RepoFile> · <RepoFile path="crates/jackin-isolation/src/cleanup.rs">`cleanup/`</RepoFile>                 | teardown/cleanup         | <RepoFile path="crates/jackin-isolation/src/cleanup/tests.rs">`tests.rs`</RepoFile>     |

## Public API [#public-api]

Materialize/finalize/cleanup entry points consumed by `jackin-runtime`. Parallel materialization must partition by dependency/order group and host repo to avoid `.git` lock contention (tracked as a performance item in the code-health roadmap).

## How to verify [#how-to-verify]

```sh
cargo nextest run -p jackin-isolation
cargo clippy -p jackin-isolation --all-targets -- -D warnings
```
