gitnexus 1.6.13-rc.71 → 1.6.13-rc.72

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3505,6 +3505,7 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, c
3505
3505
  const vectorIndexReady = await buildVectorIndex();
3506
3506
  semanticMode = vectorIndexReady ? 'vector-index' : 'exact-scan';
3507
3507
  }
3508
+ let stagedCheckpointEmbeddingCount;
3508
3509
  if (!embeddingSkipped) {
3509
3510
  const { isHttpMode } = await import('./embeddings/http-client.js');
3510
3511
  const httpMode = isHttpMode();
@@ -3550,12 +3551,14 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, c
3550
3551
  // /api/embed checkpoint writer in server/api.ts already uses, which also
3551
3552
  // keeps a concurrent writer's update from being reverted by a stale
3552
3553
  // snapshot) and replace ONLY `embeddingCheckpoint` — plus
3553
- // `stats.embeddings` when the caller actually MEASURED the live count
3554
- // (the post-window `onCheckpoint`). The window-start callback passes
3555
- // nothing: restating the previous run's count there both re-published a
3556
- // stale number and clobbered the live count a preceding `onCheckpoint`
3557
- // had just written.
3554
+ // `stats.embeddings` when the caller actually MEASURED the published
3555
+ // index (the post-window `onCheckpoint` on an in-place build). A staging
3556
+ // build's count is not published until the atomic swap succeeds. The
3557
+ // window-start callback passes nothing, preserving the latest count.
3558
3558
  const saveEmbeddingCheckpoint = async (checkpoint, pendingNodeIds, embeddings) => {
3559
+ if (embeddings !== undefined && buildPath !== lbugPath) {
3560
+ stagedCheckpointEmbeddingCount = embeddings;
3561
+ }
3559
3562
  const latestMeta = (await loadMeta(metaDir)) ?? existingMeta;
3560
3563
  // First-ever analyze of this repo: no meta exists on disk yet (the
3561
3564
  // pre-wipe dirty stamp only fires when one does). Mint the minimum
@@ -3569,7 +3572,9 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, c
3569
3572
  };
3570
3573
  await saveMeta(metaDir, {
3571
3574
  ...base,
3572
- ...(embeddings === undefined ? {} : { stats: { ...base.stats, embeddings } }),
3575
+ ...(embeddings === undefined || buildPath !== lbugPath
3576
+ ? {}
3577
+ : { stats: { ...base.stats, embeddings } }),
3573
3578
  // Written by a run that is still IN FLIGHT — see the `kind` doc in
3574
3579
  // repo-manager.ts.
3575
3580
  embeddingCheckpoint: mintInterruptedCheckpoint(embeddingIdentity, checkpoint, pendingNodeIds),
@@ -3726,11 +3731,10 @@ async function runFullAnalysisInner(repoPath, options, callbacks, writeTarget, c
3726
3731
  // already written to disk: prior meta says 0, a clean run inserts
3727
3732
  // embeddings and checkpoints the real count, the final probe is
3728
3733
  // unavailable, and finalization carries the stale 0 forward while reporting
3729
- // success. `loadMeta` never throws (it returns null), and the checkpoint
3730
- // writer already re-reads the same way, so this is the same freshness
3731
- // discipline applied to the same field.
3734
+ // success. For a staged build, use its last measured count only in the
3735
+ // final meta, written after the swap; never publish it at a checkpoint.
3732
3736
  const latestMetaForCount = embeddingCount === undefined ? ((await loadMeta(metaDir)) ?? existingMeta) : undefined;
3733
- const persistedEmbeddingCount = resolvePersistedEmbeddingCount(measuredEmbeddingCount, latestMetaForCount?.stats?.embeddings);
3737
+ const persistedEmbeddingCount = resolvePersistedEmbeddingCount(measuredEmbeddingCount, stagedCheckpointEmbeddingCount ?? latestMetaForCount?.stats?.embeddings);
3734
3738
  const { getRuntimeCapabilities } = await import('./platform/capabilities.js');
3735
3739
  const runtimeCapabilities = getRuntimeCapabilities();
3736
3740
  // `semanticMode` is authoritative when set (Phase 4 reported what it
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.13-rc.71",
3
+ "version": "1.6.13-rc.72",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",