Skip to content

feat(agents): own personal agent source - #52

Merged
furedea merged 6 commits into
mainfrom
feat/own-personal-agent-source
Aug 29, 2026
Merged

furedea merged 6 commits into
mainfrom
feat/own-personal-agent-source

Conversation

@furedea

@furedea furedea commented Aug 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • move the complete personal Claude Code and Codex source into agents/ and deploy it through the flat agent-harness source API
  • keep generated Herdr and Moshi hooks composed through named Nix inputs
  • retain PATH-resolved Bash hooks and portable macOS notification no-ops in the migrated source
  • move source-specific Bats and Python specifications, locked test dependencies, lint, type checking, audits, and Python CodeQL coverage into dotfiles
  • support Rust integration tests selected by project extension mappings
  • document the ownership boundary in ADR 0016

Dependency

The lock file pins agent-harness commit 5915059, delivered by agent-harness #117 and its stacked dependencies. The declared flake URL remains the normal repository URL.

Tests

  • 481 personal agent Bats tests
  • 24 Python tests
  • Ruff format and lint
  • ty
  • deptry and vulture
  • nix flake check --no-build
  • Home Manager generation build through tests/nix/agent_hooks.bats
  • Linux package-output evaluation
  • actionlint and all pre-commit checks
  • git diff --check

No Home Manager or nix-darwin activation was run.

Copilot AI lite review requested due to automatic review settings August 28, 2026 11:03

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-advanced-security

Copy link
Copy Markdown

You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool.

What Enabling Code Scanning Means:

  • The 'Security' tab will display more code scanning analysis results (e.g., for the default branch).
  • Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results.
  • You will be able to see the analysis results for the pull request's branch on this overview once the scans have completed and the checks have passed.

For more information about GitHub Code Scanning, check out the documentation.

## Summary
- install the Hister client on both Macs
- run the Hister LaunchAgent only on MacBook Pro and bind it to loopback
- point both clients at the MacBook Pro Tailscale HTTPS origin
- document the architecture and remaining Tailscale Serve/browser
extension setup

## Tests
- bats tests/nix
- nix flake check --no-build
- nix build --no-link
.#darwinConfigurations.mbp.config.services.hister.package
- statix check .
- deadnix --fail flake.nix nix/darwin/default.nix nix/home/default.nix
- nixfmt --check flake.nix nix/darwin/default.nix nix/home/default.nix
## Summary
- run the full Rust test suite when no related integration test exists
- detect Vitest, Jest, Node test runner, or package test scripts for
JavaScript and TypeScript
- run the related-test gate from the Codex Stop hook

## Verification
- bats tests/agents/hooks/claude/run_related_tests.bats
tests/agents/hooks/claude/related_test_rules.bats
tests/nix/agent_hooks.bats
- shellcheck agents/hooks/run_related_tests.sh
- shfmt -i 2 -ci -d agents/hooks/run_related_tests.sh
- dprint check for the changed JSON files
@furedea
furedea merged commit de295d1 into main Aug 29, 2026
13 checks passed
@furedea
furedea deleted the feat/own-personal-agent-source branch August 29, 2026 09:33
furedea added a commit that referenced this pull request Oct 28, 2026
## 概要

`agent-harness`,`agent-config`,`llm-agents` の flake input を更新します.

- `agent-harness`: `agent-harness-v0.9.9`(`cli_auth_credentials_store` を
`~/.codex/config.toml` に同期)
- `agent-config`: 現在の main(PR #52: `op` の deny,1Password フォルダの読み取り
deny,Codex の `cli_auth_credentials_store = "keyring"`.PR #54: 未登録の
docker 形式を ask に変更)
- `llm-agents`: `53a2d94`(2026-10-24)→ `0eed617`(2026-10-28)

| パッケージ | 更新前 | 更新後 |
| ---------- | ------ | ------ |
| codex | 0.164.0 | 0.165.0 |
| claude-code | 2.1.310 | 2.1.312 |
| herdr | 0.9.5 | 0.9.5 |

## 7 日ルールの例外

`llm-agents` は 7 日更新ルールの対象ですが,ユーザーの指示により今回に限り例外として更新しました.

理由: `gpt-6.1-terra` モデルに対応した Codex リリースが必要なため.Codex 0.165.0 のリリースノートに
"Added GPT-6.1 Terra to the model catalogs (#57337)"
と記載されていることを確認しました(0.164.0 には記載なし).

## 検証

`switch` は実行せず,ビルドした generation を確認しました.

- `nix build
.#checks.aarch64-darwin.{agent-codex-rendered-config,agent-claude-rendered-settings,home-configuration,host-configuration}`
が成功
- レンダリング済み Codex 設定に `cli_auth_credentials_store = "keyring"` が含まれる
- レンダリング済み Claude 設定の `permissions.deny` に `Bash(op:*)` が含まれる

## switch 後の手順

1. `codex login`
2. `rm -- ~/.codex/auth.json`

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

---------

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

3 participants