Types and internals
DearDiary.User — Type
User <: ResultTypeA struct that represents a user.
Fields
id::Int64: The ID of the user.first_name::String: The first name of the user.last_name::String: The last name of the user.username::String: The username of the user.password::String: Bcrypt hash of the user's password.created_date::DateTime: The date and time the user was created.is_admin::Bool: Whether the user is an administrator.
DearDiary.UserResponse — Type
UserResponse <: ResultTypeA safe-for-API projection of User that omits the password hash.
Fields
id::Int64: The ID of the user.first_name::String: The first name of the user.last_name::String: The last name of the user.username::String: The username of the user.created_date::DateTime: The date and time the user was created.is_admin::Bool: Whether the user is an administrator.
DearDiary.UserPermission — Type
UserPermission <: ResultTypeA struct representing a user's permissions for a specific project.
Fields
id::Int64: The unique identifier for the user permission record.user_id::Int64: The ID of the user.project_id::Int64: The ID of the project.create_permission::Bool: Permission to create resources.read_permission::Bool: Permission to read resources.update_permission::Bool: Permission to update resources.delete_permission::Bool: Permission to delete resources.
DearDiary.Project — Type
Project <: ResultTypeA struct representing a project with its details.
Fields
id::Int64: The ID of the project.name::String: The name of the project.description::String: A brief description of the project.created_date::DateTime: The date and time the project was created.
DearDiary.Experiment — Type
Experiment <: ResultTypeA struct representing an experiment within a project.
Fields
id::Int64: The unique identifier of the experiment.project_id::Int64: The identifier of the project to which the experiment belongs.status_id::Int64: The status of the experiment.name::String: The name of the experiment.description::String: A description of the experiment.created_date::DateTime: The date and time when the experiment was created.end_date::Optional{DateTime}: The date and time when the experiment ended, ornothingif it is still ongoing.
DearDiary.Iteration — Type
Iteration <: ResultTypeA struct representing an iteration within an experiment.
Fields
id::Int64: The unique identifier of the iteration.experiment_id::Int64: The identifier of the experiment to which the iteration belongs.notes::String: Notes associated with the iteration.created_date::DateTime: The date and time when the iteration was created.end_date::Optional{DateTime}: The date and time when the iteration ended, ornothingif it is still ongoing.parent_iteration_id::Optional{Int64}: The identifier of the parentIterationwhen this iteration is a child run (e.g. one trial in an HPO sweep, one fold in a nested CV, one worker in a distributed run).nothingfor top-level iterations.status_id::Int64: The current lifecycleIterationStatus.RUNNINGwhile the iteration is in flight, thenSUCCEEDED,FAILED, orKILLEDonce it terminates.error_message::String: Captured exception text whenstatus_idisFAILED. Empty otherwise.julia_version::String:string(VERSION)captured bysnapshot_environment!. Empty when no snapshot has been taken.git_sha::String: HEAD commit SHA captured bysnapshot_environment!. Empty when the iteration ran outside a git working tree or no snapshot was taken.git_dirty::Bool:truewhen the working tree had uncommitted changes at snapshot time.entrypoint::String:PROGRAM_FILEcaptured bysnapshot_environment!. Empty for REPL-driven runs.project_toml::String: Verbatim contents of the activeProject.tomlat snapshot time.manifest_toml::String: Verbatim contents of the activeManifest.tomlat snapshot time, the bit-exact dependency tree thatrestorereconstructs.
DearDiary.Parameter — Type
Parameter <: ResultTypeA struct representing a parameter with its details.
Fields
id::Int64: The ID of the parameter.iteration_id::Int64: The ID of the iteration this parameter belongs to.key::String: The key/name of the parameter.value::String: The value of the parameter.
DearDiary.Metric — Type
Metric <: ResultTypeA struct representing a metric value logged against an Iteration. Repeated logs of the same key form a series indexed by step and timestamped by recorded_at, so a training script can record a loss curve over many epochs.
Fields
id::Int64: The ID of the metric.iteration_id::Int64: The ID of the iteration this metric belongs to.key::String: The key/name of the metric (e.g."loss","accuracy").value::Float64: The recorded value.step::Int64: Position in the time series for this(iteration_id, key). Defaults tomax(step) + 1server-side when not supplied by the caller.recorded_at::DateTime: When the value was captured. Defaults to the server clock when not supplied by the caller.
DearDiary.Resource — Type
Resource <: ResultTypeA struct representing a resource associated with an experiment.
Fields
id::Int64: The ID of the resource.experiment_id::Int64: The ID of the experiment this resource belongs to.name::String: The name of the resource.description::String: A description of the resource.data::Optional{Array{UInt8,1}}: The binary data of the resource. Populated for the inline backend (legacy inline storage);nothingfor rows whose canonical bytes live in an external backend (filesystem, S3) and are fetched on demand via the trait.created_date::DateTime: The date and time when the resource was created.updated_date::Optional{DateTime}: The date and time when the resource was last updated.backend::String: Short backend identifier ("inline","filesystem","s3"). Drives dispatch on theAbstractArtifactStoretrait.uri::String: Stable pointer at the canonical bytes ("file:///...","s3://..."). Empty string whenbackend == "inline"(the bytes are inline indata).size_bytes::Int64: Exact byte count of the artifact. Surfaced in list endpoints without materialising the BLOB.content_hash::String: Lower-case sha256 hex digest of the bytes. Empty string for legacy rows not yet re-hashed by the backfill pass.
DearDiary.Tag — Type
Tag <: ResultTypeA struct that represents a tag.
Fields
id::Int64: The ID of the tag.value::String: The value of the tag.
DearDiary.Model — Type
Model <: ResultTypeA struct representing a registered model in the project-scoped model registry. A Model is the named container under which one or more ModelVersion checkpoints are recorded.
Fields
id::Int64: The unique identifier of the model.project_id::Int64: The identifier of theProjectthat owns the model.name::String: The registry-unique name of the model (unique per project).description::String: A free-form description of the model.created_date::DateTime: The date and time when the model was registered.updated_date::Optional{DateTime}: The date and time of the most recent update, ornothingif the record has never been updated.
DearDiary.ModelVersion — Type
ModelVersion <: ResultTypeA struct representing a concrete checkpoint of a registered Model. Each version is produced by a specific Iteration and may point at an artifact Resource that stores the serialised bytes.
Fields
id::Int64: The unique identifier of the model version.model_id::Int64: The identifier of the parentModel.version::Int64: The per-model monotonically-increasing version number, assigned by the service layer at registration time.iteration_id::Int64: The identifier of theIterationthat produced this checkpoint, recording lineage from training run to registered artifact.resource_id::Optional{Int64}: The identifier of theResourcethat holds the serialised artifact, ornothingwhen the registration predates the upload.stage_id::Int64: The lifecycleStagethe version currently occupies.description::String: A free-form description of the version (e.g. training notes).created_date::DateTime: The date and time when the version was registered.updated_date::Optional{DateTime}: The date and time of the most recent update, ornothingif the record has never been updated.
DearDiary.Client — Type
ClientHandle for talking to a running DearDiary REST API. Constructed via connect. The token, expiry, and cached user are mutable so refresh_token! and reauthentication do not require rebuilding the client.
Fields
base_url::String: Base URL of the server (e.g."http://127.0.0.1:9000"), without trailing slash.token::Optional{String}: Bearer token, ornothingwhen the server runs with auth disabled.expires_at::Optional{Int}: Unix epoch seconds at which the token expires.user::Optional{UserResponse}: The signed-in user, if known.
DearDiary.ClientError — Type
ClientError <: ExceptionRaised by Client methods when the server returns a non-2xx status.
Fields
status::Int: The HTTP status code.code::String: The stable error code from the response body ("NOT_FOUND","CONFLICT", …), or"UNKNOWN"when the body is unparseable.message::String: Human-readable description from the response body.
Database
DearDiary.initialize_database — Function
initialize_database(; file_name::String="deardiary.db")Open file_name (creating it if needed), run every pending Migration via apply_migrations, and re-seed the default user. Calling this repeatedly is safe: each migration runs at most once per database, and the default-user insert uses ON CONFLICT DO NOTHING.
DearDiary.get_database — Function
get_database()::Union{DuckDB.DB,Nothing}Return the active DuckDB connection, or nothing if the database has not been initialized.
DearDiary.close_database — Function
close_database()Close the database connection if one is open.
Enumerations
DearDiary.ExperimentStatus — Type
@enum ExperimentStatus IN_PROGRESS = 1 STOPPED = 2 FINISHED = 3An enumeration representing the lifecycle status of an Experiment.
DearDiary.IN_PROGRESS — Constant
IN_PROGRESS::ExperimentStatusAn enumeration value representing an experiment that is currently in progress.
DearDiary.STOPPED — Constant
STOPPED::ExperimentStatusAn enumeration value representing an experiment that has been stopped.
DearDiary.FINISHED — Constant
FINISHED::ExperimentStatusAn enumeration value representing an experiment that has finished.
DearDiary.IterationStatus — Type
@enum IterationStatus RUNNING = 1 SUCCEEDED = 2 FAILED = 3 KILLED = 4An enumeration representing the lifecycle status of an Iteration. A freshly created iteration is RUNNING; the value transitions to a terminal status (SUCCEEDED, FAILED, or KILLED) when the iteration ends.
DearDiary.RUNNING — Constant
RUNNING::IterationStatusAn enumeration value representing an Iteration that is still in progress. This is the value assigned when the iteration is created.
DearDiary.SUCCEEDED — Constant
SUCCEEDED::IterationStatusAn enumeration value representing an Iteration that ran to completion without raising an exception.
DearDiary.FAILED — Constant
FAILED::IterationStatusAn enumeration value representing an Iteration that ended because of an exception. The captured exception text is stored in error_message.
DearDiary.KILLED — Constant
KILLED::IterationStatusAn enumeration value representing an Iteration that was terminated externally (operator action, timeout, scheduler kill) rather than by a clean return or an exception.
Marker types
Upsert results
DearDiary.UpsertResult — Type
UpsertResultA marker abstract type for the result of an upsert operation.
DearDiary.Created — Type
CreatedA marker type indicating that a record was successfully created.
DearDiary.Updated — Type
Updated <: UpsertResultA marker type indicating that a record was successfully updated.
DearDiary.Duplicate — Type
Duplicate <: UpsertResultA marker type indicating that a record already exists.
DearDiary.Unprocessable — Type
Unprocessable <: UpsertResultA marker type indicating that a record violates a constraint and cannot be processed.
DearDiary.Error — Type
Error <: UpsertResultA marker type indicating that an error occurred while creating or updating a record.
Permission actions
DearDiary.PermissionAction — Type
PermissionActionAbstract supertype representing a CRUD action that a UserPermission can grant on a Project. Concrete subtypes are dispatched on by has_permission to read the matching boolean field.
DearDiary.CreatePermission — Type
CreatePermission <: PermissionActionAction that requires create_permission on the target Project.
DearDiary.ReadPermission — Type
ReadPermission <: PermissionActionAction that requires read_permission on the target Project.
DearDiary.UpdatePermission — Type
UpdatePermission <: PermissionActionAction that requires update_permission on the target Project.
DearDiary.DeletePermission — Type
DeletePermission <: PermissionActionAction that requires delete_permission on the target Project.
Error codes
DearDiary.ErrorCode — Type
ErrorCodeMarker abstract type for error codes returned in non-2xx response bodies.
Concrete subtypes pair with error_code to produce a stable, frontend-facing identifier (e.g., "NOT_FOUND", "PROJECT_PERMISSION_REQUIRED") that callers can switch on without parsing English messages.
DearDiary.NotFound — Type
NotFound <: ErrorCodeThe requested entity does not exist. Pairs with HTTP 404 Not Found.
DearDiary.InvalidCredentials — Type
InvalidCredentials <: ErrorCodeThe supplied username/password did not authenticate. Pairs with HTTP 401 Unauthorized.
DearDiary.TokenMissing — Type
TokenMissing <: ErrorCodeThe request did not include an Authorization header. Pairs with HTTP 401 Unauthorized.
DearDiary.TokenInvalid — Type
TokenInvalid <: ErrorCodeThe bearer token failed signature validation. Pairs with HTTP 401 Unauthorized.
DearDiary.TokenExpired — Type
TokenExpired <: ErrorCodeThe bearer token's exp claim is in the past. Pairs with HTTP 401 Unauthorized.
DearDiary.TokenPayloadInvalid — Type
TokenPayloadInvalid <: ErrorCodeThe bearer token decoded but its claims are missing or malformed. Pairs with HTTP 401.
DearDiary.UserNotFound — Type
UserNotFound <: ErrorCodeThe user identified by the credentials or token does not exist. Pairs with HTTP 401/404 depending on context.
DearDiary.AdminRequired — Type
AdminRequired <: ErrorCodeThe route requires administrative privileges. Pairs with HTTP 403 Forbidden.
DearDiary.SameUserRequired — Type
SameUserRequired <: ErrorCodeThe route can only be accessed by the targeted user (or an admin). Pairs with HTTP 403.
DearDiary.ProjectPermissionRequired — Type
ProjectPermissionRequired <: ErrorCodeThe user lacks the required CRUD permission on the project that scopes the route. Pairs with HTTP 403 Forbidden.
DearDiary.Conflict — Type
Conflict <: ErrorCodeA unique-constraint violation: the resource already exists. Pairs with HTTP 409 Conflict.
DearDiary.InvalidPayload — Type
InvalidPayload <: ErrorCodeThe request payload violates a constraint (foreign key, check, missing field). Pairs with HTTP 422 Unprocessable Entity.
DearDiary.ServerError — Type
ServerError <: ErrorCodeGeneric catch-all for unexpected failures. Pairs with HTTP 500 Internal Server Error.
DearDiary.error_code — Function
error_code(::Type{<:ErrorCode})::StringReturn the stable SCREAMING_SNAKE identifier for an ErrorCode type, as used in error response bodies ({"code": ..., "message": ...}). The mapping is fixed so frontend code can switch on the value without parsing English messages.
Pagination
DearDiary.Pagination — Type
PaginationCursor for windowing a collection of records.
Fields
limit::Int64: Maximum number of records to return (capped at the route boundary).offset::Int64: Number of records to skip before the page starts.
DearDiary.PaginatedResponse — Type
PaginatedResponse{T} <: ResultTypeEnvelope returned by paginated list endpoints.
Fields
data::Array{T,1}: The records in this page.total::Int64: Total number of matching records (across all pages).limit::Int64: The page size used.offset::Int64: The offset used.