Skip to content

docs(specs): claude auth strategy — three-PR plan#155

Merged
donbeave merged 1 commit into
mainfrom
chore/auth-strategy-specs
Apr 23, 2026
Merged

docs(specs): claude auth strategy — three-PR plan#155
donbeave merged 1 commit into
mainfrom
chore/auth-strategy-specs

Conversation

@donbeave

Copy link
Copy Markdown
Member

Summary

Adds design specs for a three-PR series that replaces the copy-drift Claude OAuth forwarding path with a durable token-based auth contract backed by an operator-managed env resolver.

  • PR 1 — auth-sync-default: make sync the default, migrate existing copy configs in place with a one-line deprecation notice, drop the Copy variant from the enum. Fixes the 401-after-drift failure mode from the claude-auth-strategy roadmap.
  • PR 2 — workspace-env-resolver: introduce four-layer env declarations (global / per-agent-class / per-workspace / per-workspace × agent) with scheme-dispatched values (literal / $VAR / op://). Launch-time resolution via the 1Password CLI (Touch-ID gated by op itself) with zero jackin-side secret storage. Partially delivers option fix: resolve relative paths in workspace CLI arguments #2 from onepassword-integration.
  • PR 3 — claude-token-auth-mode: add auth_forward = "token" as a thin consumer of PR 2's resolver. Requires CLAUDE_CODE_OAUTH_TOKEN in the resolved env; provisions .claude.json as {} and skips credentials forwarding so Claude Code's documented env-var precedence (wins over /login) applies cleanly. Delivers option chore: bump version to 0.5.0-dev #3 from the claude-auth-strategy roadmap.

Each spec is reviewable independently. PR 3 has a hard dependency on PR 2 landing first; PR 1 is independent.

Specs in this PR

  • docs/superpowers/specs/2026-04-23-auth-sync-default-design.md
  • docs/superpowers/specs/2026-04-23-workspace-env-resolver-design.md
  • docs/superpowers/specs/2026-04-23-claude-token-auth-mode-design.md

What this PR is not

This PR contains design specs only. No Rust code, no config changes, no behavior changes. Each of the three PRs it describes will be opened separately once the design is approved.

Test plan

  • Pre-commit gate clean on the spec commit: cargo fmt -- --check && cargo clippy && cargo nextest run
  • Reviewer reads all three specs end-to-end
  • Reviewer confirms the three-PR split (no scope collapse or expansion)
  • Reviewer confirms failure-mode choices: hard error on missing op, hard error on missing env var, hard error on reserved-name override
  • Reviewer confirms the four-layer env precedence (global → agent → workspace → workspace×agent, later wins)
  • Reviewer confirms the 30s op read timeout is acceptable (PR 2 spec)

Add design specs for a three-PR series that replaces the copy-drift Claude
OAuth forwarding path with a durable token-based auth contract backed by an
operator-managed env resolver.

- PR 1 (auth-sync-default): make sync the default, migrate copy configs in
  place with a deprecation notice, and drop the Copy variant from the enum.
  Fixes the 401-after-drift failure mode operators see today.

- PR 2 (workspace-env-resolver): introduce four-layer env declarations
  (global / per-agent-class / per-workspace / per-workspace-x-agent) with
  scheme-dispatched values (literal / \$VAR / op://). Launch-time resolution
  via the 1Password CLI unlocks Touch-ID-gated secrets with no jackin-side
  storage. Partially delivers onepassword-integration.mdx option #2.

- PR 3 (claude-token-auth-mode): add auth_forward = "token" as a thin
  consumer of PR 2's resolver. Requires CLAUDE_CODE_OAUTH_TOKEN in the
  resolved env; provisions .claude.json as {} and skips credentials forwarding
  so Claude Code's documented env-var precedence (takes priority over
  /login) applies cleanly. Delivers claude-auth-strategy.mdx option #3.

Each spec is reviewable independently; PR 3 depends on PR 2.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
@donbeave donbeave force-pushed the chore/auth-strategy-specs branch from 9472a90 to d9e1757 Compare April 23, 2026 13:23
@donbeave donbeave merged commit 077659d into main Apr 23, 2026
9 checks passed
@donbeave donbeave deleted the chore/auth-strategy-specs branch April 23, 2026 13:27
donbeave added a commit that referenced this pull request May 6, 2026
Add design specs for a three-PR series that replaces the copy-drift Claude
OAuth forwarding path with a durable token-based auth contract backed by an
operator-managed env resolver.

- PR 1 (auth-sync-default): make sync the default, migrate copy configs in
  place with a deprecation notice, and drop the Copy variant from the enum.
  Fixes the 401-after-drift failure mode operators see today.

- PR 2 (workspace-env-resolver): introduce four-layer env declarations
  (global / per-agent-class / per-workspace / per-workspace-x-agent) with
  scheme-dispatched values (literal / \$VAR / op://). Launch-time resolution
  via the 1Password CLI unlocks Touch-ID-gated secrets with no jackin-side
  storage. Partially delivers onepassword-integration.mdx option #2.

- PR 3 (claude-token-auth-mode): add auth_forward = "token" as a thin
  consumer of PR 2's resolver. Requires CLAUDE_CODE_OAUTH_TOKEN in the
  resolved env; provisions .claude.json as {} and skips credentials forwarding
  so Claude Code's documented env-var precedence (takes priority over
  /login) applies cleanly. Delivers claude-auth-strategy.mdx option #3.

Each spec is reviewable independently; PR 3 depends on PR 2.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
donbeave added a commit that referenced this pull request May 7, 2026
Add design specs for a three-PR series that replaces the copy-drift Claude
OAuth forwarding path with a durable token-based auth contract backed by an
operator-managed env resolver.

- PR 1 (auth-sync-default): make sync the default, migrate copy configs in
  place with a deprecation notice, and drop the Copy variant from the enum.
  Fixes the 401-after-drift failure mode operators see today.

- PR 2 (workspace-env-resolver): introduce four-layer env declarations
  (global / per-agent-class / per-workspace / per-workspace-x-agent) with
  scheme-dispatched values (literal / \$VAR / op://). Launch-time resolution
  via the 1Password CLI unlocks Touch-ID-gated secrets with no jackin-side
  storage. Partially delivers onepassword-integration.mdx option #2.

- PR 3 (claude-token-auth-mode): add auth_forward = "token" as a thin
  consumer of PR 2's resolver. Requires CLAUDE_CODE_OAUTH_TOKEN in the
  resolved env; provisions .claude.json as {} and skips credentials forwarding
  so Claude Code's documented env-var precedence (takes priority over
  /login) applies cleanly. Delivers claude-auth-strategy.mdx option #3.

Each spec is reviewable independently; PR 3 depends on PR 2.

Co-authored-by: Claude <noreply@anthropic.com>
Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Codex <codex@openai.com>
donbeave added a commit that referenced this pull request May 7, 2026
Add design specs for a three-PR series that replaces the copy-drift Claude
OAuth forwarding path with a durable token-based auth contract backed by an
operator-managed env resolver.

- PR 1 (auth-sync-default): make sync the default, migrate copy configs in
  place with a deprecation notice, and drop the Copy variant from the enum.
  Fixes the 401-after-drift failure mode operators see today.

- PR 2 (workspace-env-resolver): introduce four-layer env declarations
  (global / per-agent-class / per-workspace / per-workspace-x-agent) with
  scheme-dispatched values (literal / \$VAR / op://). Launch-time resolution
  via the 1Password CLI unlocks Touch-ID-gated secrets with no jackin-side
  storage. Partially delivers onepassword-integration.mdx option #2.

- PR 3 (claude-token-auth-mode): add auth_forward = "token" as a thin
  consumer of PR 2's resolver. Requires CLAUDE_CODE_OAUTH_TOKEN in the
  resolved env; provisions .claude.json as {} and skips credentials forwarding
  so Claude Code's documented env-var precedence (takes priority over
  /login) applies cleanly. Delivers claude-auth-strategy.mdx option #3.

Each spec is reviewable independently; PR 3 depends on PR 2.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
donbeave added a commit that referenced this pull request May 7, 2026
Add design specs for a three-PR series that replaces the copy-drift Claude
OAuth forwarding path with a durable token-based auth contract backed by an
operator-managed env resolver.

- PR 1 (auth-sync-default): make sync the default, migrate copy configs in
  place with a deprecation notice, and drop the Copy variant from the enum.
  Fixes the 401-after-drift failure mode operators see today.

- PR 2 (workspace-env-resolver): introduce four-layer env declarations
  (global / per-agent-class / per-workspace / per-workspace-x-agent) with
  scheme-dispatched values (literal / \$VAR / op://). Launch-time resolution
  via the 1Password CLI unlocks Touch-ID-gated secrets with no jackin-side
  storage. Partially delivers onepassword-integration.mdx option #2.

- PR 3 (claude-token-auth-mode): add auth_forward = "token" as a thin
  consumer of PR 2's resolver. Requires CLAUDE_CODE_OAUTH_TOKEN in the
  resolved env; provisions .claude.json as {} and skips credentials forwarding
  so Claude Code's documented env-var precedence (takes priority over
  /login) applies cleanly. Delivers claude-auth-strategy.mdx option #3.

Each spec is reviewable independently; PR 3 depends on PR 2.

Signed-off-by: Alexey Zhokhov <alexey@zhokhov.com>
Co-authored-by: Claude <noreply@anthropic.com>
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.

1 participant