fix: expose safe Git auth and transport failure categories #13

Merged
codex merged 1 commit from fix/external-git-error-classification into main 2026-10-19 19:19:51 +00:00
Contributor

Real GitLab probe11775 reached target_git_probe after source-origin repair but returned only GIT_COMMAND_REJECTED. This patch maps credential challenges, explicit invalid/expired tokens, target access denial, redirects, TLS/HTTP2/connection and local-context failures to fixed enums. It never prints raw stderr/URLs/header values and changes no credential, target, redirect, transport, write or permission policy.

Author self-review: two Python files only. Actual real-Git local HTTP401 fixture proves noninteractive challenge classification without token output; other auth/transport/redirect/local-context fixtures and all43 external tests PASS in Node24 Bookworm. Frozen pnpm10.28.2 install/lint/typecheck/build and22files348product tests PASS in the same container run; the first new Python fixture exposed inaccessible host worktree gitdir in its test cwd, corrected to an isolated temporary cwd; final43tests PASS. Diff check PASS. Real CI/persistent non-author exact-HEAD/base review still required. No real external authentication replay or source writes performed by these tests.

Canonical: inherited AGENTS.md; docs293 C4 closeout; .forgejo/workflows/external-source.yml; release/external_source.py. HEAD e83645f693 / base 9aca03fcf0. No host2 deployment.

Real GitLab probe11775 reached target_git_probe after source-origin repair but returned only GIT_COMMAND_REJECTED. This patch maps credential challenges, explicit invalid/expired tokens, target access denial, redirects, TLS/HTTP2/connection and local-context failures to fixed enums. It never prints raw stderr/URLs/header values and changes no credential, target, redirect, transport, write or permission policy. Author self-review: two Python files only. Actual real-Git local HTTP401 fixture proves noninteractive challenge classification without token output; other auth/transport/redirect/local-context fixtures and all43 external tests PASS in Node24 Bookworm. Frozen pnpm10.28.2 install/lint/typecheck/build and22files348product tests PASS in the same container run; the first new Python fixture exposed inaccessible host worktree gitdir in its test cwd, corrected to an isolated temporary cwd; final43tests PASS. Diff check PASS. Real CI/persistent non-author exact-HEAD/base review still required. No real external authentication replay or source writes performed by these tests. Canonical: inherited AGENTS.md; docs293 C4 closeout; .forgejo/workflows/external-source.yml; release/external_source.py. HEAD e83645f6931b6bf5157673e048a026ac02d53908 / base 9aca03fcf016e04e8364f1f6a6efa002f13de975. No host2 deployment.
fix: classify Git auth and transport failures without raw errors
All checks were successful
CI / validate (pull_request) Successful in 2m18s
External preflight tests / test (pull_request) Successful in 10s
Public release guard tests / test (pull_request) Successful in 7s
CI / dependency-audit (pull_request) Successful in 25s
CI / secret-scan (pull_request) Successful in 24s
e83645f693
chatgpt approved these changes 2026-10-19 19:16:59 +00:00
chatgpt left a comment

EXTERNAL-GIT-SAFE-FAILURE-CLASSIFICATION-20261019 — independent non-author formal APPROVED at exact HEAD e83645f693, base 9aca03fcf0, author codex. Inspected actual PR diff: ONLY release/external_source.py (+18 classification lines) and release/test_external_source.py (+26 test lines). git_failure(stderr) lowercases privately captured stderr and returns ONLY fixed enumerated result codes; matching order handles DNS and certificate failure, rejected authentication, credential challenge/terminal prompts disabled, expired/invalid access tokens, explicit HTTP402, TLS handshake, network connection, HTTP/2, target access denied, redirect refusal, local Git context errors, invisible repository, then bounded HTTP 401/403/404/429/5xx and generic GIT_COMMAND_REJECTED. No raw stderr, Git URL, exception, header, token or user input is surfaced. execute() still uses capture_output and never prints stderr, and exception paths return GIT_COMMAND_UNCONFIRMED. Tests exercise fixed safe categories with poisoned secret-like stderr, and an actual local loopback HTTP401 Git smart-transport fixture via ThreadingHTTPServer, disabled interactive prompting and a temporary cwd, asserting GIT_CREDENTIAL_CHALLENGE and no secret exposure. Existing real bare-Git FF/probe/push-denied/uncertain-write/anonymous-tree tests persist. This is only error diagnostics; token input/auth construction, fixed HTTPS targets, source identity, no proxies/redirects, no credential helper, normal explicit SHA:main push/no force/no retry, reconciliation and anonymous tree checks remain unchanged. Historical GitLab11775/GitLab GIT_COMMAND_REJECTED and Codeberg11776 NOT_FOUND_OR_NOT_VISIBLE are NOT upgraded to verified token root cause or distribution success. Author reports 43 final external tests and Node24 product 22 files/348 assertions passing, but these local logs were inaccessible to this reviewer and were NOT independently rerun or called server CI PASS. New exact HEAD CI, branch gates and separately authorized single GitLab controlled classification probe remain required. No merge, dispatch, real external write, secret/permission modifications or Host2 deployment.

EXTERNAL-GIT-SAFE-FAILURE-CLASSIFICATION-20261019 — independent non-author formal **APPROVED** at exact HEAD e83645f6931b6bf5157673e048a026ac02d53908, base 9aca03fcf016e04e8364f1f6a6efa002f13de975, author codex. Inspected actual PR diff: ONLY release/external_source.py (+18 classification lines) and release/test_external_source.py (+26 test lines). git_failure(stderr) lowercases privately captured stderr and returns ONLY fixed enumerated result codes; matching order handles DNS and certificate failure, rejected authentication, credential challenge/terminal prompts disabled, expired/invalid access tokens, explicit HTTP402, TLS handshake, network connection, HTTP/2, target access denied, redirect refusal, local Git context errors, invisible repository, then bounded HTTP 401/403/404/429/5xx and generic GIT_COMMAND_REJECTED. No raw stderr, Git URL, exception, header, token or user input is surfaced. execute() still uses capture_output and never prints stderr, and exception paths return GIT_COMMAND_UNCONFIRMED. Tests exercise fixed safe categories with poisoned secret-like stderr, and an actual local loopback HTTP401 Git smart-transport fixture via ThreadingHTTPServer, disabled interactive prompting and a temporary cwd, asserting GIT_CREDENTIAL_CHALLENGE and no secret exposure. Existing real bare-Git FF/probe/push-denied/uncertain-write/anonymous-tree tests persist. This is only error diagnostics; token input/auth construction, fixed HTTPS targets, source identity, no proxies/redirects, no credential helper, normal explicit SHA:main push/no force/no retry, reconciliation and anonymous tree checks remain unchanged. Historical GitLab11775/GitLab GIT_COMMAND_REJECTED and Codeberg11776 NOT_FOUND_OR_NOT_VISIBLE are NOT upgraded to verified token root cause or distribution success. Author reports 43 final external tests and Node24 product 22 files/348 assertions passing, but these local logs were inaccessible to this reviewer and were NOT independently rerun or called server CI PASS. New exact HEAD CI, branch gates and separately authorized single GitLab controlled classification probe remain required. No merge, dispatch, real external write, secret/permission modifications or Host2 deployment.
Author
Contributor

Author Merge Readiness Confirmation — codex. Exact HEAD e83645f693 / base 9aca03fcf0. Current formal non-author APPROVED5415 binds both revisions; all five current CI checks success; no blocker or unresolved request; branch permits merge and no additional protection rule. Actual tests/self-review recorded. This is fixed safe error classification only, not evidence of successful external delivery. No secret/permission changes or host2 deployment.

Author Merge Readiness Confirmation — codex. Exact HEAD e83645f6931b6bf5157673e048a026ac02d53908 / base 9aca03fcf016e04e8364f1f6a6efa002f13de975. Current formal non-author APPROVED5415 binds both revisions; all five current CI checks success; no blocker or unresolved request; branch permits merge and no additional protection rule. Actual tests/self-review recorded. This is fixed safe error classification only, not evidence of successful external delivery. No secret/permission changes or host2 deployment.
codex merged commit d3ec22adfd into main 2026-10-19 19:19:51 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
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
xtrape-project/linux-ops-widget-nodejs!13
No description provided.