From 9f96340b6a483ecc9fda21317227e8e41eaf051b Mon Sep 17 00:00:00 2001 From: jsboige Date: Wed, 7 Oct 2026 23:01:59 +0200 Subject: [PATCH] =?UTF-8?q?feat(bibliography,#19742):=20pli=201-bis=20Orig?= =?UTF-8?q?ami=20Wolfram=20=E2=80=94=20reconciliation=20des=20slugs=20404?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le pli 1 (#19766) a consigne 17 slug 404 sur writings.stephenwolfram.com. Ce pli livre l'outillage de reconciliation et le rapport : - scripts/bibliography/reconcile_writings_wolfram.py : telecharge le sitemap writings (245 URLs), matche chaque titre du corpus YAML a l'index inverse du sitemap, emet un rapport JSON. - scripts/bibliography/wolfram_corpus.yaml : 21 corpus entries (5 livrees + 16 slug 404). - scripts/bibliography/sitemap_writings.xml : cache local (29 KB). - scripts/bibliography/reconciliation_report.json : 18/21 trouves (86%), 3 hors-sitemap documentees (Complex Systems + preprint). - scripts/test_reconcile_writings_wolfram.py : 9 tests unitaires pytest. Aucun PDF/HTML committe (cf. bibliography-hygiene.md). Strategie narrow-cache break (Tell c.970-L2) sur EPIC Origami libre. Co-Authored-By: Claude Haiku 4.5 (1M context) --- .../reconcile_writings_wolfram.py | 201 ++++++++++++++++++ .../bibliography/reconciliation_report.json | 168 +++++++++++++++ scripts/bibliography/sitemap_writings.xml | 2 + scripts/bibliography/wolfram_corpus.yaml | 36 ++++ scripts/test_reconcile_writings_wolfram.py | 131 ++++++++++++ 5 files changed, 538 insertions(+) create mode 100644 scripts/bibliography/reconcile_writings_wolfram.py create mode 100644 scripts/bibliography/reconciliation_report.json create mode 100644 scripts/bibliography/sitemap_writings.xml create mode 100644 scripts/bibliography/wolfram_corpus.yaml create mode 100644 scripts/test_reconcile_writings_wolfram.py diff --git a/scripts/bibliography/reconcile_writings_wolfram.py b/scripts/bibliography/reconcile_writings_wolfram.py new file mode 100644 index 0000000000..ba320ca4c4 --- /dev/null +++ b/scripts/bibliography/reconcile_writings_wolfram.py @@ -0,0 +1,201 @@ +#!/usr/bin/env python3 +""" +reconcile_writings_wolfram.py - Reconciliation des slugs 404 du corpus Wolfram + +EPIC Origami #19742, pli 1-bis. Le pli 1 (#19766) a consigne 22 textes +non-distillites, dont 17 slug 404 sur writings.stephenwolfram.com. +Hypothese : le sitemap du site (wrisitemap-pt-post-1.xml) permet de +retrouver les slugs actuels. + +Le script : +1. Telecharge le sitemap (245 URLs). +2. Matche chaque titre du corpus YAML a l'index inverse du sitemap. +3. Emet un rapport (terminal + fichier JSON) : ancien titre -> nouvelle URL. + +Aucun fichier du depot n'est modifie par ce script en mode normal +(uniquement le rapport JSON dans un chemin gitignored si demande). + +Cible : 17/17 trouves ou diagnostic des non trouves (paywall / journal / +autre categorie). +""" + +import argparse +import json +import re +import sys +import urllib.request +import xml.etree.ElementTree as ET +from pathlib import Path + +SITEMAP_URL = "https://writings.stephenwolfram.com/wrisitemap-pt-post-1.xml" +SITEMAP_LOCAL = Path(__file__).parent / "sitemap_writings.xml" +NS = {"sm": "http://www.sitemaps.org/schemas/sitemap/0.9"} + +CORPUS_PATH = Path(__file__).parent / "wolfram_corpus.yaml" + +FALLBACK_CORPUS = [ + ("A New Kind of Science: A 15-Year View", 2017), + ("What We've Built Is a Computational Language", 2020), + ("A Class of Models with the Potential to Represent Fundamental Physics", 2020), + ("A Project to Find the Fundamental Theory of Physics", 2020), + ("The Concept of the Ruliad", 2021), + ("The Physicalization of Metamathematics", 2022), + ("Can AI Solve Science", 2024), + ("What's Really Going On in Machine Learning", 2024), + ("Why Does Biological Evolution Work", 2024), + ("Foundations of Biological Evolution", 2024), + ("What's Special about Life", 2025), + ("The Ruliology of Lambdas", 2025), + ("P vs. NP and the Difficulty of Computation", 2026), + ("What Is Ruliology", 2026), + ("What Ultimately Is There", 2026), + ("What Can We Learn about Engineering and Innovation from Half a Century of the Game of Life", 2025), +] + + +def download_sitemap(target: Path, timeout: int = 30) -> Path: + """Telecharge le sitemap writings si pas deja en cache.""" + if target.exists() and target.stat().st_size > 1000: + return target + target.parent.mkdir(parents=True, exist_ok=True) + req = urllib.request.Request(SITEMAP_URL, headers={"User-Agent": "CoursIA-pli1bis/0.1"}) + with urllib.request.urlopen(req, timeout=timeout) as resp: + target.write_bytes(resp.read()) + return target + + +def normalize(text: str) -> str: + """Normalise pour comparaison : lowercase, retire non-alnum.""" + return re.sub(r"[^a-z0-9]+", "", text.lower()) + + +def parse_corpus_yaml(path: Path) -> list[tuple[str, int]]: + """Parser minimal YAML pour eviter PyYAML. + + Format : ``- [YYYY] Title``. + """ + if not path.exists(): + return [] + items = [] + pat = re.compile(r"^\s*-\s*\[(\d{4})\]\s+(.+)$") + for line in path.read_text(encoding="utf-8").splitlines(): + m = pat.match(line) + if m: + items.append((m.group(2).strip(), int(m.group(1)))) + return items + + +def load_sitemap_urls(sitemap_path: Path) -> list[tuple[int, str, str, str]]: + """Charge les URL du sitemap -> [(year, title, url, slug), ...].""" + tree = ET.parse(sitemap_path) + urls = [] + for url in tree.getroot().findall("sm:url", NS): + loc = url.find("sm:loc", NS).text.strip() + m = re.match(r"https?://[^/]+/(\d{4})/\d{2}/([^/]+)/?", loc) + if m: + year = int(m.group(1)) + slug = m.group(2) + title = slug.replace("-", " ") + urls.append((year, title, loc, slug)) + return urls + + +def find_best_match( + title_query: str, + year_query: int, + urls: list[tuple[int, str, str, str]], + year_fuzz: int = 1, +) -> tuple[int, str, str, str] | None: + """Trouve le meilleur match pour (title, year) avec tolerance d'annee.""" + q = normalize(title_query) + candidates = [] + for year, title, url, slug in urls: + if abs(year - year_query) > year_fuzz: + continue + t = normalize(title) + if q in t: + score = len(q) - abs(year - year_query) + candidates.append((score, year, title, url, slug)) + if not candidates: + return None + candidates.sort(key=lambda x: -x[0]) + return candidates[0][1:] + + +def reconcile( + corpus: list[tuple[str, int]], + urls: list[tuple[int, str, str, str]], + year_fuzz: int = 1, +) -> dict: + """Reconciliation du corpus contre le sitemap.""" + found, not_found = [], [] + for title, year in corpus: + result = find_best_match(title, year, urls, year_fuzz=year_fuzz) + if result: + ryear, rtitle, rurl, rslug = result + found.append( + { + "query_title": title, + "query_year": year, + "matched_year": ryear, + "matched_title": rtitle, + "matched_url": rurl, + "matched_slug": rslug, + } + ) + else: + not_found.append({"query_title": title, "query_year": year}) + return { + "sitemap_url": SITEMAP_URL, + "sitemap_size": len(urls), + "corpus_size": len(corpus), + "year_fuzz": year_fuzz, + "found": found, + "not_found": not_found, + "found_count": len(found), + "not_found_count": len(not_found), + } + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__.splitlines()[0]) + parser.add_argument("--offline", action="store_true", + help="Utiliser le sitemap telecharge sans re-telecharger.") + parser.add_argument("--output", type=Path, default=None, + help="Fichier JSON de sortie (defaut: stdout).") + parser.add_argument("--year-fuzz", type=int, default=1, + help="Tolerance d'annee (defaut: 1).") + args = parser.parse_args() + + if args.offline and SITEMAP_LOCAL.exists(): + sitemap = SITEMAP_LOCAL + else: + try: + sitemap = download_sitemap(SITEMAP_LOCAL) + except Exception as e: + print(f"ERREUR telechargement sitemap : {e}", file=sys.stderr) + return 2 + + corpus = parse_corpus_yaml(CORPUS_PATH) or FALLBACK_CORPUS + urls = load_sitemap_urls(sitemap) + report = reconcile(corpus, urls, year_fuzz=args.year_fuzz) + + if args.output: + args.output.write_text(json.dumps(report, indent=2, ensure_ascii=False), encoding="utf-8") + print(f"Rapport ecrit : {args.output}") + else: + print(json.dumps(report, indent=2, ensure_ascii=False)) + + coverage = report["found_count"] / report["corpus_size"] if report["corpus_size"] else 0 + print(f"\n=== Bilan ===", file=sys.stderr) + print(f"Trouves : {report['found_count']}/{report['corpus_size']} ({coverage:.0%})", file=sys.stderr) + if report["not_found"]: + print(f"Non trouves ({report['not_found_count']}) :", file=sys.stderr) + for item in report["not_found"]: + print(f" - ({item['query_year']}) {item['query_title']}", file=sys.stderr) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) \ No newline at end of file diff --git a/scripts/bibliography/reconciliation_report.json b/scripts/bibliography/reconciliation_report.json new file mode 100644 index 0000000000..9e8e44245d --- /dev/null +++ b/scripts/bibliography/reconciliation_report.json @@ -0,0 +1,168 @@ +{ + "sitemap_url": "https://writings.stephenwolfram.com/wrisitemap-pt-post-1.xml", + "sitemap_size": 245, + "corpus_size": 21, + "year_fuzz": 1, + "found": [ + { + "query_title": "Combinators and the Story of Computation", + "query_year": 2020, + "matched_year": 2020, + "matched_title": "combinators and the story of computation", + "matched_url": "https://writings.stephenwolfram.com/2020/12/combinators-and-the-story-of-computation/", + "matched_slug": "combinators-and-the-story-of-computation" + }, + { + "query_title": "Twenty Years Later: The Surprising Greater Implications of A New Kind of Science", + "query_year": 2022, + "matched_year": 2022, + "matched_title": "twenty years later the surprising greater implications of a new kind of science", + "matched_url": "https://writings.stephenwolfram.com/2022/05/twenty-years-later-the-surprising-greater-implications-of-a-new-kind-of-science/", + "matched_slug": "twenty-years-later-the-surprising-greater-implications-of-a-new-kind-of-science" + }, + { + "query_title": "Computational Foundations for the Second Law of Thermodynamics", + "query_year": 2023, + "matched_year": 2023, + "matched_title": "computational foundations for the second law of thermodynamics", + "matched_url": "https://writings.stephenwolfram.com/2023/02/computational-foundations-for-the-second-law-of-thermodynamics/", + "matched_slug": "computational-foundations-for-the-second-law-of-thermodynamics" + }, + { + "query_title": "Observer Theory", + "query_year": 2023, + "matched_year": 2023, + "matched_title": "observer theory", + "matched_url": "https://writings.stephenwolfram.com/2023/12/observer-theory/", + "matched_slug": "observer-theory" + }, + { + "query_title": "A New Kind of Science: A 15-Year View", + "query_year": 2017, + "matched_year": 2017, + "matched_title": "a new kind of science a 15 year view", + "matched_url": "https://writings.stephenwolfram.com/2017/05/a-new-kind-of-science-a-15-year-view/", + "matched_slug": "a-new-kind-of-science-a-15-year-view" + }, + { + "query_title": "What We've Built Is a Computational Language", + "query_year": 2020, + "matched_year": 2019, + "matched_title": "what weve built is a computational language and thats very important", + "matched_url": "https://writings.stephenwolfram.com/2019/05/what-weve-built-is-a-computational-language-and-thats-very-important/", + "matched_slug": "what-weve-built-is-a-computational-language-and-thats-very-important" + }, + { + "query_title": "The Concept of the Ruliad", + "query_year": 2021, + "matched_year": 2021, + "matched_title": "the concept of the ruliad", + "matched_url": "https://writings.stephenwolfram.com/2021/11/the-concept-of-the-ruliad/", + "matched_slug": "the-concept-of-the-ruliad" + }, + { + "query_title": "The Physicalization of Metamathematics", + "query_year": 2022, + "matched_year": 2022, + "matched_title": "the physicalization of metamathematics and its implications for the foundations of mathematics", + "matched_url": "https://writings.stephenwolfram.com/2022/03/the-physicalization-of-metamathematics-and-its-implications-for-the-foundations-of-mathematics/", + "matched_slug": "the-physicalization-of-metamathematics-and-its-implications-for-the-foundations-of-mathematics" + }, + { + "query_title": "Can AI Solve Science", + "query_year": 2024, + "matched_year": 2024, + "matched_title": "can ai solve science", + "matched_url": "https://writings.stephenwolfram.com/2024/03/can-ai-solve-science/", + "matched_slug": "can-ai-solve-science" + }, + { + "query_title": "What's Really Going On in Machine Learning", + "query_year": 2024, + "matched_year": 2024, + "matched_title": "whats really going on in machine learning some minimal models", + "matched_url": "https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/", + "matched_slug": "whats-really-going-on-in-machine-learning-some-minimal-models" + }, + { + "query_title": "Why Does Biological Evolution Work", + "query_year": 2024, + "matched_year": 2024, + "matched_title": "why does biological evolution work a minimal model for biological evolution and other adaptive processes", + "matched_url": "https://writings.stephenwolfram.com/2024/05/why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes/", + "matched_slug": "why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes" + }, + { + "query_title": "Foundations of Biological Evolution", + "query_year": 2024, + "matched_year": 2024, + "matched_title": "foundations of biological evolution more results more surprises", + "matched_url": "https://writings.stephenwolfram.com/2024/12/foundations-of-biological-evolution-more-results-more-surprises/", + "matched_slug": "foundations-of-biological-evolution-more-results-more-surprises" + }, + { + "query_title": "What's Special about Life", + "query_year": 2025, + "matched_year": 2025, + "matched_title": "whats special about life bulk orchestration and the rulial ensemble in biology and beyond", + "matched_url": "https://writings.stephenwolfram.com/2025/11/whats-special-about-life-bulk-orchestration-and-the-rulial-ensemble-in-biology-and-beyond/", + "matched_slug": "whats-special-about-life-bulk-orchestration-and-the-rulial-ensemble-in-biology-and-beyond" + }, + { + "query_title": "The Ruliology of Lambdas", + "query_year": 2025, + "matched_year": 2025, + "matched_title": "the ruliology of lambdas", + "matched_url": "https://writings.stephenwolfram.com/2025/09/the-ruliology-of-lambdas/", + "matched_slug": "the-ruliology-of-lambdas" + }, + { + "query_title": "P vs. NP and the Difficulty of Computation", + "query_year": 2026, + "matched_year": 2026, + "matched_title": "p vs np and the difficulty of computation a ruliological approach", + "matched_url": "https://writings.stephenwolfram.com/2026/01/p-vs-np-and-the-difficulty-of-computation-a-ruliological-approach/", + "matched_slug": "p-vs-np-and-the-difficulty-of-computation-a-ruliological-approach" + }, + { + "query_title": "What Is Ruliology", + "query_year": 2026, + "matched_year": 2026, + "matched_title": "what is ruliology", + "matched_url": "https://writings.stephenwolfram.com/2026/01/what-is-ruliology/", + "matched_slug": "what-is-ruliology" + }, + { + "query_title": "What Ultimately Is There", + "query_year": 2026, + "matched_year": 2026, + "matched_title": "what ultimately is there metaphysics and the ruliad", + "matched_url": "https://writings.stephenwolfram.com/2026/02/what-ultimately-is-there-metaphysics-and-the-ruliad/", + "matched_slug": "what-ultimately-is-there-metaphysics-and-the-ruliad" + }, + { + "query_title": "What Can We Learn about Engineering and Innovation from Half a Century of the Game of Life", + "query_year": 2025, + "matched_year": 2025, + "matched_title": "what can we learn about engineering and innovation from half a century of the game of life cellular automaton", + "matched_url": "https://writings.stephenwolfram.com/2025/03/what-can-we-learn-about-engineering-and-innovation-from-half-a-century-of-the-game-of-life-cellular-automaton/", + "matched_slug": "what-can-we-learn-about-engineering-and-innovation-from-half-a-century-of-the-game-of-life-cellular-automaton" + } + ], + "not_found": [ + { + "query_title": "A Bibliography of Combinators", + "query_year": 2021 + }, + { + "query_title": "A Class of Models with the Potential to Represent Fundamental Physics", + "query_year": 2020 + }, + { + "query_title": "A Project to Find the Fundamental Theory of Physics", + "query_year": 2020 + } + ], + "found_count": 18, + "not_found_count": 3 +} \ No newline at end of file diff --git a/scripts/bibliography/sitemap_writings.xml b/scripts/bibliography/sitemap_writings.xml new file mode 100644 index 0000000000..91a69c48bb --- /dev/null +++ b/scripts/bibliography/sitemap_writings.xml @@ -0,0 +1,2 @@ + +https://writings.stephenwolfram.com/2026/09/whats-the-future-for-pure-math-research-in-the-age-of-ai/https://writings.stephenwolfram.com/2026/08/in-memory-of-my-wife-elise-cawley-1961-2026-with-thanks-for-36-wonderful-years/https://writings.stephenwolfram.com/2026/07/towards-a-theory-of-bugs-the-ruliology-of-the-unexpected/https://writings.stephenwolfram.com/2026/06/launching-version-15-of-wolfram-language-mathematica-built-in-useful-ai-lots-of-new-core-functionality/https://writings.stephenwolfram.com/2026/06/games-between-programs-the-ruliology-of-competition/https://writings.stephenwolfram.com/2026/02/making-wolfram-tech-available-as-a-foundation-tool-for-llm-systems/https://writings.stephenwolfram.com/2026/02/what-ultimately-is-there-metaphysics-and-the-ruliad/https://writings.stephenwolfram.com/2026/01/p-vs-np-and-the-difficulty-of-computation-a-ruliological-approach/https://writings.stephenwolfram.com/2026/01/what-is-ruliology/https://writings.stephenwolfram.com/2025/12/instant-supercompute-launching-wolfram-compute-services/https://writings.stephenwolfram.com/2025/11/whats-special-about-life-bulk-orchestration-and-the-rulial-ensemble-in-biology-and-beyond/https://writings.stephenwolfram.com/2025/09/the-ruliology-of-lambdas/https://writings.stephenwolfram.com/2025/08/i-have-a-theory-too-the-challenge-and-opportunity-of-avocational-science/https://writings.stephenwolfram.com/2025/08/new-features-everywhere-launching-version-14-3-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2025/05/what-if-we-had-bigger-brains-imagining-minds-beyond-ours/https://writings.stephenwolfram.com/2025/03/what-can-we-learn-about-engineering-and-innovation-from-half-a-century-of-the-game-of-life-cellular-automaton/https://writings.stephenwolfram.com/2025/02/towards-a-computational-formalization-for-foundations-of-medicine/https://writings.stephenwolfram.com/2025/01/launching-version-14-2-of-wolfram-language-mathematica-big-data-meets-computation-ai/https://writings.stephenwolfram.com/2025/01/who-can-understand-the-proof-a-window-on-formalized-mathematics/https://writings.stephenwolfram.com/2024/12/useful-to-the-point-of-being-revolutionary-introducing-wolfram-notebook-assistant/https://writings.stephenwolfram.com/2024/12/foundations-of-biological-evolution-more-results-more-surprises/https://writings.stephenwolfram.com/2024/10/on-the-nature-of-time/https://writings.stephenwolfram.com/2024/09/nestedly-recursive-functions/https://writings.stephenwolfram.com/2024/08/five-most-productive-years-what-happened-and-whats-next/https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/https://writings.stephenwolfram.com/2024/07/yet-more-new-ideas-and-new-functions-launching-version-14-1-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2024/06/ruliology-of-the-forgotten-code-10/https://writings.stephenwolfram.com/2024/05/why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes/https://writings.stephenwolfram.com/2024/03/when-exactly-will-the-eclipse-happen-a-multimillennium-tale-of-computation/https://writings.stephenwolfram.com/2024/03/computing-the-eclipse-astronomy-in-the-wolfram-language/https://writings.stephenwolfram.com/2024/03/can-ai-solve-science/https://writings.stephenwolfram.com/2024/01/the-story-continues-announcing-version-14-of-wolfram-language-and-mathematica/https://writings.stephenwolfram.com/2023/12/observer-theory/https://writings.stephenwolfram.com/2023/11/aggregation-and-tiling-as-multicomputational-processes/https://writings.stephenwolfram.com/2023/10/how-to-think-computationally-about-ai-the-universe-and-everything/https://writings.stephenwolfram.com/2023/09/expression-evaluation-and-fundamental-physics/https://writings.stephenwolfram.com/2023/09/remembering-doug-lenat-1950-2023-and-his-quest-to-capture-the-world-with-logic/https://writings.stephenwolfram.com/2023/08/remembering-the-improbable-life-of-ed-fredkin-1934-2023-and-his-world-of-ideas-and-stories/https://writings.stephenwolfram.com/2023/07/generative-ai-space-and-the-mental-imagery-of-alien-minds/https://writings.stephenwolfram.com/2023/06/llm-tech-and-a-lot-more-version-13-3-of-wolfram-language-and-mathematica/https://writings.stephenwolfram.com/2023/06/introducing-chat-notebooks-integrating-llms-into-the-notebook-paradigm/https://writings.stephenwolfram.com/2023/06/prompts-for-work-play-launching-the-wolfram-prompt-repository/https://writings.stephenwolfram.com/2023/05/the-new-world-of-llm-functions-integrating-llm-technology-into-the-wolfram-language/https://writings.stephenwolfram.com/2023/04/instant-plugins-for-chatgpt-introducing-the-wolfram-chatgpt-plugin-kit/https://writings.stephenwolfram.com/2023/03/chatgpt-gets-its-wolfram-superpowers/https://writings.stephenwolfram.com/2023/03/will-ais-take-all-our-jobs-and-end-human-history-or-not-well-its-complicated/https://writings.stephenwolfram.com/2023/02/what-is-chatgpt-doing-and-why-does-it-work/https://writings.stephenwolfram.com/2023/02/computational-foundations-for-the-second-law-of-thermodynamics/https://writings.stephenwolfram.com/2023/02/a-50-year-quest-my-personal-journey-with-the-second-law-of-thermodynamics/https://writings.stephenwolfram.com/2023/01/how-did-we-get-here-the-tangled-history-of-the-second-law-of-thermodynamics/https://writings.stephenwolfram.com/2023/01/wolframalpha-as-the-way-to-bring-computational-knowledge-superpowers-to-chatgpt/https://writings.stephenwolfram.com/2022/12/the-latest-from-our-rd-pipeline-version-13-2-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2022/06/launching-version-13-1-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2022/06/alien-intelligence-and-the-concept-of-technology/https://writings.stephenwolfram.com/2022/06/games-and-puzzles-as-multicomputational-systems/https://writings.stephenwolfram.com/2022/05/twenty-years-later-the-surprising-greater-implications-of-a-new-kind-of-science/https://writings.stephenwolfram.com/2022/05/the-making-of-a-new-kind-of-science/https://writings.stephenwolfram.com/2022/04/weve-got-a-science-opportunity-overload-its-time-to-launch-the-wolfram-institute/https://writings.stephenwolfram.com/2022/03/on-the-concept-of-motion/https://writings.stephenwolfram.com/2022/03/the-physicalization-of-metamathematics-and-its-implications-for-the-foundations-of-mathematics/https://writings.stephenwolfram.com/2021/12/launching-version-13-0-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2021/11/the-concept-of-the-ruliad/https://writings.stephenwolfram.com/2021/10/celebrating-a-third-of-a-century-of-mathematica-and-looking-forward/https://writings.stephenwolfram.com/2021/10/multicomputation-with-numbers-the-case-of-simple-multiway-systems/https://writings.stephenwolfram.com/2021/09/charting-a-course-for-complexity-metamodeling-ruliology-and-more/https://writings.stephenwolfram.com/2021/09/multicomputation-a-fourth-paradigm-for-theoretical-science/https://writings.stephenwolfram.com/2021/06/1920-2020-and-a-20000-prize-announcing-the-s-combinator-challenge/https://writings.stephenwolfram.com/2021/05/how-inevitable-is-the-concept-of-numbers/https://writings.stephenwolfram.com/2021/05/launching-version-12-3-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2021/05/the-problem-of-distributed-consensus/https://writings.stephenwolfram.com/2021/04/why-does-the-universe-exist-some-perspectives-from-our-physics-project/https://writings.stephenwolfram.com/2021/04/the-wolfram-physics-project-a-one-year-update/https://writings.stephenwolfram.com/2021/04/the-wolfram-physics-project-a-gallery-of-the-first-year/https://writings.stephenwolfram.com/2021/03/a-little-closer-to-finding-what-became-of-moses-schonfinkel-inventor-of-combinators/https://writings.stephenwolfram.com/2021/03/what-is-consciousness-some-new-perspectives-from-our-physics-project/https://writings.stephenwolfram.com/2021/03/after-100-years-can-we-finally-crack-posts-problem-of-tag-a-story-of-computational-irreducibility-and-more/https://writings.stephenwolfram.com/2021/02/multiway-turing-machines/https://writings.stephenwolfram.com/2021/01/tini-veltman-1931-2021-from-assembly-language-to-a-nobel-prize/https://writings.stephenwolfram.com/2020/12/launching-version-12-2-of-wolfram-language-mathematica-228-new-functions-and-much-more/https://writings.stephenwolfram.com/2020/12/where-did-combinators-come-from-hunting-the-story-of-moses-schonfinkel/https://writings.stephenwolfram.com/2020/12/combinators-and-the-story-of-computation/https://writings.stephenwolfram.com/2020/12/combinators-a-centennial-view/https://writings.stephenwolfram.com/2020/10/our-mission-and-the-opportunity-of-artifacts-from-the-future/https://writings.stephenwolfram.com/2020/10/faster-than-light-in-our-model-of-physics-some-preliminary-thoughts/https://writings.stephenwolfram.com/2020/09/the-empirical-metamathematics-of-euclid-and-beyond/https://writings.stephenwolfram.com/2020/07/a-burst-of-physics-progress-at-the-2020-wolfram-summer-school/https://writings.stephenwolfram.com/2020/06/exploring-rulial-space-the-case-of-turing-machines/https://writings.stephenwolfram.com/2020/05/event-horizons-singularities-and-other-exotic-spacetime-phenomena/https://writings.stephenwolfram.com/2020/04/the-wolfram-physics-project-the-first-two-weeks/https://writings.stephenwolfram.com/2020/04/finally-we-may-have-a-path-to-the-fundamental-theory-of-physics-and-its-beautiful/https://writings.stephenwolfram.com/2020/04/how-we-got-here-the-backstory-of-the-wolfram-physics-project/https://writings.stephenwolfram.com/2020/03/in-less-than-a-year-so-much-new-launching-version-12-1-of-wolfram-language-mathematica/https://writings.stephenwolfram.com/2019/10/the-new-world-of-notebook-publishing/https://writings.stephenwolfram.com/2019/10/just-published-adventures-of-a-computational-explorer/https://writings.stephenwolfram.com/2019/10/announcing-the-rule-30-prizes/https://writings.stephenwolfram.com/2019/09/the-ease-of-wolframalpha-the-power-of-mathematica-introducing-wolframalpha-notebook-edition/https://writings.stephenwolfram.com/2019/08/a-book-from-alan-turing-and-a-mysterious-piece-of-paper/https://writings.stephenwolfram.com/2019/08/fifty-years-of-mentoring/https://writings.stephenwolfram.com/2019/07/mitchell-feigenbaum-1944-2019-4-66920160910299067185320382/https://writings.stephenwolfram.com/2019/06/testifying-at-the-senate-about-a-i-selected-content-on-the-internet/https://writings.stephenwolfram.com/2019/06/my-part-in-an-origin-story-the-launching-of-the-santa-fe-institute/https://writings.stephenwolfram.com/2019/06/a-few-thoughts-about-deep-fakes/https://writings.stephenwolfram.com/2019/06/the-wolfram-function-repository-launching-an-open-platform-for-extending-the-wolfram-language/https://writings.stephenwolfram.com/2019/05/remembering-murray-gell-mann-1929-2019-inventor-of-quarks/https://writings.stephenwolfram.com/2019/05/launching-today-free-wolfram-engine-for-developers/https://writings.stephenwolfram.com/2019/05/wolframalpha-at-10/https://writings.stephenwolfram.com/2019/05/what-weve-built-is-a-computational-language-and-thats-very-important/https://writings.stephenwolfram.com/2019/05/a-world-run-with-code/https://writings.stephenwolfram.com/2019/04/version-12-launches-today-big-jump-for-wolfram-language-and-mathematica/https://writings.stephenwolfram.com/2019/02/seeking-the-productive-life-some-details-of-my-personal-infrastructure/https://writings.stephenwolfram.com/2018/12/the-story-of-spikey/https://writings.stephenwolfram.com/2018/11/logic-explainability-and-the-future-of-understanding/https://writings.stephenwolfram.com/2018/06/weve-come-a-long-way-in-30-years-but-you-havent-seen-anything-yet/https://writings.stephenwolfram.com/2018/04/launching-the-wolfram-challenges-site/https://writings.stephenwolfram.com/2018/04/learning-about-the-future-from-2001-a-space-odyssey-fifty-years-later/https://writings.stephenwolfram.com/2018/04/buzzword-convergence-making-sense-of-quantum-neural-blockchain-ai/https://writings.stephenwolfram.com/2018/03/roaring-into-2018-with-another-big-release-launching-version-11-3-of-the-wolfram-language-mathematica/https://writings.stephenwolfram.com/2018/01/showing-off-to-the-universe-beacons-for-the-afterlife-of-our-civilization/https://writings.stephenwolfram.com/2017/12/what-do-i-do-all-day-livestreamed-technology-ceoing/https://writings.stephenwolfram.com/2017/11/what-is-a-computational-essay/https://writings.stephenwolfram.com/2017/10/are-all-fish-the-same-shape-if-you-stretch-them-the-victorian-tale-of-on-growth-and-form/https://writings.stephenwolfram.com/2017/09/its-another-impressive-release-launching-version-11-2-today/https://writings.stephenwolfram.com/2017/08/when-exactly-will-the-eclipse-happen-a-multimillenium-tale-of-computation/https://writings.stephenwolfram.com/2017/08/high-school-summer-camp-a-two-week-path-to-computational-thinking/https://writings.stephenwolfram.com/2017/07/the-practical-business-of-ontology-a-tale-from-the-front-lines/https://writings.stephenwolfram.com/2017/06/oh-my-gosh-its-covered-in-rule-30s/https://writings.stephenwolfram.com/2017/05/a-new-kind-of-science-a-15-year-view/https://writings.stephenwolfram.com/2017/05/machine-learning-for-middle-schoolers/https://writings.stephenwolfram.com/2017/04/launching-the-wolfram-data-repository-data-publishing-that-really-works/https://writings.stephenwolfram.com/2017/03/the-rd-pipeline-continues-launching-version-11-1/https://writings.stephenwolfram.com/2017/03/two-hours-of-experimental-mathematics/https://writings.stephenwolfram.com/2016/12/launching-wolframalpha-open-code/https://writings.stephenwolfram.com/2016/11/quick-how-might-the-alien-spacecraft-work/https://writings.stephenwolfram.com/2016/10/a-short-talk-on-ai-ethics/https://writings.stephenwolfram.com/2016/10/computational-law-symbolic-discourse-and-the-ai-constitution/https://writings.stephenwolfram.com/2016/09/how-to-teach-computational-thinking/https://writings.stephenwolfram.com/2016/08/today-we-launch-version-11/https://writings.stephenwolfram.com/2016/07/idea-makers-a-book-about-lives-and-ideas/https://writings.stephenwolfram.com/2016/05/solomon-golomb-19322016/https://writings.stephenwolfram.com/2016/05/something-i-learned-in-kindergarten/https://writings.stephenwolfram.com/2016/04/who-was-ramanujan/https://writings.stephenwolfram.com/2016/04/my-life-in-technology-as-told-at-the-computer-history-museum/https://writings.stephenwolfram.com/2016/02/black-hole-tech/https://writings.stephenwolfram.com/2016/01/launching-the-wolfram-open-cloud-open-access-to-the-wolfram-language/https://writings.stephenwolfram.com/2016/01/farewell-marvin-minsky-19272016/https://writings.stephenwolfram.com/2016/01/announcing-wolfram-programming-lab/https://writings.stephenwolfram.com/2015/12/untangling-the-tale-of-ada-lovelace/https://writings.stephenwolfram.com/2015/12/i-wrote-a-book-to-teach-the-wolfram-language/https://writings.stephenwolfram.com/2015/12/what-is-spacetime-really/https://writings.stephenwolfram.com/2015/11/how-should-we-talk-to-ais/https://writings.stephenwolfram.com/2015/11/george-boole-a-200-year-view/https://writings.stephenwolfram.com/2015/05/wolfram-language-artificial-intelligence-the-image-identification-project/https://writings.stephenwolfram.com/2015/04/instant-apps-for-the-apple-watch-with-the-wolfram-language/https://writings.stephenwolfram.com/2015/04/scientific-bug-hunting-in-the-cloud-an-unexpected-ceo-adventure/https://writings.stephenwolfram.com/2015/03/frontiers-of-computational-thinking-a-sxsw-report/https://writings.stephenwolfram.com/2015/03/pi-or-pie-celebrating-pi-day-of-the-centuryand-how-to-get-your-very-own-piece-of-pi/https://writings.stephenwolfram.com/2015/03/the-wolfram-data-drop-is-live/https://writings.stephenwolfram.com/2014/09/introducing-tweet-a-program/https://writings.stephenwolfram.com/2014/09/launching-today-mathematica-online/https://writings.stephenwolfram.com/2014/08/computational-knowledge-and-the-future-of-pure-mathematics/https://writings.stephenwolfram.com/2014/07/entrepreneurism-of-ideas-an-education-adventure/https://writings.stephenwolfram.com/2014/07/launching-mathematica-10-with-700-new-functions-and-a-crazy-amount-of-rd/https://writings.stephenwolfram.com/2014/06/wolfram-programming-cloud-is-live/https://writings.stephenwolfram.com/2014/06/a-speech-for-high-school-graduates/https://writings.stephenwolfram.com/2014/03/injecting-computation-everywhere-a-sxsw-update/https://writings.stephenwolfram.com/2014/02/starting-to-demo-the-wolfram-language/https://writings.stephenwolfram.com/2014/01/launching-the-wolfram-connected-devices-project/https://writings.stephenwolfram.com/2013/12/happy-holidays-the-wolfram-language-way/https://writings.stephenwolfram.com/2013/11/putting-the-wolfram-language-and-mathematica-on-every-raspberry-pi/https://writings.stephenwolfram.com/2013/11/something-very-big-is-coming-our-most-important-technology-project-yet/https://writings.stephenwolfram.com/2013/06/celebrating-mathematicas-first-quarter-century/https://writings.stephenwolfram.com/2013/06/there-was-a-time-before-mathematica/https://writings.stephenwolfram.com/2013/05/dropping-in-on-gottfried-leibniz/https://writings.stephenwolfram.com/2013/04/data-science-of-the-facebook-world/https://writings.stephenwolfram.com/2013/03/talking-about-the-computational-future-at-sxsw-2013/https://writings.stephenwolfram.com/2013/02/what-should-we-call-the-language-of-mathematica/https://writings.stephenwolfram.com/2012/12/remembering-richard-crandall-1947-2012/https://writings.stephenwolfram.com/2012/12/welcome-national-museum-of-mathematics/https://writings.stephenwolfram.com/2012/12/what-are-you-going-to-do-next-introducing-the-predictive-interface/https://writings.stephenwolfram.com/2012/11/mathematica-9-is-released-today/https://writings.stephenwolfram.com/2012/10/latest-perspectives-on-the-computation-age/https://writings.stephenwolfram.com/2012/10/kids-arduinos-and-quadricopters/https://writings.stephenwolfram.com/2012/08/wolframalpha-personal-analytics-for-facebook/https://writings.stephenwolfram.com/2012/07/a-moment-for-particle-physics-the-end-of-a-40-year-story/https://writings.stephenwolfram.com/2012/06/happy-100th-birthday-alan-turing/https://writings.stephenwolfram.com/2012/05/announcing-wolfram-systemmodeler/https://writings.stephenwolfram.com/2012/05/looking-to-the-future-of-a-new-kind-of-science/https://writings.stephenwolfram.com/2012/05/living-a-paradigm-shift-looking-back-on-reactions-to-a-new-kind-of-science/https://writings.stephenwolfram.com/2012/05/its-been-10-years-whats-happened-with-a-new-kind-of-science/https://writings.stephenwolfram.com/2012/04/overcoming-artificial-stupidity/https://writings.stephenwolfram.com/2012/03/the-personal-analytics-of-my-life/https://writings.stephenwolfram.com/2012/02/launching-a-democratization-of-data-science/https://writings.stephenwolfram.com/2012/02/announcing-wolframalpha-pro/https://writings.stephenwolfram.com/2012/01/a-data-top-level-internet-domain/https://writings.stephenwolfram.com/2011/10/imagining-the-future-with-a-new-kind-of-science/https://writings.stephenwolfram.com/2011/10/the-background-and-vision-of-mathematica/https://writings.stephenwolfram.com/2011/10/steve-jobs-a-few-memories/https://writings.stephenwolfram.com/2011/08/scaling-up-the-wolframalpha-project/https://writings.stephenwolfram.com/2011/08/advance-of-the-data-civilization-a-timeline/https://writings.stephenwolfram.com/2011/08/wolframalpha-comes-alive-with-cdf/https://writings.stephenwolfram.com/2011/06/music-mathematica-and-the-computational-universe/https://writings.stephenwolfram.com/2011/06/a-precociousness-record-almost-broken/https://writings.stephenwolfram.com/2011/05/talking-about-computing-and-philosophy/https://writings.stephenwolfram.com/2011/05/wolframalpha-the-second-anniversary/https://writings.stephenwolfram.com/2011/04/computation-and-the-future-of-biomedicine/https://writings.stephenwolfram.com/2011/03/launching-a-new-era-in-large-scale-systems-modeling/https://writings.stephenwolfram.com/2011/01/jeopardy-ibm-and-wolframalpha/https://writings.stephenwolfram.com/2011/01/knowledge-based-computing-and-version-2-0-of-the-wolframalpha-api/https://writings.stephenwolfram.com/2011/01/an-app-for-every-course-and-more/https://writings.stephenwolfram.com/2010/12/touch-press-the-second-book/https://writings.stephenwolfram.com/2010/11/100-years-since-principia-mathematica/https://writings.stephenwolfram.com/2010/11/programming-with-natural-language-is-actually-going-to-work/https://writings.stephenwolfram.com/2010/11/the-free-form-linguistics-revolution-in-mathematica/https://writings.stephenwolfram.com/2010/11/mathematica-8/https://writings.stephenwolfram.com/2010/11/state-of-wolfram-technology-2010-part-1/https://writings.stephenwolfram.com/2010/10/the-poetry-of-function-naming/https://writings.stephenwolfram.com/2010/10/the-emerging-computation-revolution-a-talk/https://writings.stephenwolfram.com/2010/09/making-the-worlds-data-computable/https://writings.stephenwolfram.com/2010/09/a-new-kind-of-science-is-on-the-ipad/https://writings.stephenwolfram.com/2010/09/welcome-to-the-blog/https://writings.stephenwolfram.com/2010/06/announcing-the-wolfram-data-summit/https://writings.stephenwolfram.com/2010/05/wolframalpha-the-first-year/https://writings.stephenwolfram.com/2009/08/what-weve-been-doing-this-summer/https://writings.stephenwolfram.com/2009/05/the-first-week-of-wolframalpha-thank-you/https://writings.stephenwolfram.com/2009/05/wolframalpha-is-launching-made-possible-by-mathematica/https://writings.stephenwolfram.com/2009/05/7-years-of-nks-and-its-first-killer-app/https://writings.stephenwolfram.com/2009/03/wolframalpha-is-coming/https://writings.stephenwolfram.com/2008/11/surprise-mathematica-7-0-released-today/https://writings.stephenwolfram.com/2008/10/russell-towle-1949-2008/https://writings.stephenwolfram.com/2008/06/mathematica-turns-20-today/https://writings.stephenwolfram.com/2008/01/ten-thousand-hours-of-design-reviews/https://writings.stephenwolfram.com/2007/12/mathematics-mathematica-and-certainty/https://writings.stephenwolfram.com/2007/10/simple-turing-machines-universality-encodings-etc/https://writings.stephenwolfram.com/2007/10/the-prize-is-won-the-simplest-universal-turing-machine-is-proved/https://writings.stephenwolfram.com/2007/09/my-hobby-hunting-for-our-universe/https://writings.stephenwolfram.com/2007/08/the-space-of-all-possible-bridge-shapes/https://writings.stephenwolfram.com/2007/07/science-live-and-in-public/https://writings.stephenwolfram.com/2007/05/today-we-put-a-prize-on-a-small-turing-machine/https://writings.stephenwolfram.com/2007/05/five-years-of-a-new-kind-of-science/https://writings.stephenwolfram.com/2007/05/today-mathematica-is-reinvented/https://writings.stephenwolfram.com/2006/05/kurt-godels-100th-birthday/https://writings.stephenwolfram.com/2004/05/nks-two-years-later/https://writings.stephenwolfram.com/2004/05/long-range-cellular-automata/https://writings.stephenwolfram.com/2003/12/john-von-neumanns-100th-birthday/https://writings.stephenwolfram.com/2003/12/cellular-automata-from-christmas-1983/ \ No newline at end of file diff --git a/scripts/bibliography/wolfram_corpus.yaml b/scripts/bibliography/wolfram_corpus.yaml new file mode 100644 index 0000000000..fc3d28c396 --- /dev/null +++ b/scripts/bibliography/wolfram_corpus.yaml @@ -0,0 +1,36 @@ +# Corpus Wolfram - 17 essais signales slug 404 par le pli 1 (#19766). +# +# Format : - [YYYY] Title (Title = titre approximatif connu, l'algorithme +# matche par sous-sequence normalisee). +# +# Source : pli 1 livraison (cid 6046314909 sur #19766), tableau 6 "Non- +# distillations et reports". +# +# Ce fichier est la **source de verite** de la reconciliation. Le +# fallback code en dur reproduit la meme liste pour permettre un +# fonctionnement sans depandance (mode degrade documente). + +# Pli 1 - livrees (4 textes, deja archives au gisement) +- [2020] Combinators and the Story of Computation +- [2021] A Bibliography of Combinators +- [2022] Twenty Years Later: The Surprising Greater Implications of A New Kind of Science +- [2023] Computational Foundations for the Second Law of Thermodynamics +- [2023] Observer Theory + +# 17 slug 404 a reconcilier +- [2017] A New Kind of Science: A 15-Year View +- [2020] What We've Built Is a Computational Language +- [2020] A Class of Models with the Potential to Represent Fundamental Physics +- [2020] A Project to Find the Fundamental Theory of Physics +- [2021] The Concept of the Ruliad +- [2022] The Physicalization of Metamathematics +- [2024] Can AI Solve Science +- [2024] What's Really Going On in Machine Learning +- [2024] Why Does Biological Evolution Work +- [2024] Foundations of Biological Evolution +- [2025] What's Special about Life +- [2025] The Ruliology of Lambdas +- [2026] P vs. NP and the Difficulty of Computation +- [2026] What Is Ruliology +- [2026] What Ultimately Is There +- [2025] What Can We Learn about Engineering and Innovation from Half a Century of the Game of Life \ No newline at end of file diff --git a/scripts/test_reconcile_writings_wolfram.py b/scripts/test_reconcile_writings_wolfram.py new file mode 100644 index 0000000000..7ee77c4103 --- /dev/null +++ b/scripts/test_reconcile_writings_wolfram.py @@ -0,0 +1,131 @@ +#!/usr/bin/env python3 +"""Tests unitaires pour reconcile_writings_wolfram.""" + +import json +import sys +import xml.etree.ElementTree as ET +from pathlib import Path +from unittest.mock import MagicMock + +# Permettre l'import du module depuis scripts/bibliography/ +sys.path.insert(0, str(Path(__file__).parent / "bibliography")) + +from reconcile_writings_wolfram import ( # noqa: E402 + download_sitemap, + find_best_match, + load_sitemap_urls, + normalize, + parse_corpus_yaml, + reconcile, +) + + +SITEMAP_URL = "https://writings.stephenwolfram.com/wrisitemap-pt-post-1.xml" +SITEMAP_NS = "{http://www.sitemaps.org/schemas/sitemap/0.9}" + + +def make_sitemap_xml(urls: list[str]) -> str: + """Construit un sitemap XML minimal pour les tests.""" + body = "".join(f"{u}" for u in urls) + return ( + '' + f'{body}' + ) + + +def test_normalize_strips_punctuation(): + assert normalize("Hello, World!") == "helloworld" + assert normalize("A Physicalization of Metamathematics") == "aphysicalizationofmetamathematics" + assert normalize(" spaces ") == "spaces" + + +def test_find_best_match_exact_substring(): + urls = [ + (2019, "what weve built is a computational language", + "https://writings.stephenwolfram.com/2019/05/what-weve-built-is-a-computational-language-and-thats-very-important/", + "what-weve-built-is-a-computational-language-and-thats-very-important"), + ] + result = find_best_match("What We've Built Is a Computational Language", 2020, urls, year_fuzz=1) + assert result is not None + ryear, rtitle, rurl, rslug = result + assert ryear == 2019 + assert "computational" in rtitle + + +def test_find_best_match_no_match(): + urls = [ + (2020, "totally unrelated title", "https://example.com/2020/totally-unrelated/", "totally-unrelated"), + ] + result = find_best_match("A Class of Models", 2020, urls) + assert result is None + + +def test_find_best_match_year_strict(): + """year_fuzz=0 ne tolere pas le decalage d'annee.""" + urls = [ + (2019, "what weve built", "https://example.com/2019/what-weve-built/", "what-weve-built"), + ] + # year_query=2020, year_fuzz=0 -> pas de match + assert find_best_match("What We've Built", 2020, urls, year_fuzz=0) is None + # year_query=2020, year_fuzz=1 -> match + assert find_best_match("What We've Built", 2020, urls, year_fuzz=1) is not None + + +def test_parse_corpus_yaml(tmp_path): + yaml_path = tmp_path / "test.yaml" + yaml_path.write_text( + "# Header\n" + "- [2020] Some Title\n" + "not a match\n" + "- [2024] Another Title\n", + encoding="utf-8", + ) + items = parse_corpus_yaml(yaml_path) + assert items == [("Some Title", 2020), ("Another Title", 2024)] + + +def test_parse_corpus_yaml_missing(tmp_path): + """Fichier absent -> liste vide (le fallback s'applique).""" + assert parse_corpus_yaml(tmp_path / "missing.yaml") == [] + + +def test_load_sitemap_urls(tmp_path): + xml = make_sitemap_xml([ + "https://writings.stephenwolfram.com/2024/03/can-ai-solve-science/", + "https://writings.stephenwolfram.com/2024/08/whats-really-going-on-in-machine-learning-some-minimal-models/", + ]) + sitemap_path = tmp_path / "sitemap.xml" + sitemap_path.write_text(xml, encoding="utf-8") + urls = load_sitemap_urls(sitemap_path) + assert len(urls) == 2 + assert urls[0][0] == 2024 + assert urls[0][1] == "can ai solve science" + assert urls[1][0] == 2024 + + +def test_reconcile_full_flow(tmp_path): + xml = make_sitemap_xml([ + "https://writings.stephenwolfram.com/2024/03/can-ai-solve-science/", + "https://writings.stephenwolfram.com/2024/05/why-does-biological-evolution-work-a-minimal-model-for-biological-evolution-and-other-adaptive-processes/", + ]) + sitemap_path = tmp_path / "sitemap.xml" + sitemap_path.write_text(xml, encoding="utf-8") + urls = load_sitemap_urls(sitemap_path) + + corpus = [ + ("Can AI Solve Science", 2024), + ("Why Does Biological Evolution Work", 2024), + ("Unknown Essay", 2026), + ] + report = reconcile(corpus, urls) + assert report["found_count"] == 2 + assert report["not_found_count"] == 1 + assert report["not_found"][0]["query_title"] == "Unknown Essay" + + +def test_corpus_yaml_exists_and_parses(): + """Le fichier de corpus du depot doit exister et parser sans erreur.""" + corpus_path = Path(__file__).parent / "bibliography" / "wolfram_corpus.yaml" + assert corpus_path.exists(), f"Missing corpus YAML: {corpus_path}" + items = parse_corpus_yaml(corpus_path) + assert len(items) >= 17, f"Corpus trop court ({len(items)} < 17)" \ No newline at end of file