Skip to content

chore/remove migrated agent harness - #2

Merged
furedea merged 5 commits into
mainfrom
chore/remove-migrated-agent-harness
May 19, 2026
Merged

furedea merged 5 commits into
mainfrom
chore/remove-migrated-agent-harness

Conversation

@furedea

@furedea furedea commented May 19, 2026

Copy link
Copy Markdown
Owner
  • feat: use agent harness home-manager module
  • chore: remove migrated agent harness files

Copilot AI review requested due to automatic review settings May 19, 2026 17:59

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR migrates dotfiles’ “agent harness” setup to the external agent-harness flake/home-manager module and removes the now-redundant in-repo harness implementation (hooks, skills rendering, Codex/Claude generated config, and related Python tooling/tests).

Changes:

  • Add agent-harness as a flake input and import its Home Manager module; enable it from nix/home/default.nix.
  • Remove migrated local harness files (hooks, rules, skills/templates, Codex config/sync tooling) and their associated Bats/Python tests + Python project config.
  • Update CI + lefthook to run the reduced Bats suite and lint only the remaining github/ shell scripts.

Reviewed changes

Copilot reviewed 139 out of 142 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/python/skills/skill-auditor/test_run_audit.py Removed (migrated harness Python tests)
tests/python/skills/skill-auditor/test_generate_report.py Removed (migrated harness Python tests)
tests/python/skills/skill-auditor/test_collect_transcripts.py Removed (migrated harness Python tests)
tests/python/skills/skill-auditor/test_collect_skills.py Removed (migrated harness Python tests)
tests/python/skills/skill-auditor/test_apply_patches.py Removed (migrated harness Python tests)
tests/python/skills/skill-auditor/init.py Removed (package no longer needed)
tests/python/skills/git-commit-split/test_build_partial_patch.py Removed (migrated harness Python tests)
tests/python/skills/git-commit-split/test_branch_name.py Removed (migrated harness Python tests)
tests/python/conftest.py Removed (Python test loader no longer needed)
tests/python/codex/test_sync_config.py Removed (Codex sync tooling removed)
tests/python/agents/test_render_skills.py Removed (skills rendering tests removed)
tests/nix/agent_harness.bats Added smoke test to verify delegation to agent-harness module
tests/hooks/config/secret_patterns.bats Removed (migrated harness config tests)
tests/hooks/config/json_syntax.bats Removed (migrated harness config tests)
tests/hooks/config/codex_rules_sync.bats Removed (migrated harness config tests)
tests/hooks/config/codex_hooks_sync.bats Removed (migrated harness config tests)
tests/hooks/config/codex_generated_settings.bats Removed (migrated harness config tests)
tests/hooks/config/codex_config_sync.bats Removed (migrated harness config tests)
tests/hooks/config/claude_settings_sync.bats Removed (migrated harness config tests)
tests/hooks/config/agent_skills_render.bats Removed (migrated skills rendering tests)
tests/hooks/codex/adapt_shell_command.bats Removed (Codex hook adapter tests removed)
tests/hooks/codex/adapt_harness_files.bats Removed (Codex hook adapter tests removed)
tests/hooks/codex/adapt_guard_secret_content.bats Removed (Codex hook adapter tests removed)
tests/hooks/claude/test-helper/setup.bash Removed (Claude hook test harness removed)
tests/hooks/claude/statusline.bats Removed (statusline tests removed with harness migration)
tests/hooks/claude/shell_parse.bats Removed (shell parsing tests removed with harness migration)
tests/hooks/claude/related_test_rules.bats Removed (related-test rules tests removed)
tests/hooks/claude/notify_macos.bats Removed (macOS notify hook tests removed)
tests/hooks/claude/lint_format.bats Removed (lint-format hook tests removed)
tests/hooks/claude/lint_format_sh.bats Removed (lint-format hook tests removed)
tests/hooks/claude/lint_format_rs.bats Removed (lint-format hook tests removed)
tests/hooks/claude/lint_format_py.bats Removed (lint-format hook tests removed)
tests/hooks/claude/lint_format_json_toml.bats Removed (lint-format hook tests removed)
tests/hooks/claude/lint_format_js.bats Removed (lint-format hook tests removed)
tests/hooks/claude/guard_secret_commit.bats Removed (hook tests removed)
tests/hooks/claude/guard_harness_files.bats Removed (hook tests removed)
tests/hooks/claude/guard_forbidden_commands.bats Removed (hook tests removed)
tests/hooks/claude/command_policy_sync.bats Removed (policy sync tests removed)
tests/hooks/claude/audit_permission_denied.bats Removed (audit tests removed)
tests/hooks/claude/audit_log.bats Removed (audit tests removed)
pyproject.toml Removed (Python tooling/tests removed from repo)
nix/home/default.nix Switch to programs.agent-harness and remove local harness generation/wiring
nix/agents/skills.nix Removed (skills override generation migrated out)
nix/agents/paths.nix Removed (no longer needed after migration)
nix/agents/codex_settings.nix Removed (Codex settings generation migrated out)
nix/agents/claude_settings.nix Removed (Claude settings generation migrated out)
lefthook.yml Drop Python lint/typecheck hooks; reference agent-harness installed hooks
flake.nix Add agent-harness input/module import; simplify packages/devShells and remove old harness lib outputs
flake.lock Lock agent-harness input revision
codex/sync_config.py Removed (Codex config sync tool migrated out)
codex/hooks/adapt_shell_command.sh Removed (migrated out)
codex/hooks/adapt_lint_format.sh Removed (migrated out)
codex/hooks/adapt_harness_files.sh Removed (migrated out)
codex/hooks/adapt_guard_secret_content.sh Removed (migrated out)
codex/config.toml Removed (migrated out)
claude/settings.base.json Removed (migrated out)
agents/skills/skill-auditor/references/methodology.md Removed (migrated out)
agents/skills/skill-auditor/references/architecture.md Removed (migrated out)
agents/skills/skill-auditor/agents/portfolio_analyst.md Removed (migrated out)
agents/skills/skill-auditor/agents/improvement_planner.md Removed (migrated out)
agents/skills/nix-dev-init/references/lang_typescript.md Removed (migrated out)
agents/skills/nix-dev-init/references/lang_tex.md Removed (migrated out)
agents/skills/nix-dev-init/references/lang_rust.md Removed (migrated out)
agents/skills/nix-dev-init/references/lang_python.md Removed (migrated out)
agents/skills/nix-dev-init/references/lang_fallback.md Removed (migrated out)
agents/skills/marp-style/SKILL.md Removed (migrated out)
agents/skills/marp-style/assets/base.css Removed (migrated out)
agents/skills/github-ci-init/templates/release_please.yml Removed (migrated out)
agents/skills/github-ci-init/templates/claude.yml Removed (migrated out)
agents/skills/github-ci-init/templates/claude_code_review.yml Removed (migrated out)
agents/skills/github-ci-init/templates/artifact_attestation.yml Removed (migrated out)
agents/skills/github-ci-init/SKILL.md Removed (migrated out)
agents/skills/git-commit-split/scripts/build_partial_patch.py Removed (migrated out)
agents/skills/git-commit-split/references/hunk_split.md Removed (migrated out)
agents/skills/git-commit-split/references/direct_execute.md Removed (migrated out)
agents/skills/git-commit-split/references/conventional_commits.md Removed (migrated out)
agents/skills/gha-style/SKILL.md Removed (migrated out)
agents/hooks/rules/secret_content_patterns.json Removed (migrated out)
agents/hooks/rules/related_test_extensions.json Removed (migrated out)
agents/hooks/rules/related_test_defaults.json Removed (migrated out)
agents/hooks/notify_macos_done.sh Removed (migrated out)
agents/hooks/notify_macos_await.sh Removed (migrated out)
agents/hooks/lint_format_txt.sh Removed (migrated out)
agents/hooks/lint_format_tex.sh Removed (migrated out)
agents/hooks/lint_format_sh.sh Removed (migrated out)
agents/hooks/lint_format_rs.sh Removed (migrated out)
agents/hooks/lint_format_py.sh Removed (migrated out)
agents/hooks/lint_format_nix.sh Removed (migrated out)
agents/hooks/lint_format_md.sh Removed (migrated out)
agents/hooks/lint_format_lua.sh Removed (migrated out)
agents/hooks/lint_format_json_toml.sh Removed (migrated out)
agents/hooks/lint_format_js.sh Removed (migrated out)
agents/hooks/lint_format_gha.sh Removed (migrated out)
agents/hooks/lib/shell_parse.sh Removed (migrated out)
agents/hooks/lib/lint_format.sh Removed (migrated out)
agents/hooks/lib/audit_log.sh Removed (migrated out)
agents/hooks/guard_secret_content.sh Removed (migrated out)
agents/hooks/guard_secret_commit.sh Removed (migrated out)
agents/hooks/guard_harness_files.sh Removed (migrated out)
agents/hooks/guard_forbidden_commands.sh Removed (migrated out)
agents/hooks/audit_tool_call.sh Removed (migrated out)
agents/hooks/audit_permission_denied.sh Removed (migrated out)
agents/hooks/audit_compaction.sh Removed (migrated out)
agents/AGENTS.md Removed (migrated out)
.gitignore Remove Python ignores and old Codex generated skills ignore (Python/Codex artifacts removed)
.github/workflows/ci.yml Remove Python job; rename/re-scope Bats + shell lint to remaining test/shell surface

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/nix/agent_harness.bats Outdated
Comment on lines +15 to +18
@test "home-manager enables agent-harness instead of local generated files" {
grep -q "agent-harness = {" "$HOME_NIX"
grep -q "enable = true;" "$HOME_NIX"
grep -q "package = agent-harness.packages.\${system}.default;" "$HOME_NIX"
@furedea
furedea force-pushed the chore/remove-migrated-agent-harness branch from 9af83ad to 4bb29ac Compare May 19, 2026 18:08
@furedea
furedea merged commit faa537f into main May 19, 2026
9 checks passed
@furedea
furedea deleted the chore/remove-migrated-agent-harness branch May 19, 2026 18:09
furedea added a commit that referenced this pull request Sep 19, 2026
…inter ordering (#144)

## Summary

- **Related-test selection** (#1): `full_suite_triggers` in
`related_test_defaults.json` escalate config changes (pyproject,
uv.lock, package.json, tsconfig, Cargo.*, rust-toolchain) to a
language-wide suite; unresolved sources no longer collapse a multi-file
change into a partial run
- **Unified patch input** (#2): `hook_input.patch_body()` is the single
contract for `patch`/`input`/`command` carriers across
Devin/Codex/Hermes/pi adapters and `verification_session`; plain shell
commands are never treated as patches; conflicting carriers and
malformed `tool_input` fail closed; `multi_edit` added to generated
Devin matchers
- **Formatter/linter separation** (#3): formatter and linter adoption
detected independently — `[tool.ruff]` alone no longer implies `ruff
format`; Black + Ruff lint is a valid combination; unsupported
formatters (prettier, biome, ...) reported without substituting personal
defaults; mutating steps run fix -> format -> lint only for adopted
formatters; `readonly=True` drops all mutating steps; JS/TS no longer
applies `oxfmt` unconditionally
- **herdr-delegation** (#4): self-contained brief requirements
(request/acceptance criteria, repo/worktree, base/HEAD or diff snapshot,
scope), boundary-review guidance for multi-component changes, reconcile
rules to avoid duplicate re-reviews and stop unproductive loops
- **Coding principles** (#5): prefer existing
code/stdlib/platform/installed deps before adding code; size numbers are
heuristics, not goals; simplicity never removes
safety/compat/a11y/verification; TSDD defect fixes trace to the shared
contract rather than patching the symptom site
- **Blacksmith removal** (#6): `## 8. Runner: Blacksmith` section
removed from `github-actions-style` without adding a substitute vendor
section

## Test plan

- [x] `pytest` — 1325 passed
- [x] `ruff format --check`, `ruff check`, `ty check` — all clean
- [x] `lefthook run pre-commit` — all staged-file checks pass per commit
- [ ] Live provider payload verification — local fixtures only; no real
Devin/Codex session exercised

Refs #143

Generated with [Devin](https://devin.ai)

---------

Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
furedea added a commit that referenced this pull request Nov 10, 2026
## 概要

dotfiles の ruff 設定を template-python に揃える (Refs
furedea/agent-config#74,cfg-align の dotfiles 行).

## 設定の変更 (`pyproject.toml`)

- `select` をテンプレートの順序にそろえ,`DOC` を追加 (違反 0).`CPY` は template-python
側でも削除済みのため入れない.
- `ignore` をテンプレートの一覧に置換し,下表の 18 件を削除.
- `PLR0917` は tests 限定の ignore からグローバルの `ignore` に移動
(ユーザー判断).理由はコメントで明記.
- プロジェクト固有の ignore は無い.

## 削除した ignore の元の理由

元の理由は `git log -S` で追跡.18 件はすべて 8428059 (2026-05,`build(python):
bootstrap uv project for hook and script tests`)
で,当時のスキル用スクリプトを温存するコメント付きで追加された.faa537f (#2)
でスクリプトが移設されたときにコメントが落ち,de295d1 (#52) で理由なしで再追加された.保護対象のスクリプト
(`agents/skills/**/scripts/*.py`,`run_audit.py` など) は faa537f と 83d1a89
(#98) で削除済みで,現在の Python は `github/`,`herdr/`,`zsh/`,`tests/` のみ.

削除後,全 18 規則を有効にして全体を検査した結果,違反が出たのは I001,E501,ARG001 のみで,下記のとおり修正済み.

| 規則 | 検査内容 | 元の理由 (8428059 のコメント) | 現在は当てはまらない理由 |
| -------------- | ------------------------------------- |
-----------------------------------------------------------------------------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| ARG001 | 未使用の関数引数 | "Patch schema keeps current_description for
compatibility" | 対象の `apply_patches.py` は削除済み.違反はテストの 1
件のみで,`usefixtures` に移して修正. |
| B007 | 未使用のループ変数 | "os.walk tuple names document positional contents
in existing code" | `os.walk` を使うコードは存在しない (grep で 0). |
| C401 | `set(generator)` を内包表記へ | "Existing aggregation code favors
explicit generator layout" | 対象の集計コード (`collect_transcripts.py` など)
は削除済み.違反 0. |
| DTZ005 | tz 無しの `datetime.now()` | "Timestamped local workspace names
intentionally use local time" | ローカル時刻の作業ディレクトリ名を作る `run_audit.py`
は削除済み.`datetime.now()` の使用 0. |
| E402 | import がファイル先頭にない | "run_audit adjusts sys.path before
importing sibling scripts" | `run_audit.py` は削除済み.`sys.path`
を操作するコードは存在しない (grep で 0). |
| E501 | 行が 119 桁超 | "Embedded HTML/JS templates intentionally preserve
long source strings" | `generate_report.py` の HTML/JS テンプレートは削除済み.残りの 6
行はテスト内の fake スクリプトで,分割して修正. |
| F541 | プレースホルダーの無い f-string | "Existing report/changelog writes
include harmless f-string literals" | レポート出力コードは削除済み.違反 0. |
| FURB110 | `x if x else y` を `x or y` へ | "Existing JSON output code
keeps explicit empty-list fallback branches" | 対象の JSON 出力コードは削除済み.違反 0.
|
| FURB122 | ループ内の `write` を `writelines` へ | "Existing changelog writes
favor straightforward loops" | changelog を書くコードは削除済み.違反 0. |
| FURB162 | 末尾 `Z` の手動置換 | "Existing timestamp parser normalizes
trailing Z explicitly" | transcript のタイムスタンプパーサーは削除済み.違反 0. |
| FURB171 | 1 要素のタプルでの `in` | "Existing message-type checks use tuple
style consistently" | message-type 判定のコードは削除済み.違反 0. |
| I001 | import の並び順 | "Keep script import blocks stable while sys.path
bootstrapping is present" | `sys.path` を操作するスクリプトが無くなり,理由が消えた.15 ファイルを
`ruff --fix` で整列. |
| PERF401 | ループでの `append` を内包表記へ | "Existing batching code favors
stepwise mutation for readability" | バッチ処理コードは削除済み.違反 0. |
| PTH | `os.path` 等を `pathlib` へ | "Legacy scripts use os.path; Path
migration is a separate refactor" | `os.path` を使うレガシースクリプトは削除済み.現在のコードは
`pathlib` で,違反 0. |
| PLW2901 | ループ変数の上書き | "Existing JSONL parser reuses line after
stripping whitespace" | JSONL パーサーは削除済み.違反 0. |
| RUF005 | リスト連結を展開構文へ | "Existing path reconstruction code is clearer
with list concatenation" | 対象のパス再構築コードは削除済み.違反 0. |
| UP015 | 冗長な `open` のモード指定 | "Explicit read/write modes are kept for
CLI-script clarity" | CLI スクリプトは削除済み.違反 0. |
| UP017 | `timezone.utc` を `datetime.UTC` へ | "Existing code imports
timezone explicitly" | `timezone` を import するコードは存在しない (grep で 0). |
| PLR0917 (移動) | 位置引数の数 (`max-args` に従う) | dcb0709 (#233): "In ruff
0.16.3, `PLR0917` (positional args) is stable and follows `max-args`, so
pytest fixtures would add 83 test-only violations." | 理由 (pytest
のフィクスチャ) は今も有効なので,無視は維持.位置引数の数は全引数数以下で,PLR0913 (max-args = 3)
が既に上限を課すため,個別の ignore はグローバルに移動して統一. |

元の理由がまだ成り立つ項目は無かったため,復元した ignore は無い.

## コード修正 (別コミット)

| 規則 | 修正前 | 修正後 | 対応 |
| ------ | ----------------------------------------------- | ------ |
------------------------------------------------------------------------------------
|
| I001 | 15 ファイル | 0 | `ruff --fix --select I001` |
| E501 | 6 行 (テスト内の fake スクリプトと文字列) | 0 | 変数の導入・括弧での分割.抑制なし |
| ARG001 | 1 (`tests/github/test_repo_cli.py` の `remote`) | 0 |
副作用目的のフィクスチャを `@pytest.mark.usefixtures("remote")` に移し,引数から削除 |

非自明な修正の設計上の理由:`remote` は fake `gh`
のリモート環境を用意する副作用のためだけに要求されていたので,usefixtures に移すのが pytest の意図に沿う (未使用引数を
`_` で隠すより正しい).

## 確認

- `ruff check` / `ruff format --check` 通過,`pytest` 164 passed,`ty` 通過
(pre-commit)
- ruff の `select` はテンプレートと同じ並び.`ignore` はテンプレートの一覧に `PLR0917` (理由コメント付き)
を加えたもの

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: furedea <[email protected]>
Co-authored-by: Claude Sonnet 5.5 <[email protected]>
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