MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / appendMarkerRun

Function appendMarkerRun

packages/migration-legacy/src/marker.ts:57–82  ·  view source on GitHub ↗
(
  sourceHome: string,
  run: MarkerRun & { readonly targetPath: string },
)

Source from the content-addressed store, hash-verified

55}
56
57export async function appendMarkerRun(
58 sourceHome: string,
59 run: MarkerRun & { readonly targetPath: string },
60): Promise<void> {
61 const existing = await readMarker(sourceHome);
62 if (existing === undefined) throw new Error('appendMarkerRun: no existing marker');
63 const updated: MarkerData = {
64 ...existing,
65 last_migrated_at: run.completedAt,
66 migrator_version: run.migratorVersion,
67 // Record the latest run's target so a rerun to a different KIMI_CODE_HOME
68 // updates the marker — otherwise `detectPendingMigration` keeps prompting
69 // for the new target even though it was just migrated.
70 target_path: run.targetPath,
71 runs: [
72 ...existing.runs,
73 {
74 startedAt: run.startedAt,
75 completedAt: run.completedAt,
76 migratorVersion: run.migratorVersion,
77 summary: run.summary,
78 },
79 ],
80 };
81 await writeFile(migratedMarker(sourceHome), JSON.stringify(updated, null, 2), 'utf-8');
82}

Callers 2

marker.test.tsFile · 0.85
runMigrationFunction · 0.85

Calls 3

readMarkerFunction · 0.85
migratedMarkerFunction · 0.85
writeFileFunction · 0.50

Tested by

no test coverage detected