Spaces:
Running
Running
Add multilingual research explorer linked to the Transformers Guide
Browse files- .github/workflows/test.yml +6 -0
- README.md +17 -0
- data/research_studies.json +312 -0
- index.html +29 -0
- js/i18n.js +5 -0
- js/main.js +15 -2
- js/research_explorer.js +135 -0
- js/research_i18n.js +151 -0
- js/research_studies.js +71 -0
- package.json +2 -1
- style.css +26 -0
- tests/research_browser.mjs +85 -0
- tests/research_studies.test.mjs +53 -0
.github/workflows/test.yml
CHANGED
|
@@ -27,6 +27,8 @@ jobs:
|
|
| 27 |
run: node tests/adapter_reality.test.mjs
|
| 28 |
- name: Fit-check unit tests
|
| 29 |
run: node tests/fit_check.test.mjs
|
|
|
|
|
|
|
| 30 |
|
| 31 |
python:
|
| 32 |
name: formula tests
|
|
@@ -57,3 +59,7 @@ jobs:
|
|
| 57 |
run: python3 serve.py &
|
| 58 |
- name: Sweep every mode in every language
|
| 59 |
run: node test_sweep.mjs
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 27 |
run: node tests/adapter_reality.test.mjs
|
| 28 |
- name: Fit-check unit tests
|
| 29 |
run: node tests/fit_check.test.mjs
|
| 30 |
+
- name: Research catalog and evidence boundaries
|
| 31 |
+
run: node tests/research_studies.test.mjs
|
| 32 |
|
| 33 |
python:
|
| 34 |
name: formula tests
|
|
|
|
| 59 |
run: python3 serve.py &
|
| 60 |
- name: Sweep every mode in every language
|
| 61 |
run: node test_sweep.mjs
|
| 62 |
+
- name: Research explorer interactions (no Pyodide dependency)
|
| 63 |
+
run: node tests/research_browser.mjs
|
| 64 |
+
env:
|
| 65 |
+
TAF_URL: http://127.0.0.1:8000/
|
README.md
CHANGED
|
@@ -53,6 +53,23 @@ language:
|
|
| 53 |
> 28 browser-only modes · 4 languages · 37 Lean+Mathlib-verified theorems · 0 telemetry.
|
| 54 |
|
| 55 |
**🌐 Live**: https://karlesmarin.github.io/tafagent · HF Space: https://huggingface.co/spaces/karlexmarin/taf-agent
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 56 |
**📦 Source**: https://github.com/karlesmarin/tafagent · Lean repo: https://github.com/karlesmarin/lean-taf
|
| 57 |
**📄 Papers**: *Predicting How Transformers Attend* (Marín 2026) — a continuing **I → II → III** series: [Part I](https://doi.org/10.5281/zenodo.19826342) · [Part II](https://doi.org/10.5281/zenodo.19960572) · [Part III](https://doi.org/10.5281/zenodo.21288263) · [Lean formalization](https://doi.org/10.5281/zenodo.21299265) *(each explained below)*
|
| 58 |
**🗂️ Dataset**: [taf-attention-decay (58 measurements, 32 models)](https://huggingface.co/datasets/karlexmarin/taf-attention-decay)
|
|
|
|
| 53 |
> 28 browser-only modes · 4 languages · 37 Lean+Mathlib-verified theorems · 0 telemetry.
|
| 54 |
|
| 55 |
**🌐 Live**: https://karlesmarin.github.io/tafagent · HF Space: https://huggingface.co/spaces/karlexmarin/taf-agent
|
| 56 |
+
|
| 57 |
+
### Research connected to the guide — October 2026
|
| 58 |
+
|
| 59 |
+
[📚 Open the research explorer](https://karlesmarin.github.io/tafagent/?mode=research#research-section)
|
| 60 |
+
to browse seven studies on long context, KV compression, attention sinks, quantization and
|
| 61 |
+
agent memory. Search or filter by topic/publication status, read the original source and
|
| 62 |
+
the corresponding [guide](https://karlesmarin.github.io/transformers-guide/) chapter, and
|
| 63 |
+
download a selection with proposed experiments. Explanations follow EN/ES/FR/ZH; guide
|
| 64 |
+
links use Spanish or English, labelled explicitly.
|
| 65 |
+
|
| 66 |
+
This is a manually curated snapshot reviewed on **2026-10-24**, not an automatic literature
|
| 67 |
+
feed. Each entry separates the paper's contribution, its limits and an experiment that
|
| 68 |
+
**has not been run in TAF**. The panel needs no model inference or Pyodide. Existing
|
| 69 |
+
diagnostic formulas and scores are unchanged.
|
| 70 |
+
|
| 71 |
+
The catalog is [`data/research_studies.json`](data/research_studies.json); `npm run test:research`
|
| 72 |
+
checks its provenance fields, translated text, filtering and export boundaries.
|
| 73 |
**📦 Source**: https://github.com/karlesmarin/tafagent · Lean repo: https://github.com/karlesmarin/lean-taf
|
| 74 |
**📄 Papers**: *Predicting How Transformers Attend* (Marín 2026) — a continuing **I → II → III** series: [Part I](https://doi.org/10.5281/zenodo.19826342) · [Part II](https://doi.org/10.5281/zenodo.19960572) · [Part III](https://doi.org/10.5281/zenodo.21288263) · [Lean formalization](https://doi.org/10.5281/zenodo.21299265) *(each explained below)*
|
| 75 |
**🗂️ Dataset**: [taf-attention-decay (58 measurements, 32 models)](https://huggingface.co/datasets/karlexmarin/taf-attention-decay)
|
data/research_studies.json
ADDED
|
@@ -0,0 +1,312 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": 1,
|
| 3 |
+
"reviewed_on": "2026-10-24",
|
| 4 |
+
"update_policy": "curated_manual",
|
| 5 |
+
"papers": [
|
| 6 |
+
{
|
| 7 |
+
"id": "lurch",
|
| 8 |
+
"title": "Beyond Context Length: Characterising the Difficulty of Long-Context Reasoning",
|
| 9 |
+
"date": "2026-10-15",
|
| 10 |
+
"status": "preprint",
|
| 11 |
+
"venue": "arXiv v1",
|
| 12 |
+
"url": "https://arxiv.org/abs/2610.22067v1",
|
| 13 |
+
"topics": [
|
| 14 |
+
"context",
|
| 15 |
+
"evaluation"
|
| 16 |
+
],
|
| 17 |
+
"modes": [
|
| 18 |
+
"niah",
|
| 19 |
+
"longscore"
|
| 20 |
+
],
|
| 21 |
+
"guide": {
|
| 22 |
+
"chapter": "19-contexto-largo",
|
| 23 |
+
"anchor": "sec-contexto-evidencia"
|
| 24 |
+
},
|
| 25 |
+
"taf_validation": "not_established",
|
| 26 |
+
"experiment_status": "proposed_not_run",
|
| 27 |
+
"text": {
|
| 28 |
+
"es": {
|
| 29 |
+
"summary": "Separa cantidad de evidencia necesaria, dispersión y pasos de razonamiento: dos tareas de igual longitud pueden tener dificultades distintas.",
|
| 30 |
+
"limit": "Los resultados corresponden a las tareas y modelos evaluados. No convierten γ en un predictor de razonamiento ni validan TAF.",
|
| 31 |
+
"experiment": "Mantener longitud y respuesta; comparar pistas juntas y dispersas. Registrar acierto por tarea, posiciones y pasos de razonamiento junto a γ medido."
|
| 32 |
+
},
|
| 33 |
+
"en": {
|
| 34 |
+
"summary": "Separates evidence scope, dispersion and reasoning depth: tasks of equal length can have different difficulty.",
|
| 35 |
+
"limit": "Results concern the evaluated tasks and models. They neither turn γ into a reasoning predictor nor validate TAF.",
|
| 36 |
+
"experiment": "Hold length and answer fixed; compare clustered and scattered clues. Record accuracy by task, positions and reasoning depth alongside measured γ."
|
| 37 |
+
},
|
| 38 |
+
"fr": {
|
| 39 |
+
"summary": "Distingue quantité de preuves nécessaires, dispersion et profondeur du raisonnement : deux tâches de même longueur peuvent avoir des difficultés différentes.",
|
| 40 |
+
"limit": "Les résultats concernent les tâches et modèles évalués. Ils ne font pas de γ un prédicteur du raisonnement et ne valident pas TAF.",
|
| 41 |
+
"experiment": "Fixer longueur et réponse ; comparer indices regroupés et dispersés. Relever précision par tâche, positions et étapes de raisonnement avec γ mesuré."
|
| 42 |
+
},
|
| 43 |
+
"zh": {
|
| 44 |
+
"summary": "区分所需证据量、证据分散程度和推理深度:上下文长度相同的任务,难度也可能不同。",
|
| 45 |
+
"limit": "结论限于所评估的任务和模型,不能使 γ 成为推理能力预测器,也不构成对 TAF 的验证。",
|
| 46 |
+
"experiment": "固定长度和答案,对比集中与分散的线索;按任务记录正确率、位置、推理步骤以及实测 γ。"
|
| 47 |
+
}
|
| 48 |
+
}
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"id": "valuediff",
|
| 52 |
+
"title": "ValueDiff: Value-Geometric KV Cache Eviction for Sink-Suppressed LLMs",
|
| 53 |
+
"date": "2026-10-06",
|
| 54 |
+
"status": "preprint",
|
| 55 |
+
"venue": "arXiv v2",
|
| 56 |
+
"url": "https://arxiv.org/abs/2609.23314v2",
|
| 57 |
+
"topics": [
|
| 58 |
+
"compression",
|
| 59 |
+
"sinks"
|
| 60 |
+
],
|
| 61 |
+
"modes": [
|
| 62 |
+
"recipe",
|
| 63 |
+
"quant"
|
| 64 |
+
],
|
| 65 |
+
"guide": {
|
| 66 |
+
"chapter": "20-kv-cache",
|
| 67 |
+
"anchor": "sec-kv-evidencia"
|
| 68 |
+
},
|
| 69 |
+
"taf_validation": "not_established",
|
| 70 |
+
"experiment_status": "proposed_not_run",
|
| 71 |
+
"text": {
|
| 72 |
+
"es": {
|
| 73 |
+
"summary": "En modelos con sumideros atenuados, propone seleccionar entradas KV por cuánto se aparta su vector de valor de la media de la caché.",
|
| 74 |
+
"limit": "La ventaja depende de arquitectura, tarea y presupuesto. No demuestra que conservar masa de atención garantice fidelidad ni que D_f sea superior.",
|
| 75 |
+
"experiment": "Comparar caché completa, ventana D_f y selección por valores a igual memoria efectiva. Medir recuperación, razonamiento, error de salida y coste."
|
| 76 |
+
},
|
| 77 |
+
"en": {
|
| 78 |
+
"summary": "For models with attenuated sinks, proposes selecting KV entries by each value vector’s deviation from the cache mean.",
|
| 79 |
+
"limit": "Benefits depend on architecture, task and budget. It does not establish that retaining attention mass guarantees fidelity or that D_f is superior.",
|
| 80 |
+
"experiment": "Compare full cache, a D_f window and value-based selection at matched effective memory. Measure retrieval, reasoning, output error and cost."
|
| 81 |
+
},
|
| 82 |
+
"fr": {
|
| 83 |
+
"summary": "Pour les modèles aux puits atténués, propose de sélectionner les entrées KV selon l’écart du vecteur de valeur à la moyenne du cache.",
|
| 84 |
+
"limit": "Le gain dépend de l’architecture, de la tâche et du budget. Conserver la masse d’attention ne garantit pas la fidélité ; la supériorité de D_f reste à établir.",
|
| 85 |
+
"experiment": "Comparer cache complet, fenêtre D_f et sélection par valeurs à mémoire effective égale. Mesurer récupération, raisonnement, erreur de sortie et coût."
|
| 86 |
+
},
|
| 87 |
+
"zh": {
|
| 88 |
+
"summary": "针对注意力汇聚减弱的模型,按每个值向���偏离缓存均值的程度选择 KV 条目。",
|
| 89 |
+
"limit": "收益取决于架构、任务和预算。论文未证明保留注意力质量即可保证输出保真度,也未证明 D_f 更优。",
|
| 90 |
+
"experiment": "在相同有效内存预算下,对比完整缓存、D_f 窗口和值向量选择;测量检索、推理、输出误差和成本。"
|
| 91 |
+
}
|
| 92 |
+
}
|
| 93 |
+
},
|
| 94 |
+
{
|
| 95 |
+
"id": "sinks",
|
| 96 |
+
"title": "It’s Not RoPE that Creates Sinks: The Role of Self-Concentration and Value-Non-Mixing in Attention",
|
| 97 |
+
"date": "2026-09-08",
|
| 98 |
+
"status": "accepted",
|
| 99 |
+
"venue": "EMNLP 2026 · arXiv v1",
|
| 100 |
+
"url": "https://arxiv.org/abs/2609.09085v1",
|
| 101 |
+
"topics": [
|
| 102 |
+
"sinks"
|
| 103 |
+
],
|
| 104 |
+
"modes": [
|
| 105 |
+
"profile",
|
| 106 |
+
"depth"
|
| 107 |
+
],
|
| 108 |
+
"guide": {
|
| 109 |
+
"chapter": "17-sumideros",
|
| 110 |
+
"anchor": "sec-sumideros-mecanismo"
|
| 111 |
+
},
|
| 112 |
+
"taf_validation": "not_established",
|
| 113 |
+
"experiment_status": "proposed_not_run",
|
| 114 |
+
"text": {
|
| 115 |
+
"es": {
|
| 116 |
+
"summary": "Aporta evidencia sobre autoconcentración por máscara causal y falta de mezcla de valores como mecanismos que contribuyen a sumideros y activaciones masivas.",
|
| 117 |
+
"limit": "Un mecanismo observado en los modelos estudiados no establece independencia universal entre sumidero, RoPE y γ.",
|
| 118 |
+
"experiment": "Medir por capa masa inicial, atención al propio token, normas de V y pendiente de cola. Separar intervenciones sobre máscara y sobre θ."
|
| 119 |
+
},
|
| 120 |
+
"en": {
|
| 121 |
+
"summary": "Provides evidence for causal-mask self-concentration and value non-mixing as mechanisms contributing to sinks and massive activations.",
|
| 122 |
+
"limit": "A mechanism observed in the studied models does not establish universal independence among sinks, RoPE and γ.",
|
| 123 |
+
"experiment": "Measure initial-token mass, self-attention, V norms and tail slope per layer. Separate mask interventions from changes to θ."
|
| 124 |
+
},
|
| 125 |
+
"fr": {
|
| 126 |
+
"summary": "Apporte des preuves sur l’autoconcentration liée au masque causal et le non-mélange des valeurs, qui contribuent aux puits et activations massives.",
|
| 127 |
+
"limit": "Un mécanisme observé dans ces modèles ne prouve pas une indépendance universelle entre puits, RoPE et γ.",
|
| 128 |
+
"experiment": "Mesurer par couche masse initiale, attention au token lui-même, normes de V et pente de queue. Séparer interventions sur le masque et sur θ."
|
| 129 |
+
},
|
| 130 |
+
"zh": {
|
| 131 |
+
"summary": "提供证据表明,因果掩码引起的自集中和后续值向量缺乏混合,会促成注意力汇聚及巨大激活。",
|
| 132 |
+
"limit": "在所研究模型中发现的机制,并不证明注意力汇聚、RoPE 与 γ 在所有架构中相互独立。",
|
| 133 |
+
"experiment": "逐层测量初始 token 的注意力质量、自注意力、V 范数及尾部斜率;分别考察掩码干预和 θ 变化。"
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
},
|
| 137 |
+
{
|
| 138 |
+
"id": "shotkv",
|
| 139 |
+
"title": "Semantic Integrity Matters: Benchmarking and Preserving High-Density Reasoning in KV Cache Compression",
|
| 140 |
+
"date": "2026-07",
|
| 141 |
+
"status": "published",
|
| 142 |
+
"venue": "ICML 2026 · PMLR 306",
|
| 143 |
+
"url": "https://proceedings.mlr.press/v306/liu26dz.html",
|
| 144 |
+
"topics": [
|
| 145 |
+
"compression",
|
| 146 |
+
"evaluation"
|
| 147 |
+
],
|
| 148 |
+
"modes": [
|
| 149 |
+
"recipe",
|
| 150 |
+
"niah"
|
| 151 |
+
],
|
| 152 |
+
"guide": {
|
| 153 |
+
"chapter": "20-kv-cache",
|
| 154 |
+
"anchor": "sec-kv-evidencia"
|
| 155 |
+
},
|
| 156 |
+
"taf_validation": "not_established",
|
| 157 |
+
"experiment_status": "proposed_not_run",
|
| 158 |
+
"text": {
|
| 159 |
+
"es": {
|
| 160 |
+
"summary": "KVFundaBench evalúa razonamiento denso bajo compresión. ShotKV conserva ejemplos como unidades semánticas y distingue prefill de decode.",
|
| 161 |
+
"limit": "Recuperar una clave no demuestra que se conserve una cadena de razonamiento. Sus mejoras no son una garantía para cualquier modelo o política de caché.",
|
| 162 |
+
"experiment": "Comparar recuperación y razonamiento con presupuestos equivalentes. Registrar el efecto de conservar ejemplos completos y separar prefill y decode."
|
| 163 |
+
},
|
| 164 |
+
"en": {
|
| 165 |
+
"summary": "KVFundaBench evaluates dense reasoning under compression. ShotKV preserves examples as semantic units and distinguishes prefill from decode.",
|
| 166 |
+
"limit": "Retrieving a key does not establish preservation of reasoning. Reported gains are not guarantees for every model or cache policy.",
|
| 167 |
+
"experiment": "Compare retrieval and reasoning under comparable budgets. Record the effect of preserving intact examples and separate prefill from decode."
|
| 168 |
+
},
|
| 169 |
+
"fr": {
|
| 170 |
+
"summary": "KVFundaBench évalue le raisonnement dense sous compression. ShotKV préserve les exemples comme unités sémantiques et distingue prefill et décodage.",
|
| 171 |
+
"limit": "Retrouver une clé ne prouve pas que le raisonnement est préservé. Les gains rapportés ne sont pas garantis pour tout modèle ou politique de cache.",
|
| 172 |
+
"experiment": "Comparer récupération et raisonnement à budgets comparables. Mesurer l’effet des exemples conservés entiers et séparer prefill et décodage."
|
| 173 |
+
},
|
| 174 |
+
"zh": {
|
| 175 |
+
"summary": "KVFundaBench 评估压缩下的高密度推理。ShotKV 将示例作为完整语义单元保留,并区分预填充与解码阶段。",
|
| 176 |
+
"limit": "能够检索出键值,不等于推理链得到保留。论文报告的收益不是对所有模型或缓存策略的保证。",
|
| 177 |
+
"experiment": "以可比预算测试检索和推理,记录完整保留示例的效果,并分别测量预填充与解码。"
|
| 178 |
+
}
|
| 179 |
+
}
|
| 180 |
+
},
|
| 181 |
+
{
|
| 182 |
+
"id": "mem2act",
|
| 183 |
+
"title": "Mem2ActBench: A Benchmark for Evaluating Long-Term Memory Utilization in Task-Oriented Autonomous Agents",
|
| 184 |
+
"date": "2026-07",
|
| 185 |
+
"status": "published",
|
| 186 |
+
"venue": "ACL 2026",
|
| 187 |
+
"url": "https://aclanthology.org/2026.acl-long.370/",
|
| 188 |
+
"topics": [
|
| 189 |
+
"memory",
|
| 190 |
+
"evaluation"
|
| 191 |
+
],
|
| 192 |
+
"modes": [],
|
| 193 |
+
"guide": {
|
| 194 |
+
"chapter": "32-agentes",
|
| 195 |
+
"anchor": "sec-memoria-accion"
|
| 196 |
+
},
|
| 197 |
+
"taf_validation": "not_established",
|
| 198 |
+
"experiment_status": "proposed_not_run",
|
| 199 |
+
"text": {
|
| 200 |
+
"es": {
|
| 201 |
+
"summary": "Evalúa si un agente usa memoria a largo plazo para elegir herramientas y completar sus parámetros, además de recuperar hechos.",
|
| 202 |
+
"limit": "La memoria externa de un agente no es la caché KV ni el residual. TAF no ejecuta este benchmark ni predice su puntuación desde config.json.",
|
| 203 |
+
"experiment": "Comparar sin memoria, memoria recuperada y evidencia pertinente entregada directamente. Evaluar herramienta, parámetros y estado final en un entorno de prueba."
|
| 204 |
+
},
|
| 205 |
+
"en": {
|
| 206 |
+
"summary": "Tests whether an agent uses long-term memory to choose tools and fill their parameters, beyond retrieving facts.",
|
| 207 |
+
"limit": "External agent memory is neither KV cache nor residual state. TAF does not run this benchmark or predict its score from config.json.",
|
| 208 |
+
"experiment": "Compare no memory, retrieved memory and directly supplied relevant evidence. Evaluate tool choice, parameters and final state in a test environment."
|
| 209 |
+
},
|
| 210 |
+
"fr": {
|
| 211 |
+
"summary": "Teste si un agent utilise sa mémoire à long terme pour choisir des outils et renseigner leurs paramètres, au-delà du rappel de faits.",
|
| 212 |
+
"limit": "La mémoire externe d’un agent n’est ni le cache KV ni le résidu. TAF n’exécute pas ce benchmark et ne prédit pas son score depuis config.json.",
|
| 213 |
+
"experiment": "Comparer absence de mémoire, mémoire récupérée et preuves pertinentes fournies directement. Évaluer outil, paramètres et état final en environnement de test."
|
| 214 |
+
},
|
| 215 |
+
"zh": {
|
| 216 |
+
"summary": "检验智能体能否利用长期记忆选择工具并填写参数,而不只是回忆事实。",
|
| 217 |
+
"limit": "智能体的外部记忆不同于 KV 缓存和残差状态。TAF 不运行此基准,也不根据 config.json 预测其得分。",
|
| 218 |
+
"experiment": "对比无记忆、检索记忆、直接提供相关证据三种条件;在测试环境中评估工具选择、参数和最终状态。"
|
| 219 |
+
}
|
| 220 |
+
}
|
| 221 |
+
},
|
| 222 |
+
{
|
| 223 |
+
"id": "blockgtq",
|
| 224 |
+
"title": "RoPE-Aware Bit Allocation for KV-Cache Quantization",
|
| 225 |
+
"date": "2026-06-23",
|
| 226 |
+
"status": "preprint",
|
| 227 |
+
"venue": "arXiv v1",
|
| 228 |
+
"url": "https://arxiv.org/abs/2606.24033v1",
|
| 229 |
+
"topics": [
|
| 230 |
+
"quantization",
|
| 231 |
+
"compression"
|
| 232 |
+
],
|
| 233 |
+
"modes": [
|
| 234 |
+
"quant",
|
| 235 |
+
"fitcheck"
|
| 236 |
+
],
|
| 237 |
+
"guide": {
|
| 238 |
+
"chapter": "35-compresion",
|
| 239 |
+
"anchor": "sec-kv-bits-rope"
|
| 240 |
+
},
|
| 241 |
+
"taf_validation": "not_established",
|
| 242 |
+
"experiment_status": "proposed_not_run",
|
| 243 |
+
"text": {
|
| 244 |
+
"es": {
|
| 245 |
+
"summary": "Block-GTQ reparte bits entre bloques de claves asociados a RoPE según su energía, por capa y cabeza KV, en vez de usar precisión uniforme.",
|
| 246 |
+
"limit": "Menor error de logits no garantiza una mejora igual en cualquier tarea o motor. Hay que contar escalas, metadatos y soporte del kernel.",
|
| 247 |
+
"experiment": "A igual presupuesto de bytes, comparar bits uniformes y asignación por bloques. Cruzar cuantización sola, recorte solo y ambos; medir calidad y latencia."
|
| 248 |
+
},
|
| 249 |
+
"en": {
|
| 250 |
+
"summary": "Block-GTQ allocates bits across RoPE key blocks using their energy per layer and KV head, instead of uniform precision.",
|
| 251 |
+
"limit": "Lower logit error does not guarantee equal gains on every task or engine. Count scales, metadata and kernel support.",
|
| 252 |
+
"experiment": "At matched byte budgets, compare uniform bits with block allocation. Cross quantization alone, truncation alone and both; measure quality and latency."
|
| 253 |
+
},
|
| 254 |
+
"fr": {
|
| 255 |
+
"summary": "Block-GTQ répartit les bits entre blocs de clés RoPE selon leur énergie, par couche et tête KV, plutôt que d’utiliser une précision uniforme.",
|
| 256 |
+
"limit": "Une erreur de logits réduite ne garantit pas les mêmes gains partout. Compter échelles, métadonnées et prise en charge par le kernel.",
|
| 257 |
+
"experiment": "À budget en octets égal, comparer bits uniformes et allocation par blocs. Croiser quantification seule, troncature seule et les deux ; mesurer qualité et latence."
|
| 258 |
+
},
|
| 259 |
+
"zh": {
|
| 260 |
+
"summary": "Block-GTQ 根据每层、每个 KV 头中 RoPE 键块的能量分配位数,而非使用统一精度。",
|
| 261 |
+
"limit": "logit 误差降低并不保证所有任务或引擎均有同等收益;还需计入缩放系数、元数据和算子支持。",
|
| 262 |
+
"experiment": "在相同字节预算下比较均匀位数与分块分配;交叉测试仅量化、仅截断和两者结合,并测量质量与延迟。"
|
| 263 |
+
}
|
| 264 |
+
}
|
| 265 |
+
},
|
| 266 |
+
{
|
| 267 |
+
"id": "cre",
|
| 268 |
+
"title": "Positional Failures in Long-Context LLMs: A Blind Spot in Reasoning Benchmarks",
|
| 269 |
+
"date": "2026-05-22",
|
| 270 |
+
"status": "preprint",
|
| 271 |
+
"venue": "arXiv v1",
|
| 272 |
+
"url": "https://arxiv.org/abs/2605.23170v1",
|
| 273 |
+
"topics": [
|
| 274 |
+
"context",
|
| 275 |
+
"evaluation"
|
| 276 |
+
],
|
| 277 |
+
"modes": [
|
| 278 |
+
"niah",
|
| 279 |
+
"longscore",
|
| 280 |
+
"yarn"
|
| 281 |
+
],
|
| 282 |
+
"guide": {
|
| 283 |
+
"chapter": "19-contexto-largo",
|
| 284 |
+
"anchor": "sec-contexto-evidencia"
|
| 285 |
+
},
|
| 286 |
+
"taf_validation": "not_established",
|
| 287 |
+
"experiment_status": "proposed_not_run",
|
| 288 |
+
"text": {
|
| 289 |
+
"es": {
|
| 290 |
+
"summary": "CRE controla posición de la tarea, contenido de relleno y longitud para detectar fallos que una puntuación global de razonamiento puede ocultar.",
|
| 291 |
+
"limit": "La sensibilidad posicional varía entre modelos y tipos de relleno. No se debe convertir una caída concreta en una penalización universal.",
|
| 292 |
+
"experiment": "Mover la misma pregunta entre principio, centro y final; mantener respuesta y longitud. Repetir con varios rellenos y publicar resultados por condición."
|
| 293 |
+
},
|
| 294 |
+
"en": {
|
| 295 |
+
"summary": "CRE controls task position, filler content and length to expose failures that an aggregate reasoning score can hide.",
|
| 296 |
+
"limit": "Positional sensitivity varies across models and filler types. A particular drop must not become a universal penalty.",
|
| 297 |
+
"experiment": "Move the same question between start, middle and end while holding answer and length fixed. Repeat with different fillers and report each condition."
|
| 298 |
+
},
|
| 299 |
+
"fr": {
|
| 300 |
+
"summary": "CRE contrôle position de la tâche, contenu de remplissage et longueur pour révéler des échecs masqués par un score global de raisonnement.",
|
| 301 |
+
"limit": "La sensibilité à la position varie selon le modèle et le remplissage. Une chute particulière ne doit pas devenir une pénalité universelle.",
|
| 302 |
+
"experiment": "Déplacer la même question au début, au milieu et à la fin, à réponse et longueur fixes. Varier les remplissages et publier chaque condition."
|
| 303 |
+
},
|
| 304 |
+
"zh": {
|
| 305 |
+
"summary": "CRE 控制任务位置、填充内容和上下文长度,揭示总体推理得分可能掩盖的失败。",
|
| 306 |
+
"limit": "位置敏感性因模型和填充类型而异,不能将某次得分下降转化为通用惩罚系数。",
|
| 307 |
+
"experiment": "固定答案与长度,把相同问题放在开头、中间和结尾;更换填充内容重复测试,并按条件报告结果。"
|
| 308 |
+
}
|
| 309 |
+
}
|
| 310 |
+
}
|
| 311 |
+
]
|
| 312 |
+
}
|
index.html
CHANGED
|
@@ -52,6 +52,7 @@
|
|
| 52 |
<button id="inventory-btn" type="button" data-i18n="hero.inventory_btn">🧰 What it gives you</button>
|
| 53 |
<button id="help-btn" type="button" data-i18n="hero.help">📘 Manual & examples</button>
|
| 54 |
<button id="guide-btn" type="button" data-i18n="hero.guide">📖 Guide</button>
|
|
|
|
| 55 |
</p>
|
| 56 |
</header>
|
| 57 |
|
|
@@ -61,6 +62,11 @@
|
|
| 61 |
<button class="help-close" id="help-close" aria-label="Close help">×</button>
|
| 62 |
<h2 id="help-modal-title" data-i18n="help.title">📘 TAF Agent — User Manual</h2>
|
| 63 |
<div class="help-cards">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
<details class="inv-card" open>
|
| 65 |
<summary class="inv-card-title" data-i18n="help.what.title">What does it do?</summary>
|
| 66 |
<p data-i18n="help.what.body">Predicts <strong>practical viability</strong> of any transformer LLM
|
|
@@ -526,6 +532,7 @@
|
|
| 526 |
<button data-mode-link="arena" data-i18n="modes.arena">🎯 Arena CI</button>
|
| 527 |
<button data-mode-link="saturation" data-i18n="modes.saturation">📈 Saturation</button>
|
| 528 |
<button data-mode-link="hub" data-i18n="modes.hub">🧭 Solutions</button>
|
|
|
|
| 529 |
</div>
|
| 530 |
</div>
|
| 531 |
<div class="task-tile">
|
|
@@ -610,6 +617,7 @@
|
|
| 610 |
<button class="mode-btn" data-mode="tax" role="tab" aria-selected="false" data-i18n="modes.tax">🌍 Token Tax</button>
|
| 611 |
<button class="mode-btn" data-mode="longscore" role="tab" aria-selected="false" data-i18n="modes.longscore">🎯 LongScore</button>
|
| 612 |
<button class="mode-btn" data-mode="hub" role="tab" aria-selected="false" data-i18n="modes.hub">🧭 Solutions</button>
|
|
|
|
| 613 |
<button class="mode-btn" data-mode="yarn" role="tab" aria-selected="false" data-i18n="modes.yarn">🧵 YaRN Planner</button>
|
| 614 |
<button class="mode-btn" data-mode="gguf" role="tab" aria-selected="false" data-i18n="modes.gguf">🧊 GGUF Bridge</button>
|
| 615 |
<button class="mode-btn" data-mode="launch" role="tab" aria-selected="false" data-i18n="modes.launch">🚀 Launch Flags</button>
|
|
@@ -1450,6 +1458,27 @@
|
|
| 1450 |
</p>
|
| 1451 |
</section>
|
| 1452 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1453 |
<section id="hub-section" style="display:none;">
|
| 1454 |
<h2><span data-i18n="hub.title">🧭 Solutions Hub</span>
|
| 1455 |
<span class="info"><span class="tooltip" data-i18n="hub.tip">
|
|
|
|
| 52 |
<button id="inventory-btn" type="button" data-i18n="hero.inventory_btn">🧰 What it gives you</button>
|
| 53 |
<button id="help-btn" type="button" data-i18n="hero.help">📘 Manual & examples</button>
|
| 54 |
<button id="guide-btn" type="button" data-i18n="hero.guide">📖 Guide</button>
|
| 55 |
+
<button type="button" data-mode-link="research" data-i18n="modes.research">📚 Research</button>
|
| 56 |
</p>
|
| 57 |
</header>
|
| 58 |
|
|
|
|
| 62 |
<button class="help-close" id="help-close" aria-label="Close help">×</button>
|
| 63 |
<h2 id="help-modal-title" data-i18n="help.title">📘 TAF Agent — User Manual</h2>
|
| 64 |
<div class="help-cards">
|
| 65 |
+
<details class="inv-card">
|
| 66 |
+
<summary class="inv-card-title" data-i18n="research.title">📚 Research connected to the guide</summary>
|
| 67 |
+
<p data-i18n="research.help">A dated reading list with primary sources, guide chapters and proposed experiments. Filter by topic or publication status. No model execution or automatic updates.</p>
|
| 68 |
+
<a href="?mode=research#research-section" data-i18n="modes.research">📚 Research</a>
|
| 69 |
+
</details>
|
| 70 |
<details class="inv-card" open>
|
| 71 |
<summary class="inv-card-title" data-i18n="help.what.title">What does it do?</summary>
|
| 72 |
<p data-i18n="help.what.body">Predicts <strong>practical viability</strong> of any transformer LLM
|
|
|
|
| 532 |
<button data-mode-link="arena" data-i18n="modes.arena">🎯 Arena CI</button>
|
| 533 |
<button data-mode-link="saturation" data-i18n="modes.saturation">📈 Saturation</button>
|
| 534 |
<button data-mode-link="hub" data-i18n="modes.hub">🧭 Solutions</button>
|
| 535 |
+
<button data-mode-link="research" data-i18n="modes.research">📚 Research</button>
|
| 536 |
</div>
|
| 537 |
</div>
|
| 538 |
<div class="task-tile">
|
|
|
|
| 617 |
<button class="mode-btn" data-mode="tax" role="tab" aria-selected="false" data-i18n="modes.tax">🌍 Token Tax</button>
|
| 618 |
<button class="mode-btn" data-mode="longscore" role="tab" aria-selected="false" data-i18n="modes.longscore">🎯 LongScore</button>
|
| 619 |
<button class="mode-btn" data-mode="hub" role="tab" aria-selected="false" data-i18n="modes.hub">🧭 Solutions</button>
|
| 620 |
+
<button class="mode-btn" data-mode="research" role="tab" aria-selected="false" data-i18n="modes.research">📚 Research</button>
|
| 621 |
<button class="mode-btn" data-mode="yarn" role="tab" aria-selected="false" data-i18n="modes.yarn">🧵 YaRN Planner</button>
|
| 622 |
<button class="mode-btn" data-mode="gguf" role="tab" aria-selected="false" data-i18n="modes.gguf">🧊 GGUF Bridge</button>
|
| 623 |
<button class="mode-btn" data-mode="launch" role="tab" aria-selected="false" data-i18n="modes.launch">🚀 Launch Flags</button>
|
|
|
|
| 1458 |
</p>
|
| 1459 |
</section>
|
| 1460 |
|
| 1461 |
+
<section id="research-section" style="display:none;">
|
| 1462 |
+
<h2 data-i18n="research.title">📚 Research connected to the guide</h2>
|
| 1463 |
+
<p class="recipe-desc" data-i18n="research.intro">From paper to experiment: explore what each study adds, read the corresponding chapter and decide what to test in TAF.</p>
|
| 1464 |
+
<p class="research-note" data-i18n="research.note">Curated reading list, updated manually. These studies do not establish validation of TAF. Related tools show current functionality; proposed experiments have not been run here.</p>
|
| 1465 |
+
<p id="research-reviewed" class="subtle"></p>
|
| 1466 |
+
<div class="research-filters">
|
| 1467 |
+
<label for="research-search"><span data-i18n="research.search">Search studies</span>
|
| 1468 |
+
<input id="research-search" type="search" data-i18n-placeholder="research.placeholder" placeholder="Title, concept or experiment…" />
|
| 1469 |
+
</label>
|
| 1470 |
+
<label for="research-topic"><span data-i18n="research.topic">Topic</span><select id="research-topic"></select></label>
|
| 1471 |
+
<label for="research-publication"><span data-i18n="research.status">Publication status</span><select id="research-publication"></select></label>
|
| 1472 |
+
</div>
|
| 1473 |
+
<div class="research-actions">
|
| 1474 |
+
<button type="button" id="research-clear" class="secondary" data-i18n="research.clear">Clear filters</button>
|
| 1475 |
+
<button type="button" id="research-export" class="secondary" disabled data-i18n="research.export">Download selection (JSON)</button>
|
| 1476 |
+
</div>
|
| 1477 |
+
<p id="research-status" class="recipe-desc" role="status" aria-live="polite"></p>
|
| 1478 |
+
<button type="button" id="research-retry" hidden data-i18n="research.retry">Retry</button>
|
| 1479 |
+
<div id="research-output" class="research-grid"></div>
|
| 1480 |
+
</section>
|
| 1481 |
+
|
| 1482 |
<section id="hub-section" style="display:none;">
|
| 1483 |
<h2><span data-i18n="hub.title">🧭 Solutions Hub</span>
|
| 1484 |
<span class="info"><span class="tooltip" data-i18n="hub.tip">
|
js/i18n.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
// TAF Agent i18n — minimal translation system.
|
| 2 |
// Add languages by extending TRANSLATIONS. Set data-i18n="key" on any element.
|
| 3 |
// Persist user choice in localStorage.
|
|
|
|
| 4 |
|
| 5 |
export const LANGUAGES = [
|
| 6 |
{ code: "en", flag: "🇬🇧", label: "English" },
|
|
@@ -6588,6 +6589,10 @@ Object.assign(TRANSLATIONS.zh, {
|
|
| 6588 |
"inv.v013.delta": "<strong>📐 δ 带线索</strong> —— 对于图谱模型,J-lens 优势带位置的探索性线索 (H16,诚实标注)",
|
| 6589 |
"inv.v013.honesty": "<strong>⚠ 诚实边界</strong> —— L_crit 不是 commitment knee;传输 / 写入 / commitment 是测量的,不是推导的。无推理。",
|
| 6590 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6591 |
let currentLang = "en";
|
| 6592 |
|
| 6593 |
export function getLang() {
|
|
|
|
| 1 |
// TAF Agent i18n — minimal translation system.
|
| 2 |
// Add languages by extending TRANSLATIONS. Set data-i18n="key" on any element.
|
| 3 |
// Persist user choice in localStorage.
|
| 4 |
+
import { RESEARCH_TRANSLATIONS } from "./research_i18n.js";
|
| 5 |
|
| 6 |
export const LANGUAGES = [
|
| 7 |
{ code: "en", flag: "🇬🇧", label: "English" },
|
|
|
|
| 6589 |
"inv.v013.delta": "<strong>📐 δ 带线索</strong> —— 对于图谱模型,J-lens 优势带位置的探索性线索 (H16,诚实标注)",
|
| 6590 |
"inv.v013.honesty": "<strong>⚠ 诚实边界</strong> —— L_crit 不是 commitment knee;传输 / 写入 / commitment 是测量的,不是推导的。无推理。",
|
| 6591 |
});
|
| 6592 |
+
for (const [language, entries] of Object.entries(RESEARCH_TRANSLATIONS)) {
|
| 6593 |
+
Object.assign(TRANSLATIONS[language], entries);
|
| 6594 |
+
}
|
| 6595 |
+
|
| 6596 |
let currentLang = "en";
|
| 6597 |
|
| 6598 |
export function getLang() {
|
js/main.js
CHANGED
|
@@ -48,6 +48,7 @@ import { planExtension, suggestRopeType } from "./yarn_planner.js";
|
|
| 48 |
import { listGgufFiles, fetchGgufMetadata, ggufToConfig, quantFromFilename, analyzeGguf } from "./gguf_bridge.js";
|
| 49 |
import { checkFit } from "./fit_check.js";
|
| 50 |
import { GPU_PRESETS, QUANT_BPW, planLaunch, launchCommands } from "./launch_flags.js";
|
|
|
|
| 51 |
|
| 52 |
// Attach HF Hub search-as-you-type to all 5 model id inputs (Profile, Recipe,
|
| 53 |
// Unmask, Template, Quant). Hits public huggingface.co/api/models. Idempotent.
|
|
@@ -254,6 +255,7 @@ document.addEventListener("click", (e) => {
|
|
| 254 |
launch: "launch-section",
|
| 255 |
fitcheck: "fitcheck-section",
|
| 256 |
depth: "depth-section",
|
|
|
|
| 257 |
}[targetMode];
|
| 258 |
if (sectionId) {
|
| 259 |
const sec = document.getElementById(sectionId);
|
|
@@ -278,7 +280,7 @@ document.querySelectorAll(".mode-btn").forEach(btn => {
|
|
| 278 |
"diagnose-section", "phase-section", "unmask-section", "memreal-section", "adapter-section", "pvr-section",
|
| 279 |
"template-section", "arena-section", "contam-section",
|
| 280 |
"quant-section", "drift-section", "niah-section",
|
| 281 |
-
"saturation-section", "cot-section", "peft-section", "cache-section", "speculative-section", "tax-section", "longscore-section", "hub-section", "yarn-section", "gguf-section", "launch-section", "fitcheck-section", "depth-section"].forEach(id => {
|
| 282 |
const el = $(id);
|
| 283 |
if (el) el.style.display = "none";
|
| 284 |
});
|
|
@@ -303,6 +305,7 @@ document.querySelectorAll(".mode-btn").forEach(btn => {
|
|
| 303 |
launch: "launch-section",
|
| 304 |
fitcheck: "fitcheck-section",
|
| 305 |
depth: "depth-section",
|
|
|
|
| 306 |
};
|
| 307 |
const sectionId = sectionMap[mode];
|
| 308 |
if (sectionId) $(sectionId).style.display = "";
|
|
@@ -320,6 +323,7 @@ document.querySelectorAll(".mode-btn").forEach(btn => {
|
|
| 320 |
if (mode === "gguf") initGguf();
|
| 321 |
if (mode === "launch") initLaunch();
|
| 322 |
if (mode === "fitcheck") initFitCheck();
|
|
|
|
| 323 |
// Re-scan: any model-id input rendered lazily by an init() above now gets the
|
| 324 |
// autocomplete dropdown too. Idempotent (WeakSet) — already-attached inputs are skipped.
|
| 325 |
attachAllHfAutocompletes();
|
|
@@ -3781,7 +3785,11 @@ document.addEventListener("DOMContentLoaded", () => {
|
|
| 3781 |
// Language switcher
|
| 3782 |
// ════════════════════════════════════════════════════════════════════
|
| 3783 |
document.querySelectorAll(".lang-btn").forEach(btn => {
|
| 3784 |
-
btn.addEventListener("click", () =>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3785 |
});
|
| 3786 |
|
| 3787 |
// ════════════════════════════════════════════════════════════════════
|
|
@@ -5653,6 +5661,11 @@ function renderFitCheck(r) {
|
|
| 5653 |
// Bootstrap
|
| 5654 |
// ════════════════════════════════════════════════════════════════════
|
| 5655 |
initI18n();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5656 |
// Pyodide-independent panels: render immediately so they survive a Pyodide
|
| 5657 |
// load failure (CDN blocked / offline / slow region). These use only fetch +
|
| 5658 |
// DOM, never state.pyodide — must NOT be gated behind enableUI().
|
|
|
|
| 48 |
import { listGgufFiles, fetchGgufMetadata, ggufToConfig, quantFromFilename, analyzeGguf } from "./gguf_bridge.js";
|
| 49 |
import { checkFit } from "./fit_check.js";
|
| 50 |
import { GPU_PRESETS, QUANT_BPW, planLaunch, launchCommands } from "./launch_flags.js";
|
| 51 |
+
import { initResearchExplorer, refreshResearchExplorer } from "./research_explorer.js";
|
| 52 |
|
| 53 |
// Attach HF Hub search-as-you-type to all 5 model id inputs (Profile, Recipe,
|
| 54 |
// Unmask, Template, Quant). Hits public huggingface.co/api/models. Idempotent.
|
|
|
|
| 255 |
launch: "launch-section",
|
| 256 |
fitcheck: "fitcheck-section",
|
| 257 |
depth: "depth-section",
|
| 258 |
+
research: "research-section",
|
| 259 |
}[targetMode];
|
| 260 |
if (sectionId) {
|
| 261 |
const sec = document.getElementById(sectionId);
|
|
|
|
| 280 |
"diagnose-section", "phase-section", "unmask-section", "memreal-section", "adapter-section", "pvr-section",
|
| 281 |
"template-section", "arena-section", "contam-section",
|
| 282 |
"quant-section", "drift-section", "niah-section",
|
| 283 |
+
"saturation-section", "cot-section", "peft-section", "cache-section", "speculative-section", "tax-section", "longscore-section", "hub-section", "yarn-section", "gguf-section", "launch-section", "fitcheck-section", "depth-section", "research-section"].forEach(id => {
|
| 284 |
const el = $(id);
|
| 285 |
if (el) el.style.display = "none";
|
| 286 |
});
|
|
|
|
| 305 |
launch: "launch-section",
|
| 306 |
fitcheck: "fitcheck-section",
|
| 307 |
depth: "depth-section",
|
| 308 |
+
research: "research-section",
|
| 309 |
};
|
| 310 |
const sectionId = sectionMap[mode];
|
| 311 |
if (sectionId) $(sectionId).style.display = "";
|
|
|
|
| 323 |
if (mode === "gguf") initGguf();
|
| 324 |
if (mode === "launch") initLaunch();
|
| 325 |
if (mode === "fitcheck") initFitCheck();
|
| 326 |
+
if (mode === "research") initResearchExplorer();
|
| 327 |
// Re-scan: any model-id input rendered lazily by an init() above now gets the
|
| 328 |
// autocomplete dropdown too. Idempotent (WeakSet) — already-attached inputs are skipped.
|
| 329 |
attachAllHfAutocompletes();
|
|
|
|
| 3785 |
// Language switcher
|
| 3786 |
// ════════════════════════════════════════════════════════════════════
|
| 3787 |
document.querySelectorAll(".lang-btn").forEach(btn => {
|
| 3788 |
+
btn.addEventListener("click", () => {
|
| 3789 |
+
setLang(btn.dataset.lang);
|
| 3790 |
+
refreshResearchExplorer();
|
| 3791 |
+
if (state.currentMode === "research") $("mode-desc").textContent = t("mode_desc.research");
|
| 3792 |
+
});
|
| 3793 |
});
|
| 3794 |
|
| 3795 |
// ════════════════════════════════════════════════════════════════════
|
|
|
|
| 5661 |
// Bootstrap
|
| 5662 |
// ════════════════════════════════════════════════════════════════════
|
| 5663 |
initI18n();
|
| 5664 |
+
// Reading studies needs neither Python nor model inference. Deep-links work even
|
| 5665 |
+
// while Pyodide is still loading or its CDN is unavailable.
|
| 5666 |
+
if (new URLSearchParams(window.location.search).get("mode") === "research") {
|
| 5667 |
+
document.querySelector('.mode-btn[data-mode="research"]')?.click();
|
| 5668 |
+
}
|
| 5669 |
// Pyodide-independent panels: render immediately so they survive a Pyodide
|
| 5670 |
// load failure (CDN blocked / offline / slow region). These use only fetch +
|
| 5671 |
// DOM, never state.pyodide — must NOT be gated behind enableUI().
|
js/research_explorer.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { getLang, t } from "./i18n.js";
|
| 2 |
+
import { TOPICS, PUBLICATION_STATUSES, validateResearchCatalog, filterResearchStudies,
|
| 3 |
+
researchGuideUrl, exportResearchSelection } from "./research_studies.js";
|
| 4 |
+
|
| 5 |
+
const $ = id => document.getElementById(id);
|
| 6 |
+
let catalog = null, pending = null, bound = false, failed = false;
|
| 7 |
+
const openCards = new Set();
|
| 8 |
+
const el = (tag, text, className) => {
|
| 9 |
+
const node = document.createElement(tag);
|
| 10 |
+
if (text !== undefined) node.textContent = text;
|
| 11 |
+
if (className) node.className = className;
|
| 12 |
+
return node;
|
| 13 |
+
};
|
| 14 |
+
function filters() {
|
| 15 |
+
return { query: $("research-search").value, topic: $("research-topic").value, status: $("research-publication").value };
|
| 16 |
+
}
|
| 17 |
+
function externalLink(label, url) {
|
| 18 |
+
const node = el("a", label);
|
| 19 |
+
node.href = url; node.target = "_blank"; node.rel = "noopener noreferrer";
|
| 20 |
+
return node;
|
| 21 |
+
}
|
| 22 |
+
function populateOptions(id, values, key) {
|
| 23 |
+
const select = $(id), selected = select.value;
|
| 24 |
+
select.replaceChildren();
|
| 25 |
+
for (const value of ["all", ...values]) {
|
| 26 |
+
const option = el("option", t(value === "all" ? "research.all" : `${key}.${value}`));
|
| 27 |
+
option.value = value; select.appendChild(option);
|
| 28 |
+
}
|
| 29 |
+
select.value = ["all", ...values].includes(selected) ? selected : "all";
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
export function refreshResearchExplorer() {
|
| 33 |
+
if (!bound) return;
|
| 34 |
+
populateOptions("research-topic", TOPICS, "research.topic");
|
| 35 |
+
populateOptions("research-publication", PUBLICATION_STATUSES, "research.status");
|
| 36 |
+
const output = $("research-output"), status = $("research-status");
|
| 37 |
+
$("research-export").disabled = true;
|
| 38 |
+
$("research-retry").hidden = !failed;
|
| 39 |
+
if (!catalog) {
|
| 40 |
+
status.textContent = t(failed ? "research.error" : "research.loading");
|
| 41 |
+
return;
|
| 42 |
+
}
|
| 43 |
+
$("research-reviewed").textContent = `${t("research.reviewed")} ${catalog.reviewed_on}`;
|
| 44 |
+
const matches = filterResearchStudies(catalog, filters());
|
| 45 |
+
status.textContent = t("research.count").replace("{shown}", matches.length).replace("{total}", catalog.papers.length);
|
| 46 |
+
output.replaceChildren();
|
| 47 |
+
$("research-export").disabled = !matches.length;
|
| 48 |
+
if (!matches.length) {
|
| 49 |
+
output.appendChild(el("p", t("research.empty"), "research-empty"));
|
| 50 |
+
return;
|
| 51 |
+
}
|
| 52 |
+
const lang = getLang();
|
| 53 |
+
$("research-section").lang = lang;
|
| 54 |
+
for (const paper of matches) {
|
| 55 |
+
const card = el("article", undefined, "research-card");
|
| 56 |
+
card.dataset.paper = paper.id;
|
| 57 |
+
const meta = el("div", undefined, "research-meta");
|
| 58 |
+
meta.append(el("span", t(`research.status.${paper.status}`), `research-badge research-${paper.status}`),
|
| 59 |
+
el("span", `${paper.venue} · ${paper.date}`));
|
| 60 |
+
const heading = el("h3", paper.title); heading.lang = "en";
|
| 61 |
+
const tags = el("p", paper.topics.map(topic => t(`research.topic.${topic}`)).join(" · "), "subtle");
|
| 62 |
+
card.append(meta, heading, tags, el("p", paper.text[lang].summary));
|
| 63 |
+
const details = el("details");
|
| 64 |
+
details.open = openCards.has(paper.id);
|
| 65 |
+
details.appendChild(el("summary", t("research.details")));
|
| 66 |
+
const description = el("dl");
|
| 67 |
+
description.append(el("dt", t("research.limit")), el("dd", paper.text[lang].limit),
|
| 68 |
+
el("dt", t("research.experiment")), el("dd", paper.text[lang].experiment));
|
| 69 |
+
details.appendChild(description);
|
| 70 |
+
details.addEventListener("toggle", () => {
|
| 71 |
+
// Removed DOM nodes can emit queued toggle events during a language refresh.
|
| 72 |
+
if (!details.isConnected) return;
|
| 73 |
+
if (details.open) openCards.add(paper.id); else openCards.delete(paper.id);
|
| 74 |
+
});
|
| 75 |
+
const links = el("div", undefined, "research-links");
|
| 76 |
+
links.append(externalLink(t("research.paper"), paper.url), externalLink(t("research.guide"), researchGuideUrl(paper, lang)));
|
| 77 |
+
card.append(details, links);
|
| 78 |
+
if (paper.modes.length) {
|
| 79 |
+
const modes = el("div", undefined, "research-tools");
|
| 80 |
+
modes.appendChild(el("p", t("research.tools"), "subtle"));
|
| 81 |
+
for (const mode of paper.modes) {
|
| 82 |
+
const button = el("button", t(`modes.${mode}`), "secondary");
|
| 83 |
+
button.type = "button"; button.dataset.modeLink = mode;
|
| 84 |
+
modes.appendChild(button);
|
| 85 |
+
}
|
| 86 |
+
card.appendChild(modes);
|
| 87 |
+
}
|
| 88 |
+
output.appendChild(card);
|
| 89 |
+
}
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
export function initResearchExplorer() {
|
| 93 |
+
if (!$("research-section")) return Promise.resolve();
|
| 94 |
+
if (!bound) {
|
| 95 |
+
bound = true;
|
| 96 |
+
$("research-search").addEventListener("input", refreshResearchExplorer);
|
| 97 |
+
for (const id of ["research-topic", "research-publication"]) $(id).addEventListener("change", refreshResearchExplorer);
|
| 98 |
+
$("research-clear").addEventListener("click", () => {
|
| 99 |
+
$("research-search").value = "";
|
| 100 |
+
$("research-topic").value = "all"; $("research-publication").value = "all";
|
| 101 |
+
refreshResearchExplorer();
|
| 102 |
+
});
|
| 103 |
+
$("research-retry").addEventListener("click", () => initResearchExplorer());
|
| 104 |
+
$("research-export").addEventListener("click", () => {
|
| 105 |
+
if (!catalog) return;
|
| 106 |
+
try {
|
| 107 |
+
const data = exportResearchSelection(catalog, filters(), getLang());
|
| 108 |
+
const blob = new Blob([JSON.stringify(data, null, 2)], {type: "application/json"});
|
| 109 |
+
const url = URL.createObjectURL(blob);
|
| 110 |
+
const a = el("a"); a.href = url; a.download = `taf-studies-${catalog.reviewed_on}-${getLang()}.json`;
|
| 111 |
+
document.body.appendChild(a); a.click(); a.remove();
|
| 112 |
+
setTimeout(() => URL.revokeObjectURL(url), 1000);
|
| 113 |
+
} catch {
|
| 114 |
+
$("research-status").textContent = t("research.export_error");
|
| 115 |
+
}
|
| 116 |
+
});
|
| 117 |
+
}
|
| 118 |
+
if (catalog) { refreshResearchExplorer(); return Promise.resolve(); }
|
| 119 |
+
if (pending) return pending;
|
| 120 |
+
failed = false;
|
| 121 |
+
refreshResearchExplorer();
|
| 122 |
+
pending = (async () => {
|
| 123 |
+
try {
|
| 124 |
+
const response = await fetch(new URL("../data/research_studies.json", import.meta.url));
|
| 125 |
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
| 126 |
+
catalog = validateResearchCatalog(await response.json());
|
| 127 |
+
} catch {
|
| 128 |
+
failed = true;
|
| 129 |
+
} finally {
|
| 130 |
+
pending = null;
|
| 131 |
+
refreshResearchExplorer();
|
| 132 |
+
}
|
| 133 |
+
})();
|
| 134 |
+
return pending;
|
| 135 |
+
}
|
js/research_i18n.js
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Labels for the research explorer; paper titles remain in their original language.
|
| 2 |
+
export const RESEARCH_TRANSLATIONS = {
|
| 3 |
+
en: {
|
| 4 |
+
"modes.research": "📚 Research",
|
| 5 |
+
"mode_desc.research": "Recent studies, their limits and experiments to assess their relevance to TAF.",
|
| 6 |
+
"research.title": "📚 Research connected to the guide",
|
| 7 |
+
"research.intro": "From paper to experiment: explore what each study adds, read the corresponding chapter and decide what to test in TAF.",
|
| 8 |
+
"research.note": "Curated reading list, updated manually. These studies do not establish validation of TAF. Related tools show current functionality; proposed experiments have not been run here.",
|
| 9 |
+
"research.reviewed": "Sources reviewed on",
|
| 10 |
+
"research.search": "Search studies",
|
| 11 |
+
"research.placeholder": "Title, concept or experiment…",
|
| 12 |
+
"research.topic": "Topic",
|
| 13 |
+
"research.status": "Publication status",
|
| 14 |
+
"research.all": "All",
|
| 15 |
+
"research.topic.context": "Long context",
|
| 16 |
+
"research.topic.compression": "KV compression",
|
| 17 |
+
"research.topic.sinks": "Attention sinks",
|
| 18 |
+
"research.topic.quantization": "Quantization",
|
| 19 |
+
"research.topic.memory": "Agent memory",
|
| 20 |
+
"research.topic.evaluation": "Evaluation",
|
| 21 |
+
"research.status.published": "Published",
|
| 22 |
+
"research.status.accepted": "Accepted",
|
| 23 |
+
"research.status.preprint": "Preprint",
|
| 24 |
+
"research.clear": "Clear filters",
|
| 25 |
+
"research.export": "Download selection (JSON)",
|
| 26 |
+
"research.count": "{shown} of {total} studies · newest version first",
|
| 27 |
+
"research.loading": "Loading the reading list…",
|
| 28 |
+
"research.error": "Could not load the reading list. Check your connection and retry.",
|
| 29 |
+
"research.retry": "Retry",
|
| 30 |
+
"research.empty": "No studies match these filters. Try another term or clear the filters.",
|
| 31 |
+
"research.details": "Limits and proposed experiment",
|
| 32 |
+
"research.limit": "What it does not establish",
|
| 33 |
+
"research.experiment": "Experiment to run · not evaluated here",
|
| 34 |
+
"research.paper": "Primary source",
|
| 35 |
+
"research.guide": "Read the guide (English)",
|
| 36 |
+
"research.tools": "Explore current tools",
|
| 37 |
+
"research.export_error": "Could not download the selection. Please try again.",
|
| 38 |
+
"research.help": "A dated selection of studies on long context, KV compression, sinks, quantization and agent memory. Filter by topic or publication status, open the original source and the corresponding guide chapter, or download your selection with its proposed experiments. No model execution or automatic updates.",
|
| 39 |
+
},
|
| 40 |
+
es: {
|
| 41 |
+
"modes.research": "📚 Estudios",
|
| 42 |
+
"mode_desc.research": "Estudios recientes, sus límites y experimentos para valorar su incorporación a TAF.",
|
| 43 |
+
"research.title": "📚 Estudios conectados con la guía",
|
| 44 |
+
"research.intro": "Del artículo al experimento: consulta qué aporta cada estudio, lee el capítulo correspondiente y decide qué probar en TAF.",
|
| 45 |
+
"research.note": "Selección de lecturas actualizada manualmente. Estos estudios no establecen una validación de TAF. Las herramientas enlazadas muestran funciones actuales; los experimentos propuestos no se han ejecutado aquí.",
|
| 46 |
+
"research.reviewed": "Fuentes revisadas el",
|
| 47 |
+
"research.search": "Buscar estudios",
|
| 48 |
+
"research.placeholder": "Título, concepto o experimento…",
|
| 49 |
+
"research.topic": "Tema",
|
| 50 |
+
"research.status": "Estado de publicación",
|
| 51 |
+
"research.all": "Todos",
|
| 52 |
+
"research.topic.context": "Contexto largo",
|
| 53 |
+
"research.topic.compression": "Compresión KV",
|
| 54 |
+
"research.topic.sinks": "Sumideros de atención",
|
| 55 |
+
"research.topic.quantization": "Cuantización",
|
| 56 |
+
"research.topic.memory": "Memoria de agentes",
|
| 57 |
+
"research.topic.evaluation": "Evaluación",
|
| 58 |
+
"research.status.published": "Publicado",
|
| 59 |
+
"research.status.accepted": "Aceptado",
|
| 60 |
+
"research.status.preprint": "Preprint",
|
| 61 |
+
"research.clear": "Limpiar filtros",
|
| 62 |
+
"research.export": "Descargar selección (JSON)",
|
| 63 |
+
"research.count": "{shown} de {total} estudios · versión más reciente primero",
|
| 64 |
+
"research.loading": "Cargando la selección de lecturas…",
|
| 65 |
+
"research.error": "No se pudo cargar la selección. Comprueba la conexión y reintenta.",
|
| 66 |
+
"research.retry": "Reintentar",
|
| 67 |
+
"research.empty": "Ningún estudio coincide con estos filtros. Prueba otro término o limpia los filtros.",
|
| 68 |
+
"research.details": "Límites y experimento propuesto",
|
| 69 |
+
"research.limit": "Qué no demuestra",
|
| 70 |
+
"research.experiment": "Experimento por hacer · no evaluado aquí",
|
| 71 |
+
"research.paper": "Fuente primaria",
|
| 72 |
+
"research.guide": "Leer la guía (español)",
|
| 73 |
+
"research.tools": "Explorar herramientas actuales",
|
| 74 |
+
"research.export_error": "No se pudo descargar la selección. Vuelve a intentarlo.",
|
| 75 |
+
"research.help": "Selección fechada de estudios sobre contexto largo, compresión KV, sumideros, cuantización y memoria de agentes. Filtra por tema o estado de publicación, abre la fuente original y el capítulo correspondiente de la guía, o descarga tu selección con sus experimentos propuestos. Sin ejecución de modelos ni actualizaciones automáticas.",
|
| 76 |
+
},
|
| 77 |
+
fr: {
|
| 78 |
+
"modes.research": "📚 Études",
|
| 79 |
+
"mode_desc.research": "Études récentes, limites et expériences pour évaluer leur intérêt pour TAF.",
|
| 80 |
+
"research.title": "📚 Études reliées au guide",
|
| 81 |
+
"research.intro": "De l’article à l’expérience : découvrez chaque apport, lisez le chapitre associé et décidez quoi tester dans TAF.",
|
| 82 |
+
"research.note": "Sélection de lectures mise à jour manuellement. Ces études ne valident pas TAF. Les outils liés montrent les fonctions actuelles ; les expériences proposées n’ont pas été exécutées ici.",
|
| 83 |
+
"research.reviewed": "Sources vérifiées le",
|
| 84 |
+
"research.search": "Rechercher des études",
|
| 85 |
+
"research.placeholder": "Titre, concept ou expérience…",
|
| 86 |
+
"research.topic": "Sujet",
|
| 87 |
+
"research.status": "Statut de publication",
|
| 88 |
+
"research.all": "Tous",
|
| 89 |
+
"research.topic.context": "Contexte long",
|
| 90 |
+
"research.topic.compression": "Compression KV",
|
| 91 |
+
"research.topic.sinks": "Puits d’attention",
|
| 92 |
+
"research.topic.quantization": "Quantification",
|
| 93 |
+
"research.topic.memory": "Mémoire des agents",
|
| 94 |
+
"research.topic.evaluation": "Évaluation",
|
| 95 |
+
"research.status.published": "Publié",
|
| 96 |
+
"research.status.accepted": "Accepté",
|
| 97 |
+
"research.status.preprint": "Prépublication",
|
| 98 |
+
"research.clear": "Effacer les filtres",
|
| 99 |
+
"research.export": "Télécharger la sélection (JSON)",
|
| 100 |
+
"research.count": "{shown} études sur {total} · version la plus récente d’abord",
|
| 101 |
+
"research.loading": "Chargement des lectures…",
|
| 102 |
+
"research.error": "Impossible de charger la sélection. Vérifiez la connexion et réessayez.",
|
| 103 |
+
"research.retry": "Réessayer",
|
| 104 |
+
"research.empty": "Aucune étude ne correspond. Essayez un autre terme ou effacez les filtres.",
|
| 105 |
+
"research.details": "Limites et expérience proposée",
|
| 106 |
+
"research.limit": "Ce que cela n’établit pas",
|
| 107 |
+
"research.experiment": "Expérience à réaliser · non évaluée ici",
|
| 108 |
+
"research.paper": "Source primaire",
|
| 109 |
+
"research.guide": "Lire le guide (anglais)",
|
| 110 |
+
"research.tools": "Explorer les outils actuels",
|
| 111 |
+
"research.export_error": "Téléchargement impossible. Veuillez réessayer.",
|
| 112 |
+
"research.help": "Sélection datée sur le contexte long, la compression KV, les puits, la quantification et la mémoire des agents. Filtrez par sujet ou statut, ouvrez la source et le chapitre associé, ou téléchargez votre sélection avec les expériences proposées. Sans exécution de modèle ni mise à jour automatique.",
|
| 113 |
+
},
|
| 114 |
+
zh: {
|
| 115 |
+
"modes.research": "📚 研究",
|
| 116 |
+
"mode_desc.research": "查看近期研究、局限及评估其对 TAF 价值的实验方案。",
|
| 117 |
+
"research.title": "📚 与指南相连的研究",
|
| 118 |
+
"research.intro": "从论文到实验:了解每项研究的贡献,阅读相关章节,决定在 TAF 中测试什么。",
|
| 119 |
+
"research.note": "人工维护的阅读列表,不会自动更新。这些研究并不构成对 TAF 的验证。链接工具展示现有功能;所列实验尚未在此运行。",
|
| 120 |
+
"research.reviewed": "来源核查日期",
|
| 121 |
+
"research.search": "搜索研究",
|
| 122 |
+
"research.placeholder": "标题、概念或实验…",
|
| 123 |
+
"research.topic": "主题",
|
| 124 |
+
"research.status": "发表状态",
|
| 125 |
+
"research.all": "全部",
|
| 126 |
+
"research.topic.context": "长上下文",
|
| 127 |
+
"research.topic.compression": "KV 压缩",
|
| 128 |
+
"research.topic.sinks": "注意力汇聚",
|
| 129 |
+
"research.topic.quantization": "量化",
|
| 130 |
+
"research.topic.memory": "智能体记忆",
|
| 131 |
+
"research.topic.evaluation": "评估",
|
| 132 |
+
"research.status.published": "已发表",
|
| 133 |
+
"research.status.accepted": "已录用",
|
| 134 |
+
"research.status.preprint": "预印本",
|
| 135 |
+
"research.clear": "清除筛选",
|
| 136 |
+
"research.export": "下载所选研究(JSON)",
|
| 137 |
+
"research.count": "共 {total} 项,显示 {shown} 项 · 按最新版本排序",
|
| 138 |
+
"research.loading": "正在加载阅读列表…",
|
| 139 |
+
"research.error": "无法加载列表,请检查网络后重试。",
|
| 140 |
+
"research.retry": "重试",
|
| 141 |
+
"research.empty": "没有匹配的研究。请尝试其他关键词或清除筛选。",
|
| 142 |
+
"research.details": "局限与实验建议",
|
| 143 |
+
"research.limit": "未能证明什么",
|
| 144 |
+
"research.experiment": "待执行的实验 · 尚未在此评估",
|
| 145 |
+
"research.paper": "原始来源",
|
| 146 |
+
"research.guide": "阅读指南(英语)",
|
| 147 |
+
"research.tools": "查看现有工具",
|
| 148 |
+
"research.export_error": "无法下载,请重试。",
|
| 149 |
+
"research.help": "带核查日期的研究列表,涵盖长上下文、KV 压缩、注意力汇聚、量化和智能体记忆。可按主题或发表状态筛选,打开原始来源与指南章节,或下载研究及实验建议。不执行模型,也不自动更新。",
|
| 150 |
+
},
|
| 151 |
+
};
|
js/research_studies.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// A curated literature index. No inference, performance estimates or TAF validation claims.
|
| 2 |
+
export const TOPICS = ["context", "compression", "sinks", "quantization", "memory", "evaluation"];
|
| 3 |
+
export const PUBLICATION_STATUSES = ["published", "accepted", "preprint"];
|
| 4 |
+
const LANGS = ["en", "es", "fr", "zh"];
|
| 5 |
+
const MODES = ["niah", "longscore", "recipe", "quant", "profile", "depth", "fitcheck", "yarn"];
|
| 6 |
+
const SOURCE_HOSTS = ["arxiv.org", "proceedings.mlr.press", "aclanthology.org"];
|
| 7 |
+
const normalize = value => String(value).normalize("NFKD").replace(/\p{M}/gu, "").toLowerCase();
|
| 8 |
+
|
| 9 |
+
export function validateResearchCatalog(catalog) {
|
| 10 |
+
if (catalog?.schema_version !== 1 || catalog.update_policy !== "curated_manual"
|
| 11 |
+
|| !/^\d{4}-\d{2}-\d{2}$/.test(catalog.reviewed_on) || !Array.isArray(catalog.papers)) {
|
| 12 |
+
throw new Error("Invalid research catalog");
|
| 13 |
+
}
|
| 14 |
+
const ids = new Set();
|
| 15 |
+
for (const p of catalog.papers) {
|
| 16 |
+
if (!/^[a-z0-9-]+$/.test(p.id) || ids.has(p.id)) throw new Error("Invalid or duplicate paper id");
|
| 17 |
+
ids.add(p.id);
|
| 18 |
+
const source = new URL(p.url);
|
| 19 |
+
if (source.protocol !== "https:" || !SOURCE_HOSTS.includes(source.hostname) || source.username || source.password) {
|
| 20 |
+
throw new Error("Invalid primary-source URL");
|
| 21 |
+
}
|
| 22 |
+
if (!p.title || !p.venue || !/^\d{4}-\d{2}(-\d{2})?$/.test(p.date)
|
| 23 |
+
|| p.date > catalog.reviewed_on || !PUBLICATION_STATUSES.includes(p.status)
|
| 24 |
+
|| p.taf_validation !== "not_established" || p.experiment_status !== "proposed_not_run"
|
| 25 |
+
|| !Array.isArray(p.topics) || !p.topics.length || p.topics.some(x => !TOPICS.includes(x))
|
| 26 |
+
|| !Array.isArray(p.modes) || p.modes.some(x => !MODES.includes(x))
|
| 27 |
+
|| !/^\d{2}-[a-z0-9-]+$/.test(p.guide?.chapter) || !/^sec-[a-z0-9-]+$/.test(p.guide?.anchor)) {
|
| 28 |
+
throw new Error(`Invalid paper metadata: ${p.id}`);
|
| 29 |
+
}
|
| 30 |
+
for (const lang of LANGS) {
|
| 31 |
+
for (const field of ["summary", "limit", "experiment"]) {
|
| 32 |
+
if (typeof p.text?.[lang]?.[field] !== "string" || !p.text[lang][field].trim()) {
|
| 33 |
+
throw new Error(`Missing ${lang}/${field}: ${p.id}`);
|
| 34 |
+
}
|
| 35 |
+
}
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
return catalog;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
export function filterResearchStudies(catalog, { query = "", topic = "all", status = "all" } = {}) {
|
| 42 |
+
const terms = normalize(query).trim().split(/\s+/).filter(Boolean);
|
| 43 |
+
return catalog.papers.filter(p => {
|
| 44 |
+
if (topic !== "all" && !p.topics.includes(topic)) return false;
|
| 45 |
+
if (status !== "all" && p.status !== status) return false;
|
| 46 |
+
const haystack = normalize([p.id, p.title, p.venue, p.url, ...p.topics,
|
| 47 |
+
...Object.values(p.text).flatMap(x => Object.values(x))].join(" "));
|
| 48 |
+
return terms.every(term => haystack.includes(term));
|
| 49 |
+
}).sort((a, b) => b.date.localeCompare(a.date) || a.id.localeCompare(b.id));
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
export function researchGuideUrl(paper, lang) {
|
| 53 |
+
const edition = lang === "es" ? "es" : "en";
|
| 54 |
+
return `https://karlesmarin.github.io/transformers-guide/${edition}/chapters/${paper.guide.chapter}.html#${paper.guide.anchor}`;
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
export function exportResearchSelection(catalog, filters, lang) {
|
| 58 |
+
const language = LANGS.includes(lang) ? lang : "en";
|
| 59 |
+
return {
|
| 60 |
+
schema_version: 1, kind: "taf_research_reading_list",
|
| 61 |
+
reviewed_on: catalog.reviewed_on, update_policy: catalog.update_policy,
|
| 62 |
+
language, filters: { ...filters },
|
| 63 |
+
papers: filterResearchStudies(catalog, filters).map(p => ({
|
| 64 |
+
id: p.id, title: p.title, date: p.date, publication_status: p.status,
|
| 65 |
+
venue: p.venue, source: p.url, guide: researchGuideUrl(p, language),
|
| 66 |
+
topics: [...p.topics], related_modes: [...p.modes],
|
| 67 |
+
taf_validation: p.taf_validation, experiment_status: p.experiment_status,
|
| 68 |
+
...p.text[language],
|
| 69 |
+
})),
|
| 70 |
+
};
|
| 71 |
+
}
|
package.json
CHANGED
|
@@ -8,7 +8,8 @@
|
|
| 8 |
"test": "tests"
|
| 9 |
},
|
| 10 |
"scripts": {
|
| 11 |
-
"test": "node tests/smoke.mjs && node tests/i18n_check.mjs && node tests/memory_reality.test.mjs && node tests/confidence.test.mjs && node tests/prediction_reality.test.mjs && node tests/adapter_reality.test.mjs && node tests/fit_check.test.mjs",
|
|
|
|
| 12 |
"test:fitcheck": "node tests/fit_check.test.mjs",
|
| 13 |
"test:smoke": "node tests/smoke.mjs",
|
| 14 |
"test:adapter": "node tests/adapter_reality.test.mjs",
|
|
|
|
| 8 |
"test": "tests"
|
| 9 |
},
|
| 10 |
"scripts": {
|
| 11 |
+
"test": "node tests/smoke.mjs && node tests/i18n_check.mjs && node tests/memory_reality.test.mjs && node tests/confidence.test.mjs && node tests/prediction_reality.test.mjs && node tests/adapter_reality.test.mjs && node tests/fit_check.test.mjs && node tests/research_studies.test.mjs",
|
| 12 |
+
"test:research": "node tests/research_studies.test.mjs",
|
| 13 |
"test:fitcheck": "node tests/fit_check.test.mjs",
|
| 14 |
"test:smoke": "node tests/smoke.mjs",
|
| 15 |
"test:adapter": "node tests/adapter_reality.test.mjs",
|
style.css
CHANGED
|
@@ -1,5 +1,31 @@
|
|
| 1 |
/* TAF Agent — minimal clean styling */
|
| 2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
/* v0.7.0 — main panels foldable (every section under <main>) */
|
| 4 |
.main-panel { margin: 0; }
|
| 5 |
.main-panel > .main-panel-title {
|
|
|
|
| 1 |
/* TAF Agent — minimal clean styling */
|
| 2 |
|
| 3 |
+
/* Literature cards follow the app's existing panels; scoped to the reading list. */
|
| 4 |
+
.research-note { padding: .7rem .9rem; border-left: 3px solid var(--warning, #d29922); background: rgba(210,153,34,.07); border-radius: 4px; }
|
| 5 |
+
.research-filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .8rem; }
|
| 6 |
+
.research-filters label { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
|
| 7 |
+
.research-filters input, .research-filters select { width: 100%; box-sizing: border-box; min-width: 0; }
|
| 8 |
+
.research-actions, .research-links { display: flex; flex-wrap: wrap; gap: .75rem; margin: .8rem 0; }
|
| 9 |
+
.research-links a { color: var(--accent, #58a6ff); text-underline-offset: .18em; }
|
| 10 |
+
.research-links a:focus-visible, .research-card summary:focus-visible { outline: 2px solid var(--accent, #58a6ff); outline-offset: 4px; }
|
| 11 |
+
.research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
|
| 12 |
+
.research-card { border: 1px solid var(--border, #30363d); border-radius: 8px; padding: 1rem; background: var(--bg-input, #12181f); overflow-wrap: anywhere; min-width: 0; }
|
| 13 |
+
.research-card h3 { font-size: 1.05rem; line-height: 1.45; margin: .75rem 0 .45rem; }
|
| 14 |
+
.research-card p, .research-card dd { line-height: 1.6; }
|
| 15 |
+
.research-meta { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; font-size: .8rem; }
|
| 16 |
+
.research-badge { border: 1px solid var(--border, #30363d); border-radius: 1rem; padding: .15rem .55rem; }
|
| 17 |
+
.research-published { color: #79c0ff; border-color: #4386b9; }
|
| 18 |
+
.research-accepted { color: #d2a8ff; border-color: #8957b1; }
|
| 19 |
+
.research-preprint { color: #e3b341; border-color: #a98119; }
|
| 20 |
+
.research-card details { margin: .8rem 0; border-top: 1px solid var(--border, #30363d); padding-top: .65rem; }
|
| 21 |
+
.research-card summary { cursor: pointer; font-weight: 600; }
|
| 22 |
+
.research-card dt { font-weight: 600; margin-top: .75rem; }
|
| 23 |
+
.research-card dd { margin: .3rem 0 .7rem; }
|
| 24 |
+
.research-tools p { margin-bottom: .4rem; font-size: .85rem; }
|
| 25 |
+
.research-tools button { margin: 0 .4rem .4rem 0; font-size: .85rem; }
|
| 26 |
+
.research-empty { grid-column: 1 / -1; }
|
| 27 |
+
@media (max-width: 720px) { .research-filters, .research-grid { grid-template-columns: 1fr; } }
|
| 28 |
+
|
| 29 |
/* v0.7.0 — main panels foldable (every section under <main>) */
|
| 30 |
.main-panel { margin: 0; }
|
| 31 |
.main-panel > .main-panel-title {
|
tests/research_browser.mjs
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// UI regression with Pyodide held pending: research must work independently.
|
| 2 |
+
// Start `python -m http.server 8877`, then `node tests/research_browser.mjs`.
|
| 3 |
+
import { chromium } from "playwright";
|
| 4 |
+
import assert from "node:assert/strict";
|
| 5 |
+
import { readFileSync, mkdirSync } from "node:fs";
|
| 6 |
+
const base = process.env.TAF_URL || "http://127.0.0.1:8877/";
|
| 7 |
+
const browser = await chromium.launch({headless:true});
|
| 8 |
+
const errors = [];
|
| 9 |
+
const shots = process.env.TAF_SCREENSHOTS;
|
| 10 |
+
if (shots) mkdirSync(shots, {recursive:true});
|
| 11 |
+
try {
|
| 12 |
+
const context = await browser.newContext({locale:"es-ES", viewport:{width:1365,height:1000}});
|
| 13 |
+
await context.route("**/pyodide.js", route => route.fulfill({contentType:"text/javascript", body:"window.loadPyodide = () => new Promise(() => {});"}));
|
| 14 |
+
const page = await context.newPage();
|
| 15 |
+
page.on("pageerror", error => errors.push(error.message));
|
| 16 |
+
await page.goto(`${base}?mode=research#research-section`);
|
| 17 |
+
await page.waitForFunction(() => document.querySelectorAll(".research-card").length === 7);
|
| 18 |
+
assert.equal(await page.locator('.mode-btn.active').getAttribute('data-mode'), 'research');
|
| 19 |
+
assert.equal(await page.locator('#research-section').getAttribute('lang'),'es');
|
| 20 |
+
await page.locator('#research-topic').selectOption('compression');
|
| 21 |
+
await page.locator('#research-publication').selectOption('published');
|
| 22 |
+
assert.equal(await page.locator('.research-card').count(),1);
|
| 23 |
+
assert.equal(await page.locator('.research-card').getAttribute('data-paper'),'shotkv');
|
| 24 |
+
await page.locator('#research-clear').click();
|
| 25 |
+
await page.locator('#research-search').fill('BLOCK-GTQ cuantizacion');
|
| 26 |
+
assert.equal(await page.locator('.research-card').getAttribute('data-paper'),'blockgtq');
|
| 27 |
+
await page.locator('.research-card summary').click();
|
| 28 |
+
await page.waitForFunction(() => document.querySelector('.research-card details').open);
|
| 29 |
+
|
| 30 |
+
for (const lang of ['fr','zh','en','es']) {
|
| 31 |
+
await page.locator(`.lang-btn[data-lang="${lang}"]`).click();
|
| 32 |
+
assert.equal(await page.locator('#research-search').inputValue(),'BLOCK-GTQ cuantizacion');
|
| 33 |
+
assert.equal(await page.locator('#research-section').getAttribute('lang'),lang);
|
| 34 |
+
assert.ok(await page.locator('.research-card details').getAttribute('open') !== null);
|
| 35 |
+
const guide=await page.locator('.research-links a').nth(1).getAttribute('href');
|
| 36 |
+
assert.ok(guide.includes(`/${lang === 'es' ? 'es' : 'en'}/chapters/`));
|
| 37 |
+
const text=await page.locator('#research-section').innerText();
|
| 38 |
+
assert.ok(!/research\.(?:topic|status|count|limit|experiment)/.test(text));
|
| 39 |
+
}
|
| 40 |
+
const downloading = page.waitForEvent('download');
|
| 41 |
+
await page.locator('#research-export').click();
|
| 42 |
+
const download=await downloading;
|
| 43 |
+
const exported=JSON.parse(readFileSync(await download.path(),'utf8'));
|
| 44 |
+
assert.equal(exported.papers.length,1);
|
| 45 |
+
assert.equal(exported.papers[0].id,'blockgtq');
|
| 46 |
+
assert.equal(exported.language,'es');
|
| 47 |
+
assert.equal(exported.papers[0].experiment_status,'proposed_not_run');
|
| 48 |
+
await page.locator('#research-search').fill('no-such-study-anywhere');
|
| 49 |
+
assert.equal(await page.locator('.research-card').count(),0);
|
| 50 |
+
assert.ok(await page.locator('#research-export').isDisabled());
|
| 51 |
+
assert.ok(await page.locator('.research-empty').isVisible());
|
| 52 |
+
await page.locator('#research-clear').click();
|
| 53 |
+
await page.locator('#research-section').scrollIntoViewIfNeeded();
|
| 54 |
+
if(shots) await page.screenshot({path:`${shots}/research-desktop.png`});
|
| 55 |
+
await page.setViewportSize({width:390,height:844});
|
| 56 |
+
await page.locator('#research-topic').selectOption('memory');
|
| 57 |
+
await page.locator('#research-section').scrollIntoViewIfNeeded();
|
| 58 |
+
const overflow=await page.locator('#research-section').evaluate(el => el.scrollWidth>el.clientWidth+2);
|
| 59 |
+
assert.equal(overflow,false,'Research panel must fit mobile width');
|
| 60 |
+
if(shots) await page.screenshot({path:`${shots}/research-mobile.png`});
|
| 61 |
+
await page.locator('#research-clear').click();
|
| 62 |
+
await page.locator('[data-paper="blockgtq"] [data-mode-link="quant"]').click();
|
| 63 |
+
assert.equal(await page.locator('.mode-btn.active').getAttribute('data-mode'),'quant');
|
| 64 |
+
assert.ok(!(await page.locator('#research-section').isVisible()));
|
| 65 |
+
await page.locator('header [data-mode-link="research"]').click();
|
| 66 |
+
assert.ok(await page.locator('#research-section').isVisible());
|
| 67 |
+
|
| 68 |
+
// A failed fetch must expose a localized retry and must not cache the failure.
|
| 69 |
+
let failCatalog=true;
|
| 70 |
+
const recovery=await context.newPage();
|
| 71 |
+
recovery.on('pageerror',e=>errors.push(e.message));
|
| 72 |
+
await recovery.route('**/data/research_studies.json',route=>failCatalog
|
| 73 |
+
? route.fulfill({status:503,body:'unavailable'}) : route.continue());
|
| 74 |
+
await recovery.goto(`${base}?mode=research#research-section`);
|
| 75 |
+
await recovery.locator('#research-retry').waitFor({state:'visible'});
|
| 76 |
+
assert.ok(await recovery.locator('#research-export').isDisabled());
|
| 77 |
+
failCatalog=false;
|
| 78 |
+
await recovery.locator('#research-retry').click();
|
| 79 |
+
await recovery.waitForFunction(()=>document.querySelectorAll('.research-card').length===7);
|
| 80 |
+
assert.ok(!(await recovery.locator('#research-retry').isVisible()));
|
| 81 |
+
assert.deepEqual(errors,[]);
|
| 82 |
+
console.log('Research UI PASS: independent startup, filters, 4 languages, export, mobile, mode links, retry.');
|
| 83 |
+
} finally {
|
| 84 |
+
await browser.close();
|
| 85 |
+
}
|
tests/research_studies.test.mjs
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import assert from "node:assert/strict";
|
| 2 |
+
import { readFileSync } from "node:fs";
|
| 3 |
+
import { validateResearchCatalog, filterResearchStudies, researchGuideUrl, exportResearchSelection } from "../js/research_studies.js";
|
| 4 |
+
import { TRANSLATIONS } from "../js/i18n.js";
|
| 5 |
+
|
| 6 |
+
const catalog = JSON.parse(readFileSync(new URL("../data/research_studies.json", import.meta.url), "utf8"));
|
| 7 |
+
validateResearchCatalog(catalog);
|
| 8 |
+
const before = JSON.stringify(catalog);
|
| 9 |
+
assert.equal(catalog.papers.length, 7);
|
| 10 |
+
assert.equal(filterResearchStudies(catalog)[0].id, "lurch");
|
| 11 |
+
assert.deepEqual(filterResearchStudies(catalog, {topic: "context"}).map(x => x.id), ["lurch", "cre"]);
|
| 12 |
+
assert.equal(filterResearchStudies(catalog, {topic: "compression", status: "published"})[0].id, "shotkv");
|
| 13 |
+
assert.equal(filterResearchStudies(catalog, {status: "preprint"}).length, 4);
|
| 14 |
+
assert.equal(filterResearchStudies(catalog, {status: "accepted"})[0].id, "sinks");
|
| 15 |
+
assert.equal(filterResearchStudies(catalog, {query: "valor medio"}).length, 0); // all search terms must match
|
| 16 |
+
assert.equal(filterResearchStudies(catalog, {query: "BLOCK-GTQ cuantizacion"})[0].id, "blockgtq");
|
| 17 |
+
assert.equal(filterResearchStudies(catalog, {query: "2609.23314"})[0].id, "valuediff");
|
| 18 |
+
assert.equal(filterResearchStudies(catalog, {query: "工具 参数", topic: "memory"})[0].id, "mem2act");
|
| 19 |
+
assert.equal(filterResearchStudies(catalog, {query: "definitely-no-match"}).length, 0);
|
| 20 |
+
assert.equal(JSON.stringify(catalog), before, "Filtering must not mutate the curated evidence");
|
| 21 |
+
|
| 22 |
+
for (const lang of ["en", "es", "fr", "zh"]) {
|
| 23 |
+
const result = exportResearchSelection(catalog, {topic: "memory"}, lang);
|
| 24 |
+
assert.equal(result.papers.length, 1);
|
| 25 |
+
assert.equal(result.papers[0].summary, catalog.papers.find(p => p.id === "mem2act").text[lang].summary);
|
| 26 |
+
assert.equal(result.papers[0].experiment_status, "proposed_not_run");
|
| 27 |
+
assert.equal(result.papers[0].taf_validation, "not_established");
|
| 28 |
+
assert.equal(result.update_policy, "curated_manual");
|
| 29 |
+
assert.ok(result.papers[0].guide.includes(`/${lang === "es" ? "es" : "en"}/chapters/`));
|
| 30 |
+
for (const paper of catalog.papers) {
|
| 31 |
+
for (const topic of paper.topics) assert.ok(TRANSLATIONS[lang][`research.topic.${topic}`]);
|
| 32 |
+
for (const mode of paper.modes) assert.ok(TRANSLATIONS[lang][`modes.${mode}`]);
|
| 33 |
+
}
|
| 34 |
+
}
|
| 35 |
+
assert.ok(researchGuideUrl(catalog.papers[0], "fr").endsWith("19-contexto-largo.html#sec-contexto-evidencia"));
|
| 36 |
+
assert.equal(exportResearchSelection(catalog, {query: "no-such-study"}, "es").papers.length, 0);
|
| 37 |
+
|
| 38 |
+
// Invalid evidence must be rejected rather than displayed as verified findings.
|
| 39 |
+
for (const mutate of [
|
| 40 |
+
c => c.papers.push(c.papers[0]),
|
| 41 |
+
c => c.papers[0].url = "javascript:alert(1)",
|
| 42 |
+
c => c.papers[0].url = "https://arxiv.org.example.com/fake",
|
| 43 |
+
c => c.papers[0].guide.chapter = "../../private",
|
| 44 |
+
c => c.papers[0].experiment_status = "validated",
|
| 45 |
+
c => c.papers[0].taf_validation = "proven",
|
| 46 |
+
c => c.papers[0].status = "universal_truth",
|
| 47 |
+
c => c.papers[0].date = "2099-01-01",
|
| 48 |
+
c => delete c.papers[0].text.fr.limit,
|
| 49 |
+
]) {
|
| 50 |
+
const broken = structuredClone(catalog); mutate(broken);
|
| 51 |
+
assert.throws(() => validateResearchCatalog(broken));
|
| 52 |
+
}
|
| 53 |
+
console.log("Research catalog: provenance, filters, multilingual export and invalid-evidence rejection PASS");
|