From 809bc0c58151de1e75b9f302707699b649efac8b Mon Sep 17 00:00:00 2001 From: Taras Mankovski <74687+taras@users.noreply.github.com> Date: Tue, 1 Sep 2026 20:37:03 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Keep=20the=20session-name=20asse?= =?UTF-8?q?rtion=20off=20the=20random=20profile=20root=20(#714)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `C4: one Session carries every turn, and --session names it` asserted that the whole authorship directory path holds no "ada". The path's leaf is the digest of the name and the assertion is about the leaf; the root above it is a temporary directory named by a random hex UUID, which spells "ada" about one run in a hundred — run 33574538193 drew `xmd-plan-profile-dada9d00-…`. The assertion now reads the path relative to the root it was given. --- packages/cli/tests/plan.test.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/cli/tests/plan.test.ts b/packages/cli/tests/plan.test.ts index 522341bc..96fa01b9 100644 --- a/packages/cli/tests/plan.test.ts +++ b/packages/cli/tests/plan.test.ts @@ -23,7 +23,7 @@ import { ensure, scoped, spawn, until } from "effection"; import type { Operation } from "effection"; import { ensureDir, readTextFile, rm, writeTextFile } from "@effectionx/fs"; import { readdir } from "node:fs/promises"; -import { join, sep } from "node:path"; +import { join, relative, sep } from "node:path"; import { API, stat } from "@executablemd/runtime"; import { Elicitation } from "@executablemd/core"; import type { ElicitationRequest } from "@executablemd/core"; @@ -419,9 +419,11 @@ describe( expect(namedDirectories[0]).toBe(namedDirectories[1]); expect(survived).toEqual([true, true]); // The name never reaches the path, and the digest is what the host - // derived from it. + // derived from it. Only the leaf is the host's to keep the name out of: + // the root above it carries a random hex UUID, which spells "ada" one + // run in a hundred or so. expect(namedDirectories[0]).toBe(authorshipDirectoryFor(authorshipRoot, "ada")); - expect(namedDirectories[0]).not.toContain("ada"); + expect(relative(authorshipRoot, namedDirectories[0])).not.toContain("ada"); // The second invocation continued the record the first established // rather than placing a second one: the store holds one, and only the