Integration
Audience and Use
This page is for developers integrating Locus into applications, services, and agent tooling.
Use it to:
- Define a stable integration boundary.
- Migrate existing retrieval logic without contract breakage.
- Validate behavior parity before cutover.
Goal
Integrate host transports with Locus crates while keeping STTP protocol semantics stable.
Recommended Integration Boundary
- Parse and validate at ingestion boundary.
- Convert transport payloads into SDK DTOs.
- Execute SDK workflows in application services.
- Map results back to transport contracts.
Host Migration Pattern
- Replace transport-owned retrieval logic with locus-sdk primitives.
- Keep endpoint names stable during migration.
- Add compatibility tests for behavior parity.
- Remove deprecated transport-local logic after one release cycle.
Compatibility Policy
- Keep external MCP tool and gateway endpoint contracts stable during internal rewires.
- Prefer additive fields and optional settings over contract replacement.
- Any unavoidable breaking change requires migration notes and version bump alignment.
- Retrieval policy defaults must remain explicit and test-covered.
This policy enables staged migrations while preserving downstream client compatibility.
MCP Integration Notes
- Prefer SDK primitives for list and context tools.
- Keep tool contracts stable; change only internals first.
- Add tests for fallback policy behavior and explain parity.
Gateway Integration Notes
- Route HTTP and gRPC handlers into SDK service layer.
- Share one request mapping strategy across transports.
- Keep response payload fields stable until formal API revision.
Safety Checks During Migration
- Compare retrieval_path results before and after migration.
- Compare transform counters and side effects in dry-run first.
- Validate strict parser compatibility for generated nodes.
Migration Acceptance Criteria
- Contract parity tests pass for migrated host routes/tools.
- Explain outputs are consistent with recall behavior before and after migration.
- Transform counters and dry-run selection remain behaviorally equivalent.
- Compile and runtime smoke checks pass in workspace and host deployment jobs.
Migration is complete only when all acceptance criteria are met.
Integration Acceptance Templates
Contract Parity Template
- Endpoint or tool name unchanged.
- Request field semantics unchanged or additive.
- Response field semantics unchanged or additive.
- Error code and message class behavior unchanged.
Retrieval Behavior Template
- retrieval_path distribution aligned with baseline behavior.
- Explain output aligns with returned recall results.
- Fallback activation remains policy-consistent.
- Latency profile remains within agreed operational bounds.
Rollout Gate Template
- Local and CI validation complete.
- Staging parity checks complete.
- Rollback path validated.
- Monitoring and alert hooks confirmed in target environment.
Cutover Checklist Template
Pre-Cutover Checks
- Freeze incompatible contract changes during the cutover window.
- Confirm request and response snapshots for baseline comparison.
- Confirm on-call ownership and escalation path.
Parity Checks During Cutover
- Compare retrieval_path and explain behavior between old and new integration paths.
- Compare latency and error rate against baseline windows.
- Validate parser and validator success ratios remain stable.
Rollback Criteria
- Error-rate increase exceeds agreed threshold.
- Contract mismatch is observed in client-visible payloads.
- Retrieval behavior diverges from baseline without approved policy change.
Post-Cutover Verification
- Re-run acceptance templates in production mode.
- Confirm no delayed transform or ingestion side effects.
- Publish cutover summary with observed deltas and follow-up actions.