# Blender Safe Mutation MVP Closure

Closure date: 2026-04-22

This note closes `180.C.10` for the Blender safe mutation MVP. It records the
evidence that one remote command can safely create one Blender object with
policy, audit, evidence references, and rollback notes.

## Closure Scope

The closed command path is:

- protocol command: `blender.object.create_primitive`
- host addon command: `object.create_primitive`
- required permission scope: `project.write`
- mutation risk class: `safe-mutation`
- rollback strategy: `undo_stack`
- command result fields: `objectId`, `objectName`, `sceneInfoObjectId`,
  `undoCheckpoint`, and `evidenceReferences`

This closure does not claim broad Blender mutation support. It closes only the
first safe mutation primitive: creating one supported primitive object in a
controlled scene.

## Implementation Evidence

The closed path is backed by the following completed Phase 180 items:

- `180.C.10.01`: canonical protocol schema, fixture, metadata, and contract
  generation for `blender.object.create_primitive`
- `180.C.10.02`: addon undo checkpoint creation immediately before primitive
  mutation
- `180.C.10.03`: host observe-only policy denial before adapter routing
- `180.C.10.04`: before/after scene-info evidence artifact capture
- `180.C.10.05`: host execution through the Blender addon route with structured
  object and evidence output
- `180.C.10.06`: mocked host and gateway success/failure coverage
- `180.C.10.07`: optional headless Blender primitive mutation smoke
- `180.C.10.08`: remote gateway-host CLI timeline and audit visibility smoke
- `180.C.10.09`: rollback/undo behavior and limitation documentation

## Hardware Smoke Evidence

Command:

```bash
pnpm nx blender:create-primitive-smoke @bellona/remote-host --verbose --skip-nx-cache
```

Result on `MAC-HOST-01` with `/Applications/Blender.app/Contents/MacOS/Blender`:

```json
{
  "status": "passed",
  "beforeObjectCount": 3,
  "afterObjectCount": 4,
  "postRollbackObjectCount": 3,
  "createdObjectId": "Bellona Mutation Smoke Cube",
  "sceneInfoObjectId": "object:Bellona Mutation Smoke Cube",
  "undoCheckpointId": "undo-checkpoint:command:blender-create-primitive-smoke-001",
  "rollbackNote": {
    "fallbackRestoreSucceeded": true,
    "objectAbsent": true,
    "strategy": "undo_stack",
    "undoOperatorError": "Operator bpy.ops.ed.undo.poll() failed, context is incorrect",
    "undoOperatorSucceeded": false,
    "verificationMechanism": "saved_fixture_restore_after_headless_undo_unavailable"
  }
}
```

The headless smoke proves that the real addon creates exactly one new object,
returns the undo checkpoint id, links the expected material, selects the created
object, and can verify object absence after restoring the saved fixture.

The rollback note intentionally records that `bpy.ops.ed.undo()` is not
available in Blender `--background` mode because the editor undo operator has no
UI context. Manual rollback for a live operator remains the documented
`undo_stack` procedure in
[`blender-primitive-rollback-and-undo.md`](./blender-primitive-rollback-and-undo.md).

## Remote Audit And Timeline Evidence

Command:

```bash
pnpm nx blender:create-primitive-remote-smoke @bellona/remote-host --verbose --skip-nx-cache
```

Expected and verified summary:

```json
{
  "status": "passed",
  "auditEntryTypes": [
    "command.received",
    "command.dispatched",
    "command.completed"
  ],
  "mutationResult": {
    "objectId": "Bellona Remote Mutation Cube",
    "objectName": "Bellona Remote Mutation Cube",
    "sceneInfoObjectId": "object:Bellona Remote Mutation Cube",
    "undoCheckpointId": "undo-checkpoint:command:blender-create-primitive-remote-smoke-001",
    "evidenceReferenceCount": 4
  },
  "timelineResult": {
    "resultStatus": "succeeded",
    "source": "command-store",
    "type": "command.result"
  },
  "usedLiveAddon": false
}
```

The default remote smoke uses deterministic in-process providers so the gateway,
host, audit, and timeline path can be verified without broad UI work. Operators
can pass `--live-addon` when a local Blender addon endpoint is running and the
same command should route through the configured addon endpoint.

## Rollback Note For Review Records

For this closure, the review record should attach the following note:

```json
{
  "commandId": "command:blender-create-primitive-remote-smoke-001",
  "rollbackStrategy": "undo_stack",
  "undoCheckpointId": "undo-checkpoint:command:blender-create-primitive-remote-smoke-001",
  "createdObjectId": "Bellona Remote Mutation Cube",
  "sceneInfoObjectId": "object:Bellona Remote Mutation Cube",
  "rollbackAttempted": true,
  "rollbackResult": "documented_manual_operator_undo",
  "headlessVerification": {
    "commandId": "command:blender-create-primitive-smoke-001",
    "createdObjectId": "Bellona Mutation Smoke Cube",
    "objectAbsentAfterFixtureRestore": true,
    "undoOperatorSucceededInBackground": false,
    "undoOperatorError": "Operator bpy.ops.ed.undo.poll() failed, context is incorrect"
  },
  "limitations": [
    "Blender undo stack is valid only in the current Blender process.",
    "Blender background mode cannot exercise the editor undo operator.",
    "Later local edits can consume undo steps before the Bellona checkpoint.",
    "The MVP does not expose a remote rollback command."
  ]
}
```

## Closure Decision

`180.C.10` is closed for the safe mutation MVP because the system now has:

- canonical protocol ownership for the primitive mutation command
- host policy denial for observe-only sessions
- addon undo checkpoint metadata before mutation
- host before/after scene evidence references
- mocked adapter and gateway failure-mode coverage
- live Blender headless mutation evidence
- remote gateway-host audit and timeline evidence
- documented rollback behavior, rollback note shape, and limitations

The next eligible Phase 180 item is `180.C.11.01`. Do not start a later phase
from this closure note.
