025-evidence-delivery-and-token-budget

Evidence delivery: a selectable evidence unit under a token budget that counts the framing

Lifecycle approvedImplementation pendingVerification unknownQualification unknown

Recall ranks memories and reduces each to its best chunk (018 B-4). For a question whose answer depends on a whole conversation, that chunk is too little, and a client that wants more must fetch each record in a second call with no budget at all. This spec adds a delivery stage after ranking: the caller selects an evidence unit (chunk, neighbor window, whole record, or auto), and the stage packs the ranked results into a token budget that is a hard cap, in the declared counter's units, over everything the model reads, including 019's framing statement, every envelope delimiter and label, and every cut marker. For a turn of an imported conversation, stored one memory per message under 031, the window is the turns around the hit and the record is the whole conversation. The default counter is a fixed formula over UTF-8 bytes, named in every response. Packing is deterministic. The default unit stays the chunk until the evaluation corpus (040) shows that another one is better.

Read the full pinned specification ↗

Relationships

Claimed units

  • establishes
    {
      "kind": "file",
      "path": "crates/aicortex-recall/src/delivery.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/aicortex-recall/tests/delivery.rs"
    }
  • establishes
    {
      "kind": "file",
      "path": "crates/aicortex-recall/testdata/delivery/"
    }
  • extends
    {
      "nature": "additive",
      "spec": "018-retrieval-and-recall-trace",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-recall/src/lib.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "019-untrusted-content-boundary",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-recall/src/envelope.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "020-http-api-and-scopes",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-api/src/search.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "020-http-api-and-scopes",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-api/src/dto.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "020-http-api-and-scopes",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-api/tests/api.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "021-mcp-server",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-mcp/src/tools.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "021-mcp-server",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-mcp/tests/tools.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "011-memory-model",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-types/src/provenance.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "012-store-schema-and-repositories",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-store/src/migrations.rs"
      }
    }
  • extends
    {
      "nature": "additive",
      "spec": "012-store-schema-and-repositories",
      "unit": {
        "kind": "file",
        "path": "crates/aicortex-store/src/provenance_repo.rs"
      }
    }

Source headings

  1. 025: Evidence delivery and the token budget
  2. 1. Purpose
  3. 2. Territory
  4. 3. Behavior
  5. 3.1 The unit
  6. 3.2 The budget
  7. 3.3 Safety and determinism
  8. 3.4 Surfaces
  9. 4. Functional requirements
  10. 5. Acceptance criteria
  11. 6. Out of scope
  12. 7. Resolved decisions
  13. Verification

Frozen anchors

No frozen anchors declared.