MCPcopy Create free account
hub / github.com/TestSprite/testsprite-cli / writePartialMarker

Function writePartialMarker

src/lib/bundle.ts:764–779  ·  view source on GitHub ↗

* Write ` /.partial` so an agent inspecting the dir can detect * an aborted bundle. The marker is small JSON — the contract is "if * `.partial` exists, do not consume ` ` until the CLI is re-run * and `.partial` disappears." * * We DO NOT clean the `.tmp/` contents on partial — leaving

(
  dir: string,
  err: unknown,
  requestId: string,
  snapshotId: string,
)

Source from the content-addressed store, hash-verified

762 * call clears them.
763 */
764async function writePartialMarker(
765 dir: string,
766 err: unknown,
767 requestId: string,
768 snapshotId: string,
769): Promise<void> {
770 await mkdir(dir, { recursive: true });
771 const body = {
772 schemaVersion: BUNDLE_SCHEMA_VERSION,
773 snapshotId,
774 requestId,
775 error: err instanceof Error ? err.message : String(err),
776 createdAt: new Date().toISOString(),
777 };
778 await writeFile(join(dir, '.partial'), JSON.stringify(body, null, 2) + '\n', 'utf8');
779}
780
781function bundleIntegrityError(
782 reason: BundleIntegrityReason,

Callers 1

writeBundleFunction · 0.85

Calls 2

mkdirFunction · 0.50
writeFileFunction · 0.50

Tested by

no test coverage detected