Part of #1512 and master #1505
Parent
Dependencies
Summary
Add the typed GitHub request/result and executor without migrating callers.
Current Limitation / Root Cause
GitHubAuthTokenResolver reads environment material and invokes gh auth token outside release policy.
Affected Files
| Path |
Change |
Phantom.Workspaces.Llm.Interfaces/Access/GitHubCredentialAccessContracts.cs |
Implement the bounded production change owned by this issue. |
Phantom.Workspaces/Services/Access/GitHubCredentialAccessExecutor.cs |
Implement the bounded production change owned by this issue. |
| Focused test file |
Add only the tests listed below. |
Design / Fix
This slice implements the following exact contract:
public sealed record GitHubCredentialAccessRequest : CredentialAccessRequest<GitHubCredentialAccessResult>
{
public required GitHubCredentialPurpose Purpose { get; init; }
}
internal sealed class GitHubCredentialAccessExecutor : ICredentialAccessExecutor<GitHubCredentialAccessRequest, GitHubCredentialAccessResult>;
Inspect does not read GITHUB_TOKEN or invoke gh. Execute does so only after approval, validates source/account identity, and reduces stdout directly into an independent lease.
Use required-init properties and named object initializers. The commit must build and its focused tests must pass without relying on a second implementation slice landing in the same commit.
Security and Privacy Invariants
- Release/use authorization occurs before material access or provider interaction whenever this slice can reach either boundary.
- No token, secret value, OAuth state, verifier, authorization URL, signed URL, device code, callback, account name, unsafe identifier, or credential-bearing result enters UI-safe state, logs, notifications, entities, or persistence.
- Typed results remain caller-owned and disposable; provider/cache artifacts remain executor-owned.
- Errors are typed and sanitized; no broad catch or success-shaped fallback is introduced.
Exclusions
- No batch API, compatibility bridge, legacy-data migration, silent interactive renewal, or unrelated provider work.
- No production types beyond the bounded files/classes named here.
- No UI work unless this issue is explicitly a UI slice.
Commit Plan
Commit 1 — [access-github] - Implement approved environment and gh CLI token executor
Production scope: Phantom.Workspaces.Llm.Interfaces/Access/GitHubCredentialAccessContracts.cs, Phantom.Workspaces/Services/Access/GitHubCredentialAccessExecutor.cs.
Tests: GitHubCredentialAccessExecutorTests methods listed below.
Acceptance: one small coherent commit; no opportunistic adjacent migration.
Expected Tests
| Test Name |
Class |
What It Verifies |
GitHubExecutor_InspectAsync_DoesNotReadEnvironmentOrInvokeCli |
GitHubCredentialAccessExecutorTests |
Verifies the named contract and leaves adjacent slices independently testable. |
GitHubExecutor_ExecuteAsync_GhCliRunsOnlyAfterReleaseCommit |
GitHubCredentialAccessExecutorTests |
Verifies the named contract and leaves adjacent slices independently testable. |
GitHubExecutor_ResolvedAccountMismatch_FailsClosedWithoutLoggingToken |
GitHubCredentialAccessExecutorTests |
Verifies the named contract and leaves adjacent slices independently testable. |
Part of #1512 and master #1505
Parent
Dependencies
Summary
Add the typed GitHub request/result and executor without migrating callers.
Current Limitation / Root Cause
GitHubAuthTokenResolver reads environment material and invokes gh auth token outside release policy.
Affected Files
Phantom.Workspaces.Llm.Interfaces/Access/GitHubCredentialAccessContracts.csPhantom.Workspaces/Services/Access/GitHubCredentialAccessExecutor.csDesign / Fix
This slice implements the following exact contract:
Inspect does not read GITHUB_TOKEN or invoke gh. Execute does so only after approval, validates source/account identity, and reduces stdout directly into an independent lease.
Use required-init properties and named object initializers. The commit must build and its focused tests must pass without relying on a second implementation slice landing in the same commit.
Security and Privacy Invariants
Exclusions
Commit Plan
Commit 1 — [access-github] - Implement approved environment and gh CLI token executor
Production scope:
Phantom.Workspaces.Llm.Interfaces/Access/GitHubCredentialAccessContracts.cs,Phantom.Workspaces/Services/Access/GitHubCredentialAccessExecutor.cs.Tests:
GitHubCredentialAccessExecutorTestsmethods listed below.Acceptance: one small coherent commit; no opportunistic adjacent migration.
Expected Tests
GitHubExecutor_InspectAsync_DoesNotReadEnvironmentOrInvokeCliGitHubCredentialAccessExecutorTestsGitHubExecutor_ExecuteAsync_GhCliRunsOnlyAfterReleaseCommitGitHubCredentialAccessExecutorTestsGitHubExecutor_ResolvedAccountMismatch_FailsClosedWithoutLoggingTokenGitHubCredentialAccessExecutorTests