Files
as4-411/docs/adr/002-resolution-scoring-determinism.md
defiQUG c24ae925cf
Some checks failed
CI / lint (push) Has been cancelled
CI / build (push) Has been cancelled
Initial commit: AS4/411 directory and discovery service for Sankofa Marketplace
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 08:44:20 -08:00

784 B

ADR-002: Resolution Scoring and Determinism

Status

Accepted.

Context

Resolution must return a stable, ordered list of routing directives for the same inputs and store state.

Decision

Determinism

  • Same normalized request + same directory state implies same ordered list of RouteDirectives.
  • Tie-break when scores are equal: (1) explicit priority higher first, (2) lexical by endpoint id then participant id.

Scoring

  • Factors: endpoint priority, endpoint status (active preferred over draining over inactive). No randomness; same inputs imply same scores and order.

Cache Key

  • Derived from canonical request (sorted identifiers, serialized serviceContext and constraints, tenant).

Consequences

  • Caching and retries are reproducible and safe.