refactor(storage): tidy the shared-store fix series (#3374)

Explain the keptStaging early return where it is checked, reuse the
exported EmbeddingCheckpoint type in the publish test, and drop
review-step labels from test comments. No behavior change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Gergo Magyar 2026-09-25 08:45:17 +00:00
parent ef4776c10c
commit 61a8a26528
3 changed files with 5 additions and 3 deletions

View file

@ -460,6 +460,7 @@ export const publishSharedGraph = async (
delete meta.graphPath;
await saveMeta(slot, meta);
}
// Reclaim would delete the kept staging dir as unreferenced.
if (keptStaging) return;
// Best effort: an unreadable store must not fail a finished analysis.
try {

View file

@ -6,6 +6,7 @@ import { pathToFileURL } from 'url';
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi } from 'vitest';
import { CLASS_FRAMEWORK_ANNOTATIONS_FEATURE } from '../../src/core/analysis-features.js';
import { resolveAnalyzerRunnerIdentity } from '../../src/core/analyzer-identity.js';
import type { EmbeddingCheckpoint } from '../../src/core/embedding-checkpoint.js';
import { SCHEMA_FINGERPRINT } from '../../src/core/lbug/schema.js';
import {
ensurePrivateSharedGraph,
@ -449,7 +450,7 @@ describe('publishSharedGraph race (#3352)', () => {
expect(existsSync(path.join(slot, 'lbug'))).toBe(false);
});
const checkpoint: NonNullable<RepoMeta['embeddingCheckpoint']> = {
const checkpoint: EmbeddingCheckpoint = {
at: '2026-01-01T00:00:00.000Z',
nodesProcessed: 1,
totalNodes: 2,

View file

@ -238,7 +238,7 @@ describe('shared store clone sharing (#3352)', () => {
});
/**
* #3374 S7 — registered sibling clones that found a store at the same time
* #3374: registered sibling clones that found a store at the same time
* must pick the same key, or each keeps its own store forever. Resolves the
* store directly (no analyze): only the registry and the clones' remotes matter.
*/
@ -310,7 +310,7 @@ describe('shared store founder key for concurrent sibling clones (#3374)', () =>
expect((await resolveOptedInStore(joiner, undefined))?.key).toBe(existing);
});
// #3374 S8 — `getRemoteUrl` answers from any subdirectory, so only the
// #3374: `getRemoteUrl` answers from any subdirectory, so only the
// tree-root gate keeps `analyze --skip-git <clone>/pkg` out of the store.
it('a subdirectory of a clone with a registered sibling neither joins nor founds a store', async () => {
await cloneAndRegister('member', cloneStoreKey(path.join(root, 'zz-founder')));