# Stage 88: Composable Thin Wrappers (aq88_compose_and_verify_thin_wrapper_chain / DB-UNIT-18)

Composes and dry-runs 0..32-step functional Kleisli thin-wrapper onions (wrappers.teleon.dev) for parameter clamping, per-request engine selection, secret scrubbing, and port checks while keeping database substrates strictly unwrapped.

- Atomic micro-queue: `aq88_compose_and_verify_thin_wrapper_chain` (visibility: `public_commons`)
- Backing database unit: `DB-UNIT-18` (`Causal Scenario Foundry, Simulation Federation & Opportunity Core`)
- Database cell: `entities-db.teleon.dev` (`teleon_core.scenario_ir_manifests`, `teleon_core.world_hidden_truth_vault`, `teleon_core.actor_observation_views`, `teleon_core.opportunity_hypotheses`)
- Claim row hydration: `single_self_contained_flat_task_row` (100% context inline, normalized writeback)
- Track 2 Sister queue (`SISTER-18`): `sq18-improve-scenarios-queue.teleon.dev` (Enforce POET minimal-criterion solvability bands, audit SPDX simulator licenses, and turn production failures into regression worlds.)
- Lanes: 0..32 Kleisli Steps, DB-Exempt ACID Guard, Per-Call Engine Select

## Execution engines & AI Agent freedom contract

- **Deterministic (0 model calls)**: `mesa_amlsim_and_sql_state_world_compiler_v1` (0-step nominal fast-path router, 0..32 Kleisli onion builder & EXEMPT_DATABASE_SUBSTRATES guard)
- **Hybrid (<=1 model call)**: `autoplay_explore_first_scenario_synthesizer_v1`
- **AI Agent & Bot Fleet (1..6 calls)**: `multi_engine_concordia_oasis_and_foresight_author_v1` (Thin middlelayer shim composer & formal engine-slot bridge verifier)
  - Contract: **Instructions + Resources + Freedom to search for new resources and new ways not bound by instructions**

## Database invariants

- Investigator and solver views never access world_hidden_truth_vault or derive test fixtures from detector rules.
- Every suspicious or failure scenario pairs with a matched benign counterfactual and abstention control.
- Opportunity and problem generation stays decoupled from pre-selected solution promotion.

## External & internal bot fleet actions

- Compose modular pre/post Kleisli steps without subclassing Loops or refactoring callers
- Honor per-request engine_preference non-mutatingly with deterministic fallback reasons
- Refuse any inline agent wrapper step on transactional database substrates before effects

## Sister self-tuning areas

- Enforce POET solvability bands and family-level train/holdout lineage splits (DIM-01, DIM-02)
- Wrap permissive simulation adapters (MIT/Apache-2.0/BSD-3) while blocking copyleft or BSL traps (DIM-03)
- Convert verified production traces and failed experiments into permanent regression scenarios (DIM-06, DIM-07)
