Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
fa24acd
feat(analytics): add support for analytics in DE
jagan-jaya Jul 16, 2025
a0d208f
Merge branch 'main' of https://github.com/juspay/decision-engine into…
jagan-jaya Jul 16, 2025
d98649a
feat(analytics): resolve comments
jagan-jaya Jul 17, 2025
3a97c3e
refactor: add fallback output check for evaluate request (#117)
prajjwalkumar17 Jul 18, 2025
d34b84b
feat(debit_routing): Add support for 6-digit BIN fallback if 8-digit …
ShankarSinghC Jul 21, 2025
78cb857
feat(analytics): fix formatting issues
jagan-jaya Jul 22, 2025
2965a88
EUL-17895-reverted-brand-wise-mandate-gw-filtering (#95)
Abhinav0078 Jul 23, 2025
7e77e0b
refactor(euclid): handle metadata keys in evaluate request (#123)
prajjwalkumar17 Jul 24, 2025
bb8acfe
feat: adding more dimensional granularity for scoring (#106)
GauravRawat369 Jul 28, 2025
52290e3
fix: makefile (#125)
prajwalhaniya Jul 29, 2025
0348e63
feat: Add local prometheus setup for metrics (#129)
Sarthak1799 Jul 31, 2025
de2e6b4
fix(routing): Changes for tenant_config parse error (#127)
PriyanshuC132 Jul 31, 2025
96ab15d
feat(routing): add support to handle gateway latency during SR routin…
jagan-jaya Jul 31, 2025
00750da
Debit routing/update config (#138)
ShankarSinghC Aug 20, 2025
65a9358
Crud response enhancement (#137)
AnkitKmrGupta Aug 20, 2025
c2070f3
Added kafka config in docker compose
jagan-jaya Aug 22, 2025
5a588c3
fix null value issue for udf_txn_uuid and txn_uuid (#132)
PriyanshuC132 Sep 1, 2025
c804378
refactor: add closure for metrics (#139)
AnkitKmrGupta Sep 8, 2025
a3881b0
add:newTypes to support update-score via euler (#131)
PriyanshuC132 Sep 15, 2025
27f930d
env(euclid): add enum for cards (#153)
AnkitKmrGupta Sep 16, 2025
a55bdc6
refactor: Add latency field to decision-gateway response (#166)
spritianeja03 Oct 14, 2025
e993a20
fix/changes for audit-trail-log (#152)
PriyanshuC132 Oct 14, 2025
01a2d4d
fix: all rustc warnings elided_lifetimes_in_path (#158)
Wolfy7 Oct 21, 2025
8f33716
fix: multiple bound declarations (#163)
Wolfy7 Oct 21, 2025
4df1e67
fix: remove redundant condition (#162)
Wolfy7 Oct 21, 2025
f318020
fix: remove all rustc dead_code warnings (#161)
Wolfy7 Oct 21, 2025
a58f8e1
fix: all rustc non upper case globals (#165)
Wolfy7 Oct 22, 2025
bc3ab98
fix: remove not needed parentheses to fix all rustc(unused_parens) (…
Wolfy7 Oct 22, 2025
771263f
fix: remove unused imports (#159)
Wolfy7 Oct 23, 2025
3c2e71a
fix for TxnOfferDetails Parse error (#167)
PriyanshuC132 Oct 23, 2025
112ab71
fix: elimination error status (#168)
AnkitKmrGupta Oct 24, 2025
efa175d
fix: crud error status (#169)
AnkitKmrGupta Oct 24, 2025
11db0e6
fix: update open-router image version (#170)
AnkitKmrGupta Oct 27, 2025
c3f370b
refactor: rename functions to snake_case (#171)
AnkitKmrGupta Nov 3, 2025
2d889cb
refactor: decide gateway structs (#172)
AnkitKmrGupta Nov 3, 2025
a7d2b22
refactor: update_gateway_score structs (#173)
AnkitKmrGupta Nov 5, 2025
ce6b7f7
refactor: add latency field to decide-gateway response (#175)
spritianeja03 Nov 6, 2025
4f3f60a
fix: change cpu_start time to Instant instead of ProcessTime (#177)
spritianeja03 Nov 7, 2025
5b623dd
fix: change cpu_start from ProcessTime::now() to Instant::now() (#178)
spritianeja03 Nov 7, 2025
00cffce
feat(decider): Implement udfs support to decision engine (#136)
GauravRawat369 Nov 12, 2025
7e1d147
changes for Metric Tracking Logs and Info to Warn for Monitoring (#180)
PriyanshuC132 Nov 14, 2025
4c31d54
Changes to have udfs_values in the log (#181)
PriyanshuC132 Nov 18, 2025
7013c24
Fix/mask payment s (#184)
PriyanshuC132 Nov 19, 2025
aa29c5d
fix: set default for optional udfs in PaymentInfo struct (#185)
GauravRawat369 Nov 20, 2025
4e78127
Changes for Debug (#187)
PriyanshuC132 Nov 20, 2025
bd366f7
Fix/log debugging (#188)
PriyanshuC132 Nov 24, 2025
849ea0b
fix: change logger level from info to debug for improved logging gran…
GauravRawat369 Nov 24, 2025
c85f577
Changes for GATEWAY_SCORE_UPDATED (#191)
PriyanshuC132 Nov 26, 2025
0c70e74
feat: caching for service_configuration (#176)
AnkitKmrGupta Nov 27, 2025
b03f56f
Extended card bin (#183)
prajjwalkumar17 Nov 29, 2025
9b7f2af
refactor: add inspect logs for redis get_key (#193)
Sarthak1799 Dec 1, 2025
7dc31fa
Removed-HyperPg-Gateway-from-CardMandateBinFilterExcludedGateways-Lis…
deepakjuspay001 Dec 1, 2025
0c36723
feat: Added filterFunctionalGatewaysForPixFlows for pix automatic red…
nagesh-s-juspay Dec 1, 2025
e3c76ce
fix: euclid configs (#195)
prajjwalkumar17 Dec 2, 2025
ded870a
feat: changes for cache_config (#196)
AnkitKmrGupta Dec 2, 2025
09cdf5d
Fix/metric tracking log (#194)
PriyanshuC132 Dec 2, 2025
f6efa41
Changes to fix Global Elimiantion (#197)
PriyanshuC132 Dec 4, 2025
f0019b0
feat: Fix global elimination redis key issue (#198)
PriyanshuC132 Dec 15, 2025
e6592eb
Changes for EliminationV2 consumption (#156)
PriyanshuC132 Dec 18, 2025
6f531f2
ci: helm to accept generic override values for envs (#200)
inventvenkat Dec 30, 2025
fff0d5b
ci: add vs to decision-engine, if wanted to expose to the existing in…
inventvenkat Dec 30, 2025
454ab8d
fix: db specific schema imports (#203)
AnkitKmrGupta Jan 9, 2026
7439544
feat: rule validator (#202)
AnkitKmrGupta Jan 20, 2026
ec63a98
feat: implement redis caching layer for service_configuration (#207)
AnkitKmrGupta Feb 24, 2026
ab29547
feat(euclid): add eligibility for connector selection (#209)
prajjwalkumar17 Mar 9, 2026
8a2fbab
chore: change extraEnvVars from list to map for proper values merging…
itsharshvb Mar 23, 2026
fcc02b9
refactor: startup logs (#211)
prajjwalkumar17 Mar 24, 2026
dd7417f
fix: clippy errors (#214)
prajjwalkumar17 Mar 24, 2026
aea281b
feat: implement static and dynamic hybrid routing endpoint (#213)
prajjwalkumar17 Mar 24, 2026
248f63e
fix: formatting (#216)
prajjwalkumar17 Mar 24, 2026
001e3d4
fix: clippy (#217)
prajjwalkumar17 Mar 24, 2026
55fe1e3
feat(helm): make busybox init containers configurable and optional (#…
inventvenkat Mar 28, 2026
8c10da5
[envs]: update envs for hyps compatibility (#223)
bot4pk Apr 2, 2026
60c4904
docs: modernize README with improved visual design (#222)
bot4pk Apr 2, 2026
6c93cf1
fix(docs): refactor readme.md (#225)
bot4pk Apr 4, 2026
1382d8f
refactor(euclid): payment_id for better logging (#226)
prajjwalkumar17 Apr 6, 2026
9e0b9ba
feat(euclid): frontend changes (#229)
prajjwalkumar17 Apr 10, 2026
615a30d
fix clippy
prajjwalkumar17 Apr 10, 2026
c0acddd
refactor(docs): improve docs and docker setup (#230)
prajjwalkumar17 Apr 11, 2026
0f79875
refactor(docker): change tag to v1.4 (#232)
prajjwalkumar17 Apr 11, 2026
db54890
refactor(vite): add config url (#234)
prajjwalkumar17 Apr 13, 2026
00749a6
docs: refactor repository documentation
prajjwalkumar17 Apr 14, 2026
685048e
docs: improve readme presentation
prajjwalkumar17 Apr 14, 2026
3d664d9
analytics
prajjwalkumar17 Apr 15, 2026
eef287f
analytics
prajjwalkumar17 Apr 15, 2026
84ac214
Merge remote-tracking branch 'origin/feat-analytics' into feat-analytics
prajjwalkumar17 Apr 15, 2026
04339b6
dev: wait for API before starting dashboard
prajjwalkumar17 Apr 15, 2026
61d1609
analytics: fix lint warnings
prajjwalkumar17 Apr 15, 2026
2d2c5b5
docs: align branding and local docs links
prajjwalkumar17 Apr 15, 2026
7bae2b2
logo
prajjwalkumar17 Apr 15, 2026
4100a4a
docs: expand routing examples and fix local preview
prajjwalkumar17 Apr 15, 2026
0417a70
refactor the info button
prajjwalkumar17 Apr 15, 2026
423adc1
fix: add components to analytics UI
prajjwalkumar17 Apr 16, 2026
81c4281
feat: ui re-designed with required fields
prajjwalkumar17 Apr 17, 2026
40098d7
fix: correct ui
prajjwalkumar17 Apr 17, 2026
9f3854d
fix: improve frontend
prajjwalkumar17 Apr 19, 2026
7d2f1ce
fix: improve frontend
prajjwalkumar17 Apr 19, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,10 @@
routing-config/venv
routing-config/output.sql
dump.rdb
.vscode
.vscode
**/node_modules
cypress/screenshots
cypress/videos
cypress/fixtures
# Added by code-review-graph
.code-review-graph/
26 changes: 26 additions & 0 deletions .mintlify-dev.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
⠋ preparing local preview...
⠙ preparing local preview...
warning - Error validating OpenAPI file /mint.json: Error: Failed to validate OpenAPI schema:Unknown path: Can’t find supported Swagger/OpenAPI version in specification, version must be a string.
⠙ preparing local preview...
⠹ preparing local preview...
⠸ preparing local preview...
⠼ preparing local preview...
update available - run `mint update` to get the latest version

✓ preview ready

  local   → http://localhost:3000
  network → http://192.168.1.4:3000

press ctrl+c to exit the preview


update available - run `mint update` to get the latest version

✓ preview ready

  local   → http://localhost:3000
  network → http://192.168.1.4:3000

press ctrl+c to exit the preview

82 changes: 82 additions & 0 deletions .typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,84 @@
[default]
check-filename = true

# Ignore 2-3 letter all-caps identifiers (likely codes/abbreviations)
# and 2-3 letter lowercase identifiers (likely variable names)
extend-ignore-identifiers-re = [
"^[A-Z]{2,3}$",
"^[a-z]{2,3}$",
]

# Module/type aliases used throughout the codebase
[default.extend-identifiers]
HasTable = "HasTable"
ETO = "ETO"
ETCC = "ETCC"
ETM = "ETM"
ETD = "ETD"
ETCa = "ETCa"
ETTD = "ETTD"
ETOd = "ETOd"
ETMo = "ETMo"
TE = "TE"
ser = "ser"

# ISO 3166-1 alpha-3 country codes
CAF = "CAF"
NAM = "NAM"
SOM = "SOM"
THA = "THA"
FO = "FO"

# ISO 4217 currency codes
ZAR = "ZAR"

# Common abbreviations in code (e.g., ect = extendedCardType)
ect = "ect"

# CamelCase identifiers (Mis = Mismatch, etc.)
Mis = "Mis"

# Time zones (IST = Indian Standard Time)
IST = "IST"
Ist = "Ist"
ist = "ist"

# Order Type abbreviation
OT = "OT"

# Value Added Services (banking term)
VAS = "VAS"
Vas = "Vas"

# JWT library API term
encrypter = "encrypter"

[default.extend-words]
# Project-specific terms that are valid
incase = "incase"
# Database column name (would require migration to fix)
penality = "penality"
# HashiCorp (company name)
hashi = "hashi"
# CamelCase function name (Mismatch)
Mis = "Mis"
# Time zones (Indian Standard Time)
IST = "IST"
Ist = "Ist"
ist = "ist"
# Order Type abbreviation
OT = "OT"
# Value Added Services (banking term)
VAS = "VAS"
Vas = "Vas"
# JWT library API term
encrypter = "encrypter"
Comment on lines +63 to +75

[files]
extend-exclude = [
# Exclude non-source files
"*.groovy",
"**/Untitled*",
# Exclude build artifacts
"website/dist/**",
]
159 changes: 159 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
# Decision Engine Agent Guide

## Purpose

Use this file as the first-stop operating guide for work in `decision-engine`.

- Use docs for orientation, then verify behavior against code, config, and CI before making claims.
- Prefer the smallest relevant surface first: route -> service -> config -> storage -> deployment.
- When docs and code disagree, trust code, config, and CI over prose.

## Source of Truth

Use this precedence order when answering questions or planning changes:

1. Runtime code and entrypoints in `src/`
2. Config files and deployment manifests in `config/`, `docker-compose.yaml`, and `helm-charts/`
3. `justfile`, `Makefile`, `.github/workflows/`, and `scripts/ci-checks.sh`
4. Setup and API docs in `docs/`
5. `README.md` for high-level product context only

Do not treat README claims or marketing language as definitive implementation truth.

## Repo Map

- `src/bin/open_router.rs`: process entrypoint; loads config, fetches secrets, starts app and metrics servers
- `src/app.rs`: main HTTP server wiring, route registration, middleware, graceful shutdown, TLS handling
- `src/routes/`: REST handlers and endpoint behavior
- `src/config.rs`: config structs, config loading, env override behavior, validation hooks
- `src/tenant.rs`: tenant-aware app state wiring
- `src/decider/`: routing decision logic
- `src/euclid/`: routing rules and evaluation engine
- `src/feedback/`: score updates and routing feedback flows
- `docs/local-setup.md`: canonical local and on-prem style startup guide
- `docs/configuration.md`: config-oriented documentation and deployment pointers
- `docs/api-reference1.md`: human-readable API examples
- `docs/openapi.json`: machine-readable API contract
- `docker-compose.yaml`: local topology, compose profiles, supporting services
- `helm-charts/`: Kubernetes and on-prem deployment assets
- `justfile`: canonical engineering commands
- `Makefile`: convenience wrappers around common compose flows
- `.github/workflows/`: CI expectations and release automation
- `scripts/ci-checks.sh`: DB feature compile matrix enforced by CI
- `website/`: dashboard/frontend assets
- `cypress/`: frontend/end-to-end test area

## Which Docs to Open First

- Local startup or environment bring-up: `docs/local-setup.md` -> `docker-compose.yaml` -> `justfile`
- Runtime/config questions: `docs/configuration.md` -> `config/*.toml` -> `src/config.rs`
- API behavior: `docs/openapi.json` -> `docs/api-reference1.md` -> `src/routes/*`
- Server startup and wiring: `src/bin/open_router.rs` -> `src/app.rs`
- Deployment or on-prem: `helm-charts/README.md` -> `helm-charts/templates/*` -> `docker-compose.yaml`
- CI or verification expectations: `justfile` -> `.github/workflows/*` -> `scripts/ci-checks.sh`
- Routing logic: `src/decider/` -> `src/euclid/` -> `src/routes/decide_gateway.rs` -> `src/routes/rule_configuration.rs` -> `src/routes/update_gateway_score.rs`
- Tenant behavior: `src/tenant.rs` -> `src/custom_extractors.rs` -> `src/app.rs`

## Canonical Startup Paths

Use `docs/local-setup.md` as the canonical startup guide. Default to PostgreSQL unless the task is explicitly MySQL-specific.

Preferred quick-start paths:

- PostgreSQL with GHCR images:
`docker compose --profile postgres-ghcr up -d`
- PostgreSQL with local build:
`docker compose --profile postgres-local up -d --build`
- Convenience wrappers:
`make init-pg-ghcr`
`make init-pg-local`

Source-run commands:

- PostgreSQL build:
`cargo build --release --no-default-features --features middleware,kms-aws,postgres`
- PostgreSQL run:
`RUSTFLAGS="-Awarnings" cargo run --no-default-features --features postgres`
- MySQL build:
`cargo build --release --features release`
- MySQL run:
`RUSTFLAGS="-Awarnings" cargo run --features release`
- PostgreSQL migration:
`just migrate-pg`

Verification:

- Health:
`curl http://localhost:8080/health`

Choose the startup path based on task intent:

- local debugging: compose or source run
- deployment review: Helm and compose manifests
- API behavior inspection: route code plus health/startup verification

## Coding Expectations

- Rust edition is 2021; MSRV in `Cargo.toml` is `1.85.0`
- `unsafe` is forbidden
- Treat clippy warnings around `unwrap`, `expect`, `panic`, `todo`, and `unimplemented` as meaningful design constraints
- Verify both DB tracks when changing shared core logic; do not assume only one backend is affected
- The default feature path is MySQL; PostgreSQL uses `--no-default-features --features postgres`
- Touch the smallest relevant surface first instead of broad refactors
- When changing externally visible behavior, update the relevant docs in `docs/`
- Confirm implementation facts in `src/`, config, and deployment manifests instead of relying on README wording

## Verification Expectations

Before claiming a change is done, choose the smallest sufficient set of checks and state what was run.

Recommended command ladder:

- format check:
`cargo +nightly fmt --all --check`
- lint:
`just clippy`
- broad compile coverage:
`just check`
- unit tests:
`cargo test`
- PostgreSQL migration path when relevant:
`just migrate-pg`
- startup/config smoke check when relevant:
`curl http://localhost:8080/health`
- CI-sensitive Rust changes:
inspect `scripts/ci-checks.sh`

Rules:

- If a change touches shared Rust logic in `src/`, validate both MySQL and PostgreSQL compile paths because CI checks both.
- If a task is docs-only, config-reading only, or frontend-only, say which checks were intentionally skipped.
- If deployment behavior is in question, inspect manifests and templates directly instead of assuming docs are current.

## Task Playbooks

- Bug fix:
reproduce -> identify route/config/storage surface -> patch -> run targeted checks -> run broader compile checks if core logic changed
- API change:
inspect route handler -> inspect request/response types -> inspect `docs/openapi.json` and `docs/api-reference1.md` -> update docs if behavior changed
- Deployment issue:
inspect `docs/local-setup.md` -> inspect `docker-compose.yaml` or `helm-charts/templates/*` -> inspect config loading in `src/config.rs`
- Prod or on-prem readiness question:
verify against Helm, compose, config defaults, secrets handling, probes, CI, and runtime code
- Routing logic question:
inspect `src/routes/decide_gateway.rs`, `src/decider/`, `src/euclid/`, and feedback/update-score flows
- Tenant question:
inspect `src/tenant.rs`, `src/custom_extractors.rs`, route handlers, and config-backed tenant wiring

## Optional Local Tooling

- When available, prefer `code-review-graph` for code navigation, dependency tracing, and change-impact analysis.
- If unavailable, fall back to normal repository inspection.
- Do not make task success depend on optional local AI tooling.

## Important Caveats

- Default config files are development-oriented and should not be treated as production-ready defaults.
- Deployment docs are useful, but readiness claims must be verified against chart templates, compose manifests, runtime config, and code.
- Use actual route wiring and config structs as the authority for behavior.
- Some docs overlap or duplicate each other; prefer `docs/local-setup.md`, `docs/configuration.md`, `docs/openapi.json`, and the route code as canonical references.
Loading
Loading