Skip to content

chore(tools): remove tools/kbmine - #1906

Merged
xiaofei-zheng merged 1 commit into
mainfrom
chore/remove-tools-kbmine
Oct 15, 2026
Merged

xiaofei-zheng merged 1 commit into
mainfrom
chore/remove-tools-kbmine

Conversation

@chaojhou

Copy link
Copy Markdown
Collaborator
  • Description: what and why

Removes tools/kbmine. kbmine is a standalone estimator that mines the Recipe KB and Pulse for evidence prior sessions produced. Its own README states that nothing in src/ imports it, and that the estimator was first proposed inside the optimizer as #1391, which was closed because mining fleet evidence is not part of the Hyperloom workflow. Keeping it here still puts a separately packaged tool (its own pyproject.toml, CLI, TLS provisioning script and docs) under Hyperloom's CI, review and release. This PR deletes the directory added in #1778 and the two pytest settings that pointed at it.

  • Linked issue(s): none. Removes what feat(tools): kbmine, a standalone no-run uplift estimator over the Recipe KB and Pulse #1778 added.
  • Tests: none added. Removed tools/kbmine/tests (test_kbmine_mine.py, test_kbmine_tls.py, conftest.py), which tested only the removed tool. Checked: git grep -i kbmine finds no remaining reference; pyproject.toml parses with tomllib, and [tool.pytest.ini_options] now reads testpaths = ["src/**/tests", "scripts/tests"] and pythonpath = ["src", ".", "scripts"]. The full suite is left to CI.
  • Size/complexity triggers crossed: split, or why the shape is right: none; deletions only (15 files, 4453 lines) plus the two pyproject.toml entries.
  • If this simplifies or refactors: which mechanism was removed, which contract was preserved, and the tests that show it: removes the kbmine tool with its tests, docs, CA provisioning script and package metadata. No Hyperloom contract changes: nothing in src/, scripts/, the docs site or the workflows referenced it, and scripts/code_metrics_baseline.txt has no kbmine entry.
  • Observable effect: what an operator will now see, and what the old behaviour cost them (if none, why the change is unobservable): python -m kbmine.cli and pip install -e tools/kbmine are no longer available from a Hyperloom checkout, and pytest no longer collects tools/kbmine/tests. The optimizer, its CLI and everything a session publishes are unchanged.
  • Breaking changes: no for Hyperloom; kbmine was its own package and never part of the hyperloom distribution or its entry points. Anyone using the standalone tool from this repository needs to take it from elsewhere.
  • PR addresses single concern: yes.
  • Root cause is upstream (Magpie/TraceLens/GEAK/IntelliKit/AgentKernelArena), ticket filed: no.

kbmine is a standalone estimator that mines Recipe KB and Pulse evidence outside the Hyperloom workflow, and nothing in src/ imports it. Remove the directory added in #1778 together with its pytest testpaths and pythonpath entries in pyproject.toml.

Co-authored-by: Cursor <cursoragent@cursor.com>
@chaojhou
chaojhou requested a review from a team as a code owner October 15, 2026 06:53
@github-actions

Copy link
Copy Markdown

Code metrics gate: PASSED

Judged: the 16 files this change touches. Files it does not touch never fail it; anything found there is listed under Outside this change for information.

Dimension Limit New Worse Baseline out of date Baseline entries vs base
Cyclomatic complexity fails > 20 0 0 0 73 +0
Cognitive complexity fails > 30 0 0 0 289 +0
Function length (lines) fails > 80 0 0 0 453 +0
Nested block depth fails > 5 0 0 0 27 +0
Module length (lines) warns > 800, fails > 1200 0 0 0 53 +0
Duplicated lines per file fails > 0 0 0 0 120 +0
Dead code (vulture) fails > 0 0 0 0 2 +0
Check Findings Effect
Comments 0
English only 0
Production code imports test code 0
Repeated literals 0
A1 Private name of another package 0
A8 Flag argument 0
A9 Tuple return 0
A10 Raw vocabulary comparison 0
A11 Hidden global write 0
A12 Pure forwarder 0
A12 Single-implementation abstraction 0
95 findings in files this change does not touch

Outside this change (informational): 95

Unit Dimension Baseline Now
src/hyperloom/orchestrator/enablement/recipe/projections.py project_launch_evidence Cognitive complexity absent 36
src/hyperloom/orchestrator/state/shared_state.py resolve_graded_comparison Cognitive complexity absent 34
src/hyperloom_kb/collect/mapping.py _experience Cognitive complexity absent 31
src/hyperloom_kb/schema.py FieldDeclaration.__post_init__ Cognitive complexity absent 32
src/kernelforge/cli/forge_loop_command.py _prepare_measurement_driver Cognitive complexity absent 36
src/kernelforge/cli/forge_loop_command.py _read_kb_warm_start Cognitive complexity absent 40
src/kernelforge/loop/runner.py IterationLoop._collect_session_candidate Cognitive complexity absent 44
src/kernelforge/loop/runner.py IterationLoop._rule_on_attempt Cognitive complexity absent 38
src/hyperloom_kb/tests/test_cli.py Duplicated lines per file absent 18
src/hyperloom_kb/tests/test_global_identity_and_pull.py Duplicated lines per file absent 13
src/hyperloom_kb/tests/test_local_state.py Duplicated lines per file absent 18
src/hyperloom/inference_optimizer/cli/__init__.py _reexport_session_environment Function length (lines) absent 112
src/hyperloom/inference_optimizer/cli/__init__.py _resolve_agent_lineup Function length (lines) absent 89
src/hyperloom/inference_optimizer/cli/__init__.py _resolve_run_topology Function length (lines) absent 92
src/hyperloom/inference_optimizer/cli/__init__.py _resume_session Function length (lines) absent 171
src/hyperloom/inference_optimizer/cli/__init__.py _seed_fresh_session Function length (lines) absent 183
src/hyperloom/inference_optimizer/multi_node/cli.py _restart_multinode Function length (lines) absent 107
src/hyperloom/inference_optimizer/multi_node/scripts/launch_multinode.py _build_parser Function length (lines) absent 84
src/hyperloom/inference_optimizer/multi_node/scripts/launch_multinode.py _spawn_rank_actors Function length (lines) absent 90
src/hyperloom_kb/http_service.py RequestHandler._dispatch Function length (lines) absent 91
src/hyperloom_kb/sync.py GlobalSync.pull Function length (lines) absent 86
src/kernelforge/cli/forge_loop_command.py _RunReporter.build_result Function length (lines) absent 91
src/kernelforge/cli/forge_loop_command.py _prepare_measurement_driver Function length (lines) absent 140
src/kernelforge/cli/forge_loop_command.py _read_kb_warm_start Function length (lines) absent 154
src/kernelforge/loop/knowledge_integration.py _measure_warmstart_field Function length (lines) absent 83

...and 70 more; the job log lists every row.

Verdict computed by the gate scripts in /home/runner/work/_temp/code-metrics-gate, not by this tree's copy.

Thresholds and sources: [tool.hyperloom.code_metrics] in pyproject.toml. Tools: complexipy 8.0.1, jscpd 5.4.1, ruff 0.16.2, vulture 2.16.

@chaojhou

Copy link
Copy Markdown
Collaborator Author

/review

@xiaofei-zheng

Copy link
Copy Markdown
Collaborator

Review of #1906 -- chore(tools): remove tools/kbmine

What it does: Deletes tools/kbmine, a standalone uplift estimator that mined the Recipe KB and Pulse for evidence prior sessions had already produced. It shipped as its own package -- own pyproject.toml, kbmine CLI, TLS provisioning script, 412-line README -- and nothing in src/ ever imported it, yet it sat inside Hyperloom's CI, review and release surface. The route is a straight removal: the 15-file subtree goes, and the two [tool.pytest.ini_options] settings that reached it ("tools/kbmine/tests" in testpaths, "tools/kbmine" in pythonpath) come out of the root pyproject.toml. Nothing under src/ changes.

Blocking issues: none.

SKIPPED: V4 -- the overlap scan reports # PARTIAL: for #1032, #1154, #1276, #1675 and #1869: only each one's first 100 files were compared, so overlap with tools/kbmine in those five is unchecked rather than absent. The eight open PRs that were compared overlap on pyproject.toml only, in a different table.

Checked: tree-wide sweep for every surviving reference -- git grep -in kbmine over the head worktree (0 hits) and a tracked+untracked grep -rIn -i kbmine covering .claude/, .github/ and untracked files (0 hits); at the merge base, the same grep filtered outside tools/kbmine/ returns exactly pyproject.toml:326 and :328, both deleted here. Path-level references a literal grep would miss were hunted separately: the paths: filters of all 22 .github/workflows/*.yml, REUSE.toml (blanket path = "**", no per-path entry), .github/CODEOWNERS, .pre-commit-config.yaml (hooks scoped to src scripts / ^src/), .github/dependabot.yml, .readthedocs.yaml and the docs toctrees, every *.md at head for the now-empty top-level tools/ directory, and the committed-durations question (.test_durations is restored from actions/cache and rebuilt per run, never committed). git ls-tree <base> tools/ confirms tools/ held tools/kbmine and nothing else.

Config side effects: pyproject.toml:315-331 (the comment above testpaths explains only src/**/tests and scripts/tests and never named kbmine, so nothing went stale), :333-343 ([tool.coverage.run] source = src/hyperloom, src/kernelforge, src/hyperloom_kb, OOB -- tools/ was never in the measured denominator), :438-451 (fail_under = 90), :173-175 (packages.find where = ["src"]), [tool.hyperloom.code_metrics] roots = ["src", "scripts"]. The imports of all eight deleted tools/kbmine/**/*.py were dumped at base: stdlib, pytest and kbmine.* only, with no import of hyperloom, kernelforge or hyperloom_kb -- so the removed tests contributed no covered line and the 90% floor cannot move. Nothing asserts the two removed entries: test_packaging_lint.py reads [tool.setuptools] and [tool.ruff], tests-coverage.yml reads [tool.hyperloom.tests_coverage], and conftest.py:12-24 pins only src. AGENTS.md:38, CONTRIBUTING.md:98 and docs/contributing/style-guide.md:256 are consistent with the new values.

Description against the diff at head: the 15-file / 4453-line total re-summed from the per-file counts, both quoted config values matched against the head tree, scripts/code_metrics_baseline.txt confirmed to carry no kbmine entry, and the #1778 / #1391 attributions checked against the actual PRs and against the README at base. Every externally reachable surface the deleted tree provided -- the kbmine CLI, pip install -e tools/kbmine, the dropped test collection, the docs and the CA provisioning script -- is named in the description, and the compatibility boundary is stated explicitly rather than resting on the grep.

Ran: no local test run -- this diff deletes tests and touches no src/ code, so CI at head is authoritative: 31 checks success (12/12 test shards, both coverage jobs, ruff, mypy, pylint, bandit, gitleaks, reuse, code-metrics, import-linter, pyproject declarations, wheel contents, CodeQL, readthedocs), 6 skipped (e2e / resolve / update test durations, path- or branch-filtered), 0 failures. mergeable: MERGEABLE.

Base: 3a7210630c0ea502fb624f5a3928431900a912dc | Head: 331c00a37aa9f72ba368466dc968ed495a270c09

LGTM

@xiaofei-zheng xiaofei-zheng left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking issues. Reviewed in detail in the comment above: tree-wide sweep for surviving references (0 hits at head; the only external references at the merge base were the two [tool.pytest.ini_options] entries this PR removes), path-level references checked separately across workflow paths: filters, REUSE, CODEOWNERS, pre-commit, dependabot, readthedocs and the docs toctrees, coverage denominator and code-metrics roots confirmed never to have included tools/, and every factual claim in the description re-derived against the head tree. CI green at head: 31 success, 0 failures.

@xiaofei-zheng
xiaofei-zheng merged commit 0f333df into main Oct 15, 2026
38 checks passed
@xiaofei-zheng
xiaofei-zheng deleted the chore/remove-tools-kbmine branch October 15, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants