refactor: simplify the GitHub size preflight

main

Commit

Andrea Nodari2w ago
  • Move the preflight to its own file, github_preflight.go.
  • Move the one-line message cleaner to sanitize.Line and document it in the package's threat model, instead of a second sanitizer in bootstrap.
  • Set authOrigin for explicit credentials at construction, so CredentialsFor reads one field; share helper-credential adoption in adoptHelperCreds.
  • Reuse the default-port rule via gitproto.UsesDefaultPort.
  • logGitHubPreflight branches once and logs with the chosen level.
  • Tests: no sleeps in the timeout test (assert each attempt's deadline), zero size joins the unusable-body table, shared captureNotices and redirectingAPI helpers, bearer auth through privateRepoAPI.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Claude-Session: https://claude.ai/code/session_015oS6W9qjGMVnrTz5r8EwDL Entire-Checkpoint: 01M5CBACJHJ3YBH1HH7VZT2BWT