Definitively.Workspace (definitively v0.3.1)

Copy Markdown

Resolves an absolute program path and workspace root from a workflow YAML file.

Workspace root is the directory that contains .definitively/ (parent of that folder). Programs are expected at .definitively/programs/*.yml but any path under .definitively/ in an ancestor tree is accepted.

When layout detection fails, DEFINITIVELY_WORKSPACE may supply the root if the program path lies inside that directory (tests and explicit overrides).

Summary

Functions

Expands program_path to an absolute file and discovers workspace_root.

Types

resolved()

@type resolved() :: %{program_path: Path.t(), workspace_root: Path.t()}

Functions

resolve_run(program_path)

@spec resolve_run(Path.t()) ::
  {:ok, resolved()} | {:error, :enoent | :no_definitively_layout}

Expands program_path to an absolute file and discovers workspace_root.

Returns {:error, :enoent} when the file is missing, or {:error, :no_definitively_layout} when no workspace can be determined.