You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(gitfix): add grep-based discovery + stale-ref sweep + "Grep before you trust" rule
Lesson from a 2026-04-20 polish pass: prior audits missed 9 stale
`2ndbrain-maxxing` references hiding in `README-SECTIONS/` and `tests/`
because the sweeps only checked top-level `README.md` + `install.sh`.
Three insertions so the next `/gitfix` run enumerates the surface before
it starts reading:
1. Phase 1 gains a step 5 — grep the whole tree for renamed repo names,
version mismatches, self-references, TODO/FIXME markers, and
deprecated commands. Memory counts are an anchor, not a ceiling.
2. Phase 4 cross-reference gains a stale-reference sweep sub-rule using
the Phase-1 greps as the authoritative fix list, with a post-flip
verification requirement (`grep -rE <old-pattern> .` must return 0).
3. Rules section gains a "Grep before you trust" bullet — the refs that
slip through every prior audit are the ones hiding in
`README-SECTIONS/`, `tests/fixtures/`, `docs/`, config snippets, and
vendored scripts. Skipping the grep step is how bugs survive sweeps.
-`grep -rn '<deprecated-command-or-alias>' .` — commands that changed names
31
+
Capture every hit with line numbers — you read what grep tells you to read, not what judgment suggests. Prior audits' count of "N references" is an anchor, not a ceiling: refs hide in `README-SECTIONS/`, `tests/`, `docs/`, sub-scripts that top-level greps miss.
25
32
26
33
Do not skip any folder. The map must be complete before Phase 2 begins.
27
34
@@ -98,6 +105,11 @@ Compare what the code actually does (Phase 2) against what the docs say (Phase 3
98
105
99
106
**Cross-references between docs** — Does the README point to the right section anchors? Do links resolve?
100
107
108
+
**Stale-reference sweep (grep-driven).** Use the greps from Phase 1 step 5 as the authoritative fix list. For each pattern:
109
+
- Confirm every hit. Do not trust prior passes' counts. If memory says "N refs in README.md and install.sh", re-grep the whole tree — the misses live in `README-SECTIONS/`, `tests/fixtures/`, `docs/`, sub-scripts, config snippets.
110
+
- Flip each hit to the current canonical form, preserving case-sensitivity rules (e.g. lowercase `old-name` → new repo's canonical case).
111
+
- Post-flip verify: `grep -rE '<old-pattern>' .` must return 0 hits on tracked files. Untracked `owner: human` vault notes are out of scope but should be flagged in the Watch list.
112
+
101
113
### Phase 5 — Fix Everything
102
114
103
115
Fix every gap found in Phase 4. Apply edits in this order:
@@ -199,3 +211,4 @@ Never push without asking first. Never skip listing the commits. The user must s
199
211
-**No invented content.** If you don't know the current state of something, read the file. Don't guess.
200
212
-**Flag what you can't verify.** If something requires running a command or checking an external URL, flag it in the Watch list rather than silently skipping it.
201
213
-**Touch every section.** The value of `/gitfix` is that nothing gets missed. If a section is fine, say so in the report. If it's wrong, fix it.
214
+
-**Grep before you trust.** When looking for every instance of X across the repo, run `grep -rn <pattern> .` first — not just against top-level `README.md` + `install.sh`. The refs that slip through every prior audit are the ones hiding in `README-SECTIONS/`, `tests/fixtures/`, `docs/`, config snippets, and vendored scripts. Do not rely on memory or prior-pass counts. Skipping the grep step is how bugs survive sweeps.
0 commit comments