@r1z4x/tezgah 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (582) hide show
  1. package/CHANGELOG.md +738 -0
  2. package/LICENSE +21 -0
  3. package/MANIFEST +753 -0
  4. package/README.de.md +169 -0
  5. package/README.es.md +168 -0
  6. package/README.fr.md +166 -0
  7. package/README.md +161 -0
  8. package/README.tr.md +163 -0
  9. package/agents/tezgah-reviewer.md +70 -0
  10. package/bin/codegen +337 -0
  11. package/bin/consult +797 -0
  12. package/bin/tezgah-adhd +50 -0
  13. package/bin/tezgah-agents +45 -0
  14. package/bin/tezgah-capture +66 -0
  15. package/bin/tezgah-context +96 -0
  16. package/bin/tezgah-decisions +213 -0
  17. package/bin/tezgah-design +953 -0
  18. package/bin/tezgah-docs +1199 -0
  19. package/bin/tezgah-doctor +497 -0
  20. package/bin/tezgah-dsh +37 -0
  21. package/bin/tezgah-dsh.cmd +70 -0
  22. package/bin/tezgah-gate +75 -0
  23. package/bin/tezgah-import-ai-research +439 -0
  24. package/bin/tezgah-index +32 -0
  25. package/bin/tezgah-lessons +148 -0
  26. package/bin/tezgah-mcp +322 -0
  27. package/bin/tezgah-migrate +324 -0
  28. package/bin/tezgah-pony +50 -0
  29. package/bin/tezgah-research +772 -0
  30. package/bin/tezgah-rollback +93 -0
  31. package/bin/tezgah-route +124 -0
  32. package/bin/tezgah-setup +5798 -0
  33. package/bin/tezgah-status +383 -0
  34. package/bin/tezgah-task +607 -0
  35. package/bin/tezgah-taste +423 -0
  36. package/bin/tezgah-triage +485 -0
  37. package/bin/tezgah.js +36 -0
  38. package/commands/adhd.md +21 -0
  39. package/commands/ponytail.md +21 -0
  40. package/docs/README.md +112 -0
  41. package/docs/architecture.md +226 -0
  42. package/docs/citations-baseline.json +59 -0
  43. package/docs/clarity-baseline.json +116 -0
  44. package/docs/contract.md +416 -0
  45. package/docs/environment.md +141 -0
  46. package/docs/evidence.md +831 -0
  47. package/docs/feature-audit.md +139 -0
  48. package/docs/gate.md +407 -0
  49. package/docs/glossary.md +201 -0
  50. package/docs/hosts.md +400 -0
  51. package/docs/index.json +471 -0
  52. package/docs/judge.md +193 -0
  53. package/docs/layers.md +189 -0
  54. package/docs/models.md +160 -0
  55. package/docs/operations.md +666 -0
  56. package/docs/research.md +809 -0
  57. package/docs/results/paired-outcome-2026-10.jsonl +254 -0
  58. package/docs/results/paired-outcome-2026-10.md +204 -0
  59. package/docs/skills.md +236 -0
  60. package/docs/status-line.md +315 -0
  61. package/docs/testing.md +287 -0
  62. package/docs/vision.md +117 -0
  63. package/hooks/hooks.json +33 -0
  64. package/hooks/projects-auto-init.py +98 -0
  65. package/hooks/projects-posttooluse.py +149 -0
  66. package/hooks/projects-pretooluse.py +40 -0
  67. package/hooks/projects-stop.py +60 -0
  68. package/hooks/tezgah_agents.py +817 -0
  69. package/hooks/tezgah_apps.py +266 -0
  70. package/hooks/tezgah_attest.py +255 -0
  71. package/hooks/tezgah_clarity.py +171 -0
  72. package/hooks/tezgah_components.py +140 -0
  73. package/hooks/tezgah_context.py +2953 -0
  74. package/hooks/tezgah_embed.py +765 -0
  75. package/hooks/tezgah_gate.py +2736 -0
  76. package/hooks/tezgah_guard.py +177 -0
  77. package/hooks/tezgah_index.py +124 -0
  78. package/hooks/tezgah_integrity.py +5141 -0
  79. package/hooks/tezgah_judge.py +487 -0
  80. package/hooks/tezgah_lang.py +230 -0
  81. package/hooks/tezgah_lessons.py +210 -0
  82. package/hooks/tezgah_models.py +855 -0
  83. package/hooks/tezgah_paths.py +1132 -0
  84. package/hooks/tezgah_policy.py +1039 -0
  85. package/hooks/tezgah_rank.py +77 -0
  86. package/hooks/tezgah_replay.py +1109 -0
  87. package/hooks/tezgah_research.py +5176 -0
  88. package/hooks/tezgah_shapes.py +305 -0
  89. package/hooks/tezgah_skill_pick.py +227 -0
  90. package/hooks/tezgah_snapshot.py +490 -0
  91. package/hooks/tezgah_stopspec.py +320 -0
  92. package/hooks/tezgah_task.py +458 -0
  93. package/hooks/tezgah_taste.py +201 -0
  94. package/hooks/tezgah_untrusted.py +112 -0
  95. package/hooks/tezgah_update.py +430 -0
  96. package/hosts/codex/hook.py +268 -0
  97. package/hosts/codex/hooks.json +26 -0
  98. package/hosts/cursor/hook.py +461 -0
  99. package/hosts/cursor/hooks.json +44 -0
  100. package/hosts/dsh/hooks.json +21 -0
  101. package/hosts/dsh/statusline/lib/client.js +138 -0
  102. package/hosts/dsh/statusline/lib/index.js +104 -0
  103. package/hosts/dsh/statusline/package.json +28 -0
  104. package/hosts/omp/hook.py +277 -0
  105. package/hosts/omp/tezgah-hook.ts.in +701 -0
  106. package/hosts/opencode/plugins/tezgah.js +2742 -0
  107. package/hosts/opencode/tui/tezgah-tui.tsx +151 -0
  108. package/output-styles/tezgah.md +142 -0
  109. package/package.json +32 -0
  110. package/packaging/build.sh +342 -0
  111. package/packaging/install.ps1 +166 -0
  112. package/packaging/install.sh +56 -0
  113. package/packaging/upgrade.sh +142 -0
  114. package/skills/ai-research/0-autoresearch-skill/SKILL.md +411 -0
  115. package/skills/ai-research/0-autoresearch-skill/references/agent-continuity.md +95 -0
  116. package/skills/ai-research/0-autoresearch-skill/references/progress-reporting.md +166 -0
  117. package/skills/ai-research/0-autoresearch-skill/references/skill-routing.md +219 -0
  118. package/skills/ai-research/0-autoresearch-skill/templates/findings.md +44 -0
  119. package/skills/ai-research/0-autoresearch-skill/templates/research-log.md +41 -0
  120. package/skills/ai-research/01-model-architecture/litgpt/SKILL.md +469 -0
  121. package/skills/ai-research/01-model-architecture/litgpt/references/custom-models.md +569 -0
  122. package/skills/ai-research/01-model-architecture/litgpt/references/distributed-training.md +452 -0
  123. package/skills/ai-research/01-model-architecture/litgpt/references/supported-models.md +337 -0
  124. package/skills/ai-research/01-model-architecture/litgpt/references/training-recipes.md +620 -0
  125. package/skills/ai-research/01-model-architecture/mamba/SKILL.md +260 -0
  126. package/skills/ai-research/01-model-architecture/mamba/references/architecture-details.md +207 -0
  127. package/skills/ai-research/01-model-architecture/mamba/references/benchmarks.md +256 -0
  128. package/skills/ai-research/01-model-architecture/mamba/references/training-guide.md +389 -0
  129. package/skills/ai-research/01-model-architecture/nanogpt/SKILL.md +290 -0
  130. package/skills/ai-research/01-model-architecture/nanogpt/references/architecture.md +383 -0
  131. package/skills/ai-research/01-model-architecture/nanogpt/references/data.md +477 -0
  132. package/skills/ai-research/01-model-architecture/nanogpt/references/training.md +565 -0
  133. package/skills/ai-research/01-model-architecture/rwkv/SKILL.md +260 -0
  134. package/skills/ai-research/01-model-architecture/rwkv/references/architecture-details.md +345 -0
  135. package/skills/ai-research/01-model-architecture/rwkv/references/rwkv7.md +387 -0
  136. package/skills/ai-research/01-model-architecture/rwkv/references/state-management.md +370 -0
  137. package/skills/ai-research/01-model-architecture/torchtitan/SKILL.md +358 -0
  138. package/skills/ai-research/01-model-architecture/torchtitan/references/checkpoint.md +182 -0
  139. package/skills/ai-research/01-model-architecture/torchtitan/references/custom-models.md +259 -0
  140. package/skills/ai-research/01-model-architecture/torchtitan/references/float8.md +134 -0
  141. package/skills/ai-research/01-model-architecture/torchtitan/references/fsdp.md +127 -0
  142. package/skills/ai-research/02-tokenization/huggingface-tokenizers/SKILL.md +516 -0
  143. package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/algorithms.md +654 -0
  144. package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/integration.md +638 -0
  145. package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/pipeline.md +724 -0
  146. package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/training.md +566 -0
  147. package/skills/ai-research/02-tokenization/sentencepiece/SKILL.md +235 -0
  148. package/skills/ai-research/02-tokenization/sentencepiece/references/algorithms.md +201 -0
  149. package/skills/ai-research/02-tokenization/sentencepiece/references/training.md +305 -0
  150. package/skills/ai-research/03-fine-tuning/axolotl/SKILL.md +158 -0
  151. package/skills/ai-research/03-fine-tuning/axolotl/references/api.md +5549 -0
  152. package/skills/ai-research/03-fine-tuning/axolotl/references/dataset-formats.md +1030 -0
  153. package/skills/ai-research/03-fine-tuning/axolotl/references/index.md +16 -0
  154. package/skills/ai-research/03-fine-tuning/axolotl/references/other.md +3564 -0
  155. package/skills/ai-research/03-fine-tuning/llama-factory/SKILL.md +80 -0
  156. package/skills/ai-research/03-fine-tuning/llama-factory/references/_images.md +24 -0
  157. package/skills/ai-research/03-fine-tuning/llama-factory/references/advanced.md +1056 -0
  158. package/skills/ai-research/03-fine-tuning/llama-factory/references/getting_started.md +350 -0
  159. package/skills/ai-research/03-fine-tuning/llama-factory/references/index.md +20 -0
  160. package/skills/ai-research/03-fine-tuning/llama-factory/references/other.md +32 -0
  161. package/skills/ai-research/03-fine-tuning/peft/SKILL.md +431 -0
  162. package/skills/ai-research/03-fine-tuning/peft/references/advanced-usage.md +515 -0
  163. package/skills/ai-research/03-fine-tuning/peft/references/troubleshooting.md +481 -0
  164. package/skills/ai-research/03-fine-tuning/unsloth/SKILL.md +80 -0
  165. package/skills/ai-research/03-fine-tuning/unsloth/references/index.md +8 -0
  166. package/skills/ai-research/03-fine-tuning/unsloth/references/llms.md +83 -0
  167. package/skills/ai-research/04-mechanistic-interpretability/nnsight/SKILL.md +436 -0
  168. package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/README.md +79 -0
  169. package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/api.md +345 -0
  170. package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/tutorials.md +301 -0
  171. package/skills/ai-research/04-mechanistic-interpretability/pyvene/SKILL.md +473 -0
  172. package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/README.md +74 -0
  173. package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/api.md +384 -0
  174. package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/tutorials.md +377 -0
  175. package/skills/ai-research/04-mechanistic-interpretability/saelens/SKILL.md +386 -0
  176. package/skills/ai-research/04-mechanistic-interpretability/saelens/references/README.md +71 -0
  177. package/skills/ai-research/04-mechanistic-interpretability/saelens/references/api.md +334 -0
  178. package/skills/ai-research/04-mechanistic-interpretability/saelens/references/tutorials.md +319 -0
  179. package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/SKILL.md +346 -0
  180. package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/README.md +55 -0
  181. package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/api.md +363 -0
  182. package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/tutorials.md +340 -0
  183. package/skills/ai-research/05-data-processing/nemo-curator/SKILL.md +383 -0
  184. package/skills/ai-research/05-data-processing/nemo-curator/references/deduplication.md +88 -0
  185. package/skills/ai-research/05-data-processing/nemo-curator/references/filtering.md +103 -0
  186. package/skills/ai-research/05-data-processing/ray-data/SKILL.md +326 -0
  187. package/skills/ai-research/05-data-processing/ray-data/references/integration.md +83 -0
  188. package/skills/ai-research/05-data-processing/ray-data/references/transformations.md +84 -0
  189. package/skills/ai-research/06-post-training/grpo-rl-training/README.md +98 -0
  190. package/skills/ai-research/06-post-training/grpo-rl-training/SKILL.md +572 -0
  191. package/skills/ai-research/06-post-training/miles/SKILL.md +315 -0
  192. package/skills/ai-research/06-post-training/miles/references/api-reference.md +142 -0
  193. package/skills/ai-research/06-post-training/miles/references/troubleshooting.md +353 -0
  194. package/skills/ai-research/06-post-training/openrlhf/SKILL.md +249 -0
  195. package/skills/ai-research/06-post-training/openrlhf/references/algorithm-comparison.md +405 -0
  196. package/skills/ai-research/06-post-training/openrlhf/references/custom-rewards.md +531 -0
  197. package/skills/ai-research/06-post-training/openrlhf/references/hybrid-engine.md +288 -0
  198. package/skills/ai-research/06-post-training/openrlhf/references/multi-node-training.md +455 -0
  199. package/skills/ai-research/06-post-training/simpo/SKILL.md +219 -0
  200. package/skills/ai-research/06-post-training/simpo/references/datasets.md +479 -0
  201. package/skills/ai-research/06-post-training/simpo/references/hyperparameters.md +453 -0
  202. package/skills/ai-research/06-post-training/simpo/references/loss-functions.md +351 -0
  203. package/skills/ai-research/06-post-training/slime/SKILL.md +464 -0
  204. package/skills/ai-research/06-post-training/slime/references/api-reference.md +393 -0
  205. package/skills/ai-research/06-post-training/slime/references/troubleshooting.md +387 -0
  206. package/skills/ai-research/06-post-training/torchforge/SKILL.md +433 -0
  207. package/skills/ai-research/06-post-training/torchforge/references/api-reference.md +328 -0
  208. package/skills/ai-research/06-post-training/torchforge/references/troubleshooting.md +410 -0
  209. package/skills/ai-research/06-post-training/trl-fine-tuning/SKILL.md +455 -0
  210. package/skills/ai-research/06-post-training/trl-fine-tuning/references/dpo-variants.md +228 -0
  211. package/skills/ai-research/06-post-training/trl-fine-tuning/references/online-rl.md +83 -0
  212. package/skills/ai-research/06-post-training/trl-fine-tuning/references/reward-modeling.md +123 -0
  213. package/skills/ai-research/06-post-training/trl-fine-tuning/references/sft-training.md +169 -0
  214. package/skills/ai-research/06-post-training/verl/SKILL.md +391 -0
  215. package/skills/ai-research/06-post-training/verl/references/api-reference.md +302 -0
  216. package/skills/ai-research/06-post-training/verl/references/troubleshooting.md +392 -0
  217. package/skills/ai-research/07-safety-alignment/constitutional-ai/SKILL.md +290 -0
  218. package/skills/ai-research/07-safety-alignment/llamaguard/SKILL.md +337 -0
  219. package/skills/ai-research/07-safety-alignment/nemo-guardrails/SKILL.md +297 -0
  220. package/skills/ai-research/07-safety-alignment/prompt-guard/SKILL.md +312 -0
  221. package/skills/ai-research/08-distributed-training/accelerate/SKILL.md +332 -0
  222. package/skills/ai-research/08-distributed-training/accelerate/references/custom-plugins.md +454 -0
  223. package/skills/ai-research/08-distributed-training/accelerate/references/megatron-integration.md +490 -0
  224. package/skills/ai-research/08-distributed-training/accelerate/references/performance.md +526 -0
  225. package/skills/ai-research/08-distributed-training/deepspeed/SKILL.md +141 -0
  226. package/skills/ai-research/08-distributed-training/deepspeed/references/08.md +18 -0
  227. package/skills/ai-research/08-distributed-training/deepspeed/references/09.md +174 -0
  228. package/skills/ai-research/08-distributed-training/deepspeed/references/2020.md +379 -0
  229. package/skills/ai-research/08-distributed-training/deepspeed/references/2023.md +280 -0
  230. package/skills/ai-research/08-distributed-training/deepspeed/references/assets.md +180 -0
  231. package/skills/ai-research/08-distributed-training/deepspeed/references/index.md +36 -0
  232. package/skills/ai-research/08-distributed-training/deepspeed/references/mii.md +119 -0
  233. package/skills/ai-research/08-distributed-training/deepspeed/references/other.md +1192 -0
  234. package/skills/ai-research/08-distributed-training/megatron-core/SKILL.md +366 -0
  235. package/skills/ai-research/08-distributed-training/megatron-core/references/benchmarks.md +250 -0
  236. package/skills/ai-research/08-distributed-training/megatron-core/references/parallelism-guide.md +405 -0
  237. package/skills/ai-research/08-distributed-training/megatron-core/references/production-examples.md +474 -0
  238. package/skills/ai-research/08-distributed-training/megatron-core/references/training-recipes.md +548 -0
  239. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/SKILL.md +231 -0
  240. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_async_recipe.md +14 -0
  241. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_overview.md +19 -0
  242. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_recipe.md +18 -0
  243. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_ddp_notes.md +10 -0
  244. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_device_mesh_tutorial.md +22 -0
  245. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_examples_fsdp2.md +15 -0
  246. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fsdp1_api.md +9 -0
  247. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fsdp2_tutorial.md +45 -0
  248. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fully_shard_api.md +49 -0
  249. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_tp_tutorial.md +22 -0
  250. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/ray_train_fsdp2_example.md +13 -0
  251. package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/torchtitan_fsdp_notes.md +14 -0
  252. package/skills/ai-research/08-distributed-training/pytorch-lightning/SKILL.md +346 -0
  253. package/skills/ai-research/08-distributed-training/pytorch-lightning/references/callbacks.md +437 -0
  254. package/skills/ai-research/08-distributed-training/pytorch-lightning/references/distributed.md +491 -0
  255. package/skills/ai-research/08-distributed-training/pytorch-lightning/references/hyperparameter-tuning.md +557 -0
  256. package/skills/ai-research/08-distributed-training/ray-train/SKILL.md +406 -0
  257. package/skills/ai-research/08-distributed-training/ray-train/references/multi-node.md +629 -0
  258. package/skills/ai-research/09-infrastructure/lambda-labs/SKILL.md +545 -0
  259. package/skills/ai-research/09-infrastructure/lambda-labs/references/advanced-usage.md +612 -0
  260. package/skills/ai-research/09-infrastructure/lambda-labs/references/troubleshooting.md +531 -0
  261. package/skills/ai-research/09-infrastructure/modal/SKILL.md +341 -0
  262. package/skills/ai-research/09-infrastructure/modal/references/advanced-usage.md +504 -0
  263. package/skills/ai-research/09-infrastructure/modal/references/troubleshooting.md +495 -0
  264. package/skills/ai-research/09-infrastructure/skypilot/SKILL.md +509 -0
  265. package/skills/ai-research/09-infrastructure/skypilot/references/advanced-usage.md +492 -0
  266. package/skills/ai-research/09-infrastructure/skypilot/references/troubleshooting.md +571 -0
  267. package/skills/ai-research/10-optimization/awq/SKILL.md +310 -0
  268. package/skills/ai-research/10-optimization/awq/references/advanced-usage.md +325 -0
  269. package/skills/ai-research/10-optimization/awq/references/troubleshooting.md +345 -0
  270. package/skills/ai-research/10-optimization/bitsandbytes/SKILL.md +411 -0
  271. package/skills/ai-research/10-optimization/bitsandbytes/references/memory-optimization.md +522 -0
  272. package/skills/ai-research/10-optimization/bitsandbytes/references/qlora-training.md +522 -0
  273. package/skills/ai-research/10-optimization/bitsandbytes/references/quantization-formats.md +448 -0
  274. package/skills/ai-research/10-optimization/flash-attention/SKILL.md +367 -0
  275. package/skills/ai-research/10-optimization/flash-attention/references/benchmarks.md +216 -0
  276. package/skills/ai-research/10-optimization/flash-attention/references/transformers-integration.md +294 -0
  277. package/skills/ai-research/10-optimization/gguf/SKILL.md +427 -0
  278. package/skills/ai-research/10-optimization/gguf/references/advanced-usage.md +505 -0
  279. package/skills/ai-research/10-optimization/gguf/references/troubleshooting.md +443 -0
  280. package/skills/ai-research/10-optimization/gptq/SKILL.md +450 -0
  281. package/skills/ai-research/10-optimization/gptq/references/calibration.md +338 -0
  282. package/skills/ai-research/10-optimization/gptq/references/integration.md +130 -0
  283. package/skills/ai-research/10-optimization/gptq/references/troubleshooting.md +96 -0
  284. package/skills/ai-research/10-optimization/hqq/SKILL.md +445 -0
  285. package/skills/ai-research/10-optimization/hqq/references/advanced-usage.md +529 -0
  286. package/skills/ai-research/10-optimization/hqq/references/troubleshooting.md +504 -0
  287. package/skills/ai-research/10-optimization/ml-training-recipes/SKILL.md +319 -0
  288. package/skills/ai-research/10-optimization/ml-training-recipes/references/architecture.md +320 -0
  289. package/skills/ai-research/10-optimization/ml-training-recipes/references/biomedical.md +498 -0
  290. package/skills/ai-research/10-optimization/ml-training-recipes/references/domain-specific.md +626 -0
  291. package/skills/ai-research/10-optimization/ml-training-recipes/references/experiment-loop.md +129 -0
  292. package/skills/ai-research/10-optimization/ml-training-recipes/references/optimizers.md +330 -0
  293. package/skills/ai-research/10-optimization/ml-training-recipes/references/scaling-and-selection.md +428 -0
  294. package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/SKILL.md +405 -0
  295. package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/benchmarks.md +394 -0
  296. package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/custom-tasks.md +425 -0
  297. package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/issues.md +395 -0
  298. package/skills/ai-research/11-evaluation/lm-evaluation-harness/SKILL.md +490 -0
  299. package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/api-evaluation.md +491 -0
  300. package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/benchmark-guide.md +489 -0
  301. package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/custom-tasks.md +603 -0
  302. package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/distributed-eval.md +520 -0
  303. package/skills/ai-research/11-evaluation/nemo-evaluator/SKILL.md +494 -0
  304. package/skills/ai-research/11-evaluation/nemo-evaluator/references/adapter-system.md +341 -0
  305. package/skills/ai-research/11-evaluation/nemo-evaluator/references/configuration.md +448 -0
  306. package/skills/ai-research/11-evaluation/nemo-evaluator/references/custom-benchmarks.md +316 -0
  307. package/skills/ai-research/11-evaluation/nemo-evaluator/references/execution-backends.md +362 -0
  308. package/skills/ai-research/12-inference-serving/llama-cpp/SKILL.md +258 -0
  309. package/skills/ai-research/12-inference-serving/llama-cpp/references/optimization.md +90 -0
  310. package/skills/ai-research/12-inference-serving/llama-cpp/references/quantization.md +214 -0
  311. package/skills/ai-research/12-inference-serving/llama-cpp/references/server.md +126 -0
  312. package/skills/ai-research/12-inference-serving/sglang/SKILL.md +442 -0
  313. package/skills/ai-research/12-inference-serving/sglang/references/deployment.md +491 -0
  314. package/skills/ai-research/12-inference-serving/sglang/references/radix-attention.md +414 -0
  315. package/skills/ai-research/12-inference-serving/sglang/references/structured-generation.md +542 -0
  316. package/skills/ai-research/12-inference-serving/tensorrt-llm/SKILL.md +187 -0
  317. package/skills/ai-research/12-inference-serving/tensorrt-llm/references/multi-gpu.md +299 -0
  318. package/skills/ai-research/12-inference-serving/tensorrt-llm/references/optimization.md +243 -0
  319. package/skills/ai-research/12-inference-serving/tensorrt-llm/references/serving.md +471 -0
  320. package/skills/ai-research/12-inference-serving/vllm/SKILL.md +364 -0
  321. package/skills/ai-research/12-inference-serving/vllm/references/optimization.md +227 -0
  322. package/skills/ai-research/12-inference-serving/vllm/references/quantization.md +285 -0
  323. package/skills/ai-research/12-inference-serving/vllm/references/server-deployment.md +256 -0
  324. package/skills/ai-research/12-inference-serving/vllm/references/troubleshooting.md +448 -0
  325. package/skills/ai-research/13-mlops/mlflow/SKILL.md +704 -0
  326. package/skills/ai-research/13-mlops/mlflow/references/deployment.md +745 -0
  327. package/skills/ai-research/13-mlops/mlflow/references/model-registry.md +771 -0
  328. package/skills/ai-research/13-mlops/mlflow/references/tracking.md +681 -0
  329. package/skills/ai-research/13-mlops/swanlab/SKILL.md +406 -0
  330. package/skills/ai-research/13-mlops/swanlab/references/integrations.md +305 -0
  331. package/skills/ai-research/13-mlops/swanlab/references/visualization.md +234 -0
  332. package/skills/ai-research/13-mlops/tensorboard/SKILL.md +629 -0
  333. package/skills/ai-research/13-mlops/tensorboard/references/integrations.md +639 -0
  334. package/skills/ai-research/13-mlops/tensorboard/references/profiling.md +546 -0
  335. package/skills/ai-research/13-mlops/tensorboard/references/visualization.md +621 -0
  336. package/skills/ai-research/13-mlops/weights-and-biases/SKILL.md +590 -0
  337. package/skills/ai-research/13-mlops/weights-and-biases/references/artifacts.md +585 -0
  338. package/skills/ai-research/13-mlops/weights-and-biases/references/integrations.md +701 -0
  339. package/skills/ai-research/13-mlops/weights-and-biases/references/sweeps.md +848 -0
  340. package/skills/ai-research/14-agents/a-evolve/SKILL.md +383 -0
  341. package/skills/ai-research/14-agents/a-evolve/references/README.md +831 -0
  342. package/skills/ai-research/14-agents/a-evolve/references/api.md +594 -0
  343. package/skills/ai-research/14-agents/a-evolve/references/architecture.md +417 -0
  344. package/skills/ai-research/14-agents/a-evolve/references/design-patterns.md +462 -0
  345. package/skills/ai-research/14-agents/a-evolve/references/examples.md +352 -0
  346. package/skills/ai-research/14-agents/a-evolve/references/issues.md +591 -0
  347. package/skills/ai-research/14-agents/a-evolve/references/releases.md +112 -0
  348. package/skills/ai-research/14-agents/a-evolve/references/tutorials.md +819 -0
  349. package/skills/ai-research/14-agents/autogpt/SKILL.md +403 -0
  350. package/skills/ai-research/14-agents/autogpt/references/advanced-usage.md +536 -0
  351. package/skills/ai-research/14-agents/autogpt/references/troubleshooting.md +421 -0
  352. package/skills/ai-research/14-agents/crewai/SKILL.md +498 -0
  353. package/skills/ai-research/14-agents/crewai/references/flows.md +439 -0
  354. package/skills/ai-research/14-agents/crewai/references/tools.md +430 -0
  355. package/skills/ai-research/14-agents/crewai/references/troubleshooting.md +481 -0
  356. package/skills/ai-research/14-agents/langchain/SKILL.md +480 -0
  357. package/skills/ai-research/14-agents/langchain/references/agents.md +500 -0
  358. package/skills/ai-research/14-agents/langchain/references/integration.md +563 -0
  359. package/skills/ai-research/14-agents/langchain/references/rag.md +601 -0
  360. package/skills/ai-research/14-agents/llamaindex/SKILL.md +569 -0
  361. package/skills/ai-research/14-agents/llamaindex/references/agents.md +84 -0
  362. package/skills/ai-research/14-agents/llamaindex/references/data_connectors.md +109 -0
  363. package/skills/ai-research/14-agents/llamaindex/references/query_engines.md +407 -0
  364. package/skills/ai-research/15-rag/chroma/SKILL.md +406 -0
  365. package/skills/ai-research/15-rag/chroma/references/integration.md +39 -0
  366. package/skills/ai-research/15-rag/faiss/SKILL.md +221 -0
  367. package/skills/ai-research/15-rag/faiss/references/index_types.md +281 -0
  368. package/skills/ai-research/15-rag/pinecone/SKILL.md +358 -0
  369. package/skills/ai-research/15-rag/pinecone/references/deployment.md +182 -0
  370. package/skills/ai-research/15-rag/qdrant/SKILL.md +493 -0
  371. package/skills/ai-research/15-rag/qdrant/references/advanced-usage.md +649 -0
  372. package/skills/ai-research/15-rag/qdrant/references/troubleshooting.md +632 -0
  373. package/skills/ai-research/15-rag/sentence-transformers/SKILL.md +255 -0
  374. package/skills/ai-research/15-rag/sentence-transformers/references/models.md +124 -0
  375. package/skills/ai-research/16-prompt-engineering/dspy/SKILL.md +590 -0
  376. package/skills/ai-research/16-prompt-engineering/dspy/references/examples.md +664 -0
  377. package/skills/ai-research/16-prompt-engineering/dspy/references/modules.md +476 -0
  378. package/skills/ai-research/16-prompt-engineering/dspy/references/optimizers.md +567 -0
  379. package/skills/ai-research/16-prompt-engineering/guidance/SKILL.md +572 -0
  380. package/skills/ai-research/16-prompt-engineering/guidance/references/backends.md +555 -0
  381. package/skills/ai-research/16-prompt-engineering/guidance/references/constraints.md +675 -0
  382. package/skills/ai-research/16-prompt-engineering/guidance/references/examples.md +768 -0
  383. package/skills/ai-research/16-prompt-engineering/instructor/SKILL.md +740 -0
  384. package/skills/ai-research/16-prompt-engineering/instructor/references/examples.md +108 -0
  385. package/skills/ai-research/16-prompt-engineering/instructor/references/providers.md +71 -0
  386. package/skills/ai-research/16-prompt-engineering/instructor/references/validation.md +607 -0
  387. package/skills/ai-research/16-prompt-engineering/outlines/SKILL.md +652 -0
  388. package/skills/ai-research/16-prompt-engineering/outlines/references/backends.md +616 -0
  389. package/skills/ai-research/16-prompt-engineering/outlines/references/examples.md +774 -0
  390. package/skills/ai-research/16-prompt-engineering/outlines/references/json_generation.md +653 -0
  391. package/skills/ai-research/17-observability/langsmith/SKILL.md +422 -0
  392. package/skills/ai-research/17-observability/langsmith/references/advanced-usage.md +549 -0
  393. package/skills/ai-research/17-observability/langsmith/references/troubleshooting.md +538 -0
  394. package/skills/ai-research/17-observability/phoenix/SKILL.md +475 -0
  395. package/skills/ai-research/17-observability/phoenix/references/advanced-usage.md +620 -0
  396. package/skills/ai-research/17-observability/phoenix/references/troubleshooting.md +539 -0
  397. package/skills/ai-research/18-multimodal/audiocraft/SKILL.md +564 -0
  398. package/skills/ai-research/18-multimodal/audiocraft/references/advanced-usage.md +667 -0
  399. package/skills/ai-research/18-multimodal/audiocraft/references/troubleshooting.md +505 -0
  400. package/skills/ai-research/18-multimodal/blip-2/SKILL.md +564 -0
  401. package/skills/ai-research/18-multimodal/blip-2/references/advanced-usage.md +681 -0
  402. package/skills/ai-research/18-multimodal/blip-2/references/troubleshooting.md +527 -0
  403. package/skills/ai-research/18-multimodal/clip/SKILL.md +253 -0
  404. package/skills/ai-research/18-multimodal/clip/references/applications.md +208 -0
  405. package/skills/ai-research/18-multimodal/cosmos-policy/SKILL.md +402 -0
  406. package/skills/ai-research/18-multimodal/cosmos-policy/references/libero-commands.md +175 -0
  407. package/skills/ai-research/18-multimodal/cosmos-policy/references/robocasa-commands.md +147 -0
  408. package/skills/ai-research/18-multimodal/llava/SKILL.md +304 -0
  409. package/skills/ai-research/18-multimodal/llava/references/training.md +198 -0
  410. package/skills/ai-research/18-multimodal/openpi/SKILL.md +480 -0
  411. package/skills/ai-research/18-multimodal/openpi/references/checkpoints-and-env-map.md +86 -0
  412. package/skills/ai-research/18-multimodal/openpi/references/config-recipes.md +50 -0
  413. package/skills/ai-research/18-multimodal/openpi/references/pytorch-gotchas.md +49 -0
  414. package/skills/ai-research/18-multimodal/openpi/references/remote-client-pattern.md +48 -0
  415. package/skills/ai-research/18-multimodal/openpi/references/training-debugging.md +46 -0
  416. package/skills/ai-research/18-multimodal/openvla-oft/SKILL.md +441 -0
  417. package/skills/ai-research/18-multimodal/openvla-oft/references/aloha-workflow.md +141 -0
  418. package/skills/ai-research/18-multimodal/openvla-oft/references/config-troubleshooting.md +97 -0
  419. package/skills/ai-research/18-multimodal/openvla-oft/references/libero-workflow.md +115 -0
  420. package/skills/ai-research/18-multimodal/openvla-oft/references/paper-and-checkpoints.md +84 -0
  421. package/skills/ai-research/18-multimodal/segment-anything/SKILL.md +500 -0
  422. package/skills/ai-research/18-multimodal/segment-anything/references/advanced-usage.md +590 -0
  423. package/skills/ai-research/18-multimodal/segment-anything/references/troubleshooting.md +485 -0
  424. package/skills/ai-research/18-multimodal/stable-diffusion/SKILL.md +519 -0
  425. package/skills/ai-research/18-multimodal/stable-diffusion/references/advanced-usage.md +717 -0
  426. package/skills/ai-research/18-multimodal/stable-diffusion/references/troubleshooting.md +556 -0
  427. package/skills/ai-research/18-multimodal/whisper/SKILL.md +317 -0
  428. package/skills/ai-research/18-multimodal/whisper/references/languages.md +190 -0
  429. package/skills/ai-research/19-emerging-techniques/knowledge-distillation/SKILL.md +458 -0
  430. package/skills/ai-research/19-emerging-techniques/knowledge-distillation/references/minillm.md +335 -0
  431. package/skills/ai-research/19-emerging-techniques/long-context/SKILL.md +536 -0
  432. package/skills/ai-research/19-emerging-techniques/long-context/references/extension_methods.md +469 -0
  433. package/skills/ai-research/19-emerging-techniques/long-context/references/fine_tuning.md +612 -0
  434. package/skills/ai-research/19-emerging-techniques/long-context/references/rope.md +403 -0
  435. package/skills/ai-research/19-emerging-techniques/model-merging/SKILL.md +497 -0
  436. package/skills/ai-research/19-emerging-techniques/model-merging/references/coefficient-tuning.md +415 -0
  437. package/skills/ai-research/19-emerging-techniques/model-merging/references/evaluation.md +463 -0
  438. package/skills/ai-research/19-emerging-techniques/model-merging/references/examples.md +429 -0
  439. package/skills/ai-research/19-emerging-techniques/model-merging/references/methods.md +353 -0
  440. package/skills/ai-research/19-emerging-techniques/model-pruning/SKILL.md +495 -0
  441. package/skills/ai-research/19-emerging-techniques/model-pruning/references/wanda.md +348 -0
  442. package/skills/ai-research/19-emerging-techniques/moe-training/SKILL.md +526 -0
  443. package/skills/ai-research/19-emerging-techniques/moe-training/references/architectures.md +433 -0
  444. package/skills/ai-research/19-emerging-techniques/moe-training/references/inference.md +349 -0
  445. package/skills/ai-research/19-emerging-techniques/moe-training/references/training.md +426 -0
  446. package/skills/ai-research/19-emerging-techniques/speculative-decoding/SKILL.md +467 -0
  447. package/skills/ai-research/19-emerging-techniques/speculative-decoding/references/lookahead.md +310 -0
  448. package/skills/ai-research/19-emerging-techniques/speculative-decoding/references/medusa.md +351 -0
  449. package/skills/ai-research/20-ml-paper-writing/academic-plotting/SKILL.md +479 -0
  450. package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/data-visualization.md +509 -0
  451. package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/diagram-generation.md +395 -0
  452. package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/style-guide.md +305 -0
  453. package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/SKILL.md +982 -0
  454. package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/checklists.md +348 -0
  455. package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/citation-workflow.md +563 -0
  456. package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/reviewer-guidelines.md +349 -0
  457. package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/sources.md +165 -0
  458. package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/writing-guide.md +477 -0
  459. package/skills/ai-research/20-ml-paper-writing/presenting-conference-talks/SKILL.md +298 -0
  460. package/skills/ai-research/20-ml-paper-writing/presenting-conference-talks/references/slide-templates.md +505 -0
  461. package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/SKILL.md +270 -0
  462. package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/checklist.md +279 -0
  463. package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/reviewer-guidelines.md +116 -0
  464. package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/section-blueprints.md +400 -0
  465. package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/systems-conferences.md +261 -0
  466. package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/writing-patterns.md +231 -0
  467. package/skills/ai-research/21-research-ideation/brainstorming-research-ideas/SKILL.md +384 -0
  468. package/skills/ai-research/21-research-ideation/creative-thinking-for-research/SKILL.md +366 -0
  469. package/skills/ai-research/22-agent-native-research-artifact/compiler/SKILL.md +245 -0
  470. package/skills/ai-research/22-agent-native-research-artifact/compiler/references/ara-schema.md +439 -0
  471. package/skills/ai-research/22-agent-native-research-artifact/compiler/references/exploration-tree-spec.md +125 -0
  472. package/skills/ai-research/22-agent-native-research-artifact/compiler/references/validation-checklist.md +149 -0
  473. package/skills/ai-research/22-agent-native-research-artifact/research-manager/SKILL.md +324 -0
  474. package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/event-taxonomy.md +124 -0
  475. package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/provenance-tags.md +190 -0
  476. package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/session-protocol.md +162 -0
  477. package/skills/ai-research/22-agent-native-research-artifact/rigor-reviewer/SKILL.md +322 -0
  478. package/skills/ai-research/22-agent-native-research-artifact/rigor-reviewer/references/review-dimensions.md +182 -0
  479. package/skills/ai-research/SKILL.md +101 -0
  480. package/skills/ai-research/SOURCE +38 -0
  481. package/skills/ai-research/index/1-frame.md +18 -0
  482. package/skills/ai-research/index/2-data.md +21 -0
  483. package/skills/ai-research/index/3-train.md +48 -0
  484. package/skills/ai-research/index/4-measure.md +25 -0
  485. package/skills/ai-research/index/5-run.md +23 -0
  486. package/skills/ai-research/index/6-write.md +35 -0
  487. package/skills/ai-research/library.json +3456 -0
  488. package/skills/analyze-app/EVALS.md +82 -0
  489. package/skills/analyze-app/SKILL.md +188 -0
  490. package/skills/design-contract/EVALS.md +80 -0
  491. package/skills/design-contract/SKILL.md +171 -0
  492. package/skills/design-library/EVALS.md +85 -0
  493. package/skills/design-library/INDEX.md +59 -0
  494. package/skills/design-library/SKILL.md +58 -0
  495. package/skills/design-library/SOURCE +131 -0
  496. package/skills/design-library/adaptive-interfaces/skills/colour-independence/SKILL.md +90 -0
  497. package/skills/design-library/adaptive-interfaces/skills/flexible-typography/SKILL.md +83 -0
  498. package/skills/design-library/adaptive-interfaces/skills/information-density/SKILL.md +87 -0
  499. package/skills/design-library/adaptive-interfaces/skills/preference-audit/SKILL.md +70 -0
  500. package/skills/design-library/adaptive-interfaces/skills/responsive-accessibility/SKILL.md +86 -0
  501. package/skills/design-library/adaptive-interfaces/skills/responsive-review/SKILL.md +76 -0
  502. package/skills/design-library/adaptive-interfaces/skills/simplified-views/SKILL.md +97 -0
  503. package/skills/design-library/adaptive-interfaces/skills/specify/SKILL.md +63 -0
  504. package/skills/design-library/adaptive-interfaces/skills/user-preference-respect/SKILL.md +100 -0
  505. package/skills/design-library/cognitive-accessibility/skills/adaptive-personalisation/SKILL.md +61 -0
  506. package/skills/design-library/cognitive-accessibility/skills/assess-load/SKILL.md +48 -0
  507. package/skills/design-library/cognitive-accessibility/skills/cognitive-load-assessment/SKILL.md +60 -0
  508. package/skills/design-library/cognitive-accessibility/skills/contextual-help-design/SKILL.md +61 -0
  509. package/skills/design-library/cognitive-accessibility/skills/error-prevention-recovery/SKILL.md +71 -0
  510. package/skills/design-library/cognitive-accessibility/skills/focus-attention-design/SKILL.md +67 -0
  511. package/skills/design-library/cognitive-accessibility/skills/memory-load-reduction/SKILL.md +60 -0
  512. package/skills/design-library/cognitive-accessibility/skills/plain-language-design/SKILL.md +78 -0
  513. package/skills/design-library/cognitive-accessibility/skills/review/SKILL.md +56 -0
  514. package/skills/design-library/cognitive-accessibility/skills/simplify/SKILL.md +39 -0
  515. package/skills/design-library/cognitive-accessibility/skills/wayfinding-navigation/SKILL.md +64 -0
  516. package/skills/design-library/design-research/skills/behavioural-analytics/SKILL.md +33 -0
  517. package/skills/design-library/design-research/skills/qual-quant-triangulation/SKILL.md +33 -0
  518. package/skills/design-library/inclusive-interaction/skills/audit/SKILL.md +50 -0
  519. package/skills/design-library/inclusive-interaction/skills/design-flow/SKILL.md +58 -0
  520. package/skills/design-library/inclusive-interaction/skills/feedback-and-status/SKILL.md +76 -0
  521. package/skills/design-library/inclusive-interaction/skills/gesture-alternatives/SKILL.md +70 -0
  522. package/skills/design-library/inclusive-interaction/skills/keyboard-navigation/SKILL.md +99 -0
  523. package/skills/design-library/inclusive-interaction/skills/keyboard-review/SKILL.md +54 -0
  524. package/skills/design-library/inclusive-interaction/skills/motion-sensitivity/SKILL.md +79 -0
  525. package/skills/design-library/inclusive-interaction/skills/multi-modal-input/SKILL.md +70 -0
  526. package/skills/design-library/inclusive-interaction/skills/touch-target-design/SKILL.md +71 -0
  527. package/skills/design-library/inclusive-interaction/skills/voice-interaction/SKILL.md +68 -0
  528. package/skills/design-library/visual-critique/skills/critique-affordance/SKILL.md +45 -0
  529. package/skills/design-library/visual-critique/skills/critique-brand-consistency/SKILL.md +42 -0
  530. package/skills/design-library/visual-critique/skills/critique-color/SKILL.md +44 -0
  531. package/skills/design-library/visual-critique/skills/critique-composition/SKILL.md +46 -0
  532. package/skills/design-library/visual-critique/skills/critique-information-density/SKILL.md +45 -0
  533. package/skills/design-library/visual-critique/skills/critique-typography/SKILL.md +45 -0
  534. package/skills/design-library/visual-critique/skills/critique-visual-hierarchy/SKILL.md +40 -0
  535. package/skills/feature-audit/EVALS.md +83 -0
  536. package/skills/feature-audit/SKILL.md +326 -0
  537. package/skills/harness/EVALS.md +81 -0
  538. package/skills/harness/SKILL.md +88 -0
  539. package/skills/i-have-adhd/EVALS.md +80 -0
  540. package/skills/i-have-adhd/SKILL.md +183 -0
  541. package/skills/no-ai-slop/EVALS.md +89 -0
  542. package/skills/no-ai-slop/SKILL.md +209 -0
  543. package/skills/no-ai-slop/eval.md +52 -0
  544. package/skills/plan-add/EVALS.md +79 -0
  545. package/skills/plan-add/SKILL.md +179 -0
  546. package/skills/plan-add/render_table.py +72 -0
  547. package/skills/plan-status/EVALS.md +78 -0
  548. package/skills/plan-status/SKILL.md +52 -0
  549. package/skills/plan-sync/EVALS.md +80 -0
  550. package/skills/plan-sync/SKILL.md +69 -0
  551. package/skills/pm-frameworks/SKILL.md +33 -0
  552. package/skills/pm-frameworks/SOURCE +39 -0
  553. package/skills/pm-frameworks/intended-vs-implemented/SKILL.md +42 -0
  554. package/skills/pm-frameworks/opportunity-solution-tree/SKILL.md +64 -0
  555. package/skills/ponytail/EVALS.md +80 -0
  556. package/skills/ponytail/SKILL.md +124 -0
  557. package/skills/product-analysis/EVALS.md +103 -0
  558. package/skills/product-analysis/SKILL.md +361 -0
  559. package/skills/research/EVALS.md +104 -0
  560. package/skills/research/SKILL.md +570 -0
  561. package/skills/rl-env/SKILL.md +53 -0
  562. package/skills/rl-env/SOURCE +41 -0
  563. package/skills/rl-env/generate-nemo-gym-env/SKILL.md +169 -0
  564. package/skills/rl-env/generate-nemo-gym-env/references/architecture.md +114 -0
  565. package/skills/rl-env/generate-openenv-env/SKILL.md +183 -0
  566. package/skills/rl-env/generate-openenv-env/references/architecture.md +82 -0
  567. package/skills/rl-env/generate-ors-env/SKILL.md +209 -0
  568. package/skills/rl-env/generate-ors-env/references/architecture.md +113 -0
  569. package/skills/rl-env/generate-verifiers-env/SKILL.md +188 -0
  570. package/skills/rl-env/generate-verifiers-env/references/architecture.md +119 -0
  571. package/skills/rl-env/rl-env-from-description/SKILL.md +124 -0
  572. package/skills/rl-env/rl-env-from-description/references/interview.md +75 -0
  573. package/skills/rl-env/rl-env-from-description/references/nemo_gym.md +41 -0
  574. package/skills/rl-env/rl-env-from-description/references/openenv.md +35 -0
  575. package/skills/rl-env/rl-env-from-description/references/ors.md +50 -0
  576. package/skills/rl-env/rl-env-from-description/references/verifiers.md +39 -0
  577. package/skills/tezgah-contract/EVALS.md +78 -0
  578. package/skills/tezgah-contract/SKILL.md +792 -0
  579. package/statusline.py +129 -0
  580. package/workflows/graph-impact.js +153 -0
  581. package/workflows/graph-map.js +158 -0
  582. package/workflows/graph-review.js +170 -0
@@ -0,0 +1,809 @@
1
+ # Research: the line in the repository, the CLI that checks it, the mark it lights
2
+
3
+ The research layer is the repository's own record of an open-ended
4
+ investigation: one directory per line under `<repo>/.tezgah/research/<slug>/`,
5
+ the CLI that scaffolds and refuses it, and the conditional rule that routes a
6
+ research task to OpenResearch instead of ad-hoc scripting. Read this page before
7
+ you start a line, before you change what `check` refuses, and when a session
8
+ reported a result you have to re-verify. The workspace and the checks live in
9
+ `hooks/tezgah_research.py`; the session-facing rule is `RESEARCH`
10
+ (`hooks/tezgah_policy.py::RESEARCH`) and the tool is `bin/tezgah-research`.
11
+
12
+ The layer exists because a claim is only auditable if the repository holds the
13
+ prediction it was tested against. `protocol.md` is committed **before** the run
14
+ and `results.jsonl` after it, and `check` asks git whether that order holds - a
15
+ protocol written once the numbers are in is not a prediction
16
+ (`_check_protocol_order`, `hooks/tezgah_research.py::_check_protocol_order`). Three things the same
17
+ file answers that nothing read until now are read too: what the protocol
18
+ predicts and what would falsify it (`_check_protocol`,
19
+ `hooks/tezgah_research.py::_check_protocol`), what a concluded line's report does *not*
20
+ show (`_check_report`, `hooks/tezgah_research.py::_check_report`), and which claim a later
21
+ claim replaced (`_check_supersedes`, `hooks/tezgah_research.py::_check_supersedes`).
22
+ `predictions.jsonl` is the other half of the same idea and the one a refinement
23
+ loop needs: one row per proposed harness-text change, bound to the `commit` the
24
+ change landed in rather than to the session that proposed it, so the round after
25
+ it can falsify the prediction instead of remembering it.
26
+
27
+ ## Where a line lives: open/, done/
28
+
29
+ A line is a directory under `.tezgah/research/`, and the layout is plans': a line
30
+ in flight sits in `open/<slug>/`, and a line that concluded or was closed as a
31
+ limit moves to `done/<slug>/` (`hooks/tezgah_research.py::move_line`). One
32
+ resolver answers where a line is (`hooks/tezgah_research.py::line_dir`), and
33
+ every reader uses it: `slugs`, `status`, the session note, the checker. A
34
+ workspace from before the split still holds flat `research/<slug>/` directories -
35
+ the resolver falls back to them, `status` says the workspace needs
36
+ `tezgah-research migrate-layout`, and that command moves each flat line to `open/`
37
+ or `done/` by its own state, idempotently.
38
+
39
+ ## The ask contract
40
+
41
+ A line that states an ask (rules 3 onward) carries the user's words and a way to
42
+ judge the answer:
43
+
44
+ - `init <slug> --ask "<the user's words>"` - required; `--tier quick` refuses a
45
+ line outright, because a question small enough to answer in the reply gets no
46
+ line at all. `study` is the default, `program` the full machinery.
47
+ - `state.json` `ask` (verbatim), `tier`, and `success`: one row per part of the
48
+ ask, `{id, criterion}`, written before any experiment.
49
+ - `tezgah-research verdict <slug> <id> met|not-met|unanswerable --evidence <ref>`
50
+ records the judgement with the pointer it rests on.
51
+ - `tezgah-research conclude <slug>` refuses until every criterion carries a
52
+ verdict, then moves the line to `done/`.
53
+ - `close --limit "<what is left>" --ack "<what the user said>"` is the way out
54
+ when a criterion is `not-met`: `check` refuses a conclusion over an unjudged or
55
+ unmet criterion without an acknowledgement, and `check <slug>` and `check
56
+ --all-lines` keep refusing such a concluded line as unanswered
57
+ (`hooks/tezgah_research.py::unanswered`).
58
+
59
+ The reason: 4 of 11 sampled lines in this workspace concluded with the ask
60
+ unanswered and 0 of 416 claims cited any part of it (measured 2026-10-01), because
61
+ nothing recorded the ask and `close --limit` accepted any string.
62
+
63
+ ## Rule versions
64
+
65
+ `state.json` `rules` is the line's format version. `init` writes `RULES`, the
66
+ newest set (`hooks/tezgah_research.py::RULES`). Each set keeps its own gate. Rules 2
67
+ are the standards rules. Rules 3 add the ask contract. Rules 4 add the protocol
68
+ sections below. A bump never weakens an older set.
69
+
70
+ A `rules` above `RULES` means a later tezgah wrote the line. `check` then reports
71
+ one error that names both numbers and reads nothing else. The writers refuse the
72
+ line too: `claim`, `predict`, `compare`, `source --run`, `verdict`, `conclude`,
73
+ `close` and `migrate` (`newer_rules`). Upgrade tezgah to work on such a line.
74
+
75
+ ## Protocol sections (rules 4)
76
+
77
+ On an older line, a protocol passes on a prediction word and a falsifier word.
78
+ That let `prediction:` with nothing after it pass. Reading sections out of prose
79
+ then kept misreading new shapes, so a rules-4 line declares its answers as
80
+ `key: value` labels (`protocol_labels`). A label starts at column 0, and its key
81
+ matches in any case. Its value is the rest of the line plus the indented or `- `
82
+ lines under it. A blank line or the next column-0 line ends it. `check` reads no
83
+ heading and no prose. It refuses the protocol when:
84
+
85
+ - `prediction:`, `falsifier:`, `metric:` or `unit:` is missing or empty.
86
+ - the prediction and falsifier say the same thing, ignoring case, spacing,
87
+ punctuation and emphasis.
88
+ - `headroom:` is missing. It says how much the change could move at best, before
89
+ any arm runs. A survey with no arms writes `n/a` and a reason. Once results
90
+ exist, `check` also refuses a headroom that projects none. `check` first drops
91
+ `*`, `_`, `` ` `` and `~`. Such a value then holds no nonzero number. It is `none`,
92
+ `no`, `zero`, `nil`, `0`, `negligible` or `nothing to gain`. Or it starts
93
+ `none `, `none,`, `no headroom`, `0 `, `zero `, `no gain` or `no room`. A
94
+ leading `0.0%`, `0 %`, `0 tokens` or `0 ms` reads as `0`. A digit inside a
95
+ name such as `p95` is not a number. `0.5%`, `0 – 15%`, `no more than 12%` and
96
+ `0% today, up to 40% could` are headroom.
97
+ - `unit:` counts tokens and `tokenizer:` or `bound:` (the under-reporting bound)
98
+ is empty. `check` lower-cases the unit and reads punctuation and `_` as spaces.
99
+ The head is the words before the first `per`. The unit counts tokens when a
100
+ head word is `token`, `tokens`, `tok`, `toks` or `ktokens`. A time word as the
101
+ last head word (`ms`, `s`, `sec`, `seconds`, `latency`, `time`) cancels it. So
102
+ `prompt tokens per turn`, `input_tokens` and `tok/turn` count tokens.
103
+ `token latency ms` and `tokenset` do not. The metric's wording never decides
104
+ it.
105
+
106
+ An `evidence` claim gets the token rule only through the protocols it cites.
107
+ `check` refuses the claim when a cited protocol's `unit:` is tokens and it
108
+ leaves `tokenizer:` or `bound:` empty. The claim's own prose is never read for
109
+ it. The rules come from the gortex/SoL-Pi adoption's ideas 3 and 4 and from the
110
+ layer audit's P2 probe (`_check_protocol_sections`, `_token_claim_problem`).
111
+ Older lines keep the word rule.
112
+
113
+ ## One line, one directory
114
+
115
+ | Path | Holds |
116
+ |---|---|
117
+ | `state.json` | the question, the phase (`bootstrap`/`inner`/`outer`/`concluded`), the direction, the locked evaluation and its optional second gate (`capability_tolerance`, `counter_metric`), the session events (`PHASES`, `hooks/tezgah_research.py::PHASES`), `rules` (the rule set `init` opened it under, `RULES`), `deliverable` (`kind`, `path`, `ask`, `min_variants`), `supersedes` for a new version of an older line, and `closed` once `close` records a deliberate limit. The phase is the author's declaration; `derived_phase` (`hooks/tezgah_research.py::derived_phase`) reads the *other* authority beside it from the line's own artifacts, and the checker names the two disagreeing |
118
+ | `log.md` | the decision log, newest last: one line per decision, experiment, dead end or pivot, with the evidence that drove it |
119
+ | `findings.md` | the four sections every line answers, named by `FINDINGS_SECTIONS` (`hooks/tezgah_research.py::FINDINGS_SECTIONS`) |
120
+ | `claims.jsonl` | one JSON object per row: `statement`, `falsification`, `proof`, `provenance`, `status`, `kind`, `scope` (what the claim's numbers were measured on, which may not be wider than the rows it rests on), and `supersedes` when the row replaces an earlier claim |
121
+ | `predictions.jsonl` | one JSON object per row: `commit` (a 40-character sha the row is bound to), `claim` (an id the line holds, or empty when the prediction stands alone), `metric`, `value_before`, `value_after`, `falsifier`, `components` (the keys of the components the change touches, read from `hooks/tezgah_components.py`), and `granted_by` when a human granted what the frozen paths below forbid |
122
+ | `experiments/<hypothesis>/protocol.md` | what the change is, what it predicts, what result would falsify it, why - committed before the run |
123
+ | `experiments/<hypothesis>/results.jsonl` | the rows the run produced, one JSON object per non-blank line, each carrying a non-empty `source` and, once declared, a `scope` of `real`, `fixture` or `derived`, and - when that scope is `fixture` - a `fixture` description of what was generated |
124
+ | `experiments/<hypothesis>/analysis.md` | what the rows mean, and which claim they move |
125
+ | `experiments/<hypothesis>/raw/<runId>.log` | the OpenResearch receipt `source` writes for one run |
126
+ | `literature/**` | one file per source, at any depth and of any extension |
127
+ | `literature/INDEX.jsonl` | the index that says which sources exist and which were used; `class` is `formal`, `grey` or `agent-report` |
128
+ | `decisions/<id>/` | one comparison of the deliverable's variants: `criteria.json`, `variants.jsonl`, `comparison.jsonl`, `decision.md` (see "Variants of the deliverable") |
129
+ | `to_human/report.md` | the reader's copy: what was established, what the evidence does not show, and the four validity threats |
130
+ | `to_human/review.json` | the six-dimension review by a `reviewer` other than the `producer`, owed once a report exists |
131
+
132
+ `init` writes the first four plus the three directories and never overwrites a
133
+ file that exists (`init`, `hooks/tezgah_research.py::init`); `predictions.jsonl` is not
134
+ one of them, because a file that exists without a row is a line that looks like
135
+ it predicted something - it appears with the first `predict` the line records,
136
+ and `check` reads an absent one as no rows rather than as a missing file. A slug
137
+ is lowercase letters, digits and dashes (`valid_slug`,
138
+ `hooks/tezgah_research.py::valid_slug`), because it is the directory name `check`, `status` and
139
+ `claim` look for.
140
+
141
+ ## One open line at a time
142
+
143
+ A line is **open** until its work is either applied or deliberately not, and the
144
+ line is closed. Concretely, `open_lines` (`hooks/tezgah_research.py`) calls a line
145
+ open unless all of these hold: `phase` is `concluded`; no claim is still
146
+ `hypothesis` or `testing` *among the rows nothing supersedes*; every experiment
147
+ that has a `protocol.md` also has results and an analysis; `to_human/report.md`
148
+ and `to_human/review.json` exist; every review finding carries a `status`; and a
149
+ deliverable that takes compared variants has a decision holding them and its
150
+ `decision.md`. A line `close` concluded is not open. Those are exactly the reasons
151
+ `init` prints, one line per open line.
152
+
153
+ The supersede half of that is a rule about an append-only file rather than an
154
+ exception: a row another row supersedes keeps the status it was left in for ever -
155
+ nothing rewrites `claims.jsonl` - so reading its own status would leave the older
156
+ `hypothesis` live and the line open with no session able to close it. A row whose
157
+ `id` appears as another row's `supersedes` is therefore read through the row that
158
+ replaced it, only the newest row of a chain decides, and a replacement that is
159
+ itself `hypothesis` or `testing` keeps the line open under its own id.
160
+
161
+ The rule exists because it was broken the other way round: on 2026-09-22 this
162
+ repository held thirteen lines, eleven of them carrying unfinished work, while
163
+ later lines were opened on top of them - an unrun pre-registered experiment, a
164
+ missing report, a claim left at `hypothesis`. A line that is never closed is also
165
+ never decided, and a second line started over it hides the first.
166
+
167
+ So `tezgah-research init` refuses while anything is open, and the armed research
168
+ rule names the open lines with their reason counts on every research turn
169
+ (`open_note`, `hooks/tezgah_policy.py`). The way past is `--allow-open
170
+ "<reason>"`, which writes the reason into the new line's `log.md` - an explicit
171
+ decision on the record instead of a silent second line - and which is itself
172
+ refused while any open line has `check` errors (`broken_open_lines`): a hatch past
173
+ broken lines is how they stayed broken. What is left of a line that will not be
174
+ finished is recorded with `tezgah-research close <slug> --limit "<reason>"`
175
+ (`close_line`), which concludes it and writes the reasons it was still open into
176
+ `state.json` `closed` and `log.md` and seals it ("the order seal", below).
177
+ Its errors show in `check <slug>` and `check --all-lines`; the no-slug `check`
178
+ reads it by its seal hashes and counts it on one line (ADR 015). The
179
+ prompt-time note reads a line's `state.json`, its experiment directory and its
180
+ review, never `claims.jsonl`, so a line open *only* because of a live claim is
181
+ named by `init` and not by the note; that split is the note's cost budget and is
182
+ stated in the rule's own comment.
183
+
184
+ ## The CLI
185
+
186
+ `bin/tezgah-research` is the only writer and the only reader of the workspace;
187
+ the no-slug check a session runs from the shell reads the same lines the session
188
+ note does (`check`, `hooks/tezgah_research.py::check`): each open line through
189
+ `check_line` (`hooks/tezgah_research.py::check_line`), each line under `done/`
190
+ through its seal.
191
+
192
+ | Command | What it does | Exit |
193
+ |---|---|---|
194
+ | `tezgah-research init <slug> [--question "..."] [--allow-open "<reason>"] [--supersedes <slug>]` | scaffolds the line and makes sure `.tezgah/` is ignored by the project and has its own git repository (`tezgah_paths.ensure_workspace`). It refuses while another line is still open (see below), names each open line and its reasons one per line, and `--allow-open "<reason>"` is the way past unless an open line has `check` errors: the reason lands in the new line's `log.md` as its first entry, and an empty reason is misuse. A `--question` another line already asks is refused unless `--supersedes <that line>` says the new line is its next version (`serial_twins`). Its next-step message names the commit loop: `tezgah-research commit` for the protocol, then again for the results in a later commit (`cmd_init`, `bin/tezgah-research`) | 0, 1 refused, 2 misuse |
195
+ | `tezgah-research commit <slug> "<message>"` | stages and commits only that line's path in `.tezgah`'s private repository - the commit the order rule reads (`cmd_commit`, `bin/tezgah-research`) | 0, 1 not a work tree or git failed, 2 misuse |
196
+ | `tezgah-research check [<slug>] [--json] [--strict] [--orx] [--all-lines] [-- <slug>]` | the discipline checks below. With no slug it checks the open lines in full and a line under `done/` by its order seal alone (`done_seal`, `hooks/tezgah_research.py::done_seal`), naming it only when the seal fails or its `state.json` or seal cannot be read, then prints `research: <n> done line(s): <s> checked by their seal, <u> unsealed (not checked); ...`; `--all-lines` checks every line in full, and `check <slug>` always checks that line in full (ADR 015). `--json` prints the report (no-slug default: the open lines and any done line whose seal read fails), `--strict` turns the unverifiable class into a refusal, `--orx` adds the registry check that asks `orx project view` for this repository (`check_orx`, `hooks/tezgah_research.py::check_orx`); a slug after `--` is never read as a flag, which is how the MCP tool `tezgah_research_check` passes its validated `slug` | 0 clean, 1 a line failed a rule or names no line |
197
+ | `tezgah-research status` | one line per line: an open line `ok` or a problem count, a line under `done/` read by its seal like the no-slug `check` - `done, seal ok`, `done, <n> seal problem(s)` or `done, unsealed (not checked)` (`summary`, `hooks/tezgah_research.py::summary`, plan 058 part 4) | 0 |
198
+ | `tezgah-research --all` | every checkout of this repository (the main checkout and each linked `git worktree`, `tezgah_paths.worktrees`), one header per checkout, then ` <slug>: <phase>` per line with the reasons it is still open; a checkout with none says `no research line`. Read-only: each checkout keeps its own `.tezgah`, locks and private repository, and nothing here writes to any of them (`across`, `hooks/tezgah_research.py::across`) | 0, 2 misuse |
199
+ | `tezgah-research claim <slug>` | reads one claim from stdin and either appends it under an exclusive lock or refuses it, printing one reason per problem | 0, 1 refused, 2 misuse |
200
+ | `tezgah-research predict <slug>` | reads one prediction row from stdin and either appends it under the same lock or refuses it with one reason per problem; a row whose `commit` git cannot place is appended with the warning printed, which is the fail-open `check` uses, and a row written now has to name at least one component the manifest defines (`append_prediction`, `hooks/tezgah_research.py::append_prediction`) | 0, 1 refused, 2 misuse |
201
+ | `tezgah-research components [--json]` | the per-component report: one bucket per component the manifest defines, in the manifest's own order, then any key a row names that the manifest does not, each holding the prediction rows that name it and each row's state, and last the rows that name no component; it prints the number of components and rows it read (`component_report`, `hooks/tezgah_research.py::component_report`) | 0, 2 misuse |
202
+ | `tezgah-research migrate <slug> [--dry-run]` | derives the fields a line written before these rules cannot carry, prints what it derived and what it could not, and is idempotent (`migrate`, `hooks/tezgah_research.py::migrate`) | 0, 2 misuse |
203
+ | `tezgah-research source <slug> <hypothesis> --run <orxRunId> [--command "..."] [--scope real\|fixture\|derived] [--fixture "<what was generated>"]` | keeps the receipt: runs `orx logs <runId>`, writes `raw/<runId>.log`, appends the results row `{"source": "orx:<runId>", ...}` and the scope and fixture description the filer states (`source_run`, `hooks/tezgah_research.py::source_run`). A `--scope fixture` filed without `--fixture` still writes the row and prints the field it still owes, so the tool is never the thing that makes its own checker warn silently; a given `--fixture` that is empty is misuse | 0, 1 nothing filed, 2 without orx |
204
+ | `tezgah-research compare <slug> <decision>` | reads one variants x criteria cell from stdin and appends it to `decisions/<decision>/comparison.jsonl` under the lock, or refuses it by the rule `check` applies (`append_comparison` and `comparison_problems`, `hooks/tezgah_research.py`); it notes when `criteria.json` is not committed yet | 0, 1 refused, 2 misuse |
205
+ | `tezgah-research close <slug> --limit "<reason>"` | concludes the line as a deliberate limit, writing the reasons it was still open into `state.json` `closed` and `log.md`, and seals it (`close_line`) | 0, 1 unreadable state, 2 misuse |
206
+ | `tezgah-research seal <slug> [--history-lost] --ack "<owner decision>"` | seals a line under `done/` that was concluded before seals existed: plainly, as `conclude` would, when every experiment's order still checks; with `--history-lost`, with that verdict for every experiment whose order the lost history left undecidable. Refuses a line with a real order violation, a plain seal on any order finding, and a `history-lost` seal with nothing lost (`retro_seal`, `hooks/tezgah_research.py::retro_seal`) | 0, 1 refused, 2 misuse |
207
+ | `tezgah-research import <checkout> [<slug>] [--allow-open "<reason>"]` | brings a line - or every line this checkout lacks - from another checkout's `.tezgah` repository with its history; an open line arrives beside open ones only with `--allow-open` (`import_line`, `hooks/tezgah_research.py::import_line`) | 0, 1 refused, 2 misuse |
208
+
209
+ Exit code 2 is always misuse, so a caller can tell it from a line that fails the
210
+ checks (`misuse`, `bin/tezgah-research::misuse`). `check` asks nothing at all - no
211
+ network, no model - so its answer is reproducible on a machine with no
212
+ credential; only `--orx` asks the one question that leaves the machine.
213
+
214
+ ## The pair the order rule compares
215
+
216
+ The order rule is decided on the commit graph, so it needs both files committable
217
+ and it needs them as two commits. Whether they are is a question about the two
218
+ files, not about the line's directory: an ignore rule can cover the directory
219
+ while the pair is tracked, and a directory that is tracked says nothing about the
220
+ results inside it. `_check_tracking`
221
+ (`hooks/tezgah_research.py::_check_tracking`) therefore probes each experiment's
222
+ `protocol.md` and `results.jsonl` with `_ignored`
223
+ (`hooks/tezgah_research.py::_ignored`) - the plain question *can `git add` stage
224
+ this?*, which git's `check-ignore` answers as no for a path the index already
225
+ holds - and reports the pair that is ignored.
226
+
227
+ The loop that keeps the order decidable, stated once here because the failure is
228
+ silent: **commit the protocol** (that commit is the prediction), **run, then
229
+ commit the results in a later commit**. Both commits land in `.tezgah`'s private
230
+ repository - the project ignores `.tezgah/` and never stages it:
231
+
232
+ ```sh
233
+ tezgah-research commit <slug> "protocol <h>" # = git -C .tezgah add ... && git -C .tezgah commit
234
+ # run it
235
+ tezgah-research commit <slug> "results <h>"
236
+ ```
237
+
238
+ `_ignored` asks the repository that commits the file - the private one when it
239
+ exists, else the project's - and the history helpers (`_histories`,
240
+ `_oldest_adds`, `_top_for`, `is_ancestor`) read both histories. An **order** - the
241
+ first add of a protocol, results, criteria or comparison, the first lock - is read
242
+ along each history's HEAD and never `--all`: a side branch, an abandoned draft, a
243
+ stash or a backdated orphan is not the record, and reading every ref took the
244
+ date-oldest add among them. A **rewrite** - a committed row changed or removed
245
+ (`file_versions`), a protocol edited after the run - is read across every ref of
246
+ the private repository: a row amended away while a tag keeps the old commit is
247
+ a rewrite HEAD alone no longer shows, and a side ref can only add such evidence,
248
+ so it refuses and never passes. A line the project committed before the move
249
+ still proves its order there. A prediction's `commit` names a product commit and
250
+ is placed only in the project's history.
251
+
252
+ ### What the order rule accepts
253
+
254
+ `_check_protocol_order` (`hooks/tezgah_research.py::_check_protocol_order`) accepts one proof.
255
+
256
+ **(A) the add-before-add rule.** The commit that added `protocol.md` must be a
257
+ *strict* ancestor, in HEAD's lineage, of the commit that added `results.jsonl` -
258
+ one commit adding both proves nothing, because the plan and the numbers would
259
+ share an instant. The commit graph decides this, not the dates: a rebase rewrites
260
+ dates but not ancestry. Every history that holds the results' add has to agree
261
+ (`_answers`): a history that committed the results with no protocol before them
262
+ refuses, whatever the other one shows. One exception orders across the two: the
263
+ private repository's import that added both at once, after the project
264
+ committed the protocol and never the results, is the plan first - the move is
265
+ the premise, and a project protocol committed after an import that already held
266
+ the results is its ceiling. The second half asks whether the protocol changed
267
+ after the run and compares **blobs** (`_changed_after`, `_changed_at_tips`): the
268
+ blob of `protocol.md` at the results' add must equal the blob at the tip of every
269
+ history that carries it. A commit that only deleted the path or took it out of
270
+ the index (`git rm --cached`, what the 2026-09-24 commit did to `.tezgah/`) leaves
271
+ that blob alone and is not a change; the working-tree file is then compared
272
+ instead, so a protocol untracked and rewritten on disk is one. A commit another
273
+ ref keeps that descends from the run and holds another blob is an edit after the
274
+ run HEAD dropped. The other history's tip is a change when that history held the
275
+ run's blob on any ref and moved off it - a pre-run draft restored after the run
276
+ included. When it never held the run's blob, nothing dates its version against
277
+ the run: that is a warning, and
278
+ `--strict` refuses it. A history git cannot read is the same class: a warning,
279
+ refused under `--strict`.
280
+
281
+ **What history a row counts in.** Each comparison stays inside one repository's
282
+ history: the project's commits in the project's, the private `.tezgah`
283
+ repository's in its own (`is_ancestor`, `hooks/tezgah_research.py::is_ancestor`). A project
284
+ commit and a private-repository commit are two unrelated histories whose shas
285
+ alone order nothing - the guess that any project commit precedes any private one
286
+ was removed, and a pair the graph cannot order is reported as undecided, never
287
+ passed; the one cross-history order kept is the import exception in (A). A
288
+ prediction's `commit` is placed in the project's history only: a commit HEAD
289
+ does not reach, a benchmark pin or one a re-root left behind, stays refused.
290
+ Neither rule has a waiver.
291
+
292
+ **No history bridge.** A re-root - the whole tree landing in one "initial
293
+ commit" - leaves every experiment's two files in one add, which (A) refuses. A
294
+ declared bridge (`.tezgah/history-bridge.json`, an anchor tag pinning the old
295
+ history) used to stand in for the lost order; it proved no experiment on this
296
+ repository's workspace, and ADR 015 deleted it. The file is no longer read. A
297
+ history that is really gone is recorded instead by the seal's `history-lost`
298
+ verdict (below).
299
+
300
+ ### What the order proves, and the order seal
301
+
302
+ Protocol-before-results proves **commit order, not run order**. Git records that
303
+ the protocol entered the history before the results did. It records nothing
304
+ about when the run itself happened. A session can run first, commit the
305
+ protocol, and hold the results back until after: the rule passes that. It makes
306
+ the shortcut deliberate, not impossible. `source --run` checks only that
307
+ `protocol.md` exists on disk, not that a commit holds it (`source_run`,
308
+ `hooks/tezgah_research.py::source_run`).
309
+
310
+ A history can also go missing. The 2026-10-04 re-root left most concluded
311
+ lines' commits unresolvable. So `conclude` and `close` **seal** the line
312
+ (`order_seal`, `hooks/tezgah_research.py::order_seal`). The seal is
313
+ `state.json` `order_seal`. Per experiment it holds the sha256 of `protocol.md`
314
+ and of `results.jsonl`, with the add commits beside them as information only.
315
+ It stores no order verdict. While both blobs still hash as sealed, `check`
316
+ re-derives the order from git. So a line closed before its results reached a
317
+ commit keeps no "not committed yet" answer: committing them afterwards settles
318
+ it.
319
+
320
+ `check_line` verifies the hashes on every run, with or without git (`_check_seal`,
321
+ `hooks/tezgah_research.py::_check_seal`). An edited, removed or added experiment
322
+ fails the line. The session note (`failing`, `hooks/tezgah_research.py::failing`)
323
+ and the no-slug `check` (`check` with `all_lines=False`,
324
+ `hooks/tezgah_research.py::check`) read a line under `done/` by these hashes
325
+ alone, not by `check_line`. So they see an edit after the conclusion, and the
326
+ line's other findings stay with `check <slug>` and `check --all-lines` (ADR 015).
327
+ A line under `done/` without a seal adds nothing to either. The no-slug `check`
328
+ counts it as unsealed. A `state.json` that does not parse, or a seal that is
329
+ not an object with an `experiments` object, fails the line (`done_seal`). On a
330
+ copy of this repository's workspace (34 lines, 33 under `done/`) the note took
331
+ 0.014 s instead of 0.67 s. The ceiling: the seal sits in the line's own `state.json`.
332
+ Whoever edits `results.jsonl` can recompute the seal there too. It catches an
333
+ edit, not a forger.
334
+
335
+ A line concluded before seals existed carries none. The owner's verdict for
336
+ those lines (ADR 009) is `history-lost`. `tezgah-research seal <slug>
337
+ --history-lost --ack "<the owner's decision>"` writes it (`retro_seal`,
338
+ `hooks/tezgah_research.py::retro_seal`). It covers only an order the lost
339
+ history left undecidable (`LOST_HISTORY`,
340
+ `hooks/tezgah_research.py::LOST_HISTORY`). That is git that cannot answer, a
341
+ pair split across two histories, or versions git cannot place. Such an
342
+ experiment gets
343
+ `history-lost`, and `finding` keeps what the check said. `check` then warns
344
+ about it and names the ack (`_sealed_order`,
345
+ `hooks/tezgah_research.py::_sealed_order`), and `--strict` refuses it. An
346
+ experiment whose order still checks stays re-derived. The command refuses a
347
+ line with a real violation and prints the finding, which stays an error. A real
348
+ violation is one commit that added both files, a protocol added or changed after
349
+ the run, or a file with no commit yet. It also refuses a line with nothing lost.
350
+ The command takes only a line under `done/`, only once, only with an ack.
351
+
352
+ Without `--history-lost` (ADR 018) the command writes the plain seal `conclude`
353
+ writes, for a line whose every experiment's order still checks. The ack goes to
354
+ `log.md`. Any order finding refuses it: a lost history points to
355
+ `--history-lost`, and a real violation leaves the line unsealed.
356
+
357
+ ### Moving a line between checkouts
358
+
359
+ Each checkout keeps its own `.tezgah` repository, and that repository has no
360
+ remote. One directory on one disk holds the only copy of a line's order proof.
361
+ A **copy** of a line, committed in another checkout, lands protocol and results
362
+ in one commit. The copy destroys the proof: `check` refuses it as "one commit
363
+ added both". `tezgah-research import <checkout> [<slug>]` moves the line with
364
+ its history instead (`import_line`). It fetches the other checkout's repository
365
+ from its disk path. It merges that history as a second parent with
366
+ `--allow-unrelated-histories -s ours`. It then takes only the imported lines'
367
+ paths from it. The source's commits order the pair here, and none of its other
368
+ lines arrive. A workspace with no commit yet first gets an empty root commit.
369
+ The same merge follows, so the source's history is never its first parent.
370
+ `import` refuses a plain copy: a line the source never committed, or a source
371
+ with no `.tezgah` repository. It also refuses a slug this checkout already
372
+ holds, and a landing path that exists as something other than a line directory.
373
+ A line arriving from the source's `open/` is a new open line here, so `init`'s
374
+ rule applies. While another line here is still open, `import` refuses it unless
375
+ `--allow-open "<reason>"` says why. The reason lands in the line's `log.md` in
376
+ the import commit. A private remote for `.tezgah` stays the owner's call, and
377
+ `import` needs none.
378
+
379
+ ## Two gates, when one locked metric is not enough
380
+
381
+ A line locks one metric, and one is still enough. Beside `metric`, `baseline` and
382
+ `locked_at` a line **may** write two more fields, and this is available rather
383
+ than required - every one of the fourteen lines in this tree locks the first three
384
+ and carries neither of these, and `check` neither demands them nor warns that they
385
+ are missing:
386
+
387
+ - `capability_tolerance` - the band the capability metric has to stay inside
388
+ before a result counts at all, written as the sentence a reader checks it
389
+ against: *"capability metric within 0.02 of the baseline"*;
390
+ - `counter_metric` - the non-empty name of the metric the change is supposed to
391
+ move.
392
+
393
+ A candidate then has to pass both gates - inside the tolerance **and** an
394
+ improvement on the counter-metric - and the survivors are compared against each
395
+ other on the Pareto frontier instead of by the sign of a single number
396
+ (`_check_evaluation`, `hooks/tezgah_research.py::_check_evaluation`, and the two paragraphs the skill
397
+ carries where a session reads the loop).
398
+
399
+ The rule exists for two failures this layer has already paid for. **A candidate
400
+ can buy its gain by moving the metric**: one number improved says nothing about
401
+ the number that was not measured, and this tree has exactly that record - an
402
+ experiment whose secondary number swung from 2.20 to 0.00 between two runs of the
403
+ same configuration, with nothing in the locked evaluation shaped to catch it. A
404
+ declared capability band is what refuses that trade by construction. **And an
405
+ optimizer can be the thing judged**: the fields are read by `check`, which lives
406
+ in `hooks/tezgah_research.py`, a module the frozen set forbids a prediction's
407
+ commit to touch without a human `granted_by` (`FROZEN_PATHS`), so the gate that
408
+ decides which candidate survives is not machinery the candidate can rewrite.
409
+
410
+ What the pair cannot catch: **a tolerance its own author sets wide enough**. The
411
+ band is a sentence, not a measurement, and `check` can see that it is written and
412
+ readable - never that 0.02 is tight. A line that writes "capability metric within
413
+ 5.0 of the baseline" has adopted the form of the two-gate rule and none of its
414
+ force, and the review is the only place that is decided.
415
+
416
+ ## What `check` refuses, and what it only warns about
417
+
418
+ A **refusal** (exit 1) is a guarantee the checker can decide. A **warning** is a
419
+ guarantee it cannot: the artifact is not wrong, it is unverifiable. `--strict`
420
+ turns that whole class into a refusal, which is what a release gate wants and
421
+ what a session mid-flight must not have, so the default stays `warn`.
422
+
423
+ Refused:
424
+
425
+ - a required file missing (`STATE_FILES`, `hooks/tezgah_research.py::STATE_FILES`), a
426
+ `state.json` that does not parse, no question, or a `phase`/`direction` outside
427
+ its enum (`_check_state`, `hooks/tezgah_research.py::_check_state`);
428
+ - `evaluation.metric`, `evaluation.baseline` or `evaluation.locked_at` empty
429
+ once `phase != "bootstrap"` - a criterion chosen after seeing the results is not
430
+ a criterion (`_check_evaluation`, `hooks/tezgah_research.py::_check_evaluation`) - or an
431
+ `environment` that is not the object it is optional as, or a
432
+ `capability_tolerance`/`counter_metric` that is present and names nothing - an
433
+ empty string, a blank one, or a value of the wrong type. The two-gate pair is
434
+ refused in that state only: an absent key is a line that locks one metric, which
435
+ is the ordinary shape and every line in this tree, so nothing here fires on the
436
+ absence (`_check_evaluation`, `hooks/tezgah_research.py::_check_evaluation`);
437
+ - a `sessions[]` entry that is not an object, one whose `date` is empty, or one
438
+ whose `tag` is outside `PROVENANCE` (`hooks/tezgah_research.py::PROVENANCE`): an
439
+ untagged inference reads as the user's word. The older `{date, events: [...]}`
440
+ shape carries the tag on each event, and each of those is checked the same way;
441
+ - a `findings.md` that does not answer all four sections
442
+ (`_check_findings`, `hooks/tezgah_research.py::_check_findings`);
443
+ - a claim that states nothing, carries no falsification criterion
444
+ (`_check_claims`, `hooks/tezgah_research.py::_check_claims`) or cites no proof; a proof
445
+ naming no artifact at all, whatever the kind; a `kind` outside `KINDS`; an
446
+ `evidence` claim naming nothing the line produced, a `literature` claim citing
447
+ no note under `literature/`, a `derivation` token the line does not hold
448
+ (`_check_proof`, `hooks/tezgah_research.py::_check_proof`); a token the line never
449
+ produced (`_resolves`, `hooks/tezgah_research.py::_resolves`); a `provenance` or
450
+ `status` outside its enum;
451
+ - a claim whose `supersedes` is neither a claim id nor a list of them, or that
452
+ names an id no claim in the line carries
453
+ (`_check_supersedes`, `hooks/tezgah_research.py::_check_supersedes`): a relation to nothing is
454
+ the same as none, and the write path refuses it too
455
+ (`_supersedes`, `hooks/tezgah_research.py::_supersedes`);
456
+ - a prediction row that names no `commit` or a `commit` that is not a
457
+ 40-character sha, one whose `commit` is not an ancestor of HEAD, one whose
458
+ `metric` or `value_before` carries no number to move, one with no `falsifier`,
459
+ one whose `claim` names an id the line does not hold, or one whose `components`
460
+ is not a non-empty list of keys the manifest defines - a key nothing defines
461
+ cannot attribute the change to a component, which is what the field is for, and
462
+ the write path refuses both of those the same way
463
+ (`prediction_problems`, `hooks/tezgah_research.py::prediction_problems`); a row whose commit changed
464
+ a **frozen** path is refused unless it carries a human `granted_by`, and the
465
+ frozen set is one module-level tuple, `FROZEN_PATHS`
466
+ (`hooks/tezgah_research.py::FROZEN_PATHS`), read only through `_frozen`
467
+ (`hooks/tezgah_research.py::_frozen`) so the write path and the checker cannot drift
468
+ apart: `hooks/tezgah_gate.py` and `hooks/tezgah_integrity.py` (the verifier and
469
+ the ledger's write path), `hooks/tezgah_research.py` (this module - the
470
+ machinery that decides the rule, which the loop it judges may not edit), any
471
+ `tests/` path (the hidden checks), `benchmarks/`, and any line's
472
+ `experiments/*/protocol.md` (the pre-registration);
473
+ - an `orx:<runId>` proof token with no `raw/<runId>.log` under the line or the
474
+ repository;
475
+ - an experiment with no `protocol.md`, results with no `analysis.md`
476
+ (`_check_experiments`, `hooks/tezgah_research.py::_check_experiments`), or a git history in
477
+ which `protocol.md` entered after `results.jsonl`, entered in the same commit,
478
+ or changed after the run;
479
+ - a `results.jsonl` line that does not parse or is not an object, a row whose
480
+ `source` is present and blank, or a `fixture`-scoped row whose `fixture`
481
+ description is present and empty or not a string - the row claims the field and
482
+ names nothing (`_check_rows`, `hooks/tezgah_research.py::_check_rows`);
483
+ - a row or a claim whose `scope` is present and outside `SCOPES` (`real`,
484
+ `fixture`, `derived`) - a label nothing shares is a label no reader can weigh -
485
+ or a claim that declares `real` over rows that all record `fixture`: the field is
486
+ what the producer saw, and a claim may not claim a wider one than its evidence
487
+ (`_check_claim_scope`, `hooks/tezgah_research.py::_check_claim_scope`); the write path refuses the
488
+ same two (`claim_problems`, `hooks/tezgah_research.py::claim_problems`);
489
+ - `literature/` holding notes and no `INDEX.jsonl` at all, an INDEX line that
490
+ does not parse or is not an object, an INDEX row naming no note or naming a
491
+ file `literature/` does not hold, a `class` outside `formal`/`grey`, or a note
492
+ the index does not name (`_check_literature`, `hooks/tezgah_research.py::_check_literature`;
493
+ `_read_index`, `hooks/tezgah_research.py::_read_index`);
494
+ - a `review.json` that does not parse, carries no `dimensions` or `findings`, a
495
+ dimension missing or outside 1-5, a `severity` outside
496
+ `critical`/`major`/`minor`/`suggestion`, a finding targeting no file or quoting
497
+ nothing, or a finding whose `quote` does not occur verbatim in its `target`
498
+ (`_check_review`, `hooks/tezgah_research.py::_check_review`).
499
+
500
+ Warned, and refused under `--strict` - each is the honest state of an artifact
501
+ this layer cannot decide on, not a defect:
502
+
503
+ - a file whose rows declare no `scope`: the field cannot be inferred afterwards -
504
+ a probe run against a generated repository and a measurement of the running
505
+ system read identically once the run is over - so this is reported once per file
506
+ with the count, and `--strict` refuses it (`_check_rows`,
507
+ `hooks/tezgah_research.py::_check_rows`). The same class as a row written before `source` did:
508
+ the fix is the producer's to write, and every rule here only names it;
509
+ - a row that declares `scope: fixture` and does not say what was generated: the
510
+ scope names the class and the field beside it names the input, so a row written
511
+ before this one warns with the count and `--strict` refuses it - a class a reader
512
+ cannot size is not an input they can weigh (`_check_rows`,
513
+ `hooks/tezgah_research.py::_check_rows`);
514
+ - a claim resting on a fixture row that declares no scope of its own
515
+ (`_check_claim_scope`, `hooks/tezgah_research.py::_check_claim_scope`), because a reader of the claim
516
+ alone takes a generated input for the running system; declaring `fixture` is the
517
+ whole fix;
518
+ - a claim that declares `real` over rows that mix one fixture row with real ones
519
+ (`_check_claim_scope`, `hooks/tezgah_research.py::_check_claim_scope`), naming the experiment(s) the
520
+ fixture rows are in: the all-fixture case is the refusal above, and under-declaring
521
+ is the safe direction here because the declaration is a warning to the reader, so
522
+ a mixed claim that says `real` hides the half that is not the running system;
523
+ - a number a claim asserts that the artifacts its proof names do not contain
524
+ (`_check_claim_numbers`, `hooks/tezgah_research.py::_check_claim_numbers`): 80 of this repository's own 82
525
+ numeric claims are fully contained under this reader, so a refusal would refuse the
526
+ one or two that are not wrong - a proportion computed in the sentence, a count
527
+ restated in words - and what the warning buys is the number and the artifact,
528
+ named. Five readings are read through rather than warned about: a date
529
+ (`2026-09-19`), lifted off the statement before it is tokenised because a
530
+ measurement is a standalone number; a thousands separator, so a claim stating
531
+ `20480` is contained by an artifact holding `20,480`; a comma list, which is the
532
+ figures it holds and not decimal numbers, so `4,2,2,1,1,2` is six tokens and not
533
+ `4,2`, `2,1`, `1,2`; a bare filename, which the reader resolves with the same token
534
+ set the proof rule does instead of passing the claim against nothing; and a number
535
+ past the per-file reading window, which is streamed for in chunks rather than
536
+ called missing. A `path:line` citation reads through like a date: its line
537
+ number names a place in a file, not a measurement. What it can never decide
538
+ is a token found inside a longer
539
+ number - a claim's `10` is contained by an artifact holding `10000` - so the
540
+ warning is a consistency check and not a proof that the number was measured;
541
+ - a concluded line's `report.md` carrying a fixture-scoped claim and never saying
542
+ `fixture` anywhere in it (`_check_report`, `hooks/tezgah_research.py::_check_report`);
543
+ - a prediction whose `commit` git cannot place against HEAD, or whose commit git
544
+ cannot read at all (`commit_paths`, `hooks/tezgah_research.py::commit_paths`): the row may name
545
+ a real change in a shallow clone or a repository git cannot read here, so the
546
+ question is unverified rather than answered - the same class as a pair the
547
+ order rule cannot order - and `--strict` is what refuses it. The write path
548
+ records the row and prints the same warning, because a writer that refused what
549
+ the checker only warns about would be the stricter of two judges that have to
550
+ agree;
551
+ - a prediction row that carries no `components` at all
552
+ (`prediction_problems`, `hooks/tezgah_research.py::prediction_problems`): every row in this
553
+ repository predates the field, and which component an old change touched cannot
554
+ be recovered from the row afterwards, so the class is the warn one and
555
+ `--strict` refuses it. The asymmetry is the only one the field has and it is
556
+ deliberate: `predict` refuses a row being written now that names no component
557
+ (`new` on the same function), because the writer of a new row can name it and
558
+ the reader of an old one cannot;
559
+ - a pair the order rule compares that no repository can commit, so the
560
+ protocol order will never be decidable for it; the message names the
561
+ `git -C .tezgah add -f <path>` or `tezgah-research commit` that fixes it (`_check_tracking`,
562
+ `hooks/tezgah_research.py::_check_tracking`);
563
+ - a `protocol.md` that answers neither what it predicts nor what would falsify it
564
+ - the marker is a prediction word and a falsifier word anywhere in the file,
565
+ read as prose and not by shape, and a sentence that *disclaims* one ("this file
566
+ is the brief, not a prediction") does not answer it; the warning names which of
567
+ the two questions it could not find. Three of this repository's own protocols
568
+ are briefs for a read-only agent and carry no prediction by design, which is why
569
+ the class is the warn one (`_check_protocol`,
570
+ `hooks/tezgah_research.py::_check_protocol`; `_protocol_answers`,
571
+ `hooks/tezgah_research.py::_protocol_answers`);
572
+ - a concluded line's `to_human/report.md` that names no limit anywhere, or is not
573
+ written at all - there is no report in which to state what the evidence does not
574
+ show (`_check_report`, `hooks/tezgah_research.py::_check_report`; the marker is the
575
+ phrase a limit is stated with - "does not show", "did not look at",
576
+ "limitation", "non-goal", "open question", "unmeasured" - and a heading and a
577
+ sentence count alike, `REPORT_LIMITS`, `hooks/tezgah_research.py::REPORT_LIMITS`);
578
+ - a `## Patterns` bullet in `findings.md` naming no source - `[Cnn]`, a
579
+ `literature/...` path or an `orx:<id>` (`_check_patterns`,
580
+ `hooks/tezgah_research.py::_check_patterns`);
581
+ - a claim with no `kind` at all, the pre-migration state `migrate` closes;
582
+ - a claim that supersedes another: the relation is reported naming both ids, so a
583
+ reader who opens the older claim alone is told the line has replaced it
584
+ (`_check_supersedes`, `hooks/tezgah_research.py::_check_supersedes`);
585
+ - an `evidence` claim whose experiment's `results.jsonl` is missing or holds no
586
+ row;
587
+ - a `results.jsonl` row with no `source` key at all: the rows written before the
588
+ rule look like this, and inventing a source for someone else's measurement is
589
+ the fabrication the rule exists to catch;
590
+ - a `grey` source with no `quality` note, an INDEX row verified by fewer than two
591
+ records, or an INDEX row recording no `id`, `source` or `inclusion`
592
+ (`_index_fields`, `hooks/tezgah_research.py::_index_fields`);
593
+ - `review.json` missing on a line whose `phase` is `concluded` - a review is a
594
+ judgement, so no migration can write one for the lines that concluded before
595
+ the rule existed.
596
+
597
+ One warn is **not** promoted by `--strict`, and it is the only one: a `phase`
598
+ declared in `state.json` behind the phase the line's own artifacts show
599
+ (`_check_derived_phase`, `hooks/tezgah_research.py::_check_derived_phase`). The field is the author's
600
+ declared intent and `_check_report` and `_check_review` read it, so a derivation
601
+ simpler than that judgement must never fail a line the field says is fine. What
602
+ it does say is the "two authorities" defect this module names in its own source:
603
+ a field maintained by hand beside artifacts that are not, where a line whose
604
+ protocols, results, claims, findings, report and review are all written can still
605
+ report `inner` and no reader is told. `derived_phase`
606
+ (`hooks/tezgah_research.py::derived_phase`) walks the artifacts the line already holds, in
607
+ `PHASES` vocabulary, and takes the furthest rung that holds: the question alone is
608
+ `bootstrap`; something run is `inner` - an experiment with a protocol and at
609
+ least one committed `results.jsonl` row (`_measured`,
610
+ `hooks/tezgah_research.py::_measured`), or a claim recorded; the results folded back into
611
+ `findings.md` are `outer`, read as content under one of its four sections
612
+ (`_findings_written`, `hooks/tezgah_research.py::_findings_written`); and the two artifacts a
613
+ concluded line owes, `to_human/report.md` and `to_human/review.json`, are
614
+ `concluded`. What each rung *is* is not decided here - whether a protocol answers
615
+ its two questions, or a review carries six scored dimensions, stays
616
+ `_check_protocol`'s and `_check_review`'s business - so the derivation only says
617
+ how far the line got. A field *ahead* of its artifacts is the author's call and is
618
+ never reported: `open_lines` and `_open_reasons` read the field when a caller has
619
+ to decide whether a line is finished, and this rule does not second-guess it.
620
+
621
+ The same rule reads `direction` against the artifacts. Written findings mean the
622
+ outer loop has chosen, so `undecided` warns from `outer` on. A delivered line
623
+ shows `conclude`, so any other direction warns there. The choice between
624
+ `deepen`, `broaden` and `pivot` is a judgement no artifact holds, so the rule
625
+ leaves it alone.
626
+
627
+ ## The write path and the checker stay in step
628
+
629
+ `claim_problems` (`hooks/tezgah_research.py::claim_problems`) applies exactly the rules
630
+ `check` applies to a row, so the writer can never refuse a claim the checker
631
+ would accept: a statement, a falsification criterion, a proof naming an artifact
632
+ with a `kind`, a `provenance` in `PROVENANCE`, a `status` in `STATUSES`, every
633
+ cited path resolving under the line or the repository, and a `supersedes` id the
634
+ line holds - the ids already in `claims.jsonl`, read by `_claim_ids`
635
+ (`hooks/tezgah_research.py::_claim_ids`). The append itself takes an exclusive `flock`
636
+ with a 1 s bound (`_locked`, `hooks/tezgah_research.py::_locked`), because two
637
+ sessions recording a claim at once is normal and a torn line is not. **The lock is
638
+ taken before the judgement, and the ids it judges are read from the descriptor the
639
+ lock is held on** (`_claim_ids`'s `handle` argument, `hooks/tezgah_research.py::_claim_ids`):
640
+ judging a relation and then locking lets another session land the very id the check
641
+ had just found absent, so the writer refuses a claim the committed file accepts and
642
+ its proof describes an instant its append does not commit to. Three rules
643
+ deliberately stricter at write time, and the code says so: a new claim must
644
+ carry a `kind` (`check` only warns for a pre-rule row, which `migrate` closes),
645
+ and its proof must name an artifact (`check` applies that rule only to a row that
646
+ already carries a kind). Everything else is the checker's own - the evidence-row
647
+ rule included: an empty `results.jsonl` warns on both paths, and `--strict`
648
+ refuses it on both. A refusal never leaves an empty `claims.jsonl` behind: the line
649
+ decides when it has claims, and an empty file reads as "no claims recorded yet"
650
+ where an absent one reads as a missed requirement.
651
+
652
+ `prediction_problems` (`hooks/tezgah_research.py::prediction_problems`) is the same arrangement for the
653
+ prediction rows and the single place the two readings of that rule meet: `check`
654
+ calls it for each row of `predictions.jsonl` (`_check_predictions`,
655
+ `hooks/tezgah_research.py::_check_predictions`) and `predict` calls it inside the append lock, so a
656
+ row's verdict is one function's and the writer cannot be stricter than the
657
+ checker. The two asymmetries are deliberate and named: `check_line`'s `git=False`,
658
+ which is what the session note pays for, skips the commit half, so the shape rules
659
+ are what the cheap path reads; and `new=True`, which only the write path passes,
660
+ is what refuses a row being written now that names no `components` - a row that is
661
+ already in the file is the warning class above. The append takes the same
662
+ exclusive `flock` with the 1 s bound and the same committed-size repair the claim
663
+ path uses, and `_locked` now takes the name of the file it refuses
664
+ (`hooks/tezgah_research.py::_locked`).
665
+
666
+ The row writer is the third site of the same order (`_append_row`,
667
+ `hooks/tezgah_research.py::_append_row`): it takes the lock, then judges the row with
668
+ `row_problems` (`hooks/tezgah_research.py::row_problems`) - exactly the hard refusals `_check_rows`
669
+ applies to a row's own shape (an object, a non-empty `source`, a `scope` in
670
+ `SCOPES`, a non-empty `fixture` description), and deliberately not the warn class a
671
+ pre-rule row is in, because a writer stricter than the checker refuses what the
672
+ checker only reports.
673
+
674
+ **An append starts at the committed boundary.** `committed_size`
675
+ (`hooks/tezgah_integrity.py::committed_size`) is the offset just past the last `\n` in a file,
676
+ and `truncate_to_committed` (`hooks/tezgah_integrity.py::truncate_to_committed`) cuts a descriptor
677
+ back to it; all three writers truncate first and write after
678
+ (`append_claim`, `hooks/tezgah_research.py::append_claim`; `_append_row`; `append_prediction`,
679
+ `hooks/tezgah_research.py::append_prediction`). A fragment a killed writer left behind - no newline
680
+ ever terminated it - is then neither read as a record nor appended beside as one.
681
+ Every JSONL reader here stops at the same boundary (`_committed_text`,
682
+ `hooks/tezgah_research.py::_committed_text`; `_rows`, `hooks/tezgah_research.py::_rows`), so a reader and a
683
+ writer agree about where the records end; a record that *did* terminate and does
684
+ not parse is still refused, because the boundary hides the tail and not the file.
685
+ Before this, the claim writer terminated the fragment instead and the research
686
+ reader read to the last byte, so one kill during one append refused a line for
687
+ good while the ledger reader skipped the identical damage.
688
+
689
+ `kind` is what the proof has to be, and it decides what the proof must name -
690
+ `KINDS`, `hooks/tezgah_research.py::KINDS`: an `evidence` claim has to name an
691
+ artifact of the line itself (a repository file is not the run it rests on), and
692
+ the experiment it names has to carry rows; a `literature` claim has to cite a
693
+ note under `literature/`; a `code` claim resolves anywhere in the repository; a
694
+ `derivation` claim resolves inside the line. `migrate` derives the kind per claim
695
+ from the proof's own tokens, with the same literature test the rule applies
696
+ (`derive_kind`, `hooks/tezgah_research.py::derive_kind`), and reports what it could not
697
+ derive rather than inventing a value.
698
+
699
+ ## The per-component report
700
+
701
+ A prediction row names the components its change touches, and
702
+ `tezgah-research components` prints what that buys: per component, the rows that
703
+ name it and their state. The manifest it groups by is
704
+ `hooks/tezgah_components.py` - the one definition of what a component is, whose
705
+ `keys()` the rules read and whose `COMPONENTS` the report reads for the labels -
706
+ and it is imported inside the call that needs it (`_components`,
707
+ `hooks/tezgah_research.py::_components`), so the path a session pays for at import time never
708
+ loads it.
709
+
710
+ The state of a row is read, never guessed (`_prediction_state`,
711
+ `hooks/tezgah_research.py::_prediction_state`): `falsified` when the `claim` the row names is
712
+ `refuted` in the line's own `claims.jsonl`, because the line's own rows are the
713
+ only record of a verdict; `unmeasured` when `value_after` is empty, which is the
714
+ round that has not run; `held` when it is filled, which is the number that came
715
+ back. A row whose `claim` the line does not hold decides nothing - the filled
716
+ `value_after` is not a verdict - so it stays `unmeasured` and the report prints
717
+ why, beside the row. `PREDICTION_STATES` (`hooks/tezgah_research.py::PREDICTION_STATES`) is
718
+ that vocabulary, and the headers count it.
719
+
720
+ It is a **report, not a gate**: it exits 0 whatever the rows look like, because
721
+ the refusals belong to `check` and a second judge with a different verdict is the
722
+ disagreement this module exists to avoid. What it prints first - the number of
723
+ components and of rows it read (`components_text`,
724
+ `hooks/tezgah_research.py::components_text`) - is what tells an empty manifest from a line that has
725
+ predicted nothing, and a key the manifest does not define is reported as a bucket
726
+ of its own rather than dropped, so a hand-written row is visible.
727
+
728
+ Predictions and this report are **frozen** (ADR 009). They keep working as
729
+ documented and take no new rule, field or command. Nobody measured their use,
730
+ so the layer stays at this size. A measured use is what would reopen it.
731
+
732
+ ## `migrate`: what the artifacts already hold
733
+
734
+ Three derivations and nothing else (`migrate`,
735
+ `hooks/tezgah_research.py::migrate`): each claim's `kind` from the files its proof
736
+ names, each results row's `source` from the fields the row carries, and the
737
+ `literature/INDEX.jsonl` rows from the notes.
738
+
739
+ A row written before the `source` rule says where it came from in a field of its
740
+ own, and `_migrate_rows` (`hooks/tezgah_research.py::_migrate_rows`) reads exactly those:
741
+ `log` or `raw` is the receipt itself and is taken as written, `run` or `id` is
742
+ the run the row came out of and is prefixed with the field it came from, so a
743
+ reader can tell a run id from a row id (`ROW_SOURCE_FIELDS`,
744
+ `hooks/tezgah_research.py::ROW_SOURCE_FIELDS`; `_row_source`,
745
+ `hooks/tezgah_research.py::_row_source`). A row that carries none of the four is reported
746
+ and left alone: a source invented for someone else's measurement is the
747
+ fabrication the rule exists to catch. Both JSONL files are rewritten under the
748
+ same exclusive lock `claim` appends under, and the run is idempotent.
749
+
750
+ `scope` is the field it refuses to derive, and the refusal is the point: only the
751
+ session that ran the experiment knows whether the input was the running system or
752
+ something it generated, and a migration that read it off a path would be the same
753
+ inference E1 measured and found unusable (438 of 520 rows unknown). A row it cannot
754
+ supply stays unscoped, and `check` names it by count.
755
+
756
+ ## The session sees the layer two ways
757
+
758
+ The rule, conditionally: the prompt classifier arms `research` on a research
759
+ question - the hints are the words a reader would use, not the tool's name
760
+ (`PROMPT_HINTS`, `hooks/tezgah_context.py::PROMPT_HINTS`) - and the armed paragraph is
761
+ `RESEARCH` (`hooks/tezgah_policy.py::RESEARCH`), which names `{RESEARCH_BIN}` (the
762
+ installed `bin/tezgah-research`) and the `orx` manual step.
763
+
764
+ The note, when orx is absent or a line is broken: a session is told that `orx` is
765
+ not installed and to fall back to a host subagent rather than improvise the
766
+ protocol (`context_for`, `hooks/tezgah_context.py::context_for`), and at session start and
767
+ after a compaction a line with structural problems is named with its first error
768
+ and the advice to run `check` before reporting a result (the note
769
+ `research_broken` in `context_for`, `hooks/tezgah_context.py::context_for`). A
770
+ line under `done/` reaches the note only through its seal hashes.
771
+
772
+ The mark: `research` in the status line. It is armed when `research-off` is
773
+ absent and the research tooling is present (`health_segments`,
774
+ `hooks/tezgah_context.py::health_segments`) and turns used when a shell command really ran
775
+ the layer - `orx` or `tezgah-research`
776
+ in a command position, classified by the shared tokenizer
777
+ (`shell_kind`, `hooks/tezgah_context.py::shell_kind`), so a command that merely mentions
778
+ either name marks nothing. That is the same reader every host's status segment
779
+ uses ([status line](status-line.md)).
780
+
781
+ ## The switch
782
+
783
+ `research-off` is the kill switch: with it armed the `RESEARCH` paragraph is
784
+ dropped, the session note is not built, and the mark reads `off` rather than
785
+ armed. It removes the rule, not just the mark - the diff is in `core_split`,
786
+ `hooks/tezgah_context.py::core_split` ([kill switch](glossary.md#kill-switch)).
787
+
788
+ ## Source of truth
789
+
790
+ - `hooks/tezgah_research.py` - the workspace, the enums, `check_line`, the claim
791
+ rules shared with the writer, the prediction rules shared the same way and the
792
+ frozen set they read (`FROZEN_PATHS`), the protocol order and its tracked pair,
793
+ the protocol's two questions, the concluded report's limits, the `supersedes`
794
+ relation, `component_report` with the state it reads, `migrate`, `source_run`,
795
+ `init` and `summary`.
796
+ - `hooks/tezgah_components.py` - the manifest: the one definition of an editable
797
+ component, the keys a prediction row names and the rules a row's outcome is
798
+ attributed to.
799
+ - `bin/tezgah-research` - the CLI, its subcommands and its exit codes.
800
+ - `hooks/tezgah_policy.py` - the `RESEARCH` paragraph a session is armed with.
801
+ - `hooks/tezgah_context.py` - the prompt hint, the missing-orx note, the broken
802
+ line note and the `research` mark.
803
+ - `skills/research/SKILL.md` - the two-loop rhythm, the claim review and the
804
+ provenance tags a session records.
805
+ - `tests/test_research.py` - the CLI's refusals, the checker's rules and their
806
+ edges, the prediction cases that pin the checker and the write path to the same
807
+ verdict, and the per-component report.
808
+ - `tests/test_components.py` - the manifest's own shapes, its label pin and the
809
+ mapping table it carries.