Documentation
¶
Overview ¶
Package gitremote deterministically detects the git remotes configured in a local directory tree, so Wardyn can ground a composed run's GitHub grant on the workspace's ACTUAL remotes rather than an LLM guess.
It is read-only and runs NO subprocess: it parses .git/config and .gitmodules as plain files (so it can never trigger a git hook or a malicious include.path / core.fsmonitor in a repo's config). The walk is bounded (depth, .git count, file size), never follows symlinks, and fails safe — any error yields fewer/zero detected repos, never a grant on uncertainty.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Classify ¶
Classify maps a git remote HOST to a broker-relevant category:
- "github" — github.com, *.github.com
- "azure_devops" — dev.azure.com, *.visualstudio.com
- "gitlab" — gitlab.com and self-managed gitlab.* hosts
- "other" — anything else
Matching is case-insensitive and tolerates a trailing dot. Pure string work (no subprocess), reusing the host forms parseRemoteURL already yields.
func DetectGitHubRepos ¶
DetectGitHubRepos walks root (bounded, no symlink following) and returns the sorted, de-duplicated set of github.com "owner/repo" remotes found in .git/config and .gitmodules files, plus the sorted set of non-GitHub remote HOSTS (for an operator warning). It never returns an error: detection is best-effort and fail-safe.
Types ¶
This section is empty.