# Stage 42: Pod Repair & Twin Wrap (aq42_pod_repair_and_twin_wrap / DB-UNIT-07)

Repairs pod lease/schema/tool failures after checking edge contracts first, synthesizes middlelayer shims, and pairs wrapped OSS repos with native twin engines.

- Atomic micro-queue: `aq42_pod_repair_and_twin_wrap` (visibility: `public_commons`)
- Backing database unit: `DB-UNIT-07` (`Deterministic Wasm/gVisor Sandbox & Red-Team Oracle Core`)
- Database cell: `queues-db.teleon.dev` (`teleon_core.acceptance_oracle_suites`, `teleon_core.sandbox_slsa_attestations`, `teleon_core.adversarial_redteam_vectors`)
- Claim row hydration: `single_self_contained_flat_task_row` (100% context inline, normalized writeback)
- Track 2 Sister queue (`SISTER-07`): `sq07-improve-sandbox-queue.teleon.dev` (Strengthen mutation kill rates, reduce sandbox cold-start fuel, and harvest new adversarial fuzzing routines.)
- Lanes: Contract-First Triage, 0..32 Onion Shims, OSS + Native Twin

## Execution engines & AI Agent freedom contract

- **Deterministic (0 model calls)**: `wasmtime_wit_deterministic_runner_v1` (LE-CONTRACT-002 verifier, Kleisli shim compiler & slot conformance runner)
- **Hybrid (<=1 model call)**: `boundary_counterexample_synthesizer_v1`
- **AI Agent & Bot Fleet (1..6 calls)**: `adversarial_exploit_hunter_v1` (Pod diagnostic engineer & dual-engine adapter builder)
  - Contract: **Instructions + Resources + Freedom to search for new resources and new ways not bound by instructions**

## Database invariants

- Content approval grants zero execution authority; sandboxes enforce fuel, memory, and zero-network isolation.

## External & internal bot fleet actions

- Inspect whether the typed edge contract itself failed before mutating implementation code or tests
- Insert composable 0..32 Kleisli middlelayers (pointer carriers, budget deadlines, port shims) without touching DB kernels
- Wrap permissive upstream repositories pinned to commit and SPDX alongside a clean native twin passing the same slot kit

## Sister self-tuning areas

- Add deterministic property-testing generators for surviving code mutants
- Tune Wasm fuel ceilings and warm-snapshot pooling priorities
- Expand prompt-injection and path-traversal red-team vector corpora
