Repository navigation
Expand file tree
/
Copy pathpyproject.toml
More file actions
547 lines (526 loc) · 21.9 KB
/
Copy pathpyproject.toml
File metadata and controls
547 lines (526 loc) · 21.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
[build-system]
# setuptools>=77 is the floor for the PEP 639 ``license``/``license-files``
# form used below (the deprecated TOML-table form breaks on 2027-Feb-18).
requires = ["setuptools>=77", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "hyperloom-inference_optimizer"
version = "1.1.3"
description = "Inference Optimizer — two-role (Orchestration/Critic) autonomous LLM inference optimization runtime for AMD GPU platforms. Kernel optimization is handled by programmatic Python handlers."
readme = "README.md"
requires-python = ">=3.10"
# PEP 639 SPDX expression. The former ``{ text = "MIT" }`` table is deprecated
# by setuptools and slated to become a hard error on 2027-Feb-18.
license = "MIT"
license-files = ["LICENSE"]
# Intentionally empty: the bare wheel carries no third-party runtime deps, so a
# ``pip install --target`` workspace stays clean. Runtime deps come from the
# ``runtime`` extra, installed by the packaged install.sh.
dependencies = []
[project.urls]
Homepage = "https://github.com/AMD-AGI/Hyperloom"
Source = "https://github.com/AMD-AGI/Hyperloom"
Issues = "https://github.com/AMD-AGI/Hyperloom/issues"
Changelog = "https://github.com/AMD-AGI/Hyperloom/releases"
Security = "https://github.com/AMD-AGI/Hyperloom/security/policy"
[project.optional-dependencies]
# LLM backend SDKs, lazy-imported by the Claude/Codex/critic/scorer roles.
# ``openai-codex`` is the agent runtime for the OpenAI side: Hyperloom makes no
# bare LLM API calls, so an OpenAI-only deployment needs it to run at all.
llm = [
"claude-agent-sdk>=0.2.110",
"openai-codex>=0.144",
"openai>=1.50",
"httpx>=0.27",
]
# Critic-agent web tools (web_search / web_fetch).
web = [
"markdownify>=0.11",
"cachetools>=5.3",
]
# Full runtime dependency set installed by the packaged install.sh.
runtime = [
"PyYAML>=6.0",
"hyperloom-inference_optimizer[llm,web,forge]",
]
# Built-in kernel-opt agent (``kernelforge``). ``torch`` is deliberately absent:
# the ROCm build is supplied by the container image and a bare specifier would
# resolve to the CUDA wheel from PyPI.
#
# ``llm`` is a hard requirement, not a convenience: forge's agent backends
# lazy-import ``claude_agent_sdk`` and ``openai_codex`` at the first agent turn,
# so a ``[forge]``-only install imports cleanly and then fails minutes into a
# campaign. It only looked self-contained because ``runtime`` happens to pull
# ``[llm,web,forge]`` together.
forge = [
"click>=8.0",
"PyYAML>=6.0",
"anthropic>=0.40",
"hyperloom-inference_optimizer[llm]",
]
# ROCm Compute Profiler (rocprof-compute) Python requirements. Nothing in this
# repository imports them: they satisfy the profiler, whose binary is supplied
# by the ROCm image or system package. Without this extra, kernelforge
# profiling degrades to the lightweight PMC path.
forge-profiling = [
# Exact pins required by ROCm 7.2.x rocprofiler-compute.
"astunparse==1.6.2",
"kaleido==0.2.1",
"colorlover",
"dash-bootstrap-components",
"dash-svg",
"dash>=3.0.0",
"matplotlib",
"numpy>=1.17.5",
"plotext",
"plotille",
"plotly",
"pymongo",
"setuptools",
"sqlalchemy>=2.0.42",
"tabulate",
"textual",
"textual-plotext",
"textual-fspicker>=0.4.3",
"tqdm",
]
test = [
"hyperloom-inference_optimizer[runtime]",
"hyperloom-inference_optimizer[ci]",
"pytest>=8.0",
"pytest-asyncio>=1.0",
"jsonschema>=4.18",
# Property-based tests over the bring-up ladder.
"hypothesis>=6.0",
"respx>=0.21",
"requests>=2.28",
# psutil-based live-compiler probe in _aiter_jit.
"psutil>=5.9",
# framework-agent patch-authoring / isolation paths.
"libcst>=1.0",
"patch-ng>=1.18",
]
# Coverage job deps: ``pip install -e ".[test,ci]"``.
ci = [
"pytest-cov>=5.0",
"coverage>=7.0",
# In-runner parallelism (``-n`` in ``pytest_ci_args``).
"pytest-xdist>=3.5",
# Cross-job sharding for the coverage matrix (``--splits``/``--group``).
"pytest-split>=0.8",
"tomli>=2.0.1; python_version < '3.11'",
]
# Opt-in Langfuse trace sink (HYPERLOOM_LANGFUSE_ENABLE=1).
trace = [
"langfuse>=2.0",
]
# framework-agent patch-authoring / isolation path.
ast = [
"libcst>=1.0",
"patch-ng>=1.18",
]
# Optional ``synthesize --with-llm`` KB-distillation backend.
claude = [
"claude-agent-sdk>=0.2.110",
]
# Local dev tooling: pre-commit hooks, formatters, type checker.
dev = [
"pre-commit>=4.0",
"ruff>=0.8,<1",
"mypy>=1.0",
"reuse>=5.0",
]
[project.scripts]
hyperloom = "hyperloom.cli:main"
# Built-in kernel-opt agent. The orchestrator dispatches
# ``python -m kernelforge.cli`` directly; this is for interactive use.
kernelforge = "kernelforge.cli:main"
hyperloom-kb-serve = "hyperloom_kb.http_service:main"
hyperloom-kb-collect = "hyperloom_kb.collect.cli:main"
[tool.setuptools]
# setuptools defaults this to true for pyproject-based config, which makes
# build_py sweep every file living under a package directory -- including
# subdirectories that are NOT packages. ``packages.find.exclude`` keeps
# ``*.tests`` out of the *package* list, but the sweep then re-added the very
# same files as package *data*: the wheel shipped 627 test entries before forge
# was vendored and 833 after (all of ``kernelforge/tests/`` and
# ``kernelforge/gemm_tune/tests/``). ``scripts/check_wheel_contents.py`` has
# been reporting this; it is the ``packaging.yml`` wheel-contents job.
#
# Turning the sweep off makes ``[tool.setuptools.package-data]`` below the sole
# source of shipped non-module files, which is the state the two packaging
# checks already assume: ``test_packaging_lint.py`` walks tree -> declaration
# and check_wheel_contents.py walks declaration -> wheel, so nothing can now
# ship undeclared or be declared and missing.
include-package-data = false
[tool.setuptools.packages.find]
where = ["src"]
# Test trees are not part of the distribution: their fixture data is not
# package-data, so a shipped copy could never run. Singular/gerund spellings
# are covered too; test_packaging_lint.py fails if a new one escapes.
exclude = [
"*.tests",
"*.tests.*",
"tests",
"tests.*",
"*.test",
"*.test.*",
"test",
"test.*",
"*.testing",
"*.testing.*",
"testing",
"testing.*",
# KernelForge's examples and local-wiki resources contain .py reference
# files. Keep those resource trees out of implicit namespace discovery;
# they ship only through the package-data declarations below.
"kernelforge.examples",
"kernelforge.examples.*",
"kernelforge.knowledge.local_wiki.resources",
"kernelforge.knowledge.local_wiki.resources.*",
# Scripted launch/specialist backends and a virtual clock: scaffolding a
# test drives, not a runtime component. Nothing in the shipped tree imports
# it, and the production launch boundary it substitutes
# (``actions/executors/launch_backend.py``) ships as normal.
"hyperloom.orchestrator.rehearsal",
"hyperloom.orchestrator.rehearsal.*",
]
[tool.setuptools.data-files]
# Install the setup skill under every agent's discovery dir so /hyperloom-setup
# is visible in Claude Code (.claude), Cursor (.cursor/.agents) and Codex.
".agents/skills/hyperloom-setup" = [
"src/hyperloom/skills/hyperloom-setup/SKILL.md",
]
".claude/skills/hyperloom-setup" = [
"src/hyperloom/skills/hyperloom-setup/SKILL.md",
]
".cursor/skills/hyperloom-setup" = [
"src/hyperloom/skills/hyperloom-setup/SKILL.md",
]
# Deploys the global Experience KB that workspaces push to and pull from.
".agents/skills/hyperloom-global-kb" = ["src/hyperloom/skills/hyperloom-global-kb/SKILL.md"]
".claude/skills/hyperloom-global-kb" = ["src/hyperloom/skills/hyperloom-global-kb/SKILL.md"]
".cursor/skills/hyperloom-global-kb" = ["src/hyperloom/skills/hyperloom-global-kb/SKILL.md"]
# Demo run skills chained from /hyperloom-setup.
".agents/skills/hyperloom-qwen3-8b-3h" = ["examples/hyperloom-qwen3-8b-3h/SKILL.md"]
".claude/skills/hyperloom-qwen3-8b-3h" = ["examples/hyperloom-qwen3-8b-3h/SKILL.md"]
".cursor/skills/hyperloom-qwen3-8b-3h" = ["examples/hyperloom-qwen3-8b-3h/SKILL.md"]
".agents/skills/hyperloom-qwen3-14b-fp8-12h" = ["examples/hyperloom-qwen3-14b-fp8-12h/SKILL.md"]
".claude/skills/hyperloom-qwen3-14b-fp8-12h" = ["examples/hyperloom-qwen3-14b-fp8-12h/SKILL.md"]
".cursor/skills/hyperloom-qwen3-14b-fp8-12h" = ["examples/hyperloom-qwen3-14b-fp8-12h/SKILL.md"]
".agents/skills/hyperloom-qwen3-14b-fp8-12h-forge" = ["examples/hyperloom-qwen3-14b-fp8-12h-forge/SKILL.md"]
".claude/skills/hyperloom-qwen3-14b-fp8-12h-forge" = ["examples/hyperloom-qwen3-14b-fp8-12h-forge/SKILL.md"]
".cursor/skills/hyperloom-qwen3-14b-fp8-12h-forge" = ["examples/hyperloom-qwen3-14b-fp8-12h-forge/SKILL.md"]
".agents/skills/hyperloom-custom-advanced" = ["examples/hyperloom-custom-advanced/SKILL.md"]
".claude/skills/hyperloom-custom-advanced" = ["examples/hyperloom-custom-advanced/SKILL.md"]
".cursor/skills/hyperloom-custom-advanced" = ["examples/hyperloom-custom-advanced/SKILL.md"]
[tool.setuptools.package-data]
hyperloom = [
"orchestrator/prompts/*.md",
"orchestrator/prompts/references/*.md",
]
"hyperloom.inference_optimizer" = [
"SKILL.md",
"README.md",
"actions/*.md",
# Release-contract shell installers + configs.
"assets/*.sh",
"assets/*.example",
"assets/configs/*.yaml",
"assets/agentx/*.sh",
"assets/agentx/*.py",
# Host-side evidence probe, injected into the benchmark process via a
# PYTHONPATH prefix (see _framework_rewrite_evidence). Shipped so wheel
# installs can arm it.
"assets/host_probe/*.py",
# Slurm submission bundle (see docs/install/slurm.md).
"assets/slurm/*.sh",
"assets/slurm/*.sbatch",
"assets/slurm/*.tsv",
"assets/slurm/*.template",
# run_hyperloom.sbatch copies this template into the container at launch,
# so it has to ship alongside the .sbatch that references it.
"assets/slurm/*.sh.in",
"references/*.md",
]
# Critic LLM skill assets, mounted by the A2A / Codex chat server host.
"hyperloom.agents.critic" = [
"SKILL.md",
"README.md",
"actions/*.md",
"references/*.md",
]
"hyperloom.agents.quantization" = [
"SKILL.md",
"README.md",
]
# Vendor-operator-playbook registry (see trace_analysis/_vendor_operator_playbooks.py):
# read at runtime by classify_patchability(), so it must ship.
"hyperloom.orchestrator.trace_analysis" = [
"vendor_operator_playbooks.json",
]
# ``agentx/deploy.py`` copies these into InferenceX ``benchmarks/`` at runtime
# and raises FileNotFoundError when they are absent from the install.
"hyperloom.inference_optimizer.assets.agentx" = [
"*.sh",
]
# Breakdown skill assets; the only SKILL.md under src/ that did not ship.
"hyperloom.inference_optimizer.breakdown" = [
"*.md",
"contracts/*.json",
]
"hyperloom.inference_optimizer.multi_node" = [
"SKILL.md",
]
"hyperloom.inference_optimizer.multi_node.scripts" = [
"*.sh",
]
# KernelForge's read-only resources live with their owning features and are
# resolved through ``kernelforge.resources.resource_path``. The globs are
# deliberately type-agnostic because the trees hold several asset types.
kernelforge = [
"examples/**/*",
]
"kernelforge.knowledge.local_wiki" = [
"resources/**/*",
]
"kernelforge.roofline_ceiling" = [
"resources/**/*",
]
hyperloom_kb = [
"py.typed",
"declarations/*.yaml",
"mappings/*.yaml",
]
[tool.pytest.ini_options]
asyncio_mode = "auto"
# One recursive glob covers every per-package tests/ dir under src/ --
# hyperloom and kernelforge alike.
# ``scripts/tests`` is listed separately because the operator scripts sit
# outside the package on purpose -- they have to run on hosts with no Hyperloom
# install -- so the glob above cannot reach them, and without this line their
# tests are collected by nobody and fail in silence.
testpaths = [
"src/**/tests",
"scripts/tests",
]
pythonpath = ["src", ".", "scripts"]
markers = [
"critic_agent_e2e: end-to-end tests that shell out to the real critic-agent runtime; skip with '-m \"not critic_agent_e2e\"' if critic-agent is not on disk.",
"targeted_build_e2e: end-to-end tests that run a real AITER compile on a ROCm host; skip with '-m \"not targeted_build_e2e\"' in CI.",
]
[tool.coverage.run]
branch = false
# Relative paths so per-shard ``.coverage.*`` files from different CI runners
# combine into consistent totals.
relative_files = true
source = [
"src/hyperloom",
"src/kernelforge",
"src/hyperloom_kb",
"OOB", # optional component; not always present in a clone
]
# Omitted: tests / package boilerplate, CLI drivers, subprocess wrappers, and
# live-serving plumbing that is covered end-to-end rather than by unit tests.
omit = [
"*/tests/*",
"*/__init__.py",
"*/__main__.py",
# Operator scripts that ship outside the package. They exist to run on
# hosts with no Hyperloom install, so most of each one is argv handling,
# terminal rendering and hardware probing that only a real EPYC node
# exercises -- the same reason the CLI drivers below are omitted. Their
# tests do run (``scripts/tests`` is in ``testpaths``); it is the measured
# denominator they stay out of, not the suite.
"scripts/*",
# Byte-identical upstream KB Store SDK; guarded by a blob checksum test.
"src/hyperloom/orchestrator/knowledge/remote_recipe/_vendor/*",
# CLI drivers.
"src/hyperloom/inference_optimizer/cli/__init__.py",
"src/hyperloom/inference_optimizer/multi_node/cli.py",
"src/hyperloom/inference_optimizer/multi_node/scripts/*",
# Multi-node internals (SSH, probes, Ray dashboard, state hand-off).
"src/hyperloom/inference_optimizer/multi_node/_internal/*",
# Subprocess wrappers + multi-node server lifecycle.
"src/hyperloom/orchestrator/actions/executors/_subprocess_kill.py",
"src/hyperloom/orchestrator/actions/executors/_multi_node_server_lifecycle.py",
"src/hyperloom/orchestrator/actions/executors/_multi_node_env.py",
# Breakdown LLM HTTP client.
"src/hyperloom/inference_optimizer/breakdown/reporters/llm_client.py",
# Kernel tools that need real traces or a live framework install.
"src/hyperloom/orchestrator/trace_analysis/tracelens_analysis.py",
"src/hyperloom/orchestrator/trace_analysis/tracelens_skill_runner.py",
"src/hyperloom/orchestrator/kernel/apply_kernel_patch.py",
# GEAK runner and Ray cluster lifecycle (subprocess submit).
"src/hyperloom/orchestrator/kernel/geak_runner.py",
"src/hyperloom/orchestrator/actions/executors/_ray_runtime.py",
# quantization_agent CLI driver (argparse entrypoint).
"src/hyperloom/agents/quantization/cli.py",
# OOB server-side runtime (CLI, HTTP server, scheduler, auth proxy, agent
# backends). The unit-testable OOB logic stays measured.
"OOB/cli.py",
"OOB/server.py",
"OOB/scheduler.py",
"OOB/auth_proxy.py",
"OOB/backends/*",
# Local-host metrics probes (rocm-smi / nvidia-smi / ps / df / ray status).
# InferenceX shell-script patcher (fcntl locking + benchmark_lib.sh rewrite).
"src/hyperloom/orchestrator/actions/executors/_inferencex_patcher.py",
# TraceLens server patcher (git apply / patch --fuzz subprocess pipeline).
"src/hyperloom/orchestrator/actions/executors/_server_patcher.py",
# Breakdown collectors — exercised end-to-end by the reporter tests.
"src/hyperloom/inference_optimizer/breakdown/collectors/*",
# Operator CLIs, not library code.
"src/hyperloom/inference_optimizer/tools/*",
"src/hyperloom/orchestrator/roles/critic_agent.py",
# Subprocess-heavy benchmark drivers.
"src/hyperloom/orchestrator/actions/executors/profile.py",
"src/hyperloom/orchestrator/actions/executors/baseline.py",
# --- kernelforge (ported verbatim from KernelForge's own omit list) ---
"*/test_*.py",
# Shipped sample drivers, reference kernels, and local-wiki assets.
"src/kernelforge/examples/*",
"src/kernelforge/knowledge/local_wiki/resources/*",
# Byte-identical upstream KB Store SDK; validated by checksum contract tests.
"src/kernelforge/knowledge/kb_store/remote_client.py",
# CLI entry points (argument plumbing; exercised via the CLIs themselves).
"src/kernelforge/cli.py",
"src/kernelforge/gemm_tune/cli.py",
"src/kernelforge/fusion/command.py",
# GPU toolchain + profilers: shell out to rocprofv3 / rocprof-compute /
# ninja / the build system and require real hardware.
"src/kernelforge/mcp_server/tools/bench.py",
"src/kernelforge/mcp_server/tools/registers.py",
"src/kernelforge/loop/runner.py",
# Claude Agent SDK transport (spawns the agent CLI, network).
"src/kernelforge/orchestrator/agent.py",
# Filesystem index walker over the curated knowledge tree.
"src/kernelforge/knowledge/local_wiki/index.py",
# gemm-tune hardware tuners (drive vendor GEMM libraries on-device).
"src/kernelforge/gemm_tune/tuners/sglang_dense_bf16.py",
"src/kernelforge/gemm_tune/tuners/vllm_moe_triton.py",
"src/kernelforge/gemm_tune/tuners/fmoe_ck.py",
"src/kernelforge/gemm_tune/tuners/a4w4_blockscale.py",
"src/kernelforge/gemm_tune/tuners/a8w8.py",
"src/kernelforge/gemm_tune/tuners/a8w8_blockscale.py",
"src/kernelforge/gemm_tune/tuners/a8w8_bpreshuffle.py",
"src/kernelforge/gemm_tune/tuners/vllm_dense_tunableop.py",
"src/kernelforge/gemm_tune/tuners/_aiter_dense_common.py",
]
[tool.coverage.report]
exclude_also = [
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@overload",
]
skip_empty = true
precision = 2
# Tolerate dangling ``.coverage`` entries for transient CI-generated files so
# the standalone ``coverage report`` step does not fail on NoSource.
ignore_errors = true
# Line coverage across all ``[tool.coverage.run].source`` trees.
fail_under = 90
# GitHub Actions ``tests-coverage.yml`` reads this table with inline Python.
[tool.hyperloom.tests_coverage]
# Base trailing argv for ``pytest`` in CI; the workflow appends sharding
# (``--splits``/``--group``) and ``-n`` from the values below.
pytest_ci_args = [
"-m", "not critic_agent_e2e and not targeted_build_e2e",
"--cov=.", "--cov-report=",
]
# In-runner pytest-xdist workers per shard job (``-n auto`` yields 1 on the
# 2-vCPU GitHub runner, so pin it).
xdist_workers = 2
# GitHub matrix shards the suite is split across (pytest-split).
total_shards = 6
# Repository variable name: when truthy, CI skips fail_under enforcement.
relax_fail_under_repo_var = "COVERAGE_RELAX_FAIL_UNDER"
# Bandit security linter. ``B101`` (assert_used) is skipped repo-wide because
# nearly all hits are test assertions and runtime invariants.
[tool.bandit]
skips = ["B101"]
# Shipped knowledge-base sample kernels and reference drivers are third-party
# illustrative code, not Hyperloom's own.
exclude_dirs = [
"*/tests/*",
"*/test/*",
"build",
".venv",
"src/kernelforge/examples",
"src/kernelforge/knowledge/local_wiki/resources",
]
# Pylint: minimal defaults for local runs; CI passes ``--errors-only``.
[tool.pylint.main]
jobs = 1
[tool.ruff]
target-version = "py310"
line-length = 120
# Generated / vendored trees that ship their own linting.
extend-exclude = [
"_audit_artifacts",
"build",
".venv",
"TraceLens-internal",
"InferenceX",
"src/hyperloom/orchestrator/knowledge/remote_recipe/_vendor/kb_store_client.py",
# Local-wiki resources and example drivers are not source whose style this
# repository owns.
"src/kernelforge/examples",
"src/kernelforge/knowledge/local_wiki/resources",
"src/kernelforge/knowledge/kb_store/remote_client.py",
]
[tool.ruff.lint]
select = ["E", "F", "W", "BLE", "RUF100"]
# E501 is owned by ``ruff format``; E741 would only cause churn-only renames in
# math / parsing helpers where single-letter locals are idiomatic.
ignore = ["E501", "E741"]
# Future-proofing -- uncomment once the current findings are at zero.
# extend-select = ["B", "I", "UP", "SIM", "RUF"]
# C901 (mccabe) is the complexity trigger in the style guide's "Size and
# complexity" table. It stays off rather than on-and-ignored: the tree carries a
# backlog above the default max of 10, so selecting it would red the tree instead
# of gating new code. Measure on demand -- no config edit needed:
# ruff check --select C901 --config "lint.mccabe.max-complexity=10" src/hyperloom src/kernelforge
# [tool.ruff.lint.mccabe]
# max-complexity = 10
[tool.ruff.lint.per-file-ignores]
# Tests re-import inside function bodies (E402), redefine fixtures (F811), and
# bind setup values they assert on indirectly (F841).
"**/tests/**/*.py" = ["F811", "E402", "F841"]
# Modules whose imports sit below the module-level constants / helpers they
# close over (cycle-safe or lazy ordering).
"src/hyperloom/orchestrator/loop/coordinator.py" = ["E402"]
"src/hyperloom/orchestrator/state/shared_state.py" = ["E402"]
"src/hyperloom/inference_optimizer/cli/__init__.py" = ["E402"]
"src/hyperloom/inference_optimizer/multi_node/cli.py" = ["E402"]
"src/hyperloom/inference_optimizer/multi_node/commands/infera.py" = ["E402"]
"src/hyperloom/orchestrator/specialists/runner.py" = ["E402"]
"src/hyperloom/inference_optimizer/roofline_ceiling.py" = ["E402"]
"src/hyperloom/orchestrator/prompts/specialist_prompt_builder.py" = ["E402"]
"src/hyperloom/agents/critic/runtime/decision_reviewer.py" = ["E402"]
# The import sits under the comment block explaining why the attribute name is
# shared with kernelforge.llm rather than redeclared here.
"src/kernelforge/fusion/llm_failure.py" = ["E402"]
# Markdown formatting in Ruff is still preview/experimental; keep ``ruff format``
# scoped to Python so CI ``ruff format --check`` does not rewrite docs/skills.
[tool.ruff.format]
exclude = ["**/*.md", "**/*.rst"]
[tool.mypy]
python_version = "3.10"
files = ["src/hyperloom"]
exclude = [
".*/tests/.*",
"build",
".venv",
"_audit_artifacts",
]
ignore_missing_imports = true
warn_return_any = true
warn_unused_configs = true
warn_unused_ignores = true
warn_redundant_casts = true
no_implicit_optional = true
check_untyped_defs = false
disallow_untyped_defs = false
show_error_codes = true