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

Function appendRolloutDecisionLog

apps/kimi-code/src/cli/update/rollout.ts:170–186  ·  view source on GitHub ↗
(
  entry: Record<string, unknown>,
  filePath: string = getUpdateRolloutLogFile(),
)

Source from the content-addressed store, hash-verified

168 * reset once it grows past a small cap so it cannot grow unbounded.
169 */
170export async function appendRolloutDecisionLog(
171 entry: Record<string, unknown>,
172 filePath: string = getUpdateRolloutLogFile(),
173): Promise<void> {
174 try {
175 await mkdir(dirname(filePath), { recursive: true });
176 const line = `${JSON.stringify(entry)}\n`;
177 const size = await stat(filePath).then((s) => s.size, () => 0);
178 if (size > ROLLOUT_LOG_MAX_BYTES) {
179 await writeFile(filePath, line, 'utf-8');
180 return;
181 }
182 await appendFile(filePath, line, 'utf-8');
183 } catch {
184 // Diagnostic logging must never affect the update flow.
185 }
186}
187
188/**
189 * Stable per-installation id used for bucketing when telemetry has already

Callers 2

rollout.test.tsFile · 0.90
logRolloutDecisionFunction · 0.90

Calls 5

getUpdateRolloutLogFileFunction · 0.90
mkdirFunction · 0.50
statFunction · 0.50
writeFileFunction · 0.50
appendFileFunction · 0.50

Tested by

no test coverage detected