Skip to content

Fix robustness issues in routing, artifacts, and embeddings#18

Open
geethika131205 wants to merge 1 commit into
adrida:mainfrom
geethika131205:fix-robustness-issues
Open

Fix robustness issues in routing, artifacts, and embeddings#18
geethika131205 wants to merge 1 commit into
adrida:mainfrom
geethika131205:fix-robustness-issues

Conversation

@geethika131205

Copy link
Copy Markdown

Summary

This PR improves robustness, reproducibility, and error handling across several parts of the TRACER pipeline.

Changes

Robustness Improvements

  • Added a guard in src/tracer/analysis/qualitative.py to prevent failures when processing empty trace datasets.
  • Improved small-dataset handling in src/tracer/fit/pipeline.py by prioritizing validation splits when calibration splits are not feasible.
  • Added safe JSON serialization in src/tracer/policy/artifacts.py to prevent failures caused by non-serializable objects during manifest generation.

Consistency & Reproducibility

  • Fixed embedding index behavior so requested similarity metrics are preserved consistently when FAISS is unavailable.
  • Persist similarity metric configuration to disk and restore it during reload, ensuring identical behavior across environments and sessions.

API & Runtime Improvements

  • Added embedding dimension validation in update() to provide clearer errors when new traces are incompatible with an existing model.
  • Extended /predict_batch responses to expose additional metadata (preds and stage_id) for consistency with the local Python API.

Testing

Added dedicated tests covering:

  • Empty dataset handling
  • Small dataset split logic
  • Embedding metric persistence
  • Embedding dimension mismatch validation
  • Index fallback behavior

Validation

  • Executed the existing demo workflow after applying the changes.
  • Verified that the new test cases pass successfully.
  • Confirmed expected behavior for the affected edge cases.

@adrida adrida added bug Something isn't working area: fit Training, calibration, surrogate selection (fit/) labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: fit Training, calibration, surrogate selection (fit/) bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants