{
  "handle": "Rank",
  "mechanism": "Deterministic Sort. Applies a caller-supplied {{scoring_function}} to every element in the input Set and returns a List ordered by Score. Uses {{select}} to truncate to Top-K when requested.",
  "gloss": "Order items by score",
  "failure_modes": [
    "Score Indeterminacy: Multiple items have identical scores.",
    "Incomparability: Scoring function returns values that cannot be strictly ordered."
  ],
  "invariants": [
    "Conservation: Output set is a subset of Input set.",
    "Monotonicity: For all i, Score(Output[i]) >= Score(Output[i+1])."
  ],
  "sema_id": "sema:Rank#mh:SHA-256:67c6fb568c5fdcfbd0de64b8a5413e943378d421dee9d5614c827e3c539bde3f",
  "sema_ref": "Rank#67c6",
  "sema_stub": "67c6",
  "_meta": {
    "tier": 1,
    "ring": 0,
    "supersedes": [
      "sema:Rank#mh:SHA-256:cb98b1357a2b6e14ff1e76bca44014fabffb0936b453ba88c3ad4561a63d3c2f",
      "sema:Rank#mh:SHA-256:44ff9eebfbb89e603509718bad8954e38aa800ed22b697bb853e781aea9cb104"
    ],
    "path": [
      "Infrastructure",
      "Primitives"
    ]
  },
  "dependencies": {
    "accepts": {
      "scoring_function": "sema:ScoringFunction#mh:SHA-256:c6042940db8c3238b948c7851aa315defbe31e1639dba718fcce0e38523e8d50"
    },
    "composes_with": {
      "select": "sema:Select#mh:SHA-256:decf9c05490dc5e6b372c5dbb7d89d2285fdd832714fc992b10fdbd6b7c2c2e3"
    }
  },
  "sema_layer": "Infrastructure",
  "sema_category": "Primitives",
  "used_by": {
    "references": {
      "Abduction": "sema:Abduction#mh:SHA-256:e738d3035534bba0a6b165325ba64818abb897a0f6b9848bc00c7c17ca146921",
      "BeamSearch": "sema:BeamSearch#mh:SHA-256:345791c047f0e97dbef89d2d16e6cd67634768cebe523cef44e54a6eacec622b"
    },
    "composes_with": {
      "Prioritize": "sema:Prioritize#mh:SHA-256:99f0603f8984f4c94d02384248966603cf86d9ccf95ea62a7c481c3eccb694fd"
    }
  }
}
