runtime、steps.defaults、model registry、heartbeatなど。
設定リファレンス
2層のconfig、上書き規則、既定値、認証変数を実装上の挙動と同じ単位で確認します。
このページの内容
設定は2層をdeep mergeする
project configはrepositoryへcommitされる前提で扱います。GitHubとruntimeのsecretは環境変数、keychain、または~/.config/specrunner/credentials.jsonで解決します。詳しくは権限・認証・環境変数を参照してください。
| priority | path | role |
|---|---|---|
| 1 / base | ~/.config/specrunner/config.json | 個人・実行環境の既定値。initが作成 |
| 2 / overlay | <repo>/.specrunner/config.json | repository固有の差分。手動で作成 |
merge規則。 objectは再帰的にmergeし、project localが勝ちます。arrayは連結せず、project localのarrayで全体を置き換えます。
設定の置き場所を分ける
verification、test配置、forbidden surfaces、archive guardなど。
GitHub token、Claude OAuth、managed API key。repositoryへcommitしません。
.specrunner/*はignoreし、!.specrunner/config.jsonだけを追跡する設定がinitで追加されます。
Project configの実用例
自動検出に任せる項目は書かず、repositoryとして固定したい契約だけを宣言します。
{
"version": 1,
"verification": {
"commands": [
{ "name": "typecheck", "run": "npm run typecheck" },
{ "name": "test", "run": "npm test" },
{ "name": "lint", "run": "npm run lint" }
]
},
"tests": {
"placement": { "style": "sibling", "suffix": ".test.ts" }
},
"archive": {
"protectedPaths": [".github/workflows/**"],
"postMergeVerify": ["npm ci"]
}
}version: 1standaloneでも読めるproject configにします。
verificationを明文化環境ごとの自動検出差をなくします。
危険なmergeを止めるprotectedPathsへ運用上の高リスク領域を置きます。
Step configは6段階で解決する
model、maxTurns、timeoutMsは各fieldごとに、最初に定義された値を使用します。
- 1
steps.<step>.byRequestType.<type>.<field> - 2
steps.<step>.<field> - 3
steps.defaults.byRequestType.<type>.<field> - 4
steps.defaults.<field> - 5step hardcoded default
- 6SDK default
{
"version": 1,
"steps": {
"defaults": {
"model": "claude-sonnet-4-6",
"maxTurns": null,
"timeoutMs": null
},
"design": {
"byRequestType": {
"spec-change": { "model": "claude-opus-4-6[1m]" },
"chore": { "model": "claude-sonnet-4-6" }
}
}
}
}managed runtimeではmodel指定を実行に使いません。 managed agentは登録済みmodelを使用します。config effectiveは設定値を表示しますが、実行時に無視される旨も表示します。
built-in model、provider dispatch、custom modelの制約は対応プロバイダーを参照してください。
主要な設定キーと既定値
| key | default | behavior |
|---|---|---|
runtime | local | local / managed。managedのresource IDはsetupが管理 |
steps.<step> | step既定値 | model、maxTurns、timeoutMs、byRequestType |
models.<name>.provider | built-in registry | anthropic / openaiを追加・上書き |
workspace.setup | JS traceを検出してinstall | ShellCommand[]。[]で明示的にskip |
verification.commands | package.jsonのscriptを検出 | ShellCommand[]を順番にfail-fast実行 |
verification.coverage | 未宣言ならskip | changed-line coverageをlcovで検証 |
tests.placement | 既存配置に追従 | siblingまたはmirror |
pipeline.maxRetries | 2 | spec-review loop。1〜10 |
pipeline.fast.forbiddenSurfaces | [] | fast profileで触れてはいけないpath glob |
logs.maxJobs | 20 | 保持job数。1〜1000 |
progress.heartbeatIntervalSec | TTY 30 / non-TTY 60 | 0またはnullで無効 |
transientRetry | 3回 / 1000ms | local runtimeのみ。指数backoff |
Verificationを言語非依存にする
workspace.setupとverification.commandsは、文字列または{ name?, run }の配列です。POSIX shellで順番に実行し、最初のnon-zeroで停止します。
workspace.setup未宣言JS traceがあればpackage manager install、なければskipworkspace.setup: []JS projectでもinstallを明示的にskipverification.commands未宣言package.jsonのbuild・typecheck・test・lintを検出verification.coverage宣言base…HEADの変更行をlcovでfail-closed検証{
"verification": {
"commands": ["npm run typecheck", "npm test"],
"coverage": {
"command": "npm test -- --coverage",
"lcovPath": "coverage/lcov.info",
"include": ["src/**"],
"exclude": ["src/generated/**"],
"minChangedLineCoverage": 0.8
}
}
}coverage command失敗、lcovの欠落・空ファイル、対象fileのlcov欠落はfailです。
Archiveと任意連携
| key | default | behavior |
|---|---|---|
archive.mergeWaitTimeoutMs | 600000 | null=無制限、0=待機なし |
archive.mergeWaitPollIntervalMs | 15000 | checksのpoll間隔 |
archive.protectedPaths | [] | 一致したPRのauto-mergeを停止 |
archive.postMergeVerify | [] | merge SHAの一時worktreeで順次実行 |
github.host | github.com | GitHub Enterprise hostname |
github.apiBaseUrl | hostから導出 | 明示時はhttps URL |
inbox.approveLabel | specrunner-approved | Issue連携を使う場合の承認label |
inbox.maxStartsPerRun | 3 | 0はresume-only |
designLayer.enabled | false | aozu連携をopt-in |
designLayer.command | aozu | 起動するcommand |
designLayer.requireCitationTypes | [] | citation必須のrequest type |
designLayer.topicEmission | true | archive時のtopic出力 |
inboxは運用オプションです。 GitHub Issue起点の無人運用を前提にしません。CLIでrequestを投入する運用ではinbox設定は不要です。
archive guardの設計と実行順はPR・merge・archiveで確認できます。
認証・診断の環境変数
| variable | role |
|---|---|
GH_TOKEN | GitHub API tokenの最優先。cron・CI向け |
GITHUB_TOKEN | GitHub tokenの第2優先。GitHub Actionsで利用 |
CLAUDE_CODE_OAUTH_TOKEN | local Claude runtimeのheadless token。保存済みcredentialより優先 |
OPENAI_API_KEY | local OpenAI runnerがCodex SDKのapiKeyへ明示的に渡す |
SPECRUNNER_API_KEY | managed runtimeのAnthropic API key |
SPECRUNNER_LOG_LEVEL | quiet / verbose / debug。CLI flagが優先 |
SPECRUNNER_DEBUG | pipelineなど診断subsystemをcomma区切りで指定 |
SPECRUNNER_HEARTBEAT_INTERVAL | 秒数、0またはoffで無効。configが優先 |
GitHub tokenの解決順はGH_TOKEN → GITHUB_TOKEN → gh auth token → credentials.jsonです。
runtime別の必須変数、GitHub最小権限、GHES、secretの受け渡しは権限・認証・環境変数を参照してください。
変更前後に解決結果を確認する
config effectiveはstandard agent stepのmodel・maxTurns・timeoutMsと、それぞれの取得元を表示します。config全体のdumpではありません。
npx specrunner config effective
npx specrunner config effective --type spec-change
npx specrunner config effective --type chore --json
npx specrunner doctor確認範囲。 config変更後は構文だけでなく、対象request typeでどのstep値が採用されたかまで確認します。
目的別の最小例は設定レシピを参照してください。