Cotal TypeScript packages
    Preparing search index...

    Function divergentCwdAnchor

    • What the CWD WALK would have resolved, when that disagrees with the root a command actually used.

      This exists because the two can disagree silently and the disagreement is invisible in the output. findCotalRoot accepts any directory merely NAMED .cotal, and ~/.cotal is one on every install, because that is where the mesh registry lives. So every cwd under $HOME that is not inside a project walks up to the HOME directory, and if that directory's auth holds the same space under a different trust chain - an older mesh, a decommissioned one, a copy - a command that re-derives its seed from the cwd mints a credential the broker never trusted. That was issue #722: the failure reached the operator as a bare Authorization Violation naming neither root.

      Comparison is on the account PUBLIC key: it identifies the chain, and no secret material is read for the answer or available to a caller rendering it. Returns undefined when there is nothing to say - the walk agrees with the resolved root, or the walked root holds no auth for this space, or it holds the SAME chain (a second checkout of the same mesh, which is legitimate and silent).

      It REPORTS. It does not choose: a caller that silently preferred one root over the other would be the same defect with a different winner. It also never THROWS - a fault reading either root is reported as nothing to say, because a detector that can abort its caller is that same defect once more, wearing the cwd's failure instead of its answer.

      Parameters

      • resolvedRoot: string
      • space: string
      • Optionalcwd: string

      Returns { cwdRoot: string } | undefined