# Rule 6 in Practice: Wrapping Open-Source GitHub Projects Behind Typed Engine Slots

Published: 2026-10-18 | Domain: https://getagentfoundry.si | Radar: https://repodir.baltor.ai & https://signals.baltor.ai

## Outcome first: leveraging open-source breakthroughs without dependency lock-in

Under Rule 6 of the Loop Engine engineering constitution, we never reinvent the wheel when a strong open-source repository or published algorithm already exists, and we never wire a third-party repository directly into caller code. Every external GitHub project discovered on [signals.baltor.ai](https://signals.baltor.ai) or [repodir.baltor.ai](https://repodir.baltor.ai) enters the library as a pinned engine adapter behind a versioned slot in `engine_slots.yaml`, accompanied by a Baltor-native engine that passes the exact same conformance kit.

## Four-step onboarding pipeline for an external GitHub repository

1. **Pin commit digest and license**: Record the upstream repository URL, exact 40-character Git commit SHA, and SPDX license identifier (`MIT`, `Apache-2.0`, `BSD-3-Clause`, `CC0-1.0`) in the adapter manifest.
2. **Isolate inside the required trust boundary**: Run untrusted or native-binary adapters inside a network-isolated container or WebAssembly sandbox with explicit filesystem path confinement.
3. **Wrap behind the slot's fixed typed edge**: Translate the slot's canonical request schema into the repository's internal API and map any upstream exceptions into explicit slot refusal codes.
4. **Build and verify a Baltor-native variation**: Implement a zero-dependency Baltor-native engine alongside the wrapped adapter and require both to pass the slot's conformance kit.

```yaml
# Example Slot Registration in engine_slots.yaml
slot_id: pose_keypoint_extractor_2d
contract_version: v1
input_schema: video_frame_rgb_v1
output_schema: coco_17_joint_keypoints_v1
refusal_codes:
  - subject_occluded_below_confidence_threshold
  - invalid_frame_dimensions
engines:
  - engine_id: rtmpose_pinned_adapter
    source_repo: "https://github.com/open-mmlab/mmpose"
    pinned_commit: "4a8b91c0e2d3f4a5b6c7d8e9f0a1b2c3d4e5f6a7"
    license: "Apache-2.0"
    sandbox: "container_no_network"
  - engine_id: baltor_native_kinematic_prior
    source_repo: "baltor-native"
    license: "Proprietary-Baltor"
    sandbox: "in_process_deterministic"
```
