feat(config): generic per-provider host config maps replace claude-named fields (ADR-0034) #83

Merged
dominik.polakovics merged 1 commit from afk/78 into main 2026-07-09 23:31:09 +02:00

One generic per-provider surface replaces the claude-named host config, so provider N+1 needs zero config.go changes (decided in the provider-seam grill, 2026-07-09). New ADR-0034 records the decision.

What changed

  • internal/configConfig drops ClaudeBin/ClaudeConfig for ProviderBin/ProviderConfig maps keyed by registered provider id. Repeatable -provider-bin id=path / -provider-config id=path flags plus LAB_PROVIDER_BIN_<ID> / LAB_PROVIDER_CONFIG_<ID> env forms (claude-codeCLAUDE_CODE). Parse takes the registered ids from cmd/lab (the one place that names adapters), so an unknown id in a generic flag is a boot error listing the registered ids. -claude / -claude-config / LAB_CLAUDE_CONFIG survive as the documented deprecated alias shim writing the claude-code entries — the only provider-named remnant in config.go — with per-entry precedence generic flag > generic env > alias flag > alias env.
  • internal/provider/claudecodeNew accepts empty ClaudeBin/ConfigPath and fills the adapter-owned defaults (PATH-resolved claude; LoginDir/.claude.json), so per-provider defaults leave config.go entirely.
  • cmd/lab — constructs claude-code from the map entries, preserves the degraded-boot rule (HOME unset + no claude-code config entry → instance stack unmounted, loud warning), and -help documents the generic flags with the aliases marked deprecated (pinned by test).
  • docs/nix — ADR-0034; ops.md flag table + precedence note; extraFlags example on the generic form.

Acceptance, checked

  • config.go provider-name-free except the marked alias shim (aliasProviderID)
  • -help documents the generic flags (pinned by TestUsageDocumentsGenericProviderFlags)
  • Tests: alias and generic forms both reach the adapter; generic wins over alias; unknown id in a flag is a boot error
  • Claude-code constructed via the map path end to end — verified live: booted lab with distinct fake binaries on the generic flag and the alias, and GET /api/v1/providers/claude-code/auth/status?force=1 exec'd the generic one (alias-only and env-beats-alias-flag probed the same way); degraded boot and all four flag-validation errors exercised at the CLI

go build ./..., full go test ./... (except the pre-existing sandbox-environment tmux integration failures in untouched internal/tmuxx), golangci-lint run (0 issues), gofmt all clean.

Closes #78

🤖 Generated with Claude Code

https://claude.ai/code/session_017KmtFcjeAYBU1vxJuajaGc

One generic per-provider surface replaces the claude-named host config, so provider N+1 needs zero `config.go` changes (decided in the provider-seam grill, 2026-07-09). New ADR-0034 records the decision. ## What changed - **internal/config** — `Config` drops `ClaudeBin`/`ClaudeConfig` for `ProviderBin`/`ProviderConfig` maps keyed by registered provider id. Repeatable `-provider-bin id=path` / `-provider-config id=path` flags plus `LAB_PROVIDER_BIN_<ID>` / `LAB_PROVIDER_CONFIG_<ID>` env forms (`claude-code` → `CLAUDE_CODE`). `Parse` takes the registered ids from `cmd/lab` (the one place that names adapters), so an unknown id in a generic flag is a boot error listing the registered ids. `-claude` / `-claude-config` / `LAB_CLAUDE_CONFIG` survive as the documented deprecated alias shim writing the `claude-code` entries — the only provider-named remnant in config.go — with per-entry precedence **generic flag > generic env > alias flag > alias env**. - **internal/provider/claudecode** — `New` accepts empty `ClaudeBin`/`ConfigPath` and fills the adapter-owned defaults (PATH-resolved `claude`; `LoginDir/.claude.json`), so per-provider defaults leave config.go entirely. - **cmd/lab** — constructs claude-code from the map entries, preserves the degraded-boot rule (HOME unset + no claude-code config entry → instance stack unmounted, loud warning), and `-help` documents the generic flags with the aliases marked deprecated (pinned by test). - **docs/nix** — ADR-0034; ops.md flag table + precedence note; `extraFlags` example on the generic form. ## Acceptance, checked - config.go provider-name-free except the marked alias shim (`aliasProviderID`) - `-help` documents the generic flags (pinned by `TestUsageDocumentsGenericProviderFlags`) - Tests: alias and generic forms both reach the adapter; generic wins over alias; unknown id in a flag is a boot error - Claude-code constructed via the map path end to end — verified live: booted `lab` with distinct fake binaries on the generic flag and the alias, and `GET /api/v1/providers/claude-code/auth/status?force=1` exec'd the generic one (alias-only and env-beats-alias-flag probed the same way); degraded boot and all four flag-validation errors exercised at the CLI `go build ./...`, full `go test ./...` (except the pre-existing sandbox-environment tmux integration failures in untouched `internal/tmuxx`), `golangci-lint run` (0 issues), `gofmt` all clean. Closes #78 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_017KmtFcjeAYBU1vxJuajaGc
feat(config): generic per-provider host config maps replace claude-named fields (ADR-0034)
All checks were successful
ci / native (pull_request) Successful in 4m55s
ci-nix / flake-check (pull_request) Successful in 1h7m21s
e9f2ef7d07
One generic per-provider surface replaces the claude-named host config,
so provider N+1 needs zero config.go changes (issue #78, provider-seam
grill 2026-07-09):

- config: Config drops ClaudeBin/ClaudeConfig for ProviderBin/
  ProviderConfig maps keyed by registered provider id. Repeatable
  -provider-bin/-provider-config id=path flags plus LAB_PROVIDER_BIN_<ID>/
  LAB_PROVIDER_CONFIG_<ID> env forms (id uppercased, dashes to
  underscores). Parse takes the registered ids from the caller; an
  unknown id in a generic flag is a boot error listing the registered
  ids. -claude/-claude-config/LAB_CLAUDE_CONFIG survive as the documented
  deprecated alias shim writing the claude-code entries — the only
  provider-named remnant — with per-entry precedence generic flag >
  generic env > alias flag > alias env.
- claudecode: New accepts empty ClaudeBin/ConfigPath and fills the
  adapter-owned defaults (PATH-resolved claude; LoginDir/.claude.json) —
  per-provider defaults leave config.go entirely.
- cmd/lab: names the registered ids at the Parse call, constructs the
  provider from the map entries, keeps the degraded-boot rule (HOME
  unset and no claude-code config entry disables the instance stack,
  loud warning), and -help documents the generic flags with the aliases
  marked deprecated (pinned by test).
- docs/nix: ADR-0034; ops.md flag table gains the generic rows and the
  precedence note, claude-named rows demoted to deprecated aliases; the
  module extraFlags example uses the generic form.

Closes #78

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017KmtFcjeAYBU1vxJuajaGc
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Cloonar/coding-lab!83
No description provided.