@feigi/fleet-ctl 3.158.20 → 3.158.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/scripts/phase0.mjs +15 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@feigi/fleet-ctl",
3
- "version": "3.158.20",
3
+ "version": "3.158.21",
4
4
  "description": "Agent fleet: run-team controller, merge bot, PR reviewer, and the ticket pipeline they share",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -599,18 +599,25 @@ function shortlist({ cwd }) {
599
599
  return ok("shortlist built");
600
600
  }
601
601
 
602
- // The same `.fleet/` by the directory it names: the checkout holding it is
603
- // stat'd, then resolved through symlinks by the OS, so a `..` after a
604
- // directory that does not exist, or after a file, is not folded away (darwin's
605
- // realpath folds `file/..`; the stat refuses it). The `.fleet` name is kept as
606
- // given, so it works before `.fleet/` exists. A path that is not absolute, or
607
- // whose checkout does not resolve, stays as given.
602
+ // The alarm step accepts a `fleet` spelling only when the OS resolves it to
603
+ // this checkout's `.fleet/`. So the OS stats the part that must exist (the
604
+ // path itself when its last name is `.` or `..`, else the checkout holding it,
605
+ // the directory part), and then resolves that checkout through symlinks. A
606
+ // `..` after a directory that does not exist, after a file, or out of a
607
+ // directory the OS may not search is refused by that stat, though darwin's
608
+ // realpath folds `file/..` and `unsearchable/..` and `join` folds a trailing
609
+ // `..` as text; a `..` after a directory or a symlink to one resolves where
610
+ // the OS takes it; and on a case-insensitive volume a letter-case variant of
611
+ // the checkout path is the same checkout. The `.fleet` name is compared as
612
+ // given, so it works before `.fleet/` exists and `.FLEET` is another name. A
613
+ // path that is not absolute, or that the OS does not resolve, stays as given.
608
614
  function fleetIdentity(path) {
609
615
  if (typeof path !== "string" || !isAbsolute(path)) return path;
610
616
  try {
611
617
  const checkout = dirname(path);
612
- statSync(checkout);
613
- return join(realpathSync.native(checkout), basename(path));
618
+ const name = basename(path);
619
+ statSync(name === "." || name === ".." ? path : checkout);
620
+ return join(realpathSync.native(checkout), name);
614
621
  } catch {
615
622
  return path;
616
623
  }