@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.
- package/CHANGELOG.md +738 -0
- package/LICENSE +21 -0
- package/MANIFEST +753 -0
- package/README.de.md +169 -0
- package/README.es.md +168 -0
- package/README.fr.md +166 -0
- package/README.md +161 -0
- package/README.tr.md +163 -0
- package/agents/tezgah-reviewer.md +70 -0
- package/bin/codegen +337 -0
- package/bin/consult +797 -0
- package/bin/tezgah-adhd +50 -0
- package/bin/tezgah-agents +45 -0
- package/bin/tezgah-capture +66 -0
- package/bin/tezgah-context +96 -0
- package/bin/tezgah-decisions +213 -0
- package/bin/tezgah-design +953 -0
- package/bin/tezgah-docs +1199 -0
- package/bin/tezgah-doctor +497 -0
- package/bin/tezgah-dsh +37 -0
- package/bin/tezgah-dsh.cmd +70 -0
- package/bin/tezgah-gate +75 -0
- package/bin/tezgah-import-ai-research +439 -0
- package/bin/tezgah-index +32 -0
- package/bin/tezgah-lessons +148 -0
- package/bin/tezgah-mcp +322 -0
- package/bin/tezgah-migrate +324 -0
- package/bin/tezgah-pony +50 -0
- package/bin/tezgah-research +772 -0
- package/bin/tezgah-rollback +93 -0
- package/bin/tezgah-route +124 -0
- package/bin/tezgah-setup +5798 -0
- package/bin/tezgah-status +383 -0
- package/bin/tezgah-task +607 -0
- package/bin/tezgah-taste +423 -0
- package/bin/tezgah-triage +485 -0
- package/bin/tezgah.js +36 -0
- package/commands/adhd.md +21 -0
- package/commands/ponytail.md +21 -0
- package/docs/README.md +112 -0
- package/docs/architecture.md +226 -0
- package/docs/citations-baseline.json +59 -0
- package/docs/clarity-baseline.json +116 -0
- package/docs/contract.md +416 -0
- package/docs/environment.md +141 -0
- package/docs/evidence.md +831 -0
- package/docs/feature-audit.md +139 -0
- package/docs/gate.md +407 -0
- package/docs/glossary.md +201 -0
- package/docs/hosts.md +400 -0
- package/docs/index.json +471 -0
- package/docs/judge.md +193 -0
- package/docs/layers.md +189 -0
- package/docs/models.md +160 -0
- package/docs/operations.md +666 -0
- package/docs/research.md +809 -0
- package/docs/results/paired-outcome-2026-10.jsonl +254 -0
- package/docs/results/paired-outcome-2026-10.md +204 -0
- package/docs/skills.md +236 -0
- package/docs/status-line.md +315 -0
- package/docs/testing.md +287 -0
- package/docs/vision.md +117 -0
- package/hooks/hooks.json +33 -0
- package/hooks/projects-auto-init.py +98 -0
- package/hooks/projects-posttooluse.py +149 -0
- package/hooks/projects-pretooluse.py +40 -0
- package/hooks/projects-stop.py +60 -0
- package/hooks/tezgah_agents.py +817 -0
- package/hooks/tezgah_apps.py +266 -0
- package/hooks/tezgah_attest.py +255 -0
- package/hooks/tezgah_clarity.py +171 -0
- package/hooks/tezgah_components.py +140 -0
- package/hooks/tezgah_context.py +2953 -0
- package/hooks/tezgah_embed.py +765 -0
- package/hooks/tezgah_gate.py +2736 -0
- package/hooks/tezgah_guard.py +177 -0
- package/hooks/tezgah_index.py +124 -0
- package/hooks/tezgah_integrity.py +5141 -0
- package/hooks/tezgah_judge.py +487 -0
- package/hooks/tezgah_lang.py +230 -0
- package/hooks/tezgah_lessons.py +210 -0
- package/hooks/tezgah_models.py +855 -0
- package/hooks/tezgah_paths.py +1132 -0
- package/hooks/tezgah_policy.py +1039 -0
- package/hooks/tezgah_rank.py +77 -0
- package/hooks/tezgah_replay.py +1109 -0
- package/hooks/tezgah_research.py +5176 -0
- package/hooks/tezgah_shapes.py +305 -0
- package/hooks/tezgah_skill_pick.py +227 -0
- package/hooks/tezgah_snapshot.py +490 -0
- package/hooks/tezgah_stopspec.py +320 -0
- package/hooks/tezgah_task.py +458 -0
- package/hooks/tezgah_taste.py +201 -0
- package/hooks/tezgah_untrusted.py +112 -0
- package/hooks/tezgah_update.py +430 -0
- package/hosts/codex/hook.py +268 -0
- package/hosts/codex/hooks.json +26 -0
- package/hosts/cursor/hook.py +461 -0
- package/hosts/cursor/hooks.json +44 -0
- package/hosts/dsh/hooks.json +21 -0
- package/hosts/dsh/statusline/lib/client.js +138 -0
- package/hosts/dsh/statusline/lib/index.js +104 -0
- package/hosts/dsh/statusline/package.json +28 -0
- package/hosts/omp/hook.py +277 -0
- package/hosts/omp/tezgah-hook.ts.in +701 -0
- package/hosts/opencode/plugins/tezgah.js +2742 -0
- package/hosts/opencode/tui/tezgah-tui.tsx +151 -0
- package/output-styles/tezgah.md +142 -0
- package/package.json +32 -0
- package/packaging/build.sh +342 -0
- package/packaging/install.ps1 +166 -0
- package/packaging/install.sh +56 -0
- package/packaging/upgrade.sh +142 -0
- package/skills/ai-research/0-autoresearch-skill/SKILL.md +411 -0
- package/skills/ai-research/0-autoresearch-skill/references/agent-continuity.md +95 -0
- package/skills/ai-research/0-autoresearch-skill/references/progress-reporting.md +166 -0
- package/skills/ai-research/0-autoresearch-skill/references/skill-routing.md +219 -0
- package/skills/ai-research/0-autoresearch-skill/templates/findings.md +44 -0
- package/skills/ai-research/0-autoresearch-skill/templates/research-log.md +41 -0
- package/skills/ai-research/01-model-architecture/litgpt/SKILL.md +469 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/custom-models.md +569 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/distributed-training.md +452 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/supported-models.md +337 -0
- package/skills/ai-research/01-model-architecture/litgpt/references/training-recipes.md +620 -0
- package/skills/ai-research/01-model-architecture/mamba/SKILL.md +260 -0
- package/skills/ai-research/01-model-architecture/mamba/references/architecture-details.md +207 -0
- package/skills/ai-research/01-model-architecture/mamba/references/benchmarks.md +256 -0
- package/skills/ai-research/01-model-architecture/mamba/references/training-guide.md +389 -0
- package/skills/ai-research/01-model-architecture/nanogpt/SKILL.md +290 -0
- package/skills/ai-research/01-model-architecture/nanogpt/references/architecture.md +383 -0
- package/skills/ai-research/01-model-architecture/nanogpt/references/data.md +477 -0
- package/skills/ai-research/01-model-architecture/nanogpt/references/training.md +565 -0
- package/skills/ai-research/01-model-architecture/rwkv/SKILL.md +260 -0
- package/skills/ai-research/01-model-architecture/rwkv/references/architecture-details.md +345 -0
- package/skills/ai-research/01-model-architecture/rwkv/references/rwkv7.md +387 -0
- package/skills/ai-research/01-model-architecture/rwkv/references/state-management.md +370 -0
- package/skills/ai-research/01-model-architecture/torchtitan/SKILL.md +358 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/checkpoint.md +182 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/custom-models.md +259 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/float8.md +134 -0
- package/skills/ai-research/01-model-architecture/torchtitan/references/fsdp.md +127 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/SKILL.md +516 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/algorithms.md +654 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/integration.md +638 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/pipeline.md +724 -0
- package/skills/ai-research/02-tokenization/huggingface-tokenizers/references/training.md +566 -0
- package/skills/ai-research/02-tokenization/sentencepiece/SKILL.md +235 -0
- package/skills/ai-research/02-tokenization/sentencepiece/references/algorithms.md +201 -0
- package/skills/ai-research/02-tokenization/sentencepiece/references/training.md +305 -0
- package/skills/ai-research/03-fine-tuning/axolotl/SKILL.md +158 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/api.md +5549 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/dataset-formats.md +1030 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/index.md +16 -0
- package/skills/ai-research/03-fine-tuning/axolotl/references/other.md +3564 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/SKILL.md +80 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/_images.md +24 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/advanced.md +1056 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/getting_started.md +350 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/index.md +20 -0
- package/skills/ai-research/03-fine-tuning/llama-factory/references/other.md +32 -0
- package/skills/ai-research/03-fine-tuning/peft/SKILL.md +431 -0
- package/skills/ai-research/03-fine-tuning/peft/references/advanced-usage.md +515 -0
- package/skills/ai-research/03-fine-tuning/peft/references/troubleshooting.md +481 -0
- package/skills/ai-research/03-fine-tuning/unsloth/SKILL.md +80 -0
- package/skills/ai-research/03-fine-tuning/unsloth/references/index.md +8 -0
- package/skills/ai-research/03-fine-tuning/unsloth/references/llms.md +83 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/SKILL.md +436 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/README.md +79 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/api.md +345 -0
- package/skills/ai-research/04-mechanistic-interpretability/nnsight/references/tutorials.md +301 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/SKILL.md +473 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/README.md +74 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/api.md +384 -0
- package/skills/ai-research/04-mechanistic-interpretability/pyvene/references/tutorials.md +377 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/SKILL.md +386 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/references/README.md +71 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/references/api.md +334 -0
- package/skills/ai-research/04-mechanistic-interpretability/saelens/references/tutorials.md +319 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/SKILL.md +346 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/README.md +55 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/api.md +363 -0
- package/skills/ai-research/04-mechanistic-interpretability/transformer-lens/references/tutorials.md +340 -0
- package/skills/ai-research/05-data-processing/nemo-curator/SKILL.md +383 -0
- package/skills/ai-research/05-data-processing/nemo-curator/references/deduplication.md +88 -0
- package/skills/ai-research/05-data-processing/nemo-curator/references/filtering.md +103 -0
- package/skills/ai-research/05-data-processing/ray-data/SKILL.md +326 -0
- package/skills/ai-research/05-data-processing/ray-data/references/integration.md +83 -0
- package/skills/ai-research/05-data-processing/ray-data/references/transformations.md +84 -0
- package/skills/ai-research/06-post-training/grpo-rl-training/README.md +98 -0
- package/skills/ai-research/06-post-training/grpo-rl-training/SKILL.md +572 -0
- package/skills/ai-research/06-post-training/miles/SKILL.md +315 -0
- package/skills/ai-research/06-post-training/miles/references/api-reference.md +142 -0
- package/skills/ai-research/06-post-training/miles/references/troubleshooting.md +353 -0
- package/skills/ai-research/06-post-training/openrlhf/SKILL.md +249 -0
- package/skills/ai-research/06-post-training/openrlhf/references/algorithm-comparison.md +405 -0
- package/skills/ai-research/06-post-training/openrlhf/references/custom-rewards.md +531 -0
- package/skills/ai-research/06-post-training/openrlhf/references/hybrid-engine.md +288 -0
- package/skills/ai-research/06-post-training/openrlhf/references/multi-node-training.md +455 -0
- package/skills/ai-research/06-post-training/simpo/SKILL.md +219 -0
- package/skills/ai-research/06-post-training/simpo/references/datasets.md +479 -0
- package/skills/ai-research/06-post-training/simpo/references/hyperparameters.md +453 -0
- package/skills/ai-research/06-post-training/simpo/references/loss-functions.md +351 -0
- package/skills/ai-research/06-post-training/slime/SKILL.md +464 -0
- package/skills/ai-research/06-post-training/slime/references/api-reference.md +393 -0
- package/skills/ai-research/06-post-training/slime/references/troubleshooting.md +387 -0
- package/skills/ai-research/06-post-training/torchforge/SKILL.md +433 -0
- package/skills/ai-research/06-post-training/torchforge/references/api-reference.md +328 -0
- package/skills/ai-research/06-post-training/torchforge/references/troubleshooting.md +410 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/SKILL.md +455 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/dpo-variants.md +228 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/online-rl.md +83 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/reward-modeling.md +123 -0
- package/skills/ai-research/06-post-training/trl-fine-tuning/references/sft-training.md +169 -0
- package/skills/ai-research/06-post-training/verl/SKILL.md +391 -0
- package/skills/ai-research/06-post-training/verl/references/api-reference.md +302 -0
- package/skills/ai-research/06-post-training/verl/references/troubleshooting.md +392 -0
- package/skills/ai-research/07-safety-alignment/constitutional-ai/SKILL.md +290 -0
- package/skills/ai-research/07-safety-alignment/llamaguard/SKILL.md +337 -0
- package/skills/ai-research/07-safety-alignment/nemo-guardrails/SKILL.md +297 -0
- package/skills/ai-research/07-safety-alignment/prompt-guard/SKILL.md +312 -0
- package/skills/ai-research/08-distributed-training/accelerate/SKILL.md +332 -0
- package/skills/ai-research/08-distributed-training/accelerate/references/custom-plugins.md +454 -0
- package/skills/ai-research/08-distributed-training/accelerate/references/megatron-integration.md +490 -0
- package/skills/ai-research/08-distributed-training/accelerate/references/performance.md +526 -0
- package/skills/ai-research/08-distributed-training/deepspeed/SKILL.md +141 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/08.md +18 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/09.md +174 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/2020.md +379 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/2023.md +280 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/assets.md +180 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/index.md +36 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/mii.md +119 -0
- package/skills/ai-research/08-distributed-training/deepspeed/references/other.md +1192 -0
- package/skills/ai-research/08-distributed-training/megatron-core/SKILL.md +366 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/benchmarks.md +250 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/parallelism-guide.md +405 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/production-examples.md +474 -0
- package/skills/ai-research/08-distributed-training/megatron-core/references/training-recipes.md +548 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/SKILL.md +231 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_async_recipe.md +14 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_overview.md +19 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_dcp_recipe.md +18 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_ddp_notes.md +10 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_device_mesh_tutorial.md +22 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_examples_fsdp2.md +15 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fsdp1_api.md +9 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fsdp2_tutorial.md +45 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_fully_shard_api.md +49 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/pytorch_tp_tutorial.md +22 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/ray_train_fsdp2_example.md +13 -0
- package/skills/ai-research/08-distributed-training/pytorch-fsdp2/references/torchtitan_fsdp_notes.md +14 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/SKILL.md +346 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/references/callbacks.md +437 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/references/distributed.md +491 -0
- package/skills/ai-research/08-distributed-training/pytorch-lightning/references/hyperparameter-tuning.md +557 -0
- package/skills/ai-research/08-distributed-training/ray-train/SKILL.md +406 -0
- package/skills/ai-research/08-distributed-training/ray-train/references/multi-node.md +629 -0
- package/skills/ai-research/09-infrastructure/lambda-labs/SKILL.md +545 -0
- package/skills/ai-research/09-infrastructure/lambda-labs/references/advanced-usage.md +612 -0
- package/skills/ai-research/09-infrastructure/lambda-labs/references/troubleshooting.md +531 -0
- package/skills/ai-research/09-infrastructure/modal/SKILL.md +341 -0
- package/skills/ai-research/09-infrastructure/modal/references/advanced-usage.md +504 -0
- package/skills/ai-research/09-infrastructure/modal/references/troubleshooting.md +495 -0
- package/skills/ai-research/09-infrastructure/skypilot/SKILL.md +509 -0
- package/skills/ai-research/09-infrastructure/skypilot/references/advanced-usage.md +492 -0
- package/skills/ai-research/09-infrastructure/skypilot/references/troubleshooting.md +571 -0
- package/skills/ai-research/10-optimization/awq/SKILL.md +310 -0
- package/skills/ai-research/10-optimization/awq/references/advanced-usage.md +325 -0
- package/skills/ai-research/10-optimization/awq/references/troubleshooting.md +345 -0
- package/skills/ai-research/10-optimization/bitsandbytes/SKILL.md +411 -0
- package/skills/ai-research/10-optimization/bitsandbytes/references/memory-optimization.md +522 -0
- package/skills/ai-research/10-optimization/bitsandbytes/references/qlora-training.md +522 -0
- package/skills/ai-research/10-optimization/bitsandbytes/references/quantization-formats.md +448 -0
- package/skills/ai-research/10-optimization/flash-attention/SKILL.md +367 -0
- package/skills/ai-research/10-optimization/flash-attention/references/benchmarks.md +216 -0
- package/skills/ai-research/10-optimization/flash-attention/references/transformers-integration.md +294 -0
- package/skills/ai-research/10-optimization/gguf/SKILL.md +427 -0
- package/skills/ai-research/10-optimization/gguf/references/advanced-usage.md +505 -0
- package/skills/ai-research/10-optimization/gguf/references/troubleshooting.md +443 -0
- package/skills/ai-research/10-optimization/gptq/SKILL.md +450 -0
- package/skills/ai-research/10-optimization/gptq/references/calibration.md +338 -0
- package/skills/ai-research/10-optimization/gptq/references/integration.md +130 -0
- package/skills/ai-research/10-optimization/gptq/references/troubleshooting.md +96 -0
- package/skills/ai-research/10-optimization/hqq/SKILL.md +445 -0
- package/skills/ai-research/10-optimization/hqq/references/advanced-usage.md +529 -0
- package/skills/ai-research/10-optimization/hqq/references/troubleshooting.md +504 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/SKILL.md +319 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/architecture.md +320 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/biomedical.md +498 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/domain-specific.md +626 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/experiment-loop.md +129 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/optimizers.md +330 -0
- package/skills/ai-research/10-optimization/ml-training-recipes/references/scaling-and-selection.md +428 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/SKILL.md +405 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/benchmarks.md +394 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/custom-tasks.md +425 -0
- package/skills/ai-research/11-evaluation/bigcode-evaluation-harness/references/issues.md +395 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/SKILL.md +490 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/api-evaluation.md +491 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/benchmark-guide.md +489 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/custom-tasks.md +603 -0
- package/skills/ai-research/11-evaluation/lm-evaluation-harness/references/distributed-eval.md +520 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/SKILL.md +494 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/adapter-system.md +341 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/configuration.md +448 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/custom-benchmarks.md +316 -0
- package/skills/ai-research/11-evaluation/nemo-evaluator/references/execution-backends.md +362 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/SKILL.md +258 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/references/optimization.md +90 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/references/quantization.md +214 -0
- package/skills/ai-research/12-inference-serving/llama-cpp/references/server.md +126 -0
- package/skills/ai-research/12-inference-serving/sglang/SKILL.md +442 -0
- package/skills/ai-research/12-inference-serving/sglang/references/deployment.md +491 -0
- package/skills/ai-research/12-inference-serving/sglang/references/radix-attention.md +414 -0
- package/skills/ai-research/12-inference-serving/sglang/references/structured-generation.md +542 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/SKILL.md +187 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/references/multi-gpu.md +299 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/references/optimization.md +243 -0
- package/skills/ai-research/12-inference-serving/tensorrt-llm/references/serving.md +471 -0
- package/skills/ai-research/12-inference-serving/vllm/SKILL.md +364 -0
- package/skills/ai-research/12-inference-serving/vllm/references/optimization.md +227 -0
- package/skills/ai-research/12-inference-serving/vllm/references/quantization.md +285 -0
- package/skills/ai-research/12-inference-serving/vllm/references/server-deployment.md +256 -0
- package/skills/ai-research/12-inference-serving/vllm/references/troubleshooting.md +448 -0
- package/skills/ai-research/13-mlops/mlflow/SKILL.md +704 -0
- package/skills/ai-research/13-mlops/mlflow/references/deployment.md +745 -0
- package/skills/ai-research/13-mlops/mlflow/references/model-registry.md +771 -0
- package/skills/ai-research/13-mlops/mlflow/references/tracking.md +681 -0
- package/skills/ai-research/13-mlops/swanlab/SKILL.md +406 -0
- package/skills/ai-research/13-mlops/swanlab/references/integrations.md +305 -0
- package/skills/ai-research/13-mlops/swanlab/references/visualization.md +234 -0
- package/skills/ai-research/13-mlops/tensorboard/SKILL.md +629 -0
- package/skills/ai-research/13-mlops/tensorboard/references/integrations.md +639 -0
- package/skills/ai-research/13-mlops/tensorboard/references/profiling.md +546 -0
- package/skills/ai-research/13-mlops/tensorboard/references/visualization.md +621 -0
- package/skills/ai-research/13-mlops/weights-and-biases/SKILL.md +590 -0
- package/skills/ai-research/13-mlops/weights-and-biases/references/artifacts.md +585 -0
- package/skills/ai-research/13-mlops/weights-and-biases/references/integrations.md +701 -0
- package/skills/ai-research/13-mlops/weights-and-biases/references/sweeps.md +848 -0
- package/skills/ai-research/14-agents/a-evolve/SKILL.md +383 -0
- package/skills/ai-research/14-agents/a-evolve/references/README.md +831 -0
- package/skills/ai-research/14-agents/a-evolve/references/api.md +594 -0
- package/skills/ai-research/14-agents/a-evolve/references/architecture.md +417 -0
- package/skills/ai-research/14-agents/a-evolve/references/design-patterns.md +462 -0
- package/skills/ai-research/14-agents/a-evolve/references/examples.md +352 -0
- package/skills/ai-research/14-agents/a-evolve/references/issues.md +591 -0
- package/skills/ai-research/14-agents/a-evolve/references/releases.md +112 -0
- package/skills/ai-research/14-agents/a-evolve/references/tutorials.md +819 -0
- package/skills/ai-research/14-agents/autogpt/SKILL.md +403 -0
- package/skills/ai-research/14-agents/autogpt/references/advanced-usage.md +536 -0
- package/skills/ai-research/14-agents/autogpt/references/troubleshooting.md +421 -0
- package/skills/ai-research/14-agents/crewai/SKILL.md +498 -0
- package/skills/ai-research/14-agents/crewai/references/flows.md +439 -0
- package/skills/ai-research/14-agents/crewai/references/tools.md +430 -0
- package/skills/ai-research/14-agents/crewai/references/troubleshooting.md +481 -0
- package/skills/ai-research/14-agents/langchain/SKILL.md +480 -0
- package/skills/ai-research/14-agents/langchain/references/agents.md +500 -0
- package/skills/ai-research/14-agents/langchain/references/integration.md +563 -0
- package/skills/ai-research/14-agents/langchain/references/rag.md +601 -0
- package/skills/ai-research/14-agents/llamaindex/SKILL.md +569 -0
- package/skills/ai-research/14-agents/llamaindex/references/agents.md +84 -0
- package/skills/ai-research/14-agents/llamaindex/references/data_connectors.md +109 -0
- package/skills/ai-research/14-agents/llamaindex/references/query_engines.md +407 -0
- package/skills/ai-research/15-rag/chroma/SKILL.md +406 -0
- package/skills/ai-research/15-rag/chroma/references/integration.md +39 -0
- package/skills/ai-research/15-rag/faiss/SKILL.md +221 -0
- package/skills/ai-research/15-rag/faiss/references/index_types.md +281 -0
- package/skills/ai-research/15-rag/pinecone/SKILL.md +358 -0
- package/skills/ai-research/15-rag/pinecone/references/deployment.md +182 -0
- package/skills/ai-research/15-rag/qdrant/SKILL.md +493 -0
- package/skills/ai-research/15-rag/qdrant/references/advanced-usage.md +649 -0
- package/skills/ai-research/15-rag/qdrant/references/troubleshooting.md +632 -0
- package/skills/ai-research/15-rag/sentence-transformers/SKILL.md +255 -0
- package/skills/ai-research/15-rag/sentence-transformers/references/models.md +124 -0
- package/skills/ai-research/16-prompt-engineering/dspy/SKILL.md +590 -0
- package/skills/ai-research/16-prompt-engineering/dspy/references/examples.md +664 -0
- package/skills/ai-research/16-prompt-engineering/dspy/references/modules.md +476 -0
- package/skills/ai-research/16-prompt-engineering/dspy/references/optimizers.md +567 -0
- package/skills/ai-research/16-prompt-engineering/guidance/SKILL.md +572 -0
- package/skills/ai-research/16-prompt-engineering/guidance/references/backends.md +555 -0
- package/skills/ai-research/16-prompt-engineering/guidance/references/constraints.md +675 -0
- package/skills/ai-research/16-prompt-engineering/guidance/references/examples.md +768 -0
- package/skills/ai-research/16-prompt-engineering/instructor/SKILL.md +740 -0
- package/skills/ai-research/16-prompt-engineering/instructor/references/examples.md +108 -0
- package/skills/ai-research/16-prompt-engineering/instructor/references/providers.md +71 -0
- package/skills/ai-research/16-prompt-engineering/instructor/references/validation.md +607 -0
- package/skills/ai-research/16-prompt-engineering/outlines/SKILL.md +652 -0
- package/skills/ai-research/16-prompt-engineering/outlines/references/backends.md +616 -0
- package/skills/ai-research/16-prompt-engineering/outlines/references/examples.md +774 -0
- package/skills/ai-research/16-prompt-engineering/outlines/references/json_generation.md +653 -0
- package/skills/ai-research/17-observability/langsmith/SKILL.md +422 -0
- package/skills/ai-research/17-observability/langsmith/references/advanced-usage.md +549 -0
- package/skills/ai-research/17-observability/langsmith/references/troubleshooting.md +538 -0
- package/skills/ai-research/17-observability/phoenix/SKILL.md +475 -0
- package/skills/ai-research/17-observability/phoenix/references/advanced-usage.md +620 -0
- package/skills/ai-research/17-observability/phoenix/references/troubleshooting.md +539 -0
- package/skills/ai-research/18-multimodal/audiocraft/SKILL.md +564 -0
- package/skills/ai-research/18-multimodal/audiocraft/references/advanced-usage.md +667 -0
- package/skills/ai-research/18-multimodal/audiocraft/references/troubleshooting.md +505 -0
- package/skills/ai-research/18-multimodal/blip-2/SKILL.md +564 -0
- package/skills/ai-research/18-multimodal/blip-2/references/advanced-usage.md +681 -0
- package/skills/ai-research/18-multimodal/blip-2/references/troubleshooting.md +527 -0
- package/skills/ai-research/18-multimodal/clip/SKILL.md +253 -0
- package/skills/ai-research/18-multimodal/clip/references/applications.md +208 -0
- package/skills/ai-research/18-multimodal/cosmos-policy/SKILL.md +402 -0
- package/skills/ai-research/18-multimodal/cosmos-policy/references/libero-commands.md +175 -0
- package/skills/ai-research/18-multimodal/cosmos-policy/references/robocasa-commands.md +147 -0
- package/skills/ai-research/18-multimodal/llava/SKILL.md +304 -0
- package/skills/ai-research/18-multimodal/llava/references/training.md +198 -0
- package/skills/ai-research/18-multimodal/openpi/SKILL.md +480 -0
- package/skills/ai-research/18-multimodal/openpi/references/checkpoints-and-env-map.md +86 -0
- package/skills/ai-research/18-multimodal/openpi/references/config-recipes.md +50 -0
- package/skills/ai-research/18-multimodal/openpi/references/pytorch-gotchas.md +49 -0
- package/skills/ai-research/18-multimodal/openpi/references/remote-client-pattern.md +48 -0
- package/skills/ai-research/18-multimodal/openpi/references/training-debugging.md +46 -0
- package/skills/ai-research/18-multimodal/openvla-oft/SKILL.md +441 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/aloha-workflow.md +141 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/config-troubleshooting.md +97 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/libero-workflow.md +115 -0
- package/skills/ai-research/18-multimodal/openvla-oft/references/paper-and-checkpoints.md +84 -0
- package/skills/ai-research/18-multimodal/segment-anything/SKILL.md +500 -0
- package/skills/ai-research/18-multimodal/segment-anything/references/advanced-usage.md +590 -0
- package/skills/ai-research/18-multimodal/segment-anything/references/troubleshooting.md +485 -0
- package/skills/ai-research/18-multimodal/stable-diffusion/SKILL.md +519 -0
- package/skills/ai-research/18-multimodal/stable-diffusion/references/advanced-usage.md +717 -0
- package/skills/ai-research/18-multimodal/stable-diffusion/references/troubleshooting.md +556 -0
- package/skills/ai-research/18-multimodal/whisper/SKILL.md +317 -0
- package/skills/ai-research/18-multimodal/whisper/references/languages.md +190 -0
- package/skills/ai-research/19-emerging-techniques/knowledge-distillation/SKILL.md +458 -0
- package/skills/ai-research/19-emerging-techniques/knowledge-distillation/references/minillm.md +335 -0
- package/skills/ai-research/19-emerging-techniques/long-context/SKILL.md +536 -0
- package/skills/ai-research/19-emerging-techniques/long-context/references/extension_methods.md +469 -0
- package/skills/ai-research/19-emerging-techniques/long-context/references/fine_tuning.md +612 -0
- package/skills/ai-research/19-emerging-techniques/long-context/references/rope.md +403 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/SKILL.md +497 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/coefficient-tuning.md +415 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/evaluation.md +463 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/examples.md +429 -0
- package/skills/ai-research/19-emerging-techniques/model-merging/references/methods.md +353 -0
- package/skills/ai-research/19-emerging-techniques/model-pruning/SKILL.md +495 -0
- package/skills/ai-research/19-emerging-techniques/model-pruning/references/wanda.md +348 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/SKILL.md +526 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/references/architectures.md +433 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/references/inference.md +349 -0
- package/skills/ai-research/19-emerging-techniques/moe-training/references/training.md +426 -0
- package/skills/ai-research/19-emerging-techniques/speculative-decoding/SKILL.md +467 -0
- package/skills/ai-research/19-emerging-techniques/speculative-decoding/references/lookahead.md +310 -0
- package/skills/ai-research/19-emerging-techniques/speculative-decoding/references/medusa.md +351 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/SKILL.md +479 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/data-visualization.md +509 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/diagram-generation.md +395 -0
- package/skills/ai-research/20-ml-paper-writing/academic-plotting/references/style-guide.md +305 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/SKILL.md +982 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/checklists.md +348 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/citation-workflow.md +563 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/reviewer-guidelines.md +349 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/sources.md +165 -0
- package/skills/ai-research/20-ml-paper-writing/ml-paper-writing/references/writing-guide.md +477 -0
- package/skills/ai-research/20-ml-paper-writing/presenting-conference-talks/SKILL.md +298 -0
- package/skills/ai-research/20-ml-paper-writing/presenting-conference-talks/references/slide-templates.md +505 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/SKILL.md +270 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/checklist.md +279 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/reviewer-guidelines.md +116 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/section-blueprints.md +400 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/systems-conferences.md +261 -0
- package/skills/ai-research/20-ml-paper-writing/systems-paper-writing/references/writing-patterns.md +231 -0
- package/skills/ai-research/21-research-ideation/brainstorming-research-ideas/SKILL.md +384 -0
- package/skills/ai-research/21-research-ideation/creative-thinking-for-research/SKILL.md +366 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/SKILL.md +245 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/references/ara-schema.md +439 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/references/exploration-tree-spec.md +125 -0
- package/skills/ai-research/22-agent-native-research-artifact/compiler/references/validation-checklist.md +149 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/SKILL.md +324 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/event-taxonomy.md +124 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/provenance-tags.md +190 -0
- package/skills/ai-research/22-agent-native-research-artifact/research-manager/references/session-protocol.md +162 -0
- package/skills/ai-research/22-agent-native-research-artifact/rigor-reviewer/SKILL.md +322 -0
- package/skills/ai-research/22-agent-native-research-artifact/rigor-reviewer/references/review-dimensions.md +182 -0
- package/skills/ai-research/SKILL.md +101 -0
- package/skills/ai-research/SOURCE +38 -0
- package/skills/ai-research/index/1-frame.md +18 -0
- package/skills/ai-research/index/2-data.md +21 -0
- package/skills/ai-research/index/3-train.md +48 -0
- package/skills/ai-research/index/4-measure.md +25 -0
- package/skills/ai-research/index/5-run.md +23 -0
- package/skills/ai-research/index/6-write.md +35 -0
- package/skills/ai-research/library.json +3456 -0
- package/skills/analyze-app/EVALS.md +82 -0
- package/skills/analyze-app/SKILL.md +188 -0
- package/skills/design-contract/EVALS.md +80 -0
- package/skills/design-contract/SKILL.md +171 -0
- package/skills/design-library/EVALS.md +85 -0
- package/skills/design-library/INDEX.md +59 -0
- package/skills/design-library/SKILL.md +58 -0
- package/skills/design-library/SOURCE +131 -0
- package/skills/design-library/adaptive-interfaces/skills/colour-independence/SKILL.md +90 -0
- package/skills/design-library/adaptive-interfaces/skills/flexible-typography/SKILL.md +83 -0
- package/skills/design-library/adaptive-interfaces/skills/information-density/SKILL.md +87 -0
- package/skills/design-library/adaptive-interfaces/skills/preference-audit/SKILL.md +70 -0
- package/skills/design-library/adaptive-interfaces/skills/responsive-accessibility/SKILL.md +86 -0
- package/skills/design-library/adaptive-interfaces/skills/responsive-review/SKILL.md +76 -0
- package/skills/design-library/adaptive-interfaces/skills/simplified-views/SKILL.md +97 -0
- package/skills/design-library/adaptive-interfaces/skills/specify/SKILL.md +63 -0
- package/skills/design-library/adaptive-interfaces/skills/user-preference-respect/SKILL.md +100 -0
- package/skills/design-library/cognitive-accessibility/skills/adaptive-personalisation/SKILL.md +61 -0
- package/skills/design-library/cognitive-accessibility/skills/assess-load/SKILL.md +48 -0
- package/skills/design-library/cognitive-accessibility/skills/cognitive-load-assessment/SKILL.md +60 -0
- package/skills/design-library/cognitive-accessibility/skills/contextual-help-design/SKILL.md +61 -0
- package/skills/design-library/cognitive-accessibility/skills/error-prevention-recovery/SKILL.md +71 -0
- package/skills/design-library/cognitive-accessibility/skills/focus-attention-design/SKILL.md +67 -0
- package/skills/design-library/cognitive-accessibility/skills/memory-load-reduction/SKILL.md +60 -0
- package/skills/design-library/cognitive-accessibility/skills/plain-language-design/SKILL.md +78 -0
- package/skills/design-library/cognitive-accessibility/skills/review/SKILL.md +56 -0
- package/skills/design-library/cognitive-accessibility/skills/simplify/SKILL.md +39 -0
- package/skills/design-library/cognitive-accessibility/skills/wayfinding-navigation/SKILL.md +64 -0
- package/skills/design-library/design-research/skills/behavioural-analytics/SKILL.md +33 -0
- package/skills/design-library/design-research/skills/qual-quant-triangulation/SKILL.md +33 -0
- package/skills/design-library/inclusive-interaction/skills/audit/SKILL.md +50 -0
- package/skills/design-library/inclusive-interaction/skills/design-flow/SKILL.md +58 -0
- package/skills/design-library/inclusive-interaction/skills/feedback-and-status/SKILL.md +76 -0
- package/skills/design-library/inclusive-interaction/skills/gesture-alternatives/SKILL.md +70 -0
- package/skills/design-library/inclusive-interaction/skills/keyboard-navigation/SKILL.md +99 -0
- package/skills/design-library/inclusive-interaction/skills/keyboard-review/SKILL.md +54 -0
- package/skills/design-library/inclusive-interaction/skills/motion-sensitivity/SKILL.md +79 -0
- package/skills/design-library/inclusive-interaction/skills/multi-modal-input/SKILL.md +70 -0
- package/skills/design-library/inclusive-interaction/skills/touch-target-design/SKILL.md +71 -0
- package/skills/design-library/inclusive-interaction/skills/voice-interaction/SKILL.md +68 -0
- package/skills/design-library/visual-critique/skills/critique-affordance/SKILL.md +45 -0
- package/skills/design-library/visual-critique/skills/critique-brand-consistency/SKILL.md +42 -0
- package/skills/design-library/visual-critique/skills/critique-color/SKILL.md +44 -0
- package/skills/design-library/visual-critique/skills/critique-composition/SKILL.md +46 -0
- package/skills/design-library/visual-critique/skills/critique-information-density/SKILL.md +45 -0
- package/skills/design-library/visual-critique/skills/critique-typography/SKILL.md +45 -0
- package/skills/design-library/visual-critique/skills/critique-visual-hierarchy/SKILL.md +40 -0
- package/skills/feature-audit/EVALS.md +83 -0
- package/skills/feature-audit/SKILL.md +326 -0
- package/skills/harness/EVALS.md +81 -0
- package/skills/harness/SKILL.md +88 -0
- package/skills/i-have-adhd/EVALS.md +80 -0
- package/skills/i-have-adhd/SKILL.md +183 -0
- package/skills/no-ai-slop/EVALS.md +89 -0
- package/skills/no-ai-slop/SKILL.md +209 -0
- package/skills/no-ai-slop/eval.md +52 -0
- package/skills/plan-add/EVALS.md +79 -0
- package/skills/plan-add/SKILL.md +179 -0
- package/skills/plan-add/render_table.py +72 -0
- package/skills/plan-status/EVALS.md +78 -0
- package/skills/plan-status/SKILL.md +52 -0
- package/skills/plan-sync/EVALS.md +80 -0
- package/skills/plan-sync/SKILL.md +69 -0
- package/skills/pm-frameworks/SKILL.md +33 -0
- package/skills/pm-frameworks/SOURCE +39 -0
- package/skills/pm-frameworks/intended-vs-implemented/SKILL.md +42 -0
- package/skills/pm-frameworks/opportunity-solution-tree/SKILL.md +64 -0
- package/skills/ponytail/EVALS.md +80 -0
- package/skills/ponytail/SKILL.md +124 -0
- package/skills/product-analysis/EVALS.md +103 -0
- package/skills/product-analysis/SKILL.md +361 -0
- package/skills/research/EVALS.md +104 -0
- package/skills/research/SKILL.md +570 -0
- package/skills/rl-env/SKILL.md +53 -0
- package/skills/rl-env/SOURCE +41 -0
- package/skills/rl-env/generate-nemo-gym-env/SKILL.md +169 -0
- package/skills/rl-env/generate-nemo-gym-env/references/architecture.md +114 -0
- package/skills/rl-env/generate-openenv-env/SKILL.md +183 -0
- package/skills/rl-env/generate-openenv-env/references/architecture.md +82 -0
- package/skills/rl-env/generate-ors-env/SKILL.md +209 -0
- package/skills/rl-env/generate-ors-env/references/architecture.md +113 -0
- package/skills/rl-env/generate-verifiers-env/SKILL.md +188 -0
- package/skills/rl-env/generate-verifiers-env/references/architecture.md +119 -0
- package/skills/rl-env/rl-env-from-description/SKILL.md +124 -0
- package/skills/rl-env/rl-env-from-description/references/interview.md +75 -0
- package/skills/rl-env/rl-env-from-description/references/nemo_gym.md +41 -0
- package/skills/rl-env/rl-env-from-description/references/openenv.md +35 -0
- package/skills/rl-env/rl-env-from-description/references/ors.md +50 -0
- package/skills/rl-env/rl-env-from-description/references/verifiers.md +39 -0
- package/skills/tezgah-contract/EVALS.md +78 -0
- package/skills/tezgah-contract/SKILL.md +792 -0
- package/statusline.py +129 -0
- package/workflows/graph-impact.js +153 -0
- package/workflows/graph-map.js +158 -0
- package/workflows/graph-review.js +170 -0
package/statusline.py
ADDED
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Status line segment for every host that supports one.
|
|
3
|
+
|
|
4
|
+
python3 statusline.py # Claude Code (or any Claude-format status line)
|
|
5
|
+
python3 statusline.py --cursor # Cursor CLI (same stdin shape, no Orca passthrough)
|
|
6
|
+
|
|
7
|
+
Claude Code's statusLine pipes session JSON on stdin; Cursor's spec is aligned
|
|
8
|
+
with it. This wraps Orca's own status line for Claude, then appends the tezgah
|
|
9
|
+
checklist from hooks/tezgah_context.health_lines - the single source every host
|
|
10
|
+
renders - so the segment is identical on Claude, Cursor, Codex and opencode.
|
|
11
|
+
Used-tool marks come from the Claude transcript on Claude, and from tezgah's own
|
|
12
|
+
recorder (written by the Codex/Cursor/dsh/opencode adapters) elsewhere.
|
|
13
|
+
"""
|
|
14
|
+
import glob
|
|
15
|
+
import json
|
|
16
|
+
import os
|
|
17
|
+
import subprocess
|
|
18
|
+
import sys
|
|
19
|
+
|
|
20
|
+
# installed as a ~/.claude/statusline.py (or ~/.cursor) symlink, so resolve the
|
|
21
|
+
# real file to find the plugin it ships with before importing the shared core
|
|
22
|
+
sys.path.insert(0, os.path.join(
|
|
23
|
+
os.path.dirname(os.path.realpath(__file__)), "hooks"))
|
|
24
|
+
from tezgah_guard import import_failed # noqa: E402
|
|
25
|
+
try:
|
|
26
|
+
from tezgah_context import (GRAPH_TOOL_MARK, LEGEND, # noqa: E402
|
|
27
|
+
TOOL_USE_MEASURES, color_default,
|
|
28
|
+
health_segments, render_line, shell_kind,
|
|
29
|
+
skill_read_kind, used as used_kinds)
|
|
30
|
+
except Exception as exc:
|
|
31
|
+
# the status line is the one surface the user always sees: say the core is
|
|
32
|
+
# down there, rather than drawing nothing
|
|
33
|
+
print("tezgah \u2717 core import failed (%s)" % type(exc).__name__)
|
|
34
|
+
import_failed(exc)
|
|
35
|
+
|
|
36
|
+
HOME = os.path.expanduser("~")
|
|
37
|
+
ORCA = os.path.join(HOME, ".orca", "agent-hooks", "claude-statusline.sh")
|
|
38
|
+
HOST = "cursor" if ("--cursor" in sys.argv or
|
|
39
|
+
os.environ.get("TEZGAH_STATUS_HOST") == "cursor") else "claude"
|
|
40
|
+
|
|
41
|
+
data = sys.stdin.read()
|
|
42
|
+
try:
|
|
43
|
+
payload = json.loads(data or "{}")
|
|
44
|
+
except Exception:
|
|
45
|
+
payload = {}
|
|
46
|
+
|
|
47
|
+
orca_out = ""
|
|
48
|
+
if HOST == "claude" and os.access(ORCA, os.X_OK):
|
|
49
|
+
try:
|
|
50
|
+
orca_out = subprocess.run(
|
|
51
|
+
["/bin/sh", ORCA], input=data, capture_output=True,
|
|
52
|
+
text=True, timeout=5,
|
|
53
|
+
).stdout.strip()
|
|
54
|
+
except Exception:
|
|
55
|
+
orca_out = ""
|
|
56
|
+
|
|
57
|
+
cwd = ((payload.get("workspace") or {}).get("current_dir")
|
|
58
|
+
or payload.get("cwd") or "")
|
|
59
|
+
try:
|
|
60
|
+
real = os.path.realpath(cwd) if cwd else ""
|
|
61
|
+
except OSError:
|
|
62
|
+
real = ""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def claude_used():
|
|
66
|
+
"""Tool kinds used this session, parsed from the Claude transcript.
|
|
67
|
+
|
|
68
|
+
A substring scan would flag the tool NAME appearing in chat text, so parse
|
|
69
|
+
tool_use blocks; subagent transcripts are included so delegated graph/consult
|
|
70
|
+
use still counts.
|
|
71
|
+
"""
|
|
72
|
+
used = set()
|
|
73
|
+
tp = payload.get("transcript_path")
|
|
74
|
+
files = [tp] if tp and os.path.exists(tp) else []
|
|
75
|
+
if tp:
|
|
76
|
+
files += glob.glob(os.path.splitext(tp)[0] + "/subagents/**/*.jsonl",
|
|
77
|
+
recursive=True)
|
|
78
|
+
lines = []
|
|
79
|
+
for fp in files:
|
|
80
|
+
try:
|
|
81
|
+
size = os.path.getsize(fp)
|
|
82
|
+
with open(fp, encoding="utf-8", errors="ignore") as fh:
|
|
83
|
+
if size > 2_000_000:
|
|
84
|
+
fh.seek(size - 2_000_000)
|
|
85
|
+
lines += fh.read().splitlines()
|
|
86
|
+
except OSError:
|
|
87
|
+
pass
|
|
88
|
+
for line in lines:
|
|
89
|
+
try:
|
|
90
|
+
content = (json.loads(line).get("message") or {}).get("content")
|
|
91
|
+
except Exception:
|
|
92
|
+
continue # partial first line after seek, or non-message row
|
|
93
|
+
if not isinstance(content, list):
|
|
94
|
+
continue
|
|
95
|
+
for b in content:
|
|
96
|
+
if not isinstance(b, dict) or b.get("type") != "tool_use":
|
|
97
|
+
continue
|
|
98
|
+
name = b.get("name", "")
|
|
99
|
+
read_kind = skill_read_kind(name, b.get("input"))
|
|
100
|
+
if read_kind:
|
|
101
|
+
used.add(read_kind)
|
|
102
|
+
elif name.startswith("mcp__") and GRAPH_TOOL_MARK in name.lower():
|
|
103
|
+
used.add("graph")
|
|
104
|
+
elif name in ("Task", "Agent"):
|
|
105
|
+
used.add("orch")
|
|
106
|
+
elif name == "Bash":
|
|
107
|
+
# The shared tokenizer, not a substring: the same call the other
|
|
108
|
+
# hosts make, so an `orx` run marks `research` and a command that
|
|
109
|
+
# merely mentions the word does not mark anything.
|
|
110
|
+
kind = shell_kind((b.get("input") or {}).get("command"))
|
|
111
|
+
if kind:
|
|
112
|
+
used.add(kind)
|
|
113
|
+
return used
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
seen = used_kinds(payload.get("session_id")) if HOST == "cursor" else claude_used()
|
|
117
|
+
# Cursor's line reads tezgah's store, which sees the tool calls its hook fires on
|
|
118
|
+
# and nothing else; Claude's transcript carries the skill reads too.
|
|
119
|
+
observable = TOOL_USE_MEASURES if HOST == "cursor" else None
|
|
120
|
+
segs = health_segments(real or os.getcwd(), payload.get("session_id"),
|
|
121
|
+
used_override=seen, observable=observable)
|
|
122
|
+
# Claude Code and Cursor render ANSI; let a user or a plain terminal opt out.
|
|
123
|
+
color = color_default()
|
|
124
|
+
seg = render_line(segs, color=color)
|
|
125
|
+
parts = [p for p in (orca_out, seg) if p]
|
|
126
|
+
out = " | ".join(parts)
|
|
127
|
+
if os.environ.get("TEZGAH_STATUS_LEGEND") == "1":
|
|
128
|
+
out += "\n" + LEGEND.rstrip()
|
|
129
|
+
print(out)
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: 'graph-impact',
|
|
3
|
+
description: 'Blast radius of a change: pull every caller from the codegraph index, plan the edit per module, then have a critic hunt for missed call sites.',
|
|
4
|
+
whenToUse: 'Renaming or changing a shared symbol, migrating an API, deleting suspected dead code - anything where "did I get all the call sites" is the real question.',
|
|
5
|
+
phases: [
|
|
6
|
+
{ title: 'Trace', detail: 'codegraph callers of the target, grouped by module' },
|
|
7
|
+
{ title: 'Plan', detail: 'one planner per affected module' },
|
|
8
|
+
{ title: 'Sweep', detail: 'critic hunts call sites the graph missed' },
|
|
9
|
+
],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const target = (typeof args === 'string' && args) ? args : (args && args.target) || ''
|
|
13
|
+
if (!target) return { error: 'graph-impact needs a target: pass a symbol, file, or git ref as args' }
|
|
14
|
+
const direction = (args && args.direction) || 'inbound'
|
|
15
|
+
const MAX_MODULES = 6
|
|
16
|
+
|
|
17
|
+
const GRAPH = `On Claude the MCP server exposes one tool by default: load it with
|
|
18
|
+
ToolSearch("select:mcp__codegraph__codegraph_explore,mcp__plugin_tezgah_codegraph__codegraph_explore")
|
|
19
|
+
before the first query (a plugin install uses the plugin_tezgah_ name). The rest of the surface is the CLI:
|
|
20
|
+
\`codegraph callers <symbol>\` walks inbound call paths, \`codegraph callees <symbol>\` outbound,
|
|
21
|
+
\`codegraph impact <symbol>\` gives a symbol's blast radius - for a git ref, run it per changed symbol of
|
|
22
|
+
\`git diff <ref>\` - \`git diff --name-only <ref> | codegraph affected --stdin\` names the test files the
|
|
23
|
+
changed files reach, \`codegraph node <symbol>\` pulls a definition with its body, \`codegraph query <text>\` finds symbols,
|
|
24
|
+
\`codegraph files\` dumps what the index holds. The index is the repo's own \`.codegraph/codegraph.db\`.
|
|
25
|
+
codegraph ships no coverage report, so what the index does NOT know about is measured by diffing
|
|
26
|
+
\`codegraph files\` against \`git ls-files\`.`
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
const TRACE = {
|
|
30
|
+
type: 'object',
|
|
31
|
+
required: ['resolved_target', 'call_sites'],
|
|
32
|
+
properties: {
|
|
33
|
+
resolved_target: { type: 'string', description: 'the symbol(s) the target actually resolves to, with file:line' },
|
|
34
|
+
kind: { type: 'string', description: 'function, method, type, route, config key, ...' },
|
|
35
|
+
call_sites: { type: 'array', items: {
|
|
36
|
+
type: 'object',
|
|
37
|
+
required: ['module', 'file', 'symbol'],
|
|
38
|
+
properties: {
|
|
39
|
+
module: { type: 'string' },
|
|
40
|
+
file: { type: 'string' },
|
|
41
|
+
line: { type: 'integer' },
|
|
42
|
+
symbol: { type: 'string', description: 'the calling symbol' },
|
|
43
|
+
hops: { type: 'integer', description: 'distance from the target' },
|
|
44
|
+
},
|
|
45
|
+
} },
|
|
46
|
+
unindexed_risk: { type: 'string', description: 'from codegraph files vs git ls-files: what the index cannot see' },
|
|
47
|
+
},
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const PLAN = {
|
|
51
|
+
type: 'object',
|
|
52
|
+
required: ['module', 'edits'],
|
|
53
|
+
properties: {
|
|
54
|
+
module: { type: 'string' },
|
|
55
|
+
edits: { type: 'array', items: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
required: ['file', 'what', 'why'],
|
|
58
|
+
properties: {
|
|
59
|
+
file: { type: 'string' },
|
|
60
|
+
line: { type: 'integer' },
|
|
61
|
+
what: { type: 'string', description: 'the concrete edit' },
|
|
62
|
+
why: { type: 'string' },
|
|
63
|
+
breaks_if_skipped: { type: 'string' },
|
|
64
|
+
},
|
|
65
|
+
} },
|
|
66
|
+
order_note: { type: 'string', description: 'must this module change before or after others' },
|
|
67
|
+
tests_to_run: { type: 'array', items: { type: 'string' } },
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
phase('Trace')
|
|
72
|
+
const trace = await agent(
|
|
73
|
+
`Find every place affected by changing: ${target}
|
|
74
|
+
${GRAPH}
|
|
75
|
+
Resolve what the target actually is with \`codegraph query\` / \`codegraph node\`, then walk callers with
|
|
76
|
+
\`codegraph ${direction === 'outbound' ? 'callees' : 'callers'}\` (and, when the target is a git ref,
|
|
77
|
+
\`codegraph impact\` per changed symbol of \`git diff <ref>\`) until the frontier stops growing. Group call sites by module. Then diff \`codegraph files\`
|
|
78
|
+
against \`git ls-files\` and state plainly what the graph cannot see - unindexed files, generated code,
|
|
79
|
+
dynamic dispatch, string-keyed lookups, config and templates that reference the symbol by name, and the
|
|
80
|
+
extensionless scripts under \`bin/\` that only their \`.py\` twin puts in the graph. Do not plan any edit yet.`,
|
|
81
|
+
{ label: 'trace', schema: TRACE, effort: 'high' },
|
|
82
|
+
)
|
|
83
|
+
|
|
84
|
+
if (!trace) return { error: 'the trace agent failed - nothing was traced; unknown, not clean', target, unknown: ['trace'] }
|
|
85
|
+
if (!trace.call_sites) return { error: 'trace returned no call-site list - is the repo indexed? run `codegraph init` first', target, unknown: ['trace'] }
|
|
86
|
+
if (!trace.call_sites.length) {
|
|
87
|
+
return { target, resolved_target: trace.resolved_target, call_sites: [], modules_skipped: [], graph_blind_spots: [], note: 'no callers in the graph - possible dead code, but confirm against unindexed_risk: ' + (trace.unindexed_risk || 'n/a') }
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const byModule = {}
|
|
91
|
+
for (const cs of trace.call_sites) (byModule[cs.module] = byModule[cs.module] || []).push(cs)
|
|
92
|
+
const modules = Object.keys(byModule).sort((a, b) => byModule[b].length - byModule[a].length)
|
|
93
|
+
const picked = modules.slice(0, MAX_MODULES)
|
|
94
|
+
if (modules.length > picked.length) {
|
|
95
|
+
log(`${trace.call_sites.length} call sites across ${modules.length} modules; planning the ${picked.length} heaviest. NOT planned: ${modules.slice(MAX_MODULES).join(', ')}`)
|
|
96
|
+
}
|
|
97
|
+
log(`target resolves to: ${trace.resolved_target}`)
|
|
98
|
+
|
|
99
|
+
phase('Plan')
|
|
100
|
+
const plansPending = parallel(picked.map(m => () => agent(
|
|
101
|
+
`Plan the edits inside module "${m}" for this change: ${target}
|
|
102
|
+
Target resolves to: ${trace.resolved_target} (${trace.kind || 'unknown kind'})
|
|
103
|
+
Call sites in your module: ${JSON.stringify(byModule[m])}
|
|
104
|
+
${GRAPH}
|
|
105
|
+
Read the actual lines before proposing an edit. For each call site say the concrete edit, why, and what
|
|
106
|
+
breaks if it is skipped. Flag ordering constraints against other modules. Name the tests that cover it.
|
|
107
|
+
Do not edit anything - plan only.`,
|
|
108
|
+
{ label: `plan:${m}`, phase: 'Plan', schema: PLAN, effort: 'high' },
|
|
109
|
+
)))
|
|
110
|
+
|
|
111
|
+
// the sweep prompt reads only the trace, so it starts now instead of waiting
|
|
112
|
+
// out the slowest planner
|
|
113
|
+
phase('Sweep')
|
|
114
|
+
const sweepPending = agent(
|
|
115
|
+
`A graph-based trace found these call sites for "${target}" (resolved: ${trace.resolved_target}):
|
|
116
|
+
${JSON.stringify(trace.call_sites)}
|
|
117
|
+
The graph itself warned: ${trace.unindexed_risk || 'nothing'}
|
|
118
|
+
|
|
119
|
+
Your job: find the call sites it MISSED. The graph is blind to string-keyed dispatch, reflection, generated
|
|
120
|
+
code, config files, templates, docs, SQL, CI definitions, and anything in unindexed files. Hunt with Grep and
|
|
121
|
+
Glob across the repo - including non-source files - for the symbol name and its plausible spellings
|
|
122
|
+
(snake_case, kebab-case, quoted string, partial match). Report only hits absent from the list above.`,
|
|
123
|
+
{ label: 'sweep', schema: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
required: ['missed'],
|
|
126
|
+
properties: {
|
|
127
|
+
missed: { type: 'array', items: { type: 'object', required: ['file', 'why_it_matters'], properties: {
|
|
128
|
+
file: { type: 'string' }, line: { type: 'integer' }, snippet: { type: 'string' }, why_it_matters: { type: 'string' },
|
|
129
|
+
} } },
|
|
130
|
+
searched: { type: 'string', description: 'the patterns and paths actually searched' },
|
|
131
|
+
},
|
|
132
|
+
}, effort: 'high' },
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
const planned = await plansPending
|
|
136
|
+
const sweep = await sweepPending
|
|
137
|
+
// a failed planner or sweep is unknown: its module is unplanned, its blind spots unsearched
|
|
138
|
+
const unknown = picked.filter((m, i) => !planned[i]).map(m => `plan:${m}`).concat(sweep ? [] : ['sweep'])
|
|
139
|
+
const plans = planned.filter(Boolean)
|
|
140
|
+
if (unknown.length) log(`failed, reported as unknown: ${unknown.join(', ')}`)
|
|
141
|
+
|
|
142
|
+
return {
|
|
143
|
+
target,
|
|
144
|
+
resolved_target: trace.resolved_target,
|
|
145
|
+
call_site_count: trace.call_sites.length,
|
|
146
|
+
modules_planned: picked,
|
|
147
|
+
modules_skipped: modules.slice(MAX_MODULES),
|
|
148
|
+
plans,
|
|
149
|
+
graph_blind_spots: sweep ? (sweep.missed || []) : 'unknown - the sweep agent failed',
|
|
150
|
+
sweep_coverage: sweep ? sweep.searched : 'none - the sweep agent failed',
|
|
151
|
+
unindexed_risk: trace.unindexed_risk,
|
|
152
|
+
unknown,
|
|
153
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: 'graph-map',
|
|
3
|
+
description: 'Map a subsystem off the codegraph index: survey, one reader per module, synthesize, then gap-check.',
|
|
4
|
+
whenToUse: 'Before changing unfamiliar code, or when asked how a subsystem works / where things live / for an architecture map.',
|
|
5
|
+
phases: [
|
|
6
|
+
{ title: 'Survey', detail: 'codegraph status + module inventory from the index' },
|
|
7
|
+
{ title: 'Read', detail: 'one reader agent per module, in parallel' },
|
|
8
|
+
{ title: 'Synthesize', detail: 'merge into one map' },
|
|
9
|
+
{ title: 'Gap check', detail: 'critic names what the map still misses' },
|
|
10
|
+
],
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const focus = (typeof args === 'string' && args) ? args : (args && args.focus) || 'the whole repository'
|
|
14
|
+
const MAX_MODULES = 8
|
|
15
|
+
|
|
16
|
+
const GRAPH = `Use codegraph, not grep, for structure. On Claude the MCP server exposes one tool by
|
|
17
|
+
default: load it with ToolSearch("select:mcp__codegraph__codegraph_explore") before the first query.
|
|
18
|
+
The rest of the surface is the CLI, which is also what every other host uses:
|
|
19
|
+
\`codegraph status\`, \`codegraph files\`, \`codegraph node <symbol>\`, \`codegraph callers <symbol>\`,
|
|
20
|
+
\`codegraph callees <symbol>\`, \`codegraph impact <target>\`, \`codegraph query <text>\`. The index is the
|
|
21
|
+
repo's own \`.codegraph/codegraph.db\`. Fall back to Read/Grep only for something the graph genuinely
|
|
22
|
+
cannot answer, and say so when you do.`
|
|
23
|
+
|
|
24
|
+
const SURVEY = {
|
|
25
|
+
type: 'object',
|
|
26
|
+
required: ['modules'],
|
|
27
|
+
properties: {
|
|
28
|
+
modules: {
|
|
29
|
+
type: 'array',
|
|
30
|
+
items: {
|
|
31
|
+
type: 'object',
|
|
32
|
+
required: ['name', 'path', 'why'],
|
|
33
|
+
properties: {
|
|
34
|
+
name: { type: 'string' },
|
|
35
|
+
path: { type: 'string' },
|
|
36
|
+
why: { type: 'string', description: 'why this module matters to the focus' },
|
|
37
|
+
rank: { type: 'integer', description: '1 = most central to the focus' },
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
entrypoints: { type: 'array', items: { type: 'string' } },
|
|
42
|
+
stack: { type: 'string', description: 'languages, frameworks, storage, transport' },
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const READING = {
|
|
47
|
+
type: 'object',
|
|
48
|
+
required: ['module', 'responsibility', 'key_symbols'],
|
|
49
|
+
properties: {
|
|
50
|
+
module: { type: 'string' },
|
|
51
|
+
responsibility: { type: 'string' },
|
|
52
|
+
key_symbols: {
|
|
53
|
+
type: 'array',
|
|
54
|
+
items: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
required: ['symbol', 'file', 'role'],
|
|
57
|
+
properties: {
|
|
58
|
+
symbol: { type: 'string' },
|
|
59
|
+
file: { type: 'string' },
|
|
60
|
+
line: { type: 'integer' },
|
|
61
|
+
role: { type: 'string' },
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
collaborators: { type: 'array', items: { type: 'string' }, description: 'modules it calls or is called by, from codegraph callers/callees' },
|
|
66
|
+
data_flow: { type: 'string' },
|
|
67
|
+
risks: { type: 'array', items: { type: 'string' }, description: 'coupling, dead code, missing tests - graph-evidenced only' },
|
|
68
|
+
},
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
phase('Survey')
|
|
72
|
+
const survey = await agent(
|
|
73
|
+
`Survey this repository so other agents can split it up. Focus: ${focus}.
|
|
74
|
+
${GRAPH}
|
|
75
|
+
Start with \`codegraph status\` and \`codegraph files\`. Return the modules that matter for the
|
|
76
|
+
focus, ranked, with the real directory path for each. Do not read file bodies - stay at graph level.`,
|
|
77
|
+
{ label: 'survey', schema: SURVEY, effort: 'medium' },
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
if (!survey || !survey.modules || !survey.modules.length) {
|
|
81
|
+
return { error: 'survey returned no modules - is the repo indexed? run `codegraph init` in it first' }
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const ranked = survey.modules.slice().sort((a, b) => (a.rank || 99) - (b.rank || 99))
|
|
85
|
+
const picked = ranked.slice(0, MAX_MODULES)
|
|
86
|
+
if (ranked.length > picked.length) {
|
|
87
|
+
log(`${ranked.length} modules found, reading top ${picked.length}: dropped ${ranked.slice(MAX_MODULES).map(m => m.name).join(', ')}`)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
phase('Read')
|
|
91
|
+
const readings = (await parallel(picked.map(m => () => agent(
|
|
92
|
+
`Read module "${m.name}" at ${m.path}. It matters because: ${m.why}. Overall focus: ${focus}.
|
|
93
|
+
${GRAPH}
|
|
94
|
+
Answer: what it is responsible for, its key symbols with file and line, which other modules call it or
|
|
95
|
+
it calls (use \`codegraph callers\` and \`codegraph callees\` both directions), how data moves through it,
|
|
96
|
+
and any graph-evidenced risk (dead code, a symbol with many inbound callers, missing test coverage).
|
|
97
|
+
Cite file:line for every claim.`,
|
|
98
|
+
{ label: `read:${m.name}`, phase: 'Read', schema: READING },
|
|
99
|
+
)))).filter(Boolean)
|
|
100
|
+
|
|
101
|
+
log(`${readings.length}/${picked.length} modules read`)
|
|
102
|
+
|
|
103
|
+
phase('Synthesize')
|
|
104
|
+
const map = await agent(
|
|
105
|
+
`Write one coherent map of this codebase for focus "${focus}".
|
|
106
|
+
Stack: ${survey.stack || 'unknown'}. Entrypoints: ${(survey.entrypoints || []).join(', ') || 'unknown'}.
|
|
107
|
+
Per-module readings (JSON):
|
|
108
|
+
${JSON.stringify(readings)}
|
|
109
|
+
|
|
110
|
+
Produce markdown: a one-paragraph orientation, a module table (module - responsibility - key entry symbol as
|
|
111
|
+
\`file:line\`), the request/data path end to end naming the symbol at each hop as \`file:line\`, then "Sharp
|
|
112
|
+
edges" where every bullet ends in the \`file:line\` it refers to. Every file:line comes from the readings -
|
|
113
|
+
copy them, never reconstruct or guess one. Do not invent anything absent from the readings. If the readings
|
|
114
|
+
carry no code symbols (a docs-only or config-only repo), say so in one line at the top instead of dressing
|
|
115
|
+
document headings up as code.`,
|
|
116
|
+
{ label: 'synthesize', effort: 'high' },
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
if (!map) {
|
|
120
|
+
return { focus, modules_read: readings.map(r => r.module),
|
|
121
|
+
modules_dropped: ranked.slice(MAX_MODULES).map(m => m.name),
|
|
122
|
+
map: null, gaps: [], error: 'the synthesize agent returned nothing' }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
phase('Gap check')
|
|
126
|
+
const gaps = await agent(
|
|
127
|
+
`Here is a codebase map produced from graph-derived module readings. Focus was "${focus}".
|
|
128
|
+
|
|
129
|
+
${map}
|
|
130
|
+
|
|
131
|
+
Your job is to find what it MISSES, not to praise it. Verify against the graph yourself.
|
|
132
|
+
${GRAPH}
|
|
133
|
+
Name concretely: a module in the repo absent from the map, a claimed call path that \`codegraph callers\`
|
|
134
|
+
does not support, an entrypoint never traced, a file:line citation that does not resolve. codegraph ships
|
|
135
|
+
no coverage report of its own, so measure it: diff \`codegraph files\` against \`git ls-files\` and name the
|
|
136
|
+
files the index does not hold - an extensionless script under \`bin/\` is in the graph only through its
|
|
137
|
+
\`.py\` twin, and dot-directories are skipped unless a \`.gitignore\` negation opts them in. Return a short
|
|
138
|
+
list; empty list if genuinely clean.`,
|
|
139
|
+
{ label: 'gap-check', schema: {
|
|
140
|
+
type: 'object',
|
|
141
|
+
required: ['gaps'],
|
|
142
|
+
properties: {
|
|
143
|
+
gaps: { type: 'array', items: { type: 'object', required: ['gap', 'evidence'], properties: {
|
|
144
|
+
gap: { type: 'string' }, evidence: { type: 'string' }, severity: { type: 'string' },
|
|
145
|
+
} } },
|
|
146
|
+
coverage_note: { type: 'string' },
|
|
147
|
+
},
|
|
148
|
+
}, effort: 'high' },
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
return {
|
|
152
|
+
focus,
|
|
153
|
+
modules_read: readings.map(r => r.module),
|
|
154
|
+
modules_dropped: ranked.slice(MAX_MODULES).map(m => m.name),
|
|
155
|
+
map,
|
|
156
|
+
gaps: (gaps && gaps.gaps) || [],
|
|
157
|
+
coverage_note: gaps && gaps.coverage_note,
|
|
158
|
+
}
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export const meta = {
|
|
2
|
+
name: 'graph-review',
|
|
3
|
+
description: 'Review a diff with graph-derived blast radius: scope, dimension fan-out, then adversarial verification of every finding.',
|
|
4
|
+
whenToUse: 'Reviewing uncommitted work, a branch, or a PR when you want findings that survive a skeptic rather than a plausible-sounding list.',
|
|
5
|
+
phases: [
|
|
6
|
+
{ title: 'Scope', detail: 'git diff + codegraph impact per changed symbol: the blast radius' },
|
|
7
|
+
{ title: 'Review', detail: 'one reviewer per dimension, in parallel' },
|
|
8
|
+
{ title: 'Verify', detail: 'two refuters per finding, distinct lenses' },
|
|
9
|
+
],
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const target = (typeof args === 'string' && args) ? args : (args && args.target) || 'uncommitted changes vs HEAD'
|
|
13
|
+
const MAX_VERIFIED = 4
|
|
14
|
+
|
|
15
|
+
const GRAPH = `On Claude the MCP server exposes one tool by default: load it with
|
|
16
|
+
ToolSearch("select:mcp__codegraph__codegraph_explore,mcp__plugin_tezgah_codegraph__codegraph_explore")
|
|
17
|
+
before the first query (a plugin install uses the plugin_tezgah_ name). The rest of the surface is the CLI:
|
|
18
|
+
\`codegraph impact <symbol>\` gives a symbol's transitive callers - run it per changed symbol of \`git diff\`;
|
|
19
|
+
that blast radius is the point, a diff alone hides it - \`git diff --name-only <ref> | codegraph affected --stdin\`
|
|
20
|
+
names the test files the changed files reach, \`codegraph callers\` and \`codegraph callees\` walk one hop, \`codegraph node <symbol>\` gives a definition
|
|
21
|
+
with its body, \`codegraph query <text>\` searches symbols. The index is the repo's own
|
|
22
|
+
\`.codegraph/codegraph.db\`. Read files for exact lines.`
|
|
23
|
+
|
|
24
|
+
const SCOPE = {
|
|
25
|
+
type: 'object',
|
|
26
|
+
required: ['changed_files'],
|
|
27
|
+
properties: {
|
|
28
|
+
project: { type: 'string' },
|
|
29
|
+
changed_files: { type: 'array', items: { type: 'string' } },
|
|
30
|
+
changed_symbols: { type: 'array', items: { type: 'string' } },
|
|
31
|
+
impacted_modules: { type: 'array', items: { type: 'string' }, description: 'from codegraph impact per changed symbol, inbound direction' },
|
|
32
|
+
blast_radius_note: { type: 'string' },
|
|
33
|
+
diff_summary: { type: 'string' },
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const FINDINGS = {
|
|
38
|
+
type: 'object',
|
|
39
|
+
required: ['findings'],
|
|
40
|
+
properties: {
|
|
41
|
+
findings: { type: 'array', items: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
required: ['title', 'file', 'summary', 'failure_scenario', 'severity'],
|
|
44
|
+
properties: {
|
|
45
|
+
title: { type: 'string' },
|
|
46
|
+
file: { type: 'string' },
|
|
47
|
+
line: { type: 'integer' },
|
|
48
|
+
summary: { type: 'string' },
|
|
49
|
+
failure_scenario: { type: 'string', description: 'concrete inputs or state -> wrong output or crash' },
|
|
50
|
+
severity: { type: 'string', enum: ['high', 'medium', 'low'] },
|
|
51
|
+
},
|
|
52
|
+
} },
|
|
53
|
+
},
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const VERDICT = {
|
|
57
|
+
type: 'object',
|
|
58
|
+
required: ['refuted', 'reasoning'],
|
|
59
|
+
properties: {
|
|
60
|
+
refuted: { type: 'boolean', description: 'true = the finding does not hold' },
|
|
61
|
+
reasoning: { type: 'string' },
|
|
62
|
+
evidence: { type: 'string', description: 'file:line or tool output that settles it' },
|
|
63
|
+
},
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const DIMENSIONS = [
|
|
67
|
+
{ key: 'correctness', ask: 'logic errors, wrong boundary conditions, unhandled nil/empty/error paths, off-by-one, inverted conditions, state mutated under the wrong assumption' },
|
|
68
|
+
{ key: 'callers', ask: 'callers this change breaks: signature/contract/return-shape changes, callers in impacted_modules that were not updated, dynamic or reflective call sites text search would miss' },
|
|
69
|
+
{ key: 'security', ask: 'injection, missing authz on a newly reachable path, secrets in code or logs, unvalidated external input, unsafe deserialization, TOCTOU' },
|
|
70
|
+
{ key: 'tests', ask: 'behavior changed with no test touching it - name the exact untested branch and the test file that should have covered it' },
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
phase('Scope')
|
|
74
|
+
const scope = await agent(
|
|
75
|
+
`Establish the review scope for: ${target}.
|
|
76
|
+
${GRAPH}
|
|
77
|
+
Take the changed files and lines from \`git diff\` (against the ref when the target is a git ref -
|
|
78
|
+
a base branch, a commit range - or HEAD for "uncommitted changes vs HEAD"), then run
|
|
79
|
+
\`codegraph impact <symbol>\` for each changed symbol (or the one symbol, when the target is a
|
|
80
|
+
symbol) to get their transitive callers. Return the changed files, changed symbols, the
|
|
81
|
+
impacted modules, and one honest sentence on how far the blast radius reaches. No
|
|
82
|
+
opinions on quality yet.`,
|
|
83
|
+
{ label: 'scope', schema: SCOPE, effort: 'medium' },
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
if (!scope) {
|
|
87
|
+
return { target, findings: [], confirmed: [], refuted: [], unverified: [], unknown: ['scope'], note: 'the scope agent failed - nothing was reviewed; unknown, not clean' }
|
|
88
|
+
}
|
|
89
|
+
if (!scope.changed_files || !scope.changed_files.length) {
|
|
90
|
+
return { target, findings: [], confirmed: [], refuted: [], unverified: [], unknown: [], note: 'no changes detected for this target - nothing to review' }
|
|
91
|
+
}
|
|
92
|
+
log(`${scope.changed_files.length} changed files, impacted modules: ${(scope.impacted_modules || []).join(', ') || 'none reported'}`)
|
|
93
|
+
|
|
94
|
+
const CONTEXT = `Target: ${target}
|
|
95
|
+
Changed files: ${scope.changed_files.join(', ')}
|
|
96
|
+
Changed symbols: ${(scope.changed_symbols || []).join(', ') || 'unknown'}
|
|
97
|
+
Impacted modules (transitive callers): ${(scope.impacted_modules || []).join(', ') || 'none'}
|
|
98
|
+
Diff summary: ${scope.diff_summary || 'read it yourself with git diff'}`
|
|
99
|
+
|
|
100
|
+
phase('Review')
|
|
101
|
+
const reviewed = await parallel(DIMENSIONS.map(d => () => agent(
|
|
102
|
+
`Review this change through one lens only: ${d.key}.
|
|
103
|
+
Look for: ${d.ask}
|
|
104
|
+
|
|
105
|
+
${CONTEXT}
|
|
106
|
+
${GRAPH}
|
|
107
|
+
Report only defects in or newly caused by the changed code. A finding needs a concrete failure scenario -
|
|
108
|
+
inputs or state that produce the wrong result. No style notes, no "consider maybe", no praise. Empty list
|
|
109
|
+
is the correct answer when the lens finds nothing.`,
|
|
110
|
+
{ label: `review:${d.key}`, phase: 'Review', schema: FINDINGS, effort: 'high' },
|
|
111
|
+
)))
|
|
112
|
+
// a failed dimension is unknown, never clean: its silence is not a finding
|
|
113
|
+
const unknown = DIMENSIONS.filter((d, i) => !reviewed[i]).map(d => `review:${d.key}`)
|
|
114
|
+
const reviews = reviewed.filter(Boolean)
|
|
115
|
+
|
|
116
|
+
const rank = { high: 0, medium: 1, low: 2 }
|
|
117
|
+
const all = reviews.flatMap(r => r.findings || []).sort((a, b) => rank[a.severity] - rank[b.severity])
|
|
118
|
+
if (!all.length) {
|
|
119
|
+
const note = !unknown.length ? 'all four dimensions came back clean'
|
|
120
|
+
: !reviews.length ? 'every dimension failed - nothing was reviewed; unknown, not clean'
|
|
121
|
+
: `${unknown.join(', ')} failed - unknown, not clean; the other dimensions found nothing`
|
|
122
|
+
return { target, scope, findings: [], confirmed: [], refuted: [], unverified: [], unknown, note }
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
const toVerify = all.slice(0, MAX_VERIFIED)
|
|
126
|
+
if (all.length > toVerify.length) {
|
|
127
|
+
log(`${all.length} findings raised; verifying the ${toVerify.length} most severe. NOT verified (reported as unverified): ${all.slice(MAX_VERIFIED).map(f => f.title).join('; ')}`)
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
phase('Verify')
|
|
131
|
+
const LENSES = [
|
|
132
|
+
'Re-read the actual code at the cited location. Does the code say what the finding claims it says?',
|
|
133
|
+
'Assume the finding is wrong. Find the guard, caller contract, type constraint, or existing test that already prevents this failure scenario.',
|
|
134
|
+
]
|
|
135
|
+
const verified = await parallel(toVerify.map(f => () => parallel(LENSES.map((lens, i) => () => agent(
|
|
136
|
+
`Try to REFUTE this review finding. Default to refuted=true when the evidence is not clear.
|
|
137
|
+
|
|
138
|
+
Finding: ${f.title}
|
|
139
|
+
Location: ${f.file}${f.line ? ':' + f.line : ''}
|
|
140
|
+
Claim: ${f.summary}
|
|
141
|
+
Claimed failure: ${f.failure_scenario}
|
|
142
|
+
|
|
143
|
+
Your lens: ${lens}
|
|
144
|
+
${GRAPH}
|
|
145
|
+
Cite the file:line or tool output that settles it. A finding that cannot be tied to real code is refuted.`,
|
|
146
|
+
{ label: `verify:${f.title.slice(0, 28)}#${i + 1}`, phase: 'Verify', schema: VERDICT, effort: 'high' },
|
|
147
|
+
))).then(votes => {
|
|
148
|
+
const live = votes.filter(Boolean)
|
|
149
|
+
const kills = live.filter(v => v.refuted)
|
|
150
|
+
// "survived two refuters" means zero refutations; a 1-1 split is a kill.
|
|
151
|
+
// No live vote at all settles nothing: the finding stays unverified.
|
|
152
|
+
return { finding: f, settled: live.length > 0, survived: live.length > 0 && kills.length === 0, votes: live }
|
|
153
|
+
})))
|
|
154
|
+
|
|
155
|
+
const settled = verified.filter(v => v && v.settled)
|
|
156
|
+
const confirmed = settled.filter(v => v.survived)
|
|
157
|
+
const killed = settled.filter(v => !v.survived)
|
|
158
|
+
const unsettled = verified.filter(v => v && !v.settled)
|
|
159
|
+
for (const v of unsettled) unknown.push(`verify:${v.finding.title}`)
|
|
160
|
+
log(`${confirmed.length} findings survived verification, ${killed.length} refuted, ${unsettled.length} unverified (every refuter failed)`)
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
target,
|
|
164
|
+
scope: { changed_files: scope.changed_files, impacted_modules: scope.impacted_modules, blast_radius_note: scope.blast_radius_note },
|
|
165
|
+
confirmed: confirmed.map(v => ({ ...v.finding, verdict: 'CONFIRMED', why_it_held: v.votes.filter(x => !x.refuted).map(x => x.evidence || x.reasoning) })),
|
|
166
|
+
refuted: killed.map(v => ({ title: v.finding.title, refuted_because: v.votes.filter(x => x.refuted).map(x => x.reasoning) })),
|
|
167
|
+
unverified: unsettled.map(v => ({ ...v.finding, verdict: 'UNVERIFIED - every refuter failed' }))
|
|
168
|
+
.concat(all.slice(MAX_VERIFIED).map(f => ({ ...f, verdict: 'UNVERIFIED - budget cap' }))),
|
|
169
|
+
unknown,
|
|
170
|
+
}
|