## 背景 furedea/agent-harness#264 で `programs.agent-harness.github.agentToken` と `github-app-token` サブコマンド,その launchd ジョブが削除された(furedea/agent-harness#262 の方針:資格情報は agent-harness の外へ出す).dotfiles はまだこのオプションを設定しており,`flake.lock` が古い agent-harness を固定しているため現時点では壊れていない. エージェントが使う GitHub App のインストールトークンの発行を dotfiles が持つ. ## 方針 - `openssl` と `curl`(JSON の読み取りには既存の `jq`)だけを使う小さな Bash スクリプトを `scripts/` に置く.App の鍵で RS256 の JWT に署名し,App の唯一のインストールを `GET /app/installations` で求め,`POST /app/installations/{id}/access_tokens` でトークンを発行する. - エージェントが今使っている設定ディレクトリ(`~/.config/agent-harness/gh`)に `hosts.yml` を一時ファイルからの rename で mode 0600 で書く.`config.yml` がなければ `version: "1"` を書く. - launchd エージェントが 1 時間の有効期限より十分短い間隔で実行する. - `programs.agent-harness.github.*` を `nix/home/default.nix` から削除し,`nix/checks.nix` の契約を更新する.`flake.lock` の agent-harness と agent-config の更新は,agent-config 側の対応(`GH_CONFIG_DIR` などの設定)がマージされてから行う. ## 受け入れ条件 - [ ] スクリプトが bash-style に従い,bats のテストがある(JWT の形,偽の `curl` に送られた要求,ファイルの mode,失敗時の経路).テストは使い捨ての鍵を生成して使う. - [ ] App ID と設定ディレクトリのパスは現在と同じ. - [ ] launchd エージェントがスクリプトを定期実行する. - [ ] `programs.agent-harness.github` の設定がなくなり,`nix/checks.nix` が設定ディレクトリ,launchd エージェントの存在,旧オプションがないことを確かめる. - [ ] agent-harness と agent-config の `flake.lock` を一緒に更新し,`nix flake check` が通る. - [ ] 必要なら ADR を残す. - [ ] PR 本文にマージ後の手順(switch,launchd エージェントの実行確認,エージェントの身元で `gh` が動くこと)を書く.
Activity
fix(scripts): keep the agent token refreshing with the pinned tools
test(scripts): keep the JWT spec's values read-only and local
docs(adr): note that revoking cuts off gh processes outliving a run
fix(nix): count only absolute or home Claude Read denials for the App…
feat(scripts): mint the agents' GitHub App token with openssl and curl
feat(nix): run the agent token script under launchd instead of agent-…
feat(scripts): narrow the agent token and revoke the previous one
test(nix): require every rendered agent provider to deny the App key
feat(nix): point the agents' GH_CONFIG_DIR at the minted token
build(nix): update agent-harness and agent-config for the token move
fix(scripts): keep the agent token refreshing with the pinned tools
test(scripts): keep the JWT spec's values read-only and local
docs(adr): note that revoking cuts off gh processes outliving a run
fix(nix): count only absolute or home Claude Read denials for the App…