Concepts
Loose Coupling

Loose Coupling

The Bullet Protocol achieves loose coupling through flexible composition patterns, runtime resolution, and contract-based interfaces. Bullets connect to each other without rigid dependencies.

Version Constraints Enable Evolution

Plans use semantic versioning ranges to balance stability with flexibility:

# Accept any 2.x version, but not 3.0
- script: bullet://example/parser@^2.0.0
 
# Accept any 1.2.x version
- script: bullet://example/validator@~1.2.0
 
# Pin to exact version
- script: bullet://example/critical@1.5.3

This allows plans to automatically benefit from improvements (minor versions, patches) while preventing breaking changes (major versions). Dependencies evolve without manual updates.

Late Binding with Placeholders

Rather than hardcoding all dependencies upfront, plans use placeholders for runtime resolution. At execution time, the resolver determines what bullet satisfies each placeholder through context analysis, discovery search, or on-demand generation.

This late binding makes plans reusable across different users and contexts without sacrificing reproducibility. See Placeholders for complete details on resolution strategies and syntax.

Contract Guarantees

The contract section in bullet metadata defines immutable behavioral expectations:

contract:
  guarantees:
    - "Always uses exponential backoff for retries"
    - "Respects Retry-After headers"
    - "Fails fast on quota exhaustion"
    - "Never exceeds 5 retry attempts"

These guarantees are permanent promises. Breaking a guarantee requires creating a new bullet ID entirely, not just bumping the version number. This ensures consumers can depend on stable behavior without tight coupling to implementation details.

Contracts provide stable interfaces while allowing implementation flexibility. A script can refactor internally, optimize performance, or fix bugs—as long as guarantees hold, it remains compatible.

Runtime Selection via Discovery

Instead of compile-time hardcoding, bullets are discovered and selected at runtime based on meaning and quality. The system uses semantic search to find relevant capabilities and quality metrics to rank them, creating evolutionary pressure toward better implementations without requiring coordination between authors.

See Discovery at Scale for details on the discovery pipeline, semantic search, quality ranking, and index architecture.

Composition Constraints

The four-type bullet system enforces clear composition rules: only plans reference other bullets, and only scripts accept inputs. These constraints simplify reasoning about how bullets connect, making the dependency structure explicit rather than implicit.