project_model
project_model
¶
Project and preset data models — DDD Value Objects.
Pure data types with no filesystem or subprocess I/O. These are the value objects in the domain model: they carry configuration data but have no behavior beyond computed paths.
:class:ProjectConfig is loaded from project.yml by the companion
:mod:~terok.lib.core.projects module and wrapped by the rich
:class:~terok.lib.domain.project.Project aggregate to provide behavior.
ProjectConfig
¶
Bases: BaseModel
Resolved project configuration loaded from project.yml.
Pure value object — holds configuration fields with no behavior beyond
computed paths. The rich domain object :class:~terok.lib.domain.project.Project
wraps this and provides behavior.
presets_dir
property
¶
Directory for preset config files for this project.
PresetInfo(name, source, path)
dataclass
¶
Metadata about a discovered preset.
effective_ssh_key_name(project, key_type='ed25519')
¶
Return the SSH key filename that should be used for this project.
Precedence
- Explicit
ssh.key_namefrom project.yml (project.ssh_key_name) - Derived default: id_
_ , e.g. id_ed25519_myproj
This helper centralizes the default so ssh-init, container env (SSH_KEY_NAME) and host-side git helpers all agree even when project.yml omits ssh.key_name.
Source code in src/terok/lib/core/project_model.py
validate_project_id(project_id)
¶
Ensure a project ID is safe for use as a directory and OCI image name.
Raises SystemExit if the ID is empty, contains uppercase letters, path
separators or traversal sequences, or uses characters outside
[a-z0-9_-].