# Remove VibeVM from a project {#root}

@status:doc/work @audience:user

[p01] When a project is finished and must leave without a trace of the tool that helped build it, one operation removes every vibe file and reference while keeping the product and its build intact.

[p02]
```prompt
Show me the scrape plan for the VibeVM project in the current folder, then export a scraped copy of it into a new folder named product-clean beside the project, and prove that the copy builds without vibe.
```

- needs: the vibevm skill installed for your agent; a project with `vibe.toml` and a scrape contract adapted to it: `vibe scrape contract init` writes a conservative default that refuses to delete files whose modification it cannot prove and checks health with `cargo`; the project's native build tool on the `PATH`

outcome: `../product-clean` exists, holds no `vibevm/` directory, no `vibe.toml`, no `vibe.lock` and no managed block in the agent instruction files, and its native build and tests pass

- assert: `test ! -e ../product-clean/vibe.toml`
- assert: `test ! -e ../product-clean/vibevm`

## What happens {#what-happens}

[p03] The agent creates the contract with `vibe scrape contract init` if the project has none and adapts it: for vibe's own trees you never edited it sets `modified = "delete"`, and it keeps a health check that fits the project. It runs `vibe scrape --plan`, which reads the contract, classifies every file the tool ever wrote or marked, and prints the complete plan without writing anything: what is deleted, what is rewritten, what is kept under a neutral name. Then it runs `vibe scrape --output` with the absolute path of the new folder, which creates the scraped copy and runs the project's health checks on it; the original is untouched. The copy is a plain project of its language: no [manifest](../glossary/index.xml#manifest), no [lock file](../glossary/index.xml#lock-file), no dependency tree, no boot files, no [managed block](../glossary/index.xml#managed-block), no source annotations that pointed at [specifications](../glossary/index.xml#specification).

> [p04] A scraped tree is a project
>       tree for which every contract-selected Vibe path, dependency, managed
>       marker, source annotation, tool script and environment reference is absent
>       or explicitly retained under a neutral identity, and whose required
>       native health panel is accepted after scraping under the declared strict
>       or no-regression baseline policy. A retained non-pass verdict is never
>       described as an unconditional pass.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPED-TREE>

## By hand {#by-hand}

[p05] 1. Create the contract. The default is conservative: it names vibe's trees, refuses anything it cannot prove unmodified, and checks health with `cargo`:

[p06]
```sh
vibe scrape contract init --path hello-vibe
```

```output
Scrape contract
  ✓ created  <TMP>/work/hello-vibe/vibevm/scrape/contract.toml
Review the contract, then run `vibe scrape contract check`.
```

[p07] 2. Adapt it. A fresh project has no modification baseline for vibe's files, so the two `[[classify]]` rules refuse them as unknown. If you never edited those trees, set `modified = "delete"` on both. Replace the `[[healthcheck]]` if the project is not a Rust workspace. Then validate: `vibe scrape contract check --path hello-vibe`.

[p08] 3. Look at the plan:

[p09]
```sh
vibe scrape --plan --path hello-vibe
```

```output
```

[p10] 4. Export to a new folder, which must not exist yet and is named without `..`:

[p11]
```sh
vibe scrape --output hello-clean --path hello-vibe
```

```output
```

[p12] 5. Or [scrape](../glossary/index.xml#scrape) in place, which is a recoverable transaction and requires explicit authorisation: `vibe scrape --in-place --assume-yes`. If it is interrupted, `vibe scrape --recover --path <root>` settles the pending transaction.

> [p13] `vibe scrape --recover
>       --path <project>` settles the one pending user-local transaction.
>       Recovery reads the journaled contract and plan, never the possibly removed
>       project contract. A new scrape refuses while recovery is pending.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-RECOVER-COMMAND>

[p14] The commands in one place. `vibe scrape contract init` writes a conservative default only when none exists, and `contract check` parses and plans it without writing. `vibe scrape --plan` is read-only and, given no mode, plans the in-place form, the larger risk. `--output` creates the export in a folder that must not exist and never changes the source tree. `--in-place` runs the journaled transaction, shows the census of modified and deleted files when interactive, and unattended needs `--assume-yes` after a green plan. Planning and checking run everywhere; in this first epoch the mutating modes run on Windows only, where the safety mechanics have been proven.

> [p15] `vibe scrape contract
>       init` writes a conservative default contract only when absent;
>       `vibe scrape contract check` parses and plans it read-only. Existing
>       contracts are never silently refreshed by install or a language
>       discipline.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-CONTRACT-COMMANDS>

> [p16] `vibe scrape --plan
>       [--contract <path>] [--output <dir> | --in-place]` is read-only.
>       With neither execution mode, it plans the in-place form because that is the
>       larger risk surface; it writes no project, journal, quarantine or report
>       file.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-PLAN-COMMAND>

> [p17] `vibe scrape --output
>       <absent-dir> [--contract <path>]` creates a scraped export and
>       never changes the source tree. The destination must be absent; adoption of
>       an existing directory is forbidden.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-EXPORT-COMMAND>

> [p18] `vibe scrape --in-place
>       [--contract <path>]` executes the journaled in-place transaction.
>       Interactive use shows the exact modified-file and deletion census;
>       unattended use requires `--assume-yes` after a green plan.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-INPLACE-COMMAND>

> [p19] Epoch-1 contract
>     parsing, planning and contract checking are portable. Mutating
>     `--output`, `--in-place` and `--recover` execution is enabled only
>     on Windows, where the implementation proves handle-relative exclusive
>     directory creation, no-replace publication, write/delete-denying namespace
>     seals and restartable cleanup. Linux, macOS and other hosts return the typed
>       blocker `scrape-platform-unsupported` before journal creation or project
>       mutation. Their wire/state-machine shape remains portable, but the product
>       does not claim a weaker check-then-rename implementation as support.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-EXECUTION-PLATFORM-E1>

## The contract {#the-contract}

[p20] What counts as vibe's and what counts as yours is not guessed from file names; a contract says it. The contract lives at `vibevm/scrape/contract.toml` in the project: `vibe scrape contract init` writes the conservative default, `vibe scrape contract check` validates one, and `--contract <file>` reads another. A contained contract is the last file removed, so the plan can be re-read until the end.

> [p21] The default is the project-root
>     literal `vibevm/scrape/contract.toml`. Every operand inside it is
>     project-root-relative regardless of where an alternate contract lives.
>     Contract location never changes mutation authority.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#DEFAULT-CONTRACT>

[p22] A scrape never deletes a path blindly: a build script that calls a vibe tool, generated product sources that sit beside disposable generated state, an authored specification that shares a tree with generated boot output, all are dispositioned by the contract, and untouched files stay byte-identical.

> [p23] Product preservation means:
>       all untouched files are byte-identical; every authored source rewrite is
>       metadata erasure-equivalent; every declared relocation preserves exact
>       bytes and mode; native manifests and lockfiles describe the scraped
>       dependency graph; the health oracle accepts the result.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#PRODUCT-PRESERVATION>

[p24] The contract is strict: unknown tables and values are rejected, `schema` is 1, and every id is unique. Files you wrote under `vibevm/vibespecs` are never taken for generated because of their folder; a contract that wants zero residue names them for deletion or relocation itself. Generated code, tests and models the project accepted are product and stay unless a row names them. Globs only select; bytes change only through typed adapters, never through a regex or a shell rewrite. Zero residue means zero registered identities, paths and markers, not the word «vibe» in your prose.

> [p25] The TOML schema rejects unknown
>       tables, fields, tagged kinds and enum values. `schema` must equal 1;
>       every id is a unique portable token across classification, rewrite,
>       relocation, assertion and health rows.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#CONTRACT-STRICTNESS>

> [p26] Authored files under
>         `vibevm/vibespecs` are not generated merely because of their
>         directory. A full zero-residue contract must explicitly delete them or
>         relocate them to a neutral home. No built-in policy silently decides
>         their value.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#AUTHORED-SPECS>

> [p27] Generated cells, seams,
>         tests, models and other useful application source are authored product
>         once accepted into the project. They remain unless an exact contract
>         relocation or deletion row names them. Origin in a discipline is not
>         deletion authority.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#PRODUCT-CODE-SURVIVES>

> [p28] Globs select candidates; they never
>     rewrite bytes. Authored source and structural manifests are changed only by a
>     closed typed adapter. Generic regex replacement, shell rewrite hooks,
>     implicit format conversion and whole-document reserialization are
>     forbidden.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#TYPED-ONLY>

> [p29] Zero residue means zero
>       registered Vibe identities, paths and markers selected by this contract.
>       It does not mean deleting an ordinary word such as “vibe” from prose, nor
>       undoing architectural choices learned while using a discipline.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#ZERO-RESIDUAL-SCOPE>

[p30] You supply the policy, the engine supplies the mechanics and the verdicts. Anything the sealed contract and the observed tree cannot decide is a blocker, never a guess. The tool does not rewrite git history, does not publish, and does not remove what was deployed to your machine; those stay explicit operations.

> [p31] The owner supplies policy:
>       delete, keep, relocate, strip, retain, required checks and acceptable
>       baseline mode. The engine supplies all mechanics and verdicts. Any state
>       not decidable from the sealed contract and observed tree is a blocker,
>       never a guess or best-effort success.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#ALGORITHMIC-BOUNDARY>

> [p32] Schema 1 does not reverse the historical
>     influence of VibeVM on product architecture, infer replacements for arbitrary
>     runtime libraries, mutate Git history, publish artifacts, or silently remove
>     user-global deployments. Schema 1 does not discover, report or remove
>     receipt-owned user-global deployments; the operator runs the existing
>     explicit undeploy operation separately when external removal is
>     desired.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#NON-GOALS>

## Edge cases and rules {#edge-cases}

[p33] Scrape is not clean. `vibe clean` removes what vibe can regenerate and keeps the relationship; scrape removes the relationship itself, which is why it needs a contract, a health proof and a recoverable commit.

> [p34] PROP-053 `vibe clean` removes
>       regenerable dependency and boot products while retaining authored project
>       state and `vibe.lock`. Scrape is not clean: it removes the Vibe
>       relationship itself and therefore requires a contract, native health
>       proof and recoverable commit.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#RELATED-CLEAN>

[p35] `--output` and `--in-place` are mutually exclusive; a plan is always available before either.

> [p36] `--output` and
>       `--in-place` are mutually exclusive. `--recover` accepts neither
>       mode nor contract because the durable journal already fixes both.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-MODE-EXCLUSIVITY>

[p37] The words attach and detach are reserved for a future live-tool relationship, such as connecting a debugger; scrape is never an alias for them.

> [p38] Scrape
>     is the terminal cleaning operation defined here: it removes the selected
>     VibeVM repository layer while preserving the native product. The command
>     vocabulary deliberately reserves attach and
>     detach for a future live-tool relationship such as connecting
>     and disconnecting a debugger. Scrape is never an alias for that future
>     runtime operation, and no detach spelling is accepted by this command.
>
> <spec://org.vibevm.core/vibevm/common/PROP-056#SCRAPE-TERM-BOUNDARY>

