{
  "chapter": "AI-16",
  "title": "Retrieval, embeddings, RAG and evidence evaluation",
  "sourceContract": {"file": "source-retrieval-evidence-contract.json", "sha256": "24d0e9cebdc6e5e8571bcd6c788cf6c1e2a30490533876e2d03e23fbe7d34327"},
  "nativeSourceScope": "Three retained factual CSV snapshots, not new downloads. Native World Bank value/name/year tokens, MovieLens title/genre records, and Apple product/fiscal-year nominal sales remain separate from authored document templates, queries, relevance and role assignments.",
  "counts": {"nativeCountryRows": 32, "nativeMovieRows": 9742, "nativeCompanyRows": 30, "declaredCorpusDocuments": 302, "authoredQueries": 132, "allCorpusQueryPairs": 11616, "allThreeExactScoreValues": 34848},
  "newDerivedCSV": ["derived302-documents.csv", "derived132-queries.csv", "derived9742-movie-ledger.csv", "derived11616-all-candidate-scores.csv", "derived396-query-evaluations.csv", "derived27-role-means.csv", "derived3-selected-profiles.csv", "derived-all-context-chunks.csv", "derived132-literal-citation-checks.csv", "derived-source-figure-points.csv"],
  "roles": "Country groups stay together; movie title/predicate questions use declared deterministic roles; Apple questions split by fiscal year. The complete published corpus is indexed throughout. These are query evaluation partitions, not historical forecasts or held-out-document tests. The training-role queries document a development partition; no semantic encoder, generator, synonym dictionary or model parameters are fitted by this source study.",
  "selection": "Max validation-only macro RR@3, exact ties resolved by prior order overlap, rarity, rrf. Test questions never select the method. Overlap and rational rarity are transparent lexical methods; rarity is not standard TF-IDF/BM25. RRF combines ordered lists with rank offset60 and weights1.",
  "metrics": "Finite authored binary relevance; P denominator3 includes missing positions; recall/RR/AP need positive gold; truncated AP divides by the full positive-gold count. First-hit rank can be perfect while recall is incomplete. No calibrated correctness probability or population confidence interval is inferred.",
  "evidence": "Context size32, overlap8, budget96 original Unicode letter/number word runs, not BPE tokens. Original codepoint offsets are zero-based and end-exclusive. Overlap is charged again. Literal source/context presence is not entailment, truth, authority or freshness.",
  "reproduction": {"python": "../ai16-code/actual-source-study.py", "r": "../ai16-code/actual-source-study.R", "inputs": "Only native3CSV, not a JS engine/model JSON/precomputed answer. Python Fraction and base-R integer limbs preserve exact ranking comparisons; reduced small rational metrics are exact. R score fractions can be unreduced. Decimal graph coordinates are approximate projections.", "unicode": "Python explicitly NFKC-normalizes the search copy. The retained compiled source-study text is already NFKC. R requires a UTF8 locale and tokenizes that fixed text; it does not claim a general NFKC implementation."},
  "MovieLens": {"readme": "MovieLens-README-original.txt", "conditions": "Original credit and same-condition redistribution including transformations; no warranty or endorsement; commercial or revenue-bearing use requires separate prior permission. Not CC BY.", "citation": "F. Maxwell Harper and Joseph A. Konstan.2015. The MovieLens Datasets: History and Context. doi:10.1145/2827872", "snapshot": "Official latest-small development snapshot dated2018-09-26, original ZIP SHA256696d65a3dfceac7c45750ad32df2c259311949efec81f0f144fdfb91ebc9e436"},
  "WorldBank": "Retained2024 observations and original empty unit fields. Annual-percent wording follows official indicator descriptions. Source revisions and measurement uncertainty remain possible; retain attribution and indicator-specific sources/CCBY4.0 terms.",
  "Apple": "FY2019–2021:15 retained official2021 web-table transcription tokens; full2021 HTML was not downloaded. FY2022–2024:15 tokens from retained official2024 HTML. Nominal USD millions, fiscal years and product groups, not quantities, profit or real output.",
  "scope": "Local educational retrieval/extraction/evaluation. No pretrained semantic encoder, external LLM generation, ANN index, external tool action, private-data access or native-browser playback claim. All native factual records and declared failures are retained.",
  "review": {
    "stage": "Author fullcase candidate; independent whole/source/public/fixed/UI/native pending",
    "noSharedFilesChanged": true,
    "independentFinalReview": {
      "report": "work/textbook-rewrite-2026/ai16-math-independent-final-handoff.json",
      "reportSHA256": "76d2c24d150bc86fafe87dda76d3b47bca5cf140bcf45b1c6a82b817656df393",
      "status": "passed-independent-whole-source-engine-runtime-review-native-separate"
    }
  },
  "datasets": [
    {
      "file": "ai16-sources/actual30-Apple-product-sales-FY2019-2024.csv",
      "sha256": "b163b104c02e0362e0d61fdb3bb220350a97e6e25f6eb6098b742bfac2aa5598",
      "rows": 30
    },
    {
      "file": "ai16-sources/actual32-country-observations-2024.csv",
      "sha256": "4a544884181b228f4539c859abb874f92ddd77f09b956d1ba9c96d37b6f8587b",
      "rows": 32
    },
    {
      "file": "ai16-sources/derived-all-context-chunks.csv",
      "sha256": "43d19d930699e8439d9784905738e5a9233cbeff97f3337ecd4424ec74bb8294",
      "rows": 578
    },
    {
      "file": "ai16-sources/derived-source-figure-points.csv",
      "sha256": "955c633cffeb90a8b93e750c6d29ee38d717793b829b50a41d442678b0a5e907",
      "rows": 232
    },
    {
      "file": "ai16-sources/derived11616-all-candidate-scores.csv",
      "sha256": "166fddcea134e6188593e6b173a2c1349bdeb27f4a9938c19e46ece7c00d5ec9",
      "rows": 11616
    },
    {
      "file": "ai16-sources/derived132-authored-lookup-queries.csv",
      "sha256": "1e45a85b7f6fb412f1be7fcf6c9b4395c31e87a6d8e1702d3f17ddaa0c34b223",
      "rows": 132
    },
    {
      "file": "ai16-sources/derived132-literal-citation-checks.csv",
      "sha256": "b237b4809bf33221c2cf39d8105d931aa554468fa1cc39736fbfc2613468dc24",
      "rows": 132
    },
    {
      "file": "ai16-sources/derived132-queries.csv",
      "sha256": "4b7ec6a6f914d85942bf1512f617265ceeca242639de1d064ef2872ee7a5aeab",
      "rows": 132
    },
    {
      "file": "ai16-sources/derived27-role-means.csv",
      "sha256": "9613bd797b6cabb850841cf1b51ed774ab3ce5c9330eafb818e04dc73f973d6f",
      "rows": 27
    },
    {
      "file": "ai16-sources/derived3-selected-profiles.csv",
      "sha256": "8bc8ac844e9591b644f4d5aec1c28a09efb62d5b3d2b60825c9d106c3d97cd03",
      "rows": 3
    },
    {
      "file": "ai16-sources/derived302-compiled-document-corpus.csv",
      "sha256": "696ca4273392d786faed5344febf24263e9950d08dddd5d0238e0fdd9e11d6ce",
      "rows": 302
    },
    {
      "file": "ai16-sources/derived302-documents.csv",
      "sha256": "5b1b9e893848f1ea7167c5700f84062739aff87014049c076437da02a143d6f8",
      "rows": 302
    },
    {
      "file": "ai16-sources/derived396-query-evaluations.csv",
      "sha256": "83010f92bfcb3a97530d5effe9cae59afc5ad89a2812da3c49eb3620cb2329f0",
      "rows": 396
    },
    {
      "file": "ai16-sources/derived9742-movie-ledger.csv",
      "sha256": "78c153dc53b1079254144a26a25f9316659ce3d9234f883cf313f9f0264f1d97",
      "rows": 9742
    },
    {
      "file": "ai16-sources/derived9742-person-corpus-and-query-ledger.csv",
      "sha256": "78c153dc53b1079254144a26a25f9316659ce3d9234f883cf313f9f0264f1d97",
      "rows": 9742
    },
    {
      "file": "ai16-sources/movielens-original-movies.csv",
      "sha256": "5a5f32dd9bb3797b8e728a1b98958789d2b13f294a69fdfbc5727f8a9611aa07",
      "rows": 9742
    }
  ]
}
