# Pre-public-release repo audit A DIFFERENT trigger and scope from the main skill's per-commit diff review: use this when a private repo with real accumulated history is about to be flipped to public (open-sourced), not when reviewing one pending commit. ## Scope: the whole history, not the diff - Credentials/secrets/PII can hide in commits that are no longer on HEAD. Scan with `gitleaks git --log-opts=--all` (every branch/ref) AND a full blob dump (`git rev-list --objects --all` -> extract every blob -> `gitleaks dir` on the extracted tree) so a since-deleted file's old content is covered. - Also OCR every historical image (`tesseract`) and grep the OCR text for the same secret/PII patterns — a screenshot of a real dashboard, a real IP, or a real session/chat title is just as exposing as a text leak and gitleaks alone will not catch it. - Build the pattern list from the MACHINE's own real values first (`tailscale ip -4`, device/tailnet name, real home-dir username) and grep for those literal strings, in addition to generic secret-shaped regexes (API key formats, `BEGIN ... PRIVATE`, JWTs, `user:pass@` in URLs) — generic patterns alone miss a real private IP or real account data that isn't secret-shaped but is still PII once the repo is public. ## Triage and present options — don't silently rewrite history Rewriting published git history (`filter-repo`, force-push) is high-risk and hard to undo once anyone has fetched it. Classify findings (critical / medium / low) and give the user an explicit choice rather than picking for them: 1. Squash the whole history into a single fresh commit (fastest, safest, loses the commit log) — the right default for a repo that has never had external forks/clones depending on its history. 2. Fix only HEAD, leave old commits as-is (cheap, but the finding stays technically present and fetchable in deep history forever). 3. Targeted `git filter-repo --replace-text` + force-push (keeps commit history, but is the most complex and most likely to need re-basing every open branch/worktree afterward). Do not assume which tradeoff the user wants — ask. ## A squash does NOT clean the working tree Squashing collapses commit METADATA into one commit; it does not touch what files currently exist in the tree. Old QA screenshots, logs, or debug dumps that contain real account data, real costs, or real session titles are still present in the single squashed commit if you don't delete them from the current files first. Do the file-level cleanup (`rm` the specific sensitive artifacts) as its own step before or during the squash, not as something the squash itself is assumed to handle. ## Other go-public checklist items (cheap, easy to forget) - Add a `LICENSE` file if the README/docs already claim a license (e.g. say "MIT licensed") — claiming a license without the actual file is a common, easy-to-miss gap. - Gate any dev-only convenience that assumes a controlled environment (an emulator-host IP rewrite, a debug-only network interceptor) behind the language's debug-build flag before shipping to real users on arbitrary networks — an edge case that never matters on a dev emulator (e.g. a real user's LAN happening to use the same IP range as the emulator alias) can silently misroute traffic for a small fraction of real installs. - Rename any internal/sprint-codename version string (e.g. `0.1.0-sprint1`) to a clean public-facing semver before the first public build — internal terminology leaking into a version string visible to end users looks unfinished even when the software itself is fine.