GitNexus/gitnexus/src/cli
Gergő Magyar 22d3c2ad74
fix(cli): stop churning the committed agent guides, and nudge --index-only (#2907) (#2927)
AGENTS.md and CLAUDE.md are the agent guides teams commit, and the injected
block carried live symbol/relationship/flow counts. Those counts move with any
code change, so every reindex rewrote a tracked file and produced a spurious
diff that had to be restored by hand before committing real work.

The write is now skipped when the volatile counts are the only delta. Counts are
substituted with placeholders — not deleted — before the comparison, so
--no-stats REMOVING the parenthetical is still a material change that writes
through; only a numbers-only difference is suppressed. Both the verbose path and
the gitnexus:keep path go through the same rule, and a project rename, a template
change, or a base_ref change still rewrites as before. Live counts remain
available from `gitnexus status` and `gitnexus://repo/{name}/context`.

Two smaller churn sources go with it:

- The file was CREATED without a trailing newline while every update path writes
  `.trim() + '\n'`, so the analyze right after committing a freshly created
  AGENTS.md dirtied it purely to append that newline.
- `--no-stats` left the per-cluster `(N symbols)` counts in the skills table,
  which are exactly as volatile as the header parenthetical the flag removes.

The stale-index hook recommended plain `gitnexus analyze` — the variant that
rewrites those tracked docs — so an agent following the nudge verbatim reindexed
with the most invasive flags. `formatAnalyzeCommand` takes `indexOnly` and the
three hook call sites (Claude, plugin copy, Antigravity) pass it; the injected
"Index stale?" line and the MCP context resource's `re_index` hint name the same
`--index-only` form. Full `analyze` stays the documented way to refresh the docs
and skills.

Both resolve-analyze-cmd.cjs copies stay byte-identical.


Claude-Session: https://claude.ai/code/session_019d85r7TrMYjWbTUT3pXccS

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-11 13:30:14 +01:00
..
i18n fix(trace): add file disambiguator alias (#2705) 2026-07-27 05:05:14 +01:00
ai-context.ts fix(cli): stop churning the committed agent guides, and nudge --index-only (#2907) (#2927) 2026-08-11 13:30:14 +01:00
analyze-config.ts feat(cli): add --embeddings-baseurl/-model/-auth-token/-dims flags to analyze (#2140) 2026-06-13 14:01:12 +01:00
analyze.ts feat: close reported graph blind spots in reference resolution, analyze and storage (#2856) 2026-08-08 09:58:14 +01:00
augment.ts feat(cursor): upgrade hooks to Cursor 2.4 postToolUse for Read/Grep/Shell coverage (#1467) 2026-05-10 13:29:06 +01:00
clean.ts fix: make large incremental writebacks commit reliably (#2409) (#2425) 2026-07-10 14:05:23 +01:00
cli-message.ts fix(schema): declare the full scope-resolution relation cross product (#2792) (#2793) 2026-08-02 16:26:25 +01:00
detect-changes-format.ts fix(cli): --limit i18n, 0/negative guard, and correct truncation paths (#2310) 2026-07-01 19:16:36 +01:00
doctor.ts feat(cli): add a bunx lane so bun-only machines can run gitnexus (#2765) 2026-08-06 08:40:36 +00:00
editor-targets.ts fix(setup): preserve existing OpenCode config.jsonc (#2694) 2026-07-26 16:23:34 +01:00
embedding-dims.ts feat(cli): add --embeddings-baseurl/-model/-auth-token/-dims flags to analyze (#2140) 2026-06-13 14:01:12 +01:00
embeddings.ts fix: proxy-blocked installs survive onnxruntime-node postinstall and self-heal embeddings (#2370) (#2372) 2026-07-05 16:15:10 +01:00
eval-server.ts fix(eval): defer env file read errors to binds that need a token 2026-07-16 08:25:52 +00:00
format-elapsed.ts feat(progress): add per-language progress reporting to scope-resolution phase (#1813) 2026-05-25 11:53:54 +01:00
group.ts fix(mcp): make impact/context reproducible — deterministic ordering on every capped query (#2787) (#2796) 2026-08-02 17:03:15 +00:00
help-i18n.ts feat(analyze): add opt-in --self-commit flag for AGENTS.md/CLAUDE.md churn (#2640) 2026-07-25 06:23:26 +01:00
index-repo.ts fix(storage): rename index metadata to gitnexus.json with dual-write compatibility (#2363) 2026-07-03 19:32:59 +01:00
index.ts fix(trace): add file disambiguator alias (#2705) 2026-07-27 05:05:14 +01:00
lazy-action.ts feat(skills): GitNexus Engineering Tool Kits (#2566) 2026-07-19 15:07:24 +01:00
list.ts feat: multi-branch indexing and branch-scoped querying (#2106) (#2137) 2026-06-10 10:24:40 +01:00
mcp.ts feat(mcp): enforce repository allowlist 2026-07-14 02:01:00 +07:00
optional-grammars.ts fix(grammars): load vendored tree-sitter grammars from vendor/ by absolute path (#2111) (#2144) 2026-06-10 14:20:42 +01:00
publish.ts feat(cli): add gitnexus publish for opt-in understand-quickly registry (#1425) 2026-05-09 09:52:26 +01:00
remove.ts fix(storage): rename index metadata to gitnexus.json with dual-write compatibility (#2363) 2026-07-03 19:32:59 +01:00
resolve-invocation.ts feat(cli): add a bunx lane so bun-only machines can run gitnexus (#2765) 2026-08-06 08:40:36 +00:00
serve.ts feat(i18n): make web and CLI language-aware (#1748) 2026-05-23 06:14:24 +01:00
setup.ts fix(setup): preserve existing OpenCode config.jsonc (#2694) 2026-07-26 16:23:34 +01:00
skill-gen.ts fix(cli): make .agents/ skill mirror best-effort + exclude from dirty check 2026-07-20 16:19:59 +08:00
standard-skills.ts feat(skills): GitNexus Engineering Tool Kits (#2566) 2026-07-19 15:07:24 +01:00
status.ts feat(skills): GitNexus Engineering Tool Kits (#2566) 2026-07-19 15:07:24 +01:00
tool.ts fix(trace): add file disambiguator alias (#2705) 2026-07-27 05:05:14 +01:00
uninstall.ts feat(skills): GitNexus Engineering Tool Kits (#2566) 2026-07-19 15:07:24 +01:00
wiki.ts feat(wiki): allow explicit HTTP LLM hosts (#2491) 2026-07-16 13:53:58 +01:00