Troubleshooting
Triage Workflow
Use this sequence to reduce time-to-diagnosis:
- Reproduce with the smallest failing input.
- Classify failure domain: build/test, parser/validator, retrieval, or transform.
- Run the command pack for that domain.
- Capture escalation bundle before changing runtime defaults.
Command Packs
Build and Test Command Pack
Run from repository root:
cargo check --workspace --examples
cargo test --workspace
cargo test -p locus-core-rs --lib
cargo test -p locus-sdk
Use when:
- CI fails but local state is unclear.
- A release candidate needs a fast baseline confidence pass.
Parser and Validator Command Pack
Run from repository root:
cargo test -p locus-core-rs parser_tests
cargo test -p locus-core-rs validator_tests
cargo test -p locus-core-rs end_to_end_parsing_tests
Use when:
- Ingestion rejects node payloads.
- Strict profile compatibility appears unstable.
Retrieval Command Pack
Run from repository root:
cargo test -p locus-core-rs context_query_service_tests
cargo test -p locus-sdk --example memory_composition
cargo test -p locus-sdk --example provider_registry_setup
Use when:
- retrieval_path behavior diverges from expected baseline.
- recall and explain outputs are not aligned.
Transform and Sync Command Pack
Run from repository root:
cargo test -p locus-core-rs monthly_rollup_service_tests
cargo test -p locus-core-rs sync_coordinator_service_tests
cargo test -p locus-core-rs surrealdb_node_store_tests
cargo test -p locus-core-rs surrealdb_runtime_tests
Use when:
- Backfill, rollup, or sync progression stalls.
- selected/updated/skipped counts are inconsistent.
Build and Test Failures
Build/Test Symptom
cargo test fails in integration targets while unit tests pass.
Build/Test Actions
- Run crate-scoped tests first to isolate failure domain.
- Run failing target with single thread when test state leakage is suspected.
- Compare behavior against known baseline in source repository if migrating.
- Capture failing command output and the exact crate version set.
Build/Test Common Signatures
- Integration tests fail while crate lib tests pass: likely environment or fixture state isolation issue.
- Workspace build passes but host runtime fails: likely endpoint/config mismatch.
Parser and Validation Errors
Parser/Validation Symptom
Stored node rejected or strict parser fails.
Parser/Validation Actions
- Confirm four-layer ordering is preserved.
- Confirm content keys use field_name(.confidence) format.
- Confirm content nesting depth does not exceed five.
- Re-run parser and validator command pack and compare strict versus tolerant outcomes.
Parser/Validation Common Signatures
- Missing required layer errors indicate malformed STTP spine.
- Invalid key format errors indicate content keys not using field_name(.confidence).
- Nesting depth errors indicate recursive payload exceeded protocol constraints.
Retrieval Behavior Mismatch
Retrieval Symptom
Unexpected recall ranking or fallback path.
Retrieval Actions
- Log full scoring policy and scope.
- Verify alpha and beta values are explicitly set.
- Use explain workflow to inspect fallback triggers and stage counts.
- Compare retrieval_path distribution to recent baseline window before changing policy defaults.
Retrieval Common Signatures
- Unexpected lexical_fallback path often indicates sparse embeddings or strict filter scope.
- Score drift with unchanged input usually indicates policy defaults changed between versions.
Transform/Migration Issues
Transform/Migration Symptom
Embedding backfill updates fewer nodes than expected.
Transform/Migration Actions
- Run dry-run first and inspect selected counts.
- Validate filter scope and has_embedding settings.
- Validate provider capability routing and model configuration.
- Verify checkpoint progression and sync cursor ordering when running incremental jobs.
Transform/Migration Common Signatures
- Selected count near zero in dry-run usually indicates filter constraints are too narrow.
- Update counts diverge from selected counts when provider or storage writes are failing.
Escalation Data To Capture
- Exact request payload.
- Retrieval path and fallback reason.
- Validation and parser error text.
- Relevant crate versions and commit sha.
- Environment profile and runtime mode used during failure.
Rollback Triggers
Initiate rollback when any of the following occur:
- Client-visible contract mismatch appears in migrated host routes.
- Error rate or latency breaches remain sustained after initial mitigation window.
- Parser or validator strict failures correlate with the latest release.
Escalation Bundle Template
Capture the following in one incident record:
- Failing command and timestamp.
- Environment profile: local, CI, staging, or production.
- Request payload and redacted response sample.
- retrieval_path or transform result counters.
- Recent change references and suspected blast radius.
This bundle enables rapid handoff across development, platform, and on-call teams.