paths

Repo-relative path helpers for the per-entity .gest/ layout (ADR-0016).

Every entity type has a single function that produces the absolute filesystem path inside a project’s gest_dir. The functions are pure — they do no I/O — so they can be used both at write time (where we want to know where to put a file) and at read time (where we walk the directory and need the inverse).

The corresponding repo-relative path (suitable for the sync_digests cache key) is produced by relative, which strips the gest_dir prefix.

const PROJECT_FILE

source

pub const PROJECT_FILE: &str = "project.yaml";

File name of the project metadata file.

const ARTIFACT_DIR

source

pub const ARTIFACT_DIR: &str = "artifact";

Subdirectory name for artifact entity files.

const AUTHOR_DIR

source

pub const AUTHOR_DIR: &str = "author";

Subdirectory name for author entity files.

const EVENT_DIR

source

pub const EVENT_DIR: &str = "event";

Subdirectory name for event entity files (sharded by month).

const ITERATION_DIR

source

pub const ITERATION_DIR: &str = "iteration";

Subdirectory name for iteration entity files.

const NOTES_DIR

source

pub const NOTES_DIR: &str = "notes";

Subdirectory name nested under each entity type that owns notes.

const RELATIONSHIP_DIR

source

pub const RELATIONSHIP_DIR: &str = "relationship";

Subdirectory name for relationship entity files.

const TAG_DIR

source

pub const TAG_DIR: &str = "tag";

Subdirectory name for tag entity files.

const TASK_DIR

source

pub const TASK_DIR: &str = "task";

Subdirectory name for task entity files.

fn artifact_path

source

pub fn artifact_path(gest_dir: &Path, id: &Id) -> PathBuf

Path to an artifact body file: artifact/<id>.md.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
id &Id the artifact’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn artifact_note_path

source

pub fn artifact_note_path(gest_dir: &Path, note_id: &Id) -> PathBuf

Path to an artifact note file: artifact/notes/<note_id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
note_id &Id the note’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn author_path

source

pub fn author_path(gest_dir: &Path, id: &Id) -> PathBuf

Path to an author file: author/<id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
id &Id the author’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn event_path

source

pub fn event_path(gest_dir: &Path, event_id: &Id, created_at: &DateTime<Utc>) -> PathBuf

Path to an event file: event/<yyyy-mm>/<event_id>.yaml.

Events are sharded into monthly subdirectories (per the event’s created_at timestamp) so that no single directory grows without bound.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
event_id &Id the event’s id
created_at &DateTime<Utc> the event’s created_at timestamp
returns PathBuf The path under gest_dir; nothing is created on disk.

fn event_shard

source

pub fn event_shard(created_at: &DateTime<Utc>) -> String

Compute the monthly shard segment for an event timestamp (e.g. 2026-04).

Parameter Type Description
created_at &DateTime<Utc> the event’s creation time, in UTC
returns String The yyyy-mm folder name, with the year padded to four digits and the month to two.

fn iteration_path

source

pub fn iteration_path(gest_dir: &Path, id: &Id) -> PathBuf

Path to an iteration file: iteration/<id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
id &Id the iteration’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn iteration_note_path

source

pub fn iteration_note_path(gest_dir: &Path, note_id: &Id) -> PathBuf

Path to an iteration note file: iteration/notes/<note_id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
note_id &Id the note’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn project_path

source

pub fn project_path(gest_dir: &Path) -> PathBuf

Path to the project metadata file: project.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
returns PathBuf The path of project.yaml in gest_dir; nothing is created on disk.

fn relative

source

pub fn relative(gest_dir: &Path, path: &Path) -> Option<String>

Compute the repo-relative form of path against gest_dir.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
path &Path a file path inside gest_dir
returns Option<String> Returns None if path is not contained in gest_dir. The result uses forward slashes regardless of host platform so that sync_digests keys are portable across operating systems.

fn relationship_path

source

pub fn relationship_path(gest_dir: &Path, id: &Id) -> PathBuf

Path to a relationship file: relationship/<id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
id &Id the relationship’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn tag_path

source

pub fn tag_path(gest_dir: &Path, id: &Id) -> PathBuf

Path to a tag file: tag/<id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
id &Id the tag’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn task_path

source

pub fn task_path(gest_dir: &Path, id: &Id) -> PathBuf

Path to a task file: task/<id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
id &Id the task’s id
returns PathBuf The path under gest_dir; nothing is created on disk.

fn task_note_path

source

pub fn task_note_path(gest_dir: &Path, note_id: &Id) -> PathBuf

Path to a task note file: task/notes/<note_id>.yaml.

Parameter Type Description
gest_dir &Path the project’s .gest/ directory
note_id &Id the note’s id
returns PathBuf The path under gest_dir; nothing is created on disk.