5.2 KiB
id, title, status, wave, depends_on, plan, requirements, acceptance_criteria, system_design
| id | title | status | wave | depends_on | plan | requirements | acceptance_criteria | system_design | ||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 01-prompt-policy | Enforce final Git prompt policy | done | 1 | plan.md |
|
|
|
Task 01: Enforce final Git prompt policy
Summary
All runner variants deny interactive authentication after caller overrides; valid selected credentials and input protocols still work.
In scope
Apply shared final preparation to every runner variant after environment assembly. Move the existing SSH normalization into the shared package. Preserve explicit credential scope, indexed configuration, stdin, and working-directory semantics. Integrate the merged dependency recorded in plan.md before this work begins. Do not deduplicate repeated Git helper/configuration keys at different indexes; normalize only repeated assignments to the same environment variable. Add an ordered block case with empty helper resets, repeated user helpers, hooks/notes entries, and a marker-owned host helper. Assert that preparation preserves the entire indexed block and selected credential-directory variables. Keep the host bridge's shell function unchanged; it is not an SSH wrapper.
Write TestManagedGitCredentialFillPTY first in git_noninteractive_unix_test.go.
Start a test subprocess under a controlling PTY, then invoke the production runner with real Git and a failing helper.
On the current code, assert that the test detects an actual waiting prompt and fails under an outer timeout.
Do not mistake Git's fatal message quoting a username prompt for an interactive read.
In git_noninteractive_test.go, add TestGitFinalEnvironment, TestGitCredentialHTTPSelectedScope, and TestGitSSHCommandPreservation.
Cover all runner variants, nil and explicit empty environments, duplicate keys, inherited interactive settings, and replacement of cmd.Env after construction.
Use a local HTTP Basic-auth Git fixture with distinct synthetic host and instance credentials.
Prove valid helper success, selected-scope denial without fallback, stdin preservation, and no secrets in captured errors or logs.
Cover quoted/direct SSH paths, GIT_SSH, inherited BatchMode=no, unsupported wrappers, and repeated preparation.
Native Windows coverage must execute deny-only askpass, not merely inspect its environment value.
Out of scope
Credential-authority changes, transport fallback, live-instance changes, and unrelated refactors.
Acceptance
- All runner variants deny interactive authentication after caller overrides; valid selected credentials and input protocols still work.
- Run new behavioral tests before implementation and record the expected failure, then the passing result.
- Preserve the contracts and exclusions in the linked design.
Verification
git merge-base --is-ancestor 9cc146ee21c296d553ae684531219a5c711a4213 HEAD
(cd apps/backend && go test ./internal/common/subproc ./internal/gitconfigenv ./internal/agentctl/server/process -count=1 -timeout=5m)
Run the same applicable package tests on native Windows. Skip only Unix PTY assertions; record platform evidence separately.
Files likely touched
apps/backend/internal/common/subproc/git_command.goapps/backend/internal/common/subproc/shared.goapps/backend/internal/common/subproc/git_noninteractive*.go (new)apps/backend/internal/agentctl/server/process/workspace_git_cmd.goapps/backend/internal/agentctl/server/process/workspace_git_cmd_test.goapps/backend/internal/gitconfigenv/environment.go
Dependencies
Merged PR #3635 must be in HEAD; see the prerequisite in plan.md.
Risks
Credential helper and process-lifecycle compatibility require real subprocess evidence. Do not infer success from environment assertions alone.
Parallelism
sequential
Inputs
- Execution design.
- Plan evidence and caller inventory.
- Scoped AGENTS.md and relevant fix, TDD, and E2E skills.
Results
Implemented on the verified PR #3635 descendant 9cc146ee21c296d553ae684531219a5c711a4213.
Results: shared final preparation now runs at every classified Git runner boundary, preserving explicit environments, indexed Git configuration, selected credential scope, and direct OpenSSH options. Added PTY, local HTTP Basic-auth, runner-variant, duplicate-environment, SSH-normalization, and native Windows compile coverage. The Unix lifecycle tests were added ahead of Task 02 and pass against the current implementation.
Checks passed:
git merge-base --is-ancestor 9cc146ee21c296d553ae684531219a5c711a4213 HEAD(cd apps/backend && go test ./internal/common/subproc ./internal/gitconfigenv ./internal/agentctl/server/process -count=1 -timeout=5m)GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c -o /tmp/kandev-subproc-windows.test ./internal/common/subprocGOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c -o /tmp/kandev-process-windows.test ./internal/agentctl/server/processGOOS=windows GOARCH=amd64 CGO_ENABLED=0 go test -c -o /tmp/kandev-winproc-windows.test ./internal/agentctl/server/winproc