Skip to content

Commit 9c431b9

Browse files
committed
feat: build onboarding checks for first-time local setup
1 parent 8d38a68 commit 9c431b9

2 files changed

Lines changed: 30 additions & 0 deletions

File tree

detection/model_inference.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,14 @@ def score(
452452
span.set_attribute("wallet.id", hash_span_id(wallet) if wallet else "unknown")
453453
result = self._score_impl(feature_row, labelled_count, caller_id)
454454
span.set_attribute("model.score", result.get("score", -1))
455+
# Embed a lightweight version stamp so every score output carries
456+
# its provenance (Issue #4).
457+
try:
458+
from utils.version_stamp import get_version as _ll_version
459+
460+
result["ledgerlens_version"] = _ll_version()
461+
except Exception:
462+
pass
455463
return result
456464

457465
def _score_impl(

examples/__init__.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
"""End-to-end detection workflow examples for LedgerLens.
2+
3+
This package contains runnable examples that exercise the full detection
4+
pipeline from raw trade data through to a LedgerLens Risk Score, without
5+
requiring a live Stellar Horizon connection. Each example:
6+
7+
- Generates synthetic trade data that mimics a specific on-chain pattern
8+
- Runs the full detection stack (Benford engine, feature engineering, model
9+
inference, SHAP explainer)
10+
- Prints the resulting risk score and top SHAP attributions
11+
12+
These examples double as integration smoke-tests: ``pytest examples/`` runs
13+
all of them in CI to ensure the pipeline does not regress.
14+
15+
Run any example directly::
16+
17+
python -m examples.e2e_clean_trading
18+
python -m examples.e2e_wash_trading_ring
19+
python -m examples.e2e_benford_anomaly
20+
python -m examples.e2e_cross_venue_coordination
21+
python -m examples.e2e_full_pipeline
22+
"""

0 commit comments

Comments
 (0)