From 134cd430fd9b8373fae642f4d19b629db7877134 Mon Sep 17 00:00:00 2001 From: garrytan Date: Thu, 8 Oct 2026 15:04:30 +0000 Subject: [PATCH] docs(autoplan): canonicalRequested comment matches realpath behavior realpathSync resolves a leaf link as well as directory links; only a missing target or dangling link keeps the literal spelling. Note why resolving a leaf link cannot bind an aliased active plan, and drop Read from the callers list (only Write/Edit use it). Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --- autoplan/bin/phase-publication-hook.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/autoplan/bin/phase-publication-hook.ts b/autoplan/bin/phase-publication-hook.ts index 4a0b3da20..485e891db 100644 --- a/autoplan/bin/phase-publication-hook.ts +++ b/autoplan/bin/phase-publication-hook.ts @@ -44,9 +44,10 @@ const samePath = (a: unknown, b: unknown): boolean => sameNativePath(a, b); const requestedPath = (cwd: string, file: string) => nativePathSpelling(path.resolve(cwd, file.replace(/^~(?=[\\/]|$)/, () => os.homedir()))); /** - * The file a Write/Edit/Read path names, with directory links resolved, so a - * symlinked plan directory compares equal to init's canonical paths. A missing or - * leaf-linked target falls back to the literal spelling. + * The file a Write/Edit path names, realpathed so a symlinked plan directory + * compares equal to init's canonical paths. realpath resolves a leaf link too; a + * missing target or dangling link keeps the literal spelling. An aliased active + * plan never binds, because invocation() reads it through read(), which denies aliases. */ const canonicalRequested = (cwd: string, file: unknown): string | undefined => { if (typeof file !== 'string') return;