fix(cli): apply --no-stats to keep-marker stats line (#1706)#1765
Conversation
…#1706) The keep-marker branch of upsertGitNexusSection rebuilt the index-summary line on every analyze and always re-injected the volatile counts, ignoring --no-stats. For teams that commit a trimmed AGENTS.md/CLAUDE.md with a gitnexus:keep marker, that produced recurring no-value merge conflicts — exactly what --no-stats exists to prevent. Thread noStats into upsertGitNexusSection. Under --no-stats the keep-path stats line becomes "Indexed as **<name>**" with no (N symbols, ...) parenthetical; the project name still refreshes so renames propagate. The statsPattern parenthetical is now optional so a count-free line left by a prior --no-stats run still matches.
|
Someone is attempting to deploy a commit to the NexusCore Team on Vercel. A member of the Team first needs to authorize it. |
|
Claude finished @magyargergo's task in 5m 14s —— View job PR #1765 Production-Readiness ReviewTasks
Review bar for this PR
Problem being solved
Current PR state
Merge status and mergeabilityCI is in progress. Cannot confirm merge-readiness until the Repository history considered
Branch hygiene assessmentThe branch contains a merge-from-main commit ( Understanding of the change
FindingsF1 — No explicit test for counts returning after
|
CI Report✅ All checks passed Pipeline Status
Test Results
✅ All 9460 tests passed 1 test(s) skipped — expand for details
Code CoverageTests
📋 View full run · Generated by CI |
|
@oddFEELING can you please look into claude's actionable findings? |
Giving it a look now |
…p path Addresses review findings F1 and F2 on PR abhigyanpatwari#1765: - F1: add a test that counts RETURN when --no-stats is dropped after a prior count-free run — guards against the flag becoming sticky. - F2: extend the noStats+keep "drops the volatile counts" test to assert AGENTS.md alongside CLAUDE.md, so a future asymmetry between the two upsertGitNexusSection call sites is caught.
|
Addressed the actionable findings in
F3 (merge-from-main commit): left as-is for now since the repo squash-merges PRs, so it collapses on merge. Happy to rebase to a linear history if you'd prefer. F4: CI was already green (9459/9459) on the prior run.
|
|
Thank you for your PR! |
What
Closes #1706.
gitnexus analyze --no-statsis documented as "Omit volatile file/symbol counts from AGENTS.md and CLAUDE.md", but it did not strip the counts from the index-summary line when the block carries a<!-- gitnexus:keep -->marker.The regular (no keep marker) path already respects
--no-statsviagenerateGitNexusContent(#1477). The keep-marker branch ofupsertGitNexusSection, however, rebuilt the stats line itself and always re-injected(N symbols, N relationships, N execution flows)—noStatswas never passed to that function. For teams that commit a trimmedAGENTS.md/CLAUDE.mdwith a keep marker, everyanalyzerewrote that line with different numbers, producing recurring no-value merge conflicts between branches.How
noStatsintoupsertGitNexusSection.--no-statsthe stats line becomesIndexed as **<name>**— no parenthetical counts.statsPattern's parenthetical is now optional, so a count-free line left by a prior--no-statsrun still matches — the name keeps refreshing, and counts return if--no-statsis later dropped.generateAIContextFilespassesoptions?.noStatsinto bothupsertGitNexusSectioncalls.Tests
#1508review-F3 test: undernoStats+ keep marker it now asserts the volatile counts are stripped (previously it expected them rewritten), while keeping its Always-Do-tuple corruption guards.--no-stats+ keep when the existing line has no parenthetical to match.Full
test/unitsuite is green;prettier --checkandeslintclean on the touched files.Risk / rollback
Low.
upsertGitNexusSectionis a private function with only the two in-file callers updated here. No public CLI/MCP contract changes — the--no-statshelp text already promised this behavior. Revert is a single-commit revert.